Changeset 836 for trunk/core/luascript.c


Ignore:
Timestamp:
11/12/09 04:13:30 (4 years ago)
Author:
reyalp
Message:

Third part of mode override support. See http://chdk.kernreaktor.org/mantis/view.php?id=64

  • add set_capture_mode to lua. Sets the current capture mode, using a PROPCASE_SHOOTING_MODE value. This interface is preliminary and subject to change. ixus40_sd300 is not supported. ixus50_sd400, ixus700_sd500, s2is are untested and likely to to be incorrect.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/luascript.c

    r826 r836  
    10471047} 
    10481048 
    1049 #if 0 
    1050 static int luaCB_set_capture_mode_type( lua_State* L ) 
    1051 { 
    1052   unsigned i = luaL_checknumber(L,1); 
    1053   // TODO check against modemap as valid mode! 
    1054   SetCurrentCaptureModeType(i); 
    1055   return 0; 
    1056 } 
    1057 #endif 
     1049/* TODO warning this interface may change! 
     1050  set_capture_mode(modenum) 
     1051  where modenum is a valid PROPCASE_SHOOTING_MODE value for the current camera 
     1052*/ 
     1053static int luaCB_set_capture_mode( lua_State* L ) 
     1054{ 
     1055  int modenum = luaL_checknumber(L,1); 
     1056  // if the value as negative, assume it is a mistakenly sign extended PROPCASE_SHOOTING_MODE value 
     1057  if(modenum < 0)  
     1058    modenum &= 0xFFFF; 
     1059  SetCurrentCaptureModeType((unsigned)modenum); 
     1060  return 0; 
     1061} 
    10581062 
    10591063/*  
     
    12211225   FUNC(set_levent_active); 
    12221226   FUNC(set_levent_script_mode); 
    1223 //   FUNC(set_capture_mode_type); 
     1227   FUNC(set_capture_mode); 
    12241228 
    12251229   FUNC(set_record); 
Note: See TracChangeset for help on using the changeset viewer.