changeset 847 should pretty much complete play/rec and capture mode override support.
NOTE: the meaning of set_capture_mode in lua has changed.
It now takes a CHDK mode value, not a propcase value!. If you have been using this in any recent builds, replace it with set_capture_mode_canon.
There are tests scripts included in the CHDK/SCRIPTS/TEST folder. I encourage people to use
http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Test/Setmode in batch mode, and report their results (with log files) in
http://chdk.setepontos.com/index.php/topic,3228.90.htmlThis commit involved fairly substantial re-organization of the modemap related code. Not only was this needed to implement the script features sanely, it will also make it easier to clean up mode handling more in the future. I don't think I've broken anything, but it's always possible.
Commit Message:
Mode override support. See
http://chdk.kernreaktor.org/mantis/view.php?id=64 All cameras except ixus40_sd400 should be supported
* add capture mode API. NOTE: behavior of set_capture_mode in lua HAS CHANGED!
see
http://chdk.wikia.com/wiki/CHDK_firmware_usage/MoreBest#set_record.28state.29 and following
* move modemap to platform/<cam>/shooting.c so mode handling can be generic
* move mode_get to platform/generic/shooting.c
* add helper functions so mode_get can be generic
rec_mode_active (checks play_rec_mode, weak, can be overriden on cameras that need it)
screen_opened, screen_rotated: only defined on swivel screen cams, check phsw_ bits for screen pos
* move old play/rec checking code to rec_switch_state. #ifdef'd out for now
* move mode enum into it's own header file: modelist.h to allow easy lua generation.
* use playrec_mode on tx1
+ add new generated lua file LUALIB/GEN/modelist.lua
+ add lua library LUALIB/capmode.lua see
http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Lualib/Capmode + add test scripts see
http://chdk.wikia.com/wiki/UBASIC/Scripts:Standard/Test/Setmode http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Test/Setmode