Changeset 467


Ignore:
Timestamp:
08/05/08 09:39:29 (5 years ago)
Author:
Jucifer
Message:
  • adding missing scripting commands to Lua
Location:
branches/juciphox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/juciphox/core/luascript.c

    r427 r467  
    479479} 
    480480 
    481  
    482  
    483 static int luaCB_get_moviestate( lua_State* L ) 
     481static int luaCB_get_movie_status( lua_State* L ) 
    484482{ 
    485483  lua_pushnumber( L, movie_status ); 
    486484  return 1; 
     485} 
     486 
     487static int luaCB_set_movie_status( lua_State* L ) 
     488{ 
     489  int to; 
     490  to = luaL_checknumber( L, 1 ); 
     491if (to==1) { 
     492        if (movie_status == 4) { 
     493        movie_status = 1; 
     494}} 
     495if (to==2) { 
     496        if (movie_status == 1) { 
     497        movie_status = 4; 
     498} 
     499} 
     500if (to==3) { 
     501        if (movie_status == 1 || 4) { 
     502        movie_status = 5; 
     503}} 
     504  return 0; 
    487505} 
    488506 
     
    593611} 
    594612 
     613static int luaCB_play_sound( lua_State* L ) 
     614{ 
     615  play_sound(luaL_checknumber( L, 1 )); 
     616  return 0; 
     617} 
     618 
     619static int luaCB_get_temperature( lua_State* L ) 
     620{ 
     621  int which = (luaL_checknumber( L, 1 )); 
     622  int temp; 
     623  switch (which) 
     624  { 
     625    case 0: 
     626      temp = get_optical_temp();  
     627      break; 
     628    case 1: 
     629      temp = get_ccd_temp();  
     630      break; 
     631    case 2: 
     632      temp = get_battery_temp(); 
     633      break; 
     634  } 
     635  lua_pushnumber( L, temp ); 
     636  return 1; 
     637} 
    595638 
    596639void register_lua_funcs( lua_State* L ) 
     
    672715  FUNC(is_pressed); 
    673716  FUNC(is_key); 
    674 #if defined (CAMERA_g7) 
     717#if defined (CAMERA_g7) || defined (CAMERA_sx100is) 
    675718  FUNC(wheel_right); 
    676719  FUNC(wheel_left); 
     
    698741  FUNC(get_orientation_sensor); 
    699742  FUNC(get_nd_present); 
    700   FUNC(get_moviestate); 
     743  FUNC(get_movie_status); 
     744  FUNC(set_movie_status); 
    701745   
    702746  FUNC(get_histo_range); 
    703747  FUNC(shot_histo_enable); 
    704 } 
     748  FUNC(play_sound); 
     749  FUNC(get_temperature); 
     750} 
  • branches/juciphox/version.inc

    r464 r467  
    1 BUILD_NUMBER := 0.2.1 
     1BUILD_NUMBER := 0.2.2 
Note: See TracChangeset for help on using the changeset viewer.