Skip to content

Instantly share code, notes, and snippets.

@dannephoto
Forked from Jip-Hop/ETC.lua
Created July 4, 2019 08:15
Show Gist options
  • Save dannephoto/4bda05e5657d39ed3f811f35a726cdf1 to your computer and use it in GitHub Desktop.
Save dannephoto/4bda05e5657d39ed3f811f35a726cdf1 to your computer and use it in GitHub Desktop.
-- Crop mode toggle
-- Toggle between 3x crop mode
require('config')
-- end this script if not eosm
if camera.model_short ~= "EOSM" then
display.notify_box("Script not working on this cam");
msleep(2000);
return
end
-- warnings
while camera.mode ~= MODE.MOVIE do
display.notify_box("enable MOVIE mode");
msleep(1000);
end
function toggle_x3crop()
-- crop mode
if menu.get("Crop mode", "x3crop") == "x3crop" then
menu.set("Crop mode", "x3crop", 0);
else
menu.set("Crop mode", "x3crop", "x3crop");
end
lv.pause();
lv.start();
end
x3crop_toggle_menu = menu.new
{
parent = "Movie",
name = "x3crop toggle",
help = "Pick a button to toggle x3crop in mv1080.",
value = 0,
submenu =
{
{
select = function(this)
if x3crop_toggle_menu.value == 0 then
x3crop_toggle_menu.value = 1;
else
x3crop_toggle_menu.value = 0;
end
end,
update = function(this)
if x3crop_toggle_menu.value == 0 then
this.name = "Enable";
else
this.name = "Disable";
end
end,
},
{
name = "Button",
choices = { "SET", "INFO", "HALFSHUTTER"},
}
},
update = function(this)
if this.value == 0 then
this.help2 = "Click Enable in submenu to activate.";
return "OFF";
else
this.help2 = ""
return "ON, " .. this.submenu["Button"].value;
end
end,
};
config.create_from_menu(x3crop_toggle_menu)
event.keypress = function(key)
if key == KEY[x3crop_toggle_menu.submenu["Button"].value] and menu.visible == false and x3crop_toggle_menu.value ~= 0 then
task.create(toggle_x3crop);
return false;
end
end
console.hide();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment