root/lib/ubasic/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

   1 #ifdef UBASIC_TEST
   2 
   3 #include <stdio.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 #endif

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