root/tools/ubasic_test/camera_functions.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. script_keyid_by_name
  2. console_set_autoredraw
  3. action_push_press
  4. action_push_release
  5. action_push_click
  6. action_push_delay
  7. action_push
  8. action_wait_for_click
  9. script_key_is_clicked
  10. shooting_get_tv
  11. shooting_set_tv
  12. shooting_set_tv_rel
  13. shooting_get_av
  14. shooting_set_av
  15. shooting_set_av_rel
  16. shooting_get_zoom
  17. shooting_set_zoom
  18. shooting_set_zoom_rel
  19. shooting_set_zoom_speed
  20. shooting_get_focus
  21. shooting_set_focus
  22. shooting_get_iso
  23. shooting_set_iso
  24. shooting_get_iso_real
  25. script_console_add_line
  26. console_set_layout
  27. script_console_set_autoredraw
  28. console_redraw
  29. console_clear
  30. md_detect_motion
  31. md_get_cell_diff
  32. md_get_cell_val
  33. md_init_motion_detector
  34. camera_set_nr
  35. camera_get_nr
  36. camera_set_raw
  37. ubasic_camera_get_raw
  38. shooting_set_prop
  39. shooting_get_prop
  40. stat_get_vbatt
  41. camera_set_led
  42. camera_get_script_autostart
  43. camera_set_script_autostart
  44. get_usb_power
  45. GetTotalCardSpaceKb
  46. GetFreeCardSpaceKb
  47. GetJpgCount
  48. GetRawCount
  49. exit_alt
  50. shooting_set_user_tv_by_id
  51. shooting_set_user_tv_by_id_rel
  52. shooting_set_sv96
  53. shooting_get_av96
  54. shooting_get_user_av96
  55. shooting_get_user_av_id
  56. shooting_set_av96
  57. shooting_set_av96_direct
  58. shooting_set_user_av96
  59. shooting_set_user_av_by_id
  60. shooting_set_user_av_by_id_rel
  61. shooting_get_subject_distance
  62. shooting_get_hyperfocal_distance
  63. mode_get
  64. shooting_get_focus_mode
  65. shooting_get_focus_state
  66. shooting_get_focus_ok
  67. shooting_get_iso_market
  68. shooting_get_bv96
  69. shooting_get_sv96_real
  70. shooting_set_iso_real
  71. shooting_get_iso_mode
  72. shooting_set_iso_mode
  73. shooting_set_nd_filter_state
  74. camera_shutdown_in_a_second
  75. shooting_get_tv96
  76. shooting_get_user_tv96
  77. shooting_get_user_tv_id
  78. shooting_set_tv96
  79. shooting_set_tv96_direct
  80. shooting_set_user_tv96
  81. get_exposure_counter
  82. script_key_is_pressed
  83. shot_histogram_get_range
  84. script_print_screen_statement
  85. get_tick_count
  86. shooting_get_drive_mode
  87. shot_histogram_isenabled
  88. get_ccd_temp
  89. get_optical_temp
  90. get_battery_temp
  91. play_sound
  92. TurnOnBackLight
  93. TurnOffBackLight
  94. set_draw_title_line
  95. get_draw_title_line
  96. DoAFLock
  97. UnlockAF
  98. shot_histogram_set
  99. levent_set_record
  100. levent_set_play
  101. set_capture_mode
  102. shooting_set_mode_chdk
  103. shooting_set_mode_canon
  104. shooting_mode_chdk2canon
  105. conf_getValue
  106. conf_setValue
  107. reboot
  108. mode_is_video
  109. swap_partitions
  110. shooting_update_dof_values
  111. shooting_sv96_real_to_market
  112. shooting_sv96_market_to_real
  113. shooting_set_playrec_mode
  114. shooting_iso_real_to_market
  115. shooting_iso_market_to_real
  116. shooting_is_flash
  117. shooting_in_progress
  118. shooting_get_tv96_from_shutter_speed
  119. shooting_get_sv96_from_iso
  120. shooting_get_shutter_speed_from_tv96
  121. shooting_get_resolution
  122. shooting_get_real_focus_mode
  123. shooting_get_nd_value_ev96
  124. shooting_get_nd_current_ev96
  125. shooting_get_min_av96
  126. shooting_get_max_av96
  127. shooting_get_iso_from_sv96
  128. shooting_get_is_mode
  129. shooting_get_imager_active
  130. shooting_get_flash_mode
  131. shooting_get_ev_correction1
  132. shooting_get_display_mode
  133. shooting_get_current_tv96
  134. shooting_get_current_av96
  135. shooting_get_current_base_sv96
  136. shooting_get_current_delta_sv96
  137. shooting_get_av96_from_aperture
  138. shooting_get_aperture_from_av96
  139. shooting_can_focus
  140. set_movie_status
  141. sd_over_modes
  142. script_set_terminate_key
  143. script_console_add_error
  144. lens_get_zoom_point
  145. is_video_recording
  146. is_raw_possible
  147. get_movie_status
  148. get_localtime
  149. get_focal_length
  150. force_usb_state
  151. enter_alt
  152. action_top
  153. action_pop_func
  154. action_push_func
  155. action_push_shoot
  156. DoAELock
  157. UnlockAE
  158. DoMFLock
  159. UnlockMF
  160. JogDial_CW
  161. JogDial_CCW
  162. TurnOnDisplay
  163. TurnOffDisplay

   1 #include <stdio.h>
   2 #include <math.h>
   3 #include <time.h>
   4 
   5 static int tv=0, av=0, zoom=0, focus=0, iso=0, raw=0, raw_nr=0,autostart=0; 
   6 int movie_status=0;
   7 int shot_histogram_enabled=0;
   8 int state_kbd_script_run=1;
   9 int zoom_points = 3;
  10 #define MODE_REC                0x0100
  11 #define AS_SHOOT 1
  12 #define CONF_VALUE 2
  13 int script_keyid_by_name(const char *s) {
  14         return 1;
  15 }
  16 
  17 void console_set_autoredraw(int n) {
  18     printf("*** console_set_auto_redraw %d ***\n",n);
  19 }
  20 
  21 void action_push_press(int k)
  22 {
  23     printf("*** button press %d ***\n",k);
  24 }
  25 
  26 void action_push_release(int k)
  27 {
  28     printf("*** button release %d ***\n",k);
  29 }
  30 
  31 void action_push_click(int k)
  32 {
  33     printf("*** button click %d ***\n",k);
  34 }
  35 
  36 void action_push_delay(int v)
  37 {
  38     printf("*** sleep %d ***\n",v);
  39 }
  40 
  41 void action_push(int id)
  42 {
  43         if(id == AS_SHOOT)
  44                 printf("*** shoot ***\n");
  45         else
  46                 printf("*** action_push(%d) ***\n",id);
  47 }
  48 
  49 void action_wait_for_click(int t)
  50 {
  51     printf("*** wait_click %d ***\n", t);
  52 }
  53 
  54 int script_key_is_clicked(int k)
  55 {
  56     printf("*** is_clicked %d ***\n", k);
  57     return 1;
  58 }
  59 
  60 int shooting_get_tv()
  61 {
  62     return tv;
  63 }
  64 
  65 void shooting_set_tv(int v)
  66 {
  67     tv = v;
  68     printf("*** set tv %d ***\n",v);
  69 }
  70 
  71 void shooting_set_tv_rel(int v)
  72 {
  73     tv += v;
  74     printf("*** set tv rel %d ***\n",v);
  75 }
  76 
  77 int shooting_get_av()
  78 {
  79     return av;
  80 }
  81 
  82 void shooting_set_av(int v)
  83 {
  84     av = v;
  85     printf("*** set av %d ***\n",v);
  86 }
  87 
  88 void shooting_set_av_rel(int v)
  89 {
  90     av += v;
  91     printf("*** set av rel %d ***\n",v);
  92 }
  93 
  94 int shooting_get_zoom()
  95 {
  96     return zoom;
  97 }
  98 
  99 void shooting_set_zoom(int v)
 100 {
 101     zoom = v;
 102     printf("*** set zoom %d ***\n",v);
 103 }
 104 
 105 void shooting_set_zoom_rel(int v)
 106 {
 107     zoom += v;
 108     printf("*** set zoom rel %d ***\n",v);
 109 }
 110 
 111 void shooting_set_zoom_speed(int v)
 112 {
 113     printf("*** set zoom speed %d ***\n",v);
 114 }
 115 
 116 int shooting_get_focus()
 117 {
 118     return focus;
 119 }
 120 
 121 void shooting_set_focus(int v)
 122 {
 123     focus = v;
 124     printf("*** set focus %d ***\n",v);
 125 }
 126 
 127 int shooting_get_iso()
 128 {
 129     return iso;
 130 }
 131 
 132 void shooting_set_iso(int v)
 133 {
 134     iso = v;
 135     printf("*** set iso %d ***\n",v);
 136 }
 137 //ARM Begin
 138 int shooting_get_iso_real()
 139 {
 140   return iso;
 141 }
 142 //ARM End
 143 void script_console_add_line(const char *str) {
 144     printf(">>> %s\n", str);
 145 }
 146 
 147 void console_set_layout(int x1, int y1, int x2, int y2) {
 148     printf(">>> set console layout to %d %d %d %d\n", x1,y1,x2,y2);
 149 }
 150 
 151 void script_console_set_autoredraw(int value) {
 152     printf(">>> set console auto_redraw to %d\n", value);
 153 }
 154 
 155 void console_redraw() {
 156     printf("*** console redraw ***\n");
 157 }
 158 
 159 void console_clear() {
 160     printf("*** clear console ***\n");
 161 }
 162 int md_detect_motion(void)
 163 {
 164     printf("*** md_detect_motion ***\n");
 165         return 0;
 166 }
 167 int md_get_cell_diff(int column, int row)
 168 {
 169     printf("*** md_get_sell_diff %d %d ***\n", column, row);
 170         return 0;
 171 }
 172 int md_get_cell_val(int column, int row)
 173 {
 174     printf("*** md_get_sell_abs %d %d ***\n", column, row);
 175         return 0;
 176 }
 177 int md_init_motion_detector()
 178 {
 179     printf("*** md_init_motion_detector ***\n");
 180         return 0;
 181 }
 182 void camera_set_nr(to) 
 183 {
 184         raw_nr = to;
 185     printf("*** set raw nr %d ***\n",raw_nr);
 186 };
 187 
 188 int camera_get_nr(to) 
 189 {
 190     printf("*** get raw nr ***\n");
 191         return raw_nr;
 192 };
 193 
 194 void camera_set_raw(int mode)
 195 {
 196         raw = mode;
 197     printf("*** set raw %d ***\n",raw);
 198 }
 199 
 200 int ubasic_camera_get_raw()
 201 {
 202         return raw;
 203 }
 204 void shooting_set_prop(int id, int v)
 205 {
 206     printf("*** set prop %d %d ***\n",id, v);
 207 }
 208 int shooting_get_prop(int id)
 209 {
 210         return 0;
 211 }
 212 long stat_get_vbatt()
 213 {
 214         return 4085;
 215 }
 216 void camera_set_led(int led, int state, int bright)
 217 {
 218     printf("*** set led %d %d %d ***\n",led, state, bright);
 219 }
 220 
 221 int camera_get_script_autostart()
 222 {
 223         return 0;
 224 }
 225 void camera_set_script_autostart(int state)
 226 {
 227         autostart = state;
 228     printf("*** set autostart %d ***\n",autostart);
 229 }
 230 int get_usb_power(int edge)
 231 {
 232         return 0;
 233 }
 234 int GetTotalCardSpaceKb()
 235 {
 236         return 0;
 237 }
 238 int GetFreeCardSpaceKb()
 239 {
 240         return 0;
 241 }
 242 
 243 int GetJpgCount()
 244 {
 245     printf("*** GetJpgCount ***\n");
 246     return 0;
 247 }
 248 
 249 int GetRawCount()
 250 {
 251     printf("*** GetRawCount ***\n");
 252     return 0;
 253 }
 254 
 255 void exit_alt()
 256 {
 257     printf("*** exit alt ***\n");
 258 
 259 }
 260 
 261 void shooting_set_user_tv_by_id(int v)
 262 {
 263     printf("*** shooting_set_user_tv_by_id %d ***\n", v);
 264 }
 265 
 266 void shooting_set_user_tv_by_id_rel(int v)
 267 {
 268     printf("*** shooting_set_user_tv_by_id_rel %d ***\n", v);
 269 }
 270 
 271 void shooting_set_sv96(short sv96, short is_now)
 272 {
 273     printf("*** shooting_set_sv96 %d %d ***\n", sv96, is_now);
 274 }
 275 
 276 short shooting_get_av96()
 277 {
 278     printf("*** shooting_get_av96 ***\n");
 279     return 0;
 280 }
 281 
 282 short shooting_get_user_av96()
 283 {
 284     printf("*** shooting_get_user_av96 ***\n");
 285     return 0;
 286 }
 287 
 288 int shooting_get_user_av_id()
 289 {
 290     printf("*** shooting_get_user_av_id ***\n");
 291     return 0;
 292 }
 293 
 294 void shooting_set_av96(short v,short is_now)
 295 {
 296     printf("*** shooting_set_av96 %d %d ***\n", v, is_now);
 297 }
 298 
 299 void shooting_set_av96_direct(short v, short is_now)
 300 {
 301     printf("*** shooting_set_av96_direct %d %d ***\n", v, is_now);
 302 }
 303 
 304 void shooting_set_user_av96(short v)
 305 {
 306     printf("*** shooting_set_user_av96 %d ***\n", v);
 307 }
 308 
 309 void shooting_set_user_av_by_id(int v)
 310 {
 311     printf("*** shooting_set_user_av_by_id %d ***\n", v);
 312 }
 313 
 314 void shooting_set_user_av_by_id_rel(int v)
 315 {
 316     printf("*** shooting_set_user_av_by_id_rel %d ***\n", v);
 317 }
 318 
 319 int shooting_get_subject_distance()
 320 {
 321     printf("*** shooting_get_subject_distance ***\n");
 322     return 1000;
 323 }
 324 
 325 int shooting_get_hyperfocal_distance()
 326 {
 327     printf("*** shooting_get_hyperfocal_distance ***\n");
 328     return 1000;
 329 }
 330 
 331 int mode_get()
 332 {
 333     printf("*** mode_get ***\n");
 334     return MODE_REC;
 335 }
 336 
 337 short shooting_get_focus_mode()
 338 {
 339     printf("*** shooting_get_focus_mode ***\n");
 340     return 0;
 341 }
 342  
 343 short shooting_get_focus_state()
 344 {
 345     printf("*** shooting_get_focus_state ***\n");
 346     return 0;
 347 }
 348 
 349 short shooting_get_focus_ok()
 350 {
 351     printf("*** shooting_get_focus_ok ***\n");
 352     return 0;
 353 }
 354 
 355 short shooting_get_iso_market()
 356 {
 357     printf("*** shooting_get_iso_market ***\n");
 358     return 100;
 359 }
 360 
 361 short shooting_get_bv96()
 362 {
 363     printf("*** shooting_get_bv96 ***\n");
 364     return 32;
 365 }
 366 
 367 short shooting_get_sv96_real()
 368 {
 369     printf("*** shooting_get_sv96 ***\n");
 370     return 32;
 371 }
 372 
 373 void shooting_set_iso_real(short iso, short is_now)
 374 {
 375     printf("*** shooting_set_iso_real %d %d ***\n", iso, is_now);
 376 }
 377 
 378 int shooting_get_iso_mode()
 379 {
 380     printf("*** shooting_get_iso_mode ***\n");
 381     return 0;
 382 }
 383 
 384 void shooting_set_iso_mode(int v)
 385 {
 386     printf("*** shooting_set_iso_mode %d ***\n", v);
 387 }
 388 
 389 void shooting_set_nd_filter_state(short v, short is_now)
 390 {
 391     printf("*** shooting_set_nd_filter_state %d %d ***\n", v, is_now);
 392 }
 393 
 394 void camera_shutdown_in_a_second()
 395 {
 396     printf("*** camera_shutdown_in_a_second ***\n");
 397 }
 398 
 399 short shooting_get_tv96()
 400 {
 401     printf("*** shooting_get_tv96 ***\n");
 402     return 0;
 403 }
 404 
 405 short shooting_get_user_tv96()
 406 {
 407     printf("*** shooting_get_user_tv96 ***\n");
 408     return 0;
 409 }
 410 
 411 int shooting_get_user_tv_id()
 412 {
 413     printf("*** shooting_get_user_tv_id ***\n");
 414     return 0;
 415 }
 416 
 417 void shooting_set_tv96(short v, short is_now)
 418 {
 419     printf("*** shooting_set_tv96 %d %d ***\n", v, is_now);
 420 }
 421 
 422 void shooting_set_tv96_direct(short v, short is_now)
 423 {
 424     printf("*** shooting_set_tv96_direct %d %d ***\n", v, is_now);
 425 }
 426 
 427 void shooting_set_user_tv96(short v)
 428 {
 429     printf("*** shooting_set_user_tv96 %d ***\n", v);
 430 }
 431 
 432 int get_exposure_counter(void)
 433 {
 434     printf("*** get_exposure_counter ***\n");
 435         return 123;
 436 }
 437 
 438 int script_key_is_pressed( int keyid )
 439 {
 440     printf("*** script_key_is_pressed %d ***\n", keyid);
 441         return 0;
 442 }
 443 
 444 int shot_histogram_get_range(int from, int to)
 445 {
 446     printf("*** shot_histogram_get_range %d,%d ***\n", from,to);
 447         return 100;
 448 }
 449 
 450 void script_print_screen_statement(int v)
 451 {
 452     printf("*** script_print_screensatement %d ***\n", v);
 453 }
 454 
 455 int get_tick_count(void)
 456 {
 457     printf("*** get_tick_count ***\n");
 458         // what should it return ?
 459         return 10;
 460 }
 461 
 462 short shooting_get_drive_mode()
 463 {
 464     printf("*** shooting_get_drive_mode ***\n");
 465         // what should it return ?
 466         return 10;
 467 }
 468 
 469 int shot_histogram_isenabled()
 470 {
 471     printf("*** shot_histogram_isenabled ***\n");
 472         return shot_histogram_enabled;
 473 }
 474 
 475 int get_ccd_temp() 
 476 {
 477     printf("*** get_ccd_temp ***\n");
 478         return 69;
 479 }
 480 int get_optical_temp()
 481 {
 482     printf("*** get_optical_temp ***\n");
 483         return 69;
 484 }
 485 
 486 int get_battery_temp()
 487 {
 488     printf("*** get_battery_temp ***\n");
 489         return 69;
 490 }
 491 
 492 void play_sound()
 493 {
 494     printf("*** play_sound ***\n");
 495 }       
 496 
 497 void TurnOnBackLight()
 498 {
 499     printf("*** TurOnBackLight ***\n");
 500 }
 501 
 502 void TurnOffBackLight()
 503 {
 504     printf("*** TurnOffBackLight ***\n");
 505 }
 506 
 507 void set_draw_title_line(int m)
 508 {
 509    printf("*** set CHDK OSD title line ( %d ) ***\n",m);
 510    return ;
 511 }
 512 
 513 void get_draw_title_line(int m)
 514 {
 515    printf("*** get CHDK OSD title line state ***\n");
 516    return ;
 517 }
 518 
 519 void DoAFLock()
 520 {
 521     printf("*** DoAFLock ***\n");
 522 }
 523 
 524 void UnlockAF()
 525 {
 526     printf("*** UnlockAF ***\n");
 527 }
 528 
 529 int shot_histogram_set(int x)
 530 {
 531     printf("*** shot_histogram_set ***\n");
 532         return 1;
 533 }
 534 
 535 void levent_set_record()
 536 {
 537     printf("*** levent_set_record ***\n");
 538 }
 539 
 540 void levent_set_play()
 541 {
 542     printf("*** levent_set_play ***\n");
 543 }
 544 
 545 int set_capture_mode(int x)
 546 {
 547     printf("*** set_capture_mode %d ***\n",x);
 548         return 1;
 549 }
 550 
 551 int shooting_set_mode_chdk(int x)
 552 {
 553     printf("*** set_capture_mode_canon %d ***\n",x);
 554         return 1;
 555 }
 556 
 557 int shooting_set_mode_canon(int x)
 558 {
 559     printf("*** set_capture_mode_canon %d ***\n",x);
 560         return 1;
 561 }
 562 
 563 int shooting_mode_chdk2canon(int chdkmode)
 564 {
 565     printf("*** shooting_mode_chdk2canon %d ***\n",chdkmode);
 566         if(chdkmode < 1 || chdkmode > 50)
 567                 return 0;
 568         return 1;
 569 }
 570 
 571 int conf_getValue(unsigned short id, int* configVal) {
 572     printf("*** get config value %d ***\n",id);
 573     *configVal = 1;
 574     return CONF_VALUE;
 575 }
 576 
 577 int conf_setValue(unsigned short id, int configVal) {
 578     printf("*** set config value %d %d***\n",id, configVal);
 579     return CONF_VALUE;
 580 }
 581 
 582 void reboot(const char *filename) 
 583 {
 584     printf("*** reboot %s ***\n",filename?filename:"NULL");
 585 }
 586 
 587 int mode_is_video(int m)
 588 {
 589     printf("*** mode is video %d ***\n",m);
 590     return 0;
 591 }
 592 
 593 int swap_partitions(int new)
 594 {
 595     printf("*** swap_partitions %d ***\n",new);
 596     return 1;
 597 }
 598 
 599 void shooting_update_dof_values()
 600 {
 601     printf("*** shooting_update_dof_values ***\n");
 602 }
 603 
 604 short shooting_sv96_real_to_market(short isor)
 605 {
 606     printf("*** shooting_sv96_real_to_market %d ***\n",isor);
 607     return isor;
 608 }
 609 
 610 short shooting_sv96_market_to_real(short sv96)
 611 {
 612     printf("*** shooting_sv96_market_to_real %d ***\n",sv96);
 613     return sv96;
 614 }
 615 
 616 void shooting_set_playrec_mode(int mode)
 617 {
 618     printf("*** shooting_set_playrec_mode %d ***\n",mode);
 619 }
 620 
 621 short shooting_iso_real_to_market(short isor)
 622 {
 623     printf("*** shooting_iso_real_to_market %d ***\n",isor);
 624     return isor;
 625 }
 626 
 627 short shooting_iso_market_to_real(short isom)
 628 {
 629     printf("*** shooting_iso_market_to_real %d ***\n",isom);
 630     return isom;
 631 }
 632 
 633 int shooting_is_flash()
 634 {
 635     printf("*** shooting_is_flash ***\n");
 636     return 0;
 637 }
 638 
 639 int shooting_in_progress()
 640 {
 641     printf("*** shooting_in_progress ***\n");
 642     return 0;
 643 }
 644 
 645 static const double inv_log_2 = 1.44269504088906;   // 1 / log_2
 646 #define SHOOTING_TV96_INVALID -10000
 647 
 648 short shooting_get_tv96_from_shutter_speed(float t)
 649 {
 650     printf("*** shooting_get_tv96_from_shutter_speed %f ***\n",t);
 651     if (t > 0)
 652     {
 653         t = ((96.0 * -log(t)) * inv_log_2);
 654         if (t < 0)
 655             return (short)(t - 0.5);
 656         return (short)(t + 0.5);
 657     }
 658     return SHOOTING_TV96_INVALID;
 659 }
 660 
 661 short shooting_get_sv96_from_iso(short iso)
 662 {
 663     printf("*** shooting_get_sv96_from_iso %d ***\n",iso);
 664     // Equivalent to (short)(log2(iso/3.125)*96+0.5) [APEX equation]
 665     if (iso > 0)
 666         return (short)( log((double)(iso)*32.0/100.0)*96.0*(inv_log_2)+0.5 );
 667     return 0;
 668 }
 669 
 670 float shooting_get_shutter_speed_from_tv96(short tv96)
 671 {
 672     printf("*** shooting_get_shutter_speed_from_tv96 %d ***\n",tv96);
 673     return pow(2,((float)(-tv96))/96.0);
 674 }
 675 
 676 short shooting_get_resolution()
 677 {
 678     printf("*** shooting_get_resolution ***\n");
 679     return 0;
 680 }
 681 
 682 short shooting_get_real_focus_mode()
 683 {
 684     printf("*** shooting_get_real_focus_mode ***\n");
 685     return 0;
 686 }
 687 
 688 short shooting_get_nd_value_ev96()
 689 {
 690     printf("*** shooting_get_nd_value_ev96 ***\n");
 691     return 0;
 692 }
 693 
 694 short shooting_get_nd_current_ev96()
 695 {
 696     printf("*** shooting_get_nd_current_ev96 ***\n");
 697     return 0;
 698 }
 699 
 700 short shooting_get_min_av96()
 701 {
 702     printf("*** shooting_get_min_av96 ***\n");
 703     return -1;
 704 }
 705 
 706 short shooting_get_max_av96()
 707 {
 708     printf("*** shooting_get_max_av96 ***\n");
 709     return -1;
 710 }
 711 
 712 short shooting_get_iso_from_sv96(short sv96)
 713 {
 714     printf("*** shooting_get_shutter_speed_from_tv96 %d ***\n",sv96);
 715     // APEX equation --> (int)(POWER(2,(iso/96)) * 3.125) + 0.5)
 716     return (short)( (double)pow(2, (((double)sv96)/96.0))*100.0/32.0 + 0.5 );
 717 }
 718 
 719 short shooting_get_is_mode()
 720 {
 721     printf("*** shooting_get_is_mode ***\n");
 722     return 0;
 723 }
 724 
 725 int shooting_get_imager_active() {
 726     printf("*** shooting_get_imager_active ***\n");
 727     return 0;
 728 }
 729 
 730 short shooting_get_flash_mode()
 731 {
 732     printf("*** shooting_get_flash_mode ***\n");
 733     return 0;
 734 }
 735 
 736 short shooting_get_ev_correction1()
 737 {
 738     printf("*** shooting_get_ev_correction1 ***\n");
 739     return 0;
 740 }
 741 
 742 short shooting_get_display_mode()
 743 {
 744     printf("*** shooting_get_display_mode ***\n");
 745     return 0;
 746 }
 747 
 748 #define SHOOTING_TV96_INVALID -10000
 749 
 750 long shooting_get_current_tv96()
 751 {
 752     printf("*** shooting_get_current_tv96 ***\n");
 753     return SHOOTING_TV96_INVALID;
 754 }
 755 
 756 long shooting_get_current_av96()
 757 {
 758     printf("*** shooting_get_current_av96 ***\n");
 759     return 0;
 760 }
 761 
 762 long shooting_get_current_base_sv96()
 763 {
 764     printf("*** shooting_get_current_base_sv96 ***\n");
 765     return 0;
 766 }
 767 
 768 long shooting_get_current_delta_sv96()
 769 {
 770     printf("*** shooting_get_current_delta_sv96 ***\n");
 771     return 0;
 772 }
 773 
 774 short shooting_get_av96_from_aperture(int aperture)
 775 {
 776     printf("*** shooting_get_av96_from_aperture %d ***\n", aperture);
 777     return (int)((log((double)aperture/1000.0) * 192 * inv_log_2) + 0.5);
 778 }
 779 
 780 int shooting_get_aperture_from_av96(short av96)
 781 {
 782     printf("*** shooting_get_aperture_from_av96 %d ***\n", av96);
 783     if (av96)
 784         return (short)((pow(2, ((double)av96)/192.0))*1000.0 + 0.5);
 785     return -1;
 786 }
 787 
 788 short shooting_can_focus()
 789 {
 790     printf("*** shooting_can_focus ***\n");
 791     return 0;
 792 }
 793 
 794 void set_movie_status(int status)
 795 {
 796     printf("*** set_movie_status %d ***\n", status);
 797 }
 798 
 799 int sd_over_modes()
 800 {
 801     printf("*** sd_over_modes ***\n");
 802     return 0;
 803 }
 804 
 805 void script_set_terminate_key(int key, const char *keyname)
 806 {
 807     printf("*** script_set_terminate_key %d %s ***\n", key, keyname);
 808 }
 809 
 810 void script_console_add_error(long str_id)
 811 {
 812     printf("*** script_console_add_error %ld ***\n", str_id);
 813 }
 814 
 815 long lens_get_zoom_point()
 816 {
 817     printf("*** lens_get_zoom_point ***\n");
 818     return 0;
 819 }
 820 
 821 int is_video_recording()
 822 {
 823     printf("*** is_video_recording ***\n");
 824     return 0;
 825 }
 826 
 827 int is_raw_possible()
 828 {
 829     printf("*** is_raw_possible ***\n");
 830     return 0;
 831 }
 832 
 833 int get_movie_status()
 834 {
 835     printf("*** get_movie_status ***\n");
 836     return 0;
 837 }
 838 
 839 struct tm *get_localtime()
 840 {
 841     printf("*** get_localtime ***\n");
 842     time_t t = time(NULL);
 843     return localtime(&t);
 844 }
 845 
 846 int get_focal_length(int zp)
 847 {
 848     printf("*** get_focal_length  %d ***\n", zp);
 849     return 0;
 850 }
 851 
 852 int force_usb_state(int state)
 853 {
 854     printf("*** force_usb_state  %d ***\n", state);
 855     return 0;
 856 }
 857 
 858 void enter_alt(int script_mode)
 859 {
 860     printf("*** enter_alt  %d ***\n", script_mode);
 861 }
 862 
 863 long action_top(int n)
 864 {
 865     printf("*** action_top  %d ***\n", n);
 866     return 0;
 867 }
 868 
 869 long action_pop_func(int nParam)
 870 {
 871     printf("*** action_pop_func  %d ***\n", nParam);
 872     return 0;
 873 }
 874 
 875 typedef int (*action_func)(void);
 876 
 877 void action_push_func(action_func f)
 878 {
 879     printf("*** action_push_func  %ld ***\n", (long)f);
 880 }
 881 
 882 void action_push_shoot(int retry)
 883 {
 884     printf("*** action_push_shoot  %d ***\n", retry);
 885 }
 886 
 887 void DoAELock()
 888 {
 889     printf("*** DoAELock ***\n");
 890 }
 891 
 892 void UnlockAE()
 893 {
 894     printf("*** UnlockAE ***\n");
 895 }
 896 
 897 int DoMFLock()
 898 {
 899     printf("*** DoMFLock ***\n");
 900     return 0;
 901 }
 902 
 903 int UnlockMF()
 904 {
 905     printf("*** UnlockMF ***\n");
 906     return 0;
 907 }
 908 
 909 void JogDial_CW()
 910 {
 911     printf("*** JogDial_CW ***\n");
 912 }
 913 
 914 void JogDial_CCW()
 915 {
 916     printf("*** JogDial_CW ***\n");
 917 }
 918 
 919 void TurnOnDisplay()
 920 {
 921     printf("*** TurnOnDisplay ***\n");
 922 }
 923 
 924 void TurnOffDisplay()
 925 {
 926     printf("*** TurnOffDisplay ***\n");
 927 }

/* [<][>][^][v][top][bottom][index][help] */