I usually use the following multicam.lua cameraside script to switch modes:
function cmds.set_mode()
--e.g. to run from the cli -> !return mc:cmdwait('set_mode',{args=1})
--1 -> AUTO
--2 -> P
--3 -> TV
--4 -> AV
--5 -> M
--61 -> Movies
--ensure record mode
if ( get_mode() == false ) then
set_record(1)
while ( get_mode() == false ) do
sleep(100)
end
end
local new_mode = tonumber(mc.args)
capmode.set(new_mode)
wait_timeout_write_status(capmode.get,new_mode,100,mc.mode_sw_timeout)
end
But (using suba build) I get random crashes (among 16 cameras) when switching between M & Movies.
@ntstatic
I tried this scripted mode change on my SX100. It doesn't crash on "set", but the shooting menu is inappropriate, as in your case.
However, just tried running this script
set_capture_mode(9)
sleep(10)
post_levent_to_ui("ModeDialToMovie")
from a random mode (Av or Tv), and it's a step closer, meaning the shooting menu is now correct. The jogdial still doesn't do what it is supposed to. Mode 9 is MODE_VIDEO_STD (see the enum in include/modelist.h).
Side note: I had to do the same in my S1IS port to make mode change work.
I haven't read the details of the thread related to that comment but, on a single camera, using the chdkptp gui:
=set_capture_mode(9)
=post_levent_to_ui("ModeDialToMovie")
only momentarily switches to Movies before reverting to M.
(
Edit1: as does
=set_capture_mode(9) sleep(10) post_levent_to_ui("ModeDialToMovie")
)
Should I have expected that to make Movies persistent or should something else be done?
Edit2
a possible solution:
When camera was booted to REC mode, I can't get any mode change (including movie) to stick (camera announces the change on LCD, but then it changes back to whatever it was). In the mode dial thread http://chdk.setepontos.com/index.php/topic,3228.45.html reyalp's solution for this particular problem is to set set_levent_script_mode(1) first but it doesn't seem to help when PTP is active.
set_levent_script_mode() is only half the solution. The other half is set_levent_active("ModeDailTo...",false) on all the mode dial position events *except* the one you want to use, and set_levent_active("ModeDailToMovie",true)
Will try that out.