tv=560set_tv96_direct( tv+96 )press("shoot_half")repeat sleep(50) until (get_shooting() == true )press("shoot_full_only")sleep(100)release("shoot_full")
press("shoot_half")repeat sleep(50) until (get_shooting() == true )release("shoot_half")tv=get_tv96()set_tv96_direct( tv+96 )press("shoot_half")repeat sleep(50) until (get_shooting() == true )press("shoot_full_only")sleep(100)release("shoot_full")
//when() function allows scripts to set exposure (tv,sv,av,nd) values with half shoot// pressed that take effect immediately. Without when() function, changes won't// take place until the NEXT half_shoot. This requires double metering of each// shot, which slows down rate (by half) for multiple shots.static int when(){ if(shooting_in_progress())return SET_NOW; return SET_LATER;}static int luaCB_set_av96_direct( lua_State* L ){ shooting_set_av96_direct( luaL_checknumber( L, 1 ), when() );// shooting_set_av96_direct( luaL_checknumber( L, 1 ), SET_LATER ); return 0;}static int luaCB_set_av96( lua_State* L ){ shooting_set_av96( luaL_checknumber( L, 1 ), when() );// shooting_set_av96( luaL_checknumber( L, 1 ), SET_LATER ); return 0;}static int luaCB_set_iso_real( lua_State* L ){ shooting_set_iso_real( luaL_checknumber( L, 1 ), when()); return 0;}//search for SET_LATER and replace with when()
It's a little easier to create a "when()" function and substitute "when()" for "SET_LATER" in the relevant set_xx96() functions. Basically, you just search for "SET_LATER" in luascript.c and replace it with "when()".
shooting_set_tv96( param, shooting_in_progress()? SET_NOW : SET_LATER );
Code: [Select]shooting_set_tv96( param, shooting_in_progress()? SET_NOW : SET_LATER ); That works too, and it's a little more clear than the when() function.
And one additional update to my original post - I believe that this patch is 100% backwards compatible for Lua & uBASIC scripts.
I think this is a good change and I will add it to SVN soon;
but I don't think it is 100% compatible with all existing scripts.
A script might rely on the old behaviour to set the overrides for the next shot by calling the functions after the shutter half press.For example I think this logic will work with the current code; but will fail in the new code:- half press shutter- get current values and calculate new values- call override functions (sets up for next shot)- release shutter- call shootI have no idea if there are any scripts that do this, and if they do they can be easily fixed.
For example I think this logic will work with the current code; but will fail in the new code:- half press shutter- get current values and calculate new values- call override functions (sets up for next shot)- release shutter- call shootI have no idea if there are any scripts that do this, and if they do they can be easily fixed.
static int luaCB_set_av96_direct( lua_State* L ){ if(shooting_in_progress())shooting_set_av96_direct( luaL_checknumber( L, 1 ), SET_NOW); shooting_set_av96_direct( luaL_checknumber( L, 1 ), SET_LATER ); return 0;}
I don't suppose I can raise any support for back porting this into 1.2 ?
If no one else objects I'll add it tomorrow.
Started by PhyrePhoX « 1 2 » General Discussion and Assistance
Started by mattkime Script Writing
Started by sargon Script Writing
Started by John1234 « 1 2 ... 18 19 » General Help and Assistance on using CHDK stable releases
Started by lapser General Discussion and Assistance