| 278 | | const char* gui_USB_switch_types[] = { "None","OnePush", "TwoPush", "CA-1" }; // note : make sure # of entries less than NUM_USB_INPUT_DRV in usb_remote.c |
| 279 | | const char* gui_USB_control_modes[] = { "None", "Normal", "Quick", "Burst", "Bracket","Zoom", "Video" }; // note : make sure # of entries less than NUM_USB_MODULES in usb_remote.c |
| 280 | | |
| 281 | | static CMenu bracketing_in_continuous_submenu ; |
| 282 | | |
| 283 | | static CMenuItem remote_submenu_items[] = { |
| 284 | | MENU_ITEM(0x71,LANG_MENU_REMOTE_ENABLE, MENUITEM_BOOL, &conf.remote_enable, 0), |
| 285 | | MENU_ENUM2(0x5f,LANG_MENU_REMOTE_DEVICE, &conf.remote_switch_type, gui_USB_switch_types ), |
| 286 | | MENU_ENUM2(0x5f,LANG_MENU_REMOTE_LOGIC, &conf.remote_control_mode, gui_USB_control_modes ), |
| 287 | | MENU_ITEM(0x0, LANG_MENU_REMOTE_OPTIONS, MENUITEM_SEPARATOR, 0, 0 ), |
| 288 | | MENU_ITEM(0x5c,LANG_MENU_SYNCH_ENABLE, MENUITEM_BOOL, &conf.synch_enable, 0), |
| 289 | | MENU_ITEM(0x5c,LANG_MENU_SYNCH_DELAY_ENABLE, MENUITEM_BOOL, &conf.synch_delay_enable, 0), |
| 290 | | MENU_ITEM(0x5e,LANG_MENU_SYNCH_DELAY_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED, &conf.synch_delay_value, 0), |
| 291 | | MENU_ITEM(0x5c,LANG_MENU_SCRIPT_START_ENABLE, MENUITEM_BOOL, &conf.remote_enable_scripts, 0), |
| 292 | | MENU_ITEM(0x2c,LANG_MENU_BRACKET_IN_CONTINUOUS, MENUITEM_SUBMENU, &bracketing_in_continuous_submenu, 0 ), |
| 293 | | // MENU_ITEM(0x5e,LANG_MENU_SYNCH_DELAY_COARSE_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED, &conf.synch_delay_coarse_value, 0), |
| 294 | | // MENU_ITEM(0x5e,LANG_MENU_REMOTE_ZOOM_TIMEOUT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zoom_timeout, MENU_MINMAX(2,10)), |
| 295 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0), |
| 296 | | {0} |
| 297 | | }; |
| 298 | | static CMenu remote_submenu = {0x86,LANG_MENU_REMOTE_PARAM_TITLE, NULL, remote_submenu_items }; |
| 299 | | |
| 300 | | |
| 301 | | #ifdef OPT_SCRIPTING |
| 302 | | static const char* gui_script_autostart_modes[]= { "Off", "On", "Once"}; |
| 303 | | static CMenuItem script_submenu_items_top[] = { |
| 304 | | MENU_ITEM (0x35,LANG_MENU_SCRIPT_LOAD, MENUITEM_PROC, gui_load_script, 0 ), |
| 305 | | MENU_ITEM (0x5f,LANG_MENU_SCRIPT_DELAY, MENUITEM_INT|MENUITEM_F_UNSIGNED, &conf.script_shoot_delay, 0 ), |
| 306 | | // remote autostart |
| 307 | | MENU_ENUM2 (0x5f,LANG_MENU_SCRIPT_AUTOSTART, &conf.script_startup, gui_script_autostart_modes ), |
| 308 | | |
| 309 | | #if CAM_REMOTE |
| 310 | | MENU_ITEM (0x86,LANG_MENU_REMOTE_PARAM, MENUITEM_SUBMENU, &remote_submenu, 0 ), |
| 311 | | #endif |
| 312 | | MENU_ITEM (0x5d,LANG_MENU_SCRIPT_DEFAULT_VAL, MENUITEM_PROC, gui_load_script_default, 0 ), |
| 313 | | MENU_ITEM (0x5e,LANG_MENU_SCRIPT_PARAM_SET, MENUITEM_ENUM, gui_script_param_set_enum, 0 ), |
| 314 | | MENU_ITEM (0x5c,LANG_MENU_SCRIPT_PARAM_SAVE, MENUITEM_BOOL, &conf.script_param_save, 0 ), |
| 315 | | MENU_ITEM (0x0 ,(int)script_title, MENUITEM_SEPARATOR, 0, 0 ), |
| 316 | | }; |
| 317 | | |
| 318 | | static CMenuItem script_submenu_items_bottom[] = { |
| 319 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 320 | | {0} |
| 321 | | }; |
| 322 | | |
| 323 | | static CMenuItem script_submenu_items[sizeof(script_submenu_items_top)/sizeof(script_submenu_items_top[0])+SCRIPT_NUM_PARAMS+ |
| 324 | | sizeof(script_submenu_items_bottom)/sizeof(script_submenu_items_bottom[0])]; |
| 325 | | static CMenu script_submenu = {0x27,LANG_MENU_SCRIPT_TITLE, NULL, script_submenu_items }; |
| 326 | | #endif |
| 327 | | |
| 328 | | static const char* gui_autoiso_shutter_modes[] = { "Auto", "1/8s", "1/15s", "1/30s", "1/60s", "1/125s", "1/250s", "1/500s", "1/1000s" }; |
| 329 | | static const int shutter1_values[]={0, 8, 15, 30, 60, 125, 250, 500, 1000 }; |
| 330 | | |
| 331 | | static const char* gui_autoiso2_shutter_modes[]={ "Off", "1/4s", "1/6s", "1/8s", "1/12s", "1/15s", "1/20s", "1/25s", "1/30s", |
| 332 | | "1/40s", "1/50s", "1/60s", "1/80s", "1/100s", "1/125s", "1/160s", "1/250s", "1/500s", "1/1000s"}; |
| 333 | | static const int shutter2_values[]={0, 4, 6, 8, 12, 15, 20, 25, 30, 40, 50, 60, 80, 100, 125, 160, 200, 250, 500, 1000 }; |
| 334 | | |
| 335 | | static const char* gui_overexp_ev_modes[]={ "Off", "-1/3 Ev", "-2/3 Ev", "-1 Ev", "-1 1/3Ev", "-1 2/3Ev", "-2 Ev" }; |
| 336 | | |
| 337 | | |
| 338 | | static CMenuItem autoiso_submenu_items[] = { |
| 339 | | MENU_ITEM (0x5c,LANG_MENU_AUTOISO_ENABLED, MENUITEM_BOOL, &conf.autoiso_enable, 0 ), |
| 340 | | MENU_ENUM2 (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER, &conf.autoiso_shutter_enum, gui_autoiso_shutter_modes ), |
| 341 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_USER_FACTOR, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_user_factor, MENU_MINMAX(1, 8) ), |
| 342 | | |
| 343 | | #if CAM_HAS_IS |
| 344 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_IS_FACTOR, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_is_factor, MENU_MINMAX(1, 8) ), |
| 345 | | #endif |
| 346 | | |
| 347 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MIN_ISO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_min_iso, MENU_MINMAX(1, 20) ), |
| 348 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MAX_ISO_AUTO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_auto, MENU_MINMAX(10, 320) ), |
| 349 | | |
| 350 | | //@tsv |
| 351 | | MENU_ENUM2 (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER2, &conf.autoiso2_shutter_enum, gui_autoiso2_shutter_modes ), |
| 352 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MAX_ISO2, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_max_iso_auto, MENU_MINMAX(10, 320) ), |
| 353 | | |
| 354 | | #if !defined(CAMERA_sx230hs) |
| 355 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MAX_ISO_HI, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_hi, MENU_MINMAX(20, 320) ), |
| 356 | | #endif |
| 357 | | |
| 358 | | MENU_ENUM2 (0x5f,LANG_MENU_AUTOISO_OVEREXP_EV, &conf.overexp_ev_enum, gui_overexp_ev_modes ), |
| 359 | | MENU_ITEM (0x57,LANG_MENU_ZEBRA_OVER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_over, MENU_MINMAX(0, 32) ), |
| 360 | | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_OVEREXP_THRES, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.overexp_threshold, MENU_MINMAX(1, 20) ), |
| 361 | | |
| 362 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 363 | | {0} |
| 364 | | }; |
| 365 | | //static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, NULL, autoiso_submenu_items }; |
| 366 | | static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, cb_autoiso_menu_change, autoiso_submenu_items }; |
| 367 | | |
| 368 | | |
| 369 | | #ifdef OPT_DEBUGGING |
| 370 | | static const char* gui_debug_shortcut_modes[] = { "None", "DmpRAM", "Page", "CmpProps"}; |
| 371 | | #ifdef CAM_DRYOS |
| 372 | | static const char* gui_debug_display_modes[] = { "None", "Props", "Params" }; |
| 373 | | #else |
| 374 | | static const char* gui_debug_display_modes[] = { "None", "Props", "Params", "Tasks"}; |
| 375 | | #endif |
| 376 | | static CMenuItem debug_submenu_items[] = { |
| 377 | | MENU_ENUM2 (0x5c,LANG_MENU_DEBUG_DISPLAY, &conf.debug_display, gui_debug_display_modes ), |
| 378 | | MENU_ITEM (0x2a,LANG_MENU_DEBUG_PROPCASE_PAGE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.debug_propcase_page, MENU_MINMAX(0, 128) ), |
| 379 | | #ifndef CAM_DRYOS |
| 380 | | MENU_ITEM (0x2a,LANG_MENU_DEBUG_TASKLIST_START, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &debug_tasklist_start, MENU_MINMAX(0, 63) ), |
| 381 | | #endif |
| 382 | | MENU_ITEM (0x5c,LANG_MENU_DEBUG_SHOW_MISC_VALS, MENUITEM_BOOL, &conf.debug_misc_vals_show, 0 ), |
| 383 | | MENU_ITEM (0x2a,LANG_MENU_DEBUG_MEMORY_BROWSER, MENUITEM_PROC, gui_menu_run_fltmodule, "memview.flt" ), |
| 384 | | MENU_ITEM (0x2a,LANG_MENU_DEBUG_BENCHMARK, MENUITEM_PROC, gui_menu_run_fltmodule, "benchm.flt" ), |
| 385 | | MENU_ENUM2 (0x5c,LANG_MENU_DEBUG_SHORTCUT_ACTION, &conf.debug_shortcut_action, gui_debug_shortcut_modes ), |
| 386 | | MENU_ITEM (0x5c,LANG_MENU_RAW_TIMER, MENUITEM_BOOL, &conf.raw_timer, 0 ), |
| 387 | | #ifdef OPT_LUA |
| 388 | | MENU_ITEM (0x5c,LANG_MENU_LUA_RESTART, MENUITEM_BOOL, &conf.debug_lua_restart_on_error, 0 ), |
| 389 | | #endif |
| 390 | | #if CAM_MULTIPART |
| 391 | | MENU_ITEM (0x33,LANG_MENU_DEBUG_CREATE_MULTIPART , MENUITEM_PROC, gui_menuproc_break_card, 0 ), |
| 392 | | #endif |
| 393 | | MENU_ITEM (0x2a,LANG_SAVE_ROMLOG, MENUITEM_PROC, save_romlog, 0 ), |
| 394 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 395 | | {0} |
| 396 | | }; |
| 397 | | static CMenu debug_submenu = {0x2a,LANG_MENU_DEBUG_TITLE, NULL, debug_submenu_items }; |
| 398 | | #endif |
| 399 | | #ifdef CAM_HAS_GPS |
| 400 | | |
| 401 | | static CMenuItem gps_logging_items[] = { |
| 402 | | MENU_ITEM (0x2a,LANG_MENU_GPS_TRACK_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_track_time, MENU_MINMAX(1, 60) ), |
| 403 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 404 | | MENU_ITEM (0x2a,LANG_MENU_GPS_TRACK_SYMBOL, MENUITEM_BOOL, &conf.gps_track_symbol, 0 ), |
| 405 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 406 | | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_SET_1, MENUITEM_BOOL, &conf.gps_rec_play_set_1, 0 ), |
| 407 | | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_TIME_1, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_rec_play_time_1, MENU_MINMAX(1, 60) ), |
| 408 | | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_SET_1, MENUITEM_BOOL, &conf.gps_play_dark_set_1, 0 ), |
| 409 | | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_TIME_1, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_play_dark_time_1, MENU_MINMAX(1, 60) ), |
| 410 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 411 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 412 | | {0} |
| 413 | | }; |
| 414 | | static CMenu gps_logging_submenu = {0x86,LANG_MENU_GPS_LOGGING, NULL, gps_logging_items }; |
| 415 | | |
| 416 | | static CMenuItem gps_tagging_items[] = { |
| 417 | | MENU_ITEM (0x5c,LANG_MENU_GPS_WAYPOINT_SAVE, MENUITEM_BOOL, &conf.gps_waypoint_save, 0 ), |
| 418 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 419 | | MENU_ITEM (0x2a,LANG_MENU_GPS_WAIT_FOR_SIGNAL, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_wait_for_signal, MENU_MINMAX(1, 599) ), |
| 420 | | MENU_ITEM (0x2a,LANG_MENU_GPS_WAIT_FOR_SIGNAL_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_wait_for_signal_time, MENU_MINMAX(1, 60) ), |
| 421 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 422 | | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_SET, MENUITEM_BOOL, &conf.gps_rec_play_set, 0 ), |
| 423 | | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_rec_play_time, MENU_MINMAX(1, 60) ), |
| 424 | | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_SET, MENUITEM_BOOL, &conf.gps_play_dark_set, 0 ), |
| 425 | | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_play_dark_time, MENU_MINMAX(1, 60) ), |
| 426 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 427 | | MENU_ITEM (0x5c,LANG_MENU_GPS_COUNTDOWN, MENUITEM_BOOL, &conf.gps_countdown , 0 ), |
| 428 | | // MENU_ITEM (0x5c,LANG_MENU_GPS_COUNTDOWN_BLINK, MENUITEM_BOOL, &conf.gps_countdown_blink, 0 ), |
| 429 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 430 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 431 | | {0} |
| 432 | | }; |
| 433 | | static CMenu gps_tagging_submenu = {0x86,LANG_MENU_GPS_TAGGING, NULL, gps_tagging_items }; |
| 434 | | |
| 435 | | |
| 436 | | static CMenuItem gps_navigation_items[] = { |
| 437 | | MENU_ITEM (0x2a,LANG_MENU_GPS_KOMPASS_SMOOTH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_kompass_smooth, MENU_MINMAX(1, 40) ), |
| 438 | | MENU_ITEM (0x2a,LANG_MENU_GPS_KOMPASS_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_kompass_time, MENU_MINMAX(1, 60) ), |
| 439 | | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVI_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_navi_time, MENU_MINMAX(1, 60) ), |
| 440 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 441 | | MENU_ITEM (0x2a,LANG_MENU_GPS_MARK_HOME, MENUITEM_PROC, (int*)mark_home, 0 ), |
| 442 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 443 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 444 | | {0} |
| 445 | | }; |
| 446 | | static CMenu gps_navigation_submenu = {0x86,LANG_MENU_GPS_NAVIGATION, NULL, gps_navigation_items }; |
| 447 | | |
| 448 | | |
| 449 | | static const char* gui_gps_sat_fix[] = { "immer", "2D", "3D", "2D/3D" }; |
| 450 | | static CMenuItem gps_values_items[] = { |
| 451 | | MENU_ITEM (0x2a,LANG_MENU_GPS_BATT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_batt, MENU_MINMAX(0, 99) ), |
| 452 | | MENU_ITEM (0x2a,LANG_MENU_GPS_BATT_WARNING, MENUITEM_BOOL, &conf.gps_batt_warn, 0 ), |
| 453 | | MENU_ITEM (0x2a,LANG_MENU_GPS_BEEP_WARNING, MENUITEM_BOOL, &conf.gps_beep_warn, 0 ), |
| 454 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 455 | | MENU_ENUM2 (0x69,LANG_MENU_GPS_2D_3D_FIX, &conf.gps_2D_3D_fix, gui_gps_sat_fix ), |
| 456 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 457 | | MENU_ITEM (0x2a,LANG_MENU_GPS_SYMBOL_SHOW, MENUITEM_BOOL, &conf.gps_show_symbol, 0 ), |
| 458 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 459 | | MENU_ITEM (0x2a,LANG_MENU_GPS_TEST_TIMEZONE, MENUITEM_BOOL, &conf.gps_test_timezone, 0 ), |
| 460 | | MENU_ITEM (0x2a,LANG_MENU_GPS_MARK_TIMEZONE, MENUITEM_PROC, (int*)mark_timezone, 0 ), |
| 461 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 462 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 463 | | {0} |
| 464 | | }; |
| 465 | | static CMenu gps_values_submenu = {0x86,LANG_MENU_GPS_VALUES, NULL, gps_values_items }; |
| 466 | | |
| 467 | | |
| 468 | | static CMenuItem gps_submenu_items[] = { |
| 469 | | MENU_ITEM (0x2a,LANG_MENU_GPS_ON_OFF, MENUITEM_BOOL, &conf.gps_on_off, 0 ), |
| 470 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 471 | | MENU_ITEM (0x2a,LANG_MENU_GPS_KOMPASS_SHOW, MENUITEM_PROC, (int*)show_kompass, 0 ), |
| 472 | | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVI_SHOW, MENUITEM_PROC, (int*)show_navi, 0 ), |
| 473 | | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVI_HOME, MENUITEM_PROC, (int*)navigate_home, 0 ), |
| 474 | | MENU_ITEM (0x2a,LANG_MENU_GPS_TRACK_START, MENUITEM_PROC, (int*)gpx_start_stop, 0 ), |
| 475 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 476 | | MENU_ITEM (0x2a,LANG_MENU_GPS_VALUES, MENUITEM_SUBMENU, &gps_values_submenu, 0 ), |
| 477 | | MENU_ITEM (0x2a,LANG_MENU_GPS_LOGGING, MENUITEM_SUBMENU, &gps_logging_submenu, 0 ), |
| 478 | | MENU_ITEM (0x2a,LANG_MENU_GPS_TAGGING, MENUITEM_SUBMENU, &gps_tagging_submenu, 0 ), |
| 479 | | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVIGATION, MENUITEM_SUBMENU, &gps_navigation_submenu, 0 ), |
| 480 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 481 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 482 | | {0} |
| 483 | | }; |
| 484 | | static CMenu gps_submenu = {0x2a,LANG_MENU_GPS, NULL, gps_submenu_items }; |
| 485 | | |
| 486 | | #endif |
| 487 | | |
| 488 | | //------------------------------------------------------------------- |
| 489 | | static void gui_draw_read_selected(const char *fn) { |
| 490 | | if (fn) { |
| 491 | | unsigned int argv[] ={ (unsigned int)fn }; |
| 492 | | module_run("txtread.flt", 0, sizeof(argv)/sizeof(argv[0]), argv, UNLOAD_IF_ERR); |
| 493 | | } |
| 494 | | } |
| 495 | | |
| 496 | | void gui_draw_read(int arg) { |
| 497 | | module_fselect_init_w_mode(LANG_STR_SELECT_TEXT_FILE, conf.reader_file, "A/CHDK/BOOKS", gui_draw_read_selected, 1); |
| 498 | | } |
| 499 | | |
| 500 | | void gui_draw_read_last(int arg) { |
| 501 | | struct stat st; |
| 502 | | if (stat(conf.reader_file,&st) == 0) { |
| 503 | | gui_draw_read_selected(conf.reader_file); |
| 504 | | } else { |
| 505 | | gui_draw_read(arg); |
| 506 | | } |
| 507 | | } |
| 508 | | |
| 509 | | static void gui_draw_rbf_selected(const char *fn) { |
| 510 | | if (fn) { |
| 511 | | strcpy(conf.reader_rbf_file, fn); |
| 512 | | } |
| 513 | | } |
| 514 | | |
| 515 | | void gui_draw_load_rbf(int arg) { |
| 516 | | module_fselect_init(LANG_STR_SELECT_FONT_FILE, conf.reader_rbf_file, "A/CHDK/FONTS", gui_draw_rbf_selected); |
| 517 | | } |
| 518 | | |
| 519 | | static const char* gui_reader_codepage_cps[] = { "Win1251", "DOS"}; |
| 520 | | static CMenuItem reader_submenu_items[] = { |
| 521 | | MENU_ITEM(0x35,LANG_MENU_READ_OPEN_NEW, MENUITEM_PROC, gui_draw_read, 0 ), |
| 522 | | MENU_ITEM(0x35,LANG_MENU_READ_OPEN_LAST, MENUITEM_PROC, gui_draw_read_last, 0 ), |
| 523 | | MENU_ITEM(0x35,LANG_MENU_READ_SELECT_FONT, MENUITEM_PROC, gui_draw_load_rbf, 0 ), |
| 524 | | MENU_ENUM2(0x5f,LANG_MENU_READ_CODEPAGE, &conf.reader_codepage, gui_reader_codepage_cps ), |
| 525 | | MENU_ITEM(0x5c,LANG_MENU_READ_WORD_WRAP, MENUITEM_BOOL, &conf.reader_wrap_by_words, 0 ), |
| 526 | | MENU_ITEM(0x5c,LANG_MENU_READ_AUTOSCROLL, MENUITEM_BOOL, &conf.reader_autoscroll, 0 ), |
| 527 | | MENU_ITEM(0x5f,LANG_MENU_READ_AUTOSCROLL_DELAY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.reader_autoscroll_delay, MENU_MINMAX(0, 60) ), |
| 528 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 529 | | {0} |
| 530 | | }; |
| 531 | | static CMenu reader_submenu = {0x37,LANG_MENU_READ_TITLE, NULL, reader_submenu_items }; |
| 532 | | |
| 533 | | //------------------------------------------------------------------- |
| 534 | | |
| 535 | | static CMenuItem games_submenu_items[] = { |
| 536 | | MENU_ITEM(0x38,LANG_MENU_GAMES_REVERSI, MENUITEM_PROC, gui_menu_run_fltmodule, "reversi.flt" ), |
| 537 | | MENU_ITEM(0x38,LANG_MENU_GAMES_SOKOBAN, MENUITEM_PROC, gui_menu_run_fltmodule, "sokoban.flt" ), |
| 538 | | MENU_ITEM(0x38,LANG_MENU_GAMES_CONNECT4, MENUITEM_PROC, gui_menu_run_fltmodule, "4wins.flt" ), |
| 539 | | MENU_ITEM(0x38,LANG_MENU_GAMES_MASTERMIND, MENUITEM_PROC, gui_menu_run_fltmodule, "mastmind.flt" ), |
| 540 | | MENU_ITEM(0x38,"Snake" , MENUITEM_PROC, gui_menu_run_fltmodule, "snake.flt" ), |
| 541 | | MENU_ITEM(0x38,"Tetris", MENUITEM_PROC, gui_menu_run_fltmodule, "tetris.flt" ), |
| 542 | | MENU_ITEM(0x38,"Sudoku", MENUITEM_PROC, gui_menu_run_fltmodule, "sudoku.flt" ), |
| 543 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 544 | | {0} |
| 545 | | }; |
| 546 | | static CMenu games_submenu = {0x38,LANG_MENU_GAMES_TITLE, NULL, games_submenu_items }; |
| 547 | | |
| 548 | | //------------------------------------------------------------------- |
| 549 | | |
| 550 | | static CMenuItem misc_submenu_items[] = { |
| 551 | | MENU_ITEM (0x35,LANG_MENU_MISC_FILE_BROWSER, MENUITEM_PROC, gui_draw_fselect, 0 ), |
| 552 | | MENU_ITEM(0x80,(int)"Module Inspector", MENUITEM_PROC, gui_menu_run_fltmodule, "modinsp.flt" ), |
| 553 | | #ifdef OPT_CALENDAR |
| 554 | | MENU_ITEM(0x36,LANG_MENU_MISC_CALENDAR, MENUITEM_PROC, gui_menu_run_fltmodule, "calend.flt" ), |
| 555 | | #endif |
| 556 | | #ifdef OPT_TEXTREADER |
| 557 | | MENU_ITEM (0x37,LANG_MENU_MISC_TEXT_READER, MENUITEM_SUBMENU, &reader_submenu, 0 ), |
| 558 | | #endif |
| 559 | | #if defined (OPT_GAMES) |
| 560 | | MENU_ITEM (0x38,LANG_MENU_MISC_GAMES, MENUITEM_SUBMENU, &games_submenu, 0 ), |
| 561 | | #endif |
| 562 | | #if CAM_SWIVEL_SCREEN |
| 563 | | MENU_ITEM (0x28,LANG_MENU_MISC_FLASHLIGHT, MENUITEM_BOOL, &conf.flashlight, 0 ), |
| 564 | | #endif |
| 565 | | MENU_ITEM (0x5c,LANG_MENU_MISC_SHOW_SPLASH, MENUITEM_BOOL, &conf.splash_show, 0 ), |
| 566 | | MENU_ITEM (0x5c,LANG_MENU_MISC_START_SOUND, MENUITEM_BOOL, &conf.start_sound, 0 ), |
| 567 | | #if CAM_USE_ZOOM_FOR_MF |
| 568 | | MENU_ITEM (0x59,LANG_MENU_MISC_ZOOM_FOR_MF, MENUITEM_BOOL, &conf.use_zoom_mf, 0 ), |
| 569 | | #endif |
| 570 | | #if CAM_ADJUSTABLE_ALT_BUTTON |
| 571 | | MENU_ITEM(0x22,LANG_MENU_MISC_ALT_BUTTON, MENUITEM_ENUM, gui_alt_mode_button_enum, 0 ), |
| 572 | | #endif |
| 573 | | #if defined(CAM_ZOOM_ASSIST_BUTTON_CONTROL) |
| 574 | | MENU_ITEM (0x5c,LANG_MENU_MISC_ZOOM_ASSIST, MENUITEM_BOOL, &conf.zoom_assist_button_disable, 0 ), |
| 575 | | #endif |
| 576 | | MENU_ITEM(0x5d,LANG_MENU_MISC_DISABLE_LCD_OFF, MENUITEM_ENUM, gui_alt_power_enum, 0 ), |
| 577 | | MENU_ITEM(0x65,LANG_MENU_MISC_PALETTE, MENUITEM_PROC, gui_menu_run_fltmodule, "palette.flt" ), |
| 578 | | MENU_ITEM(0x80,LANG_MENU_MISC_BUILD_INFO, MENUITEM_PROC, gui_show_build_info, 0 ), |
| 579 | | MENU_ITEM(0x80,LANG_MENU_MISC_MEMORY_INFO, MENUITEM_PROC, gui_show_memory_info, 0 ), |
| 580 | | MENU_ITEM(0x33,LANG_MENU_DEBUG_MAKE_BOOTABLE, MENUITEM_PROC, gui_menuproc_mkbootdisk, 0 ), |
| 581 | | #if CAM_MULTIPART |
| 582 | | MENU_ITEM (0x33,LANG_MENU_DEBUG_SWAP_PART, MENUITEM_ENUM, gui_menuproc_swap_partitions_enum, 0 ), |
| 583 | | #endif |
| 584 | | MENU_ITEM (0x2b,LANG_MENU_MAIN_RESET_OPTIONS, MENUITEM_PROC, gui_menuproc_reset, 0 ), |
| 585 | | #ifdef OPT_DEBUGGING |
| 586 | | MENU_ITEM (0x2a,LANG_MENU_MAIN_DEBUG, MENUITEM_SUBMENU, &debug_submenu, 0 ), |
| 587 | | #endif |
| 588 | | MENU_ITEM (0x86,LANG_MENU_REMOTE_PARAM, MENUITEM_SUBMENU, &remote_submenu, 0 ), |
| 589 | | #if defined (DNG_EXT_FROM) |
| 590 | | MENU_ITEM (0x71,LANG_MENU_DNG_VIA_USB, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_usb_ext , (int)cb_change_dng_usb_ext ), |
| 591 | | #endif |
| 592 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 593 | | {0}, |
| 594 | | }; |
| 595 | | static CMenu misc_submenu = {0x29,LANG_MENU_MISC_TITLE, NULL, misc_submenu_items }; |
| 596 | | |
| 597 | | static int voltage_step; |
| 598 | | static CMenuItem battery_submenu_items[] = { |
| 599 | | MENU_ITEM (0x66,LANG_MENU_BATT_VOLT_MAX, MENUITEM_INT|MENUITEM_ARG_ADDR_INC, &conf.batt_volts_max, (int)&voltage_step ), |
| 600 | | MENU_ITEM (0x67,LANG_MENU_BATT_VOLT_MIN, MENUITEM_INT|MENUITEM_ARG_ADDR_INC, &conf.batt_volts_min, (int)&voltage_step ), |
| 601 | | MENU_ITEM (0x68,LANG_MENU_BATT_STEP_25, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_step_25, (int)cb_step_25 ), |
| 602 | | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 603 | | MENU_ITEM (0x73,LANG_MENU_BATT_SHOW_PERCENT, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_perc_show, (int)cb_perc ), |
| 604 | | MENU_ITEM (0x73,LANG_MENU_BATT_SHOW_VOLTS, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_volts_show, (int)cb_volts ), |
| 605 | | MENU_ITEM (0x32,LANG_MENU_BATT_SHOW_ICON, MENUITEM_BOOL, &conf.batt_icon_show, 0 ), |
| 606 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 607 | | {0} |
| 608 | | }; |
| 609 | | static CMenu battery_submenu = {0x32,LANG_MENU_BATT_TITLE, cb_battery_menu_change, battery_submenu_items }; |
| 610 | | |
| 611 | | static const char* gui_space_bar_modes[] = { "Don't", "Horizontal", "Vertical"}; |
| 612 | | static const char* gui_space_bar_size_modes[] = { "1/4", "1/2", "1"}; |
| 613 | | static const char* gui_space_bar_width_modes[] = { "1", "2", "3","4","5","6","7","8","9","10"}; |
| 614 | | static const char* gui_space_warn_type_modes[] = { "Percent", "MB", "Don't"}; |
| 615 | | static CMenuItem space_submenu_items[] = { |
| 616 | | MENU_ITEM (0x5c,LANG_MENU_SPACE_SHOW_ICON, MENUITEM_BOOL, &conf.space_icon_show, 0 ), |
| 617 | | MENU_ENUM2 (0x69,LANG_MENU_SPACE_SHOW_BAR, &conf.space_bar_show, gui_space_bar_modes ), |
| 618 | | MENU_ENUM2 (0x6a,LANG_MENU_SPACE_BAR_SIZE, &conf.space_bar_size, gui_space_bar_size_modes ), |
| 619 | | MENU_ENUM2 (0x6b,LANG_MENU_SPACE_BAR_WIDTH, &conf.space_bar_width, gui_space_bar_width_modes ), |
| 620 | | MENU_ITEM (0x5c,LANG_MENU_SPACE_SHOW_PERCENT, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_perc_show, (int)cb_space_perc ), |
| 621 | | MENU_ITEM (0x5c,LANG_MENU_SPACE_SHOW_MB, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_mb_show, (int)cb_space_mb ), |
| 622 | | #if CAM_MULTIPART |
| 623 | | MENU_ITEM (0x5c,LANG_MENU_SHOW_PARTITION_NR, MENUITEM_BOOL, &conf.show_partition_nr, 0 ), |
| 624 | | #endif |
| 625 | | MENU_ENUM2 (0x5f,LANG_MENU_SPACE_WARN_TYPE, &conf.space_warn_type, gui_space_warn_type_modes ), |
| 626 | | MENU_ITEM (0x58,LANG_MENU_SPACE_WARN_PERCENT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.space_perc_warn, MENU_MINMAX(1, 99) ), |
| 627 | | MENU_ITEM (0x58,LANG_MENU_SPACE_WARN_MB, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.space_mb_warn, MENU_MINMAX(1, 4000) ), |
| 628 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 629 | | {0} |
| 630 | | }; |
| 631 | | static CMenu space_submenu = {0x33,LANG_MENU_OSD_SPACE_PARAMS_TITLE, NULL, space_submenu_items}; |
| 632 | | |
| 633 | | static const char* gui_dof_show_value_modes[] = { "Don't", "Separate", "+Separate", "In Misc", "+In Misc" }; |
| 634 | | static CMenuItem dof_submenu_items[] = { |
| 635 | | MENU_ENUM2 (0x5f,LANG_MENU_OSD_SHOW_DOF_CALC, &conf.show_dof, gui_dof_show_value_modes ), |
| 636 | | MENU_ITEM (0x5c,LANG_MENU_DOF_SUBJ_DIST_AS_NEAR_LIMIT,MENUITEM_BOOL, &conf.dof_subj_dist_as_near_limit, 0 ), |
| 637 | | MENU_ITEM (0x5c,LANG_MENU_DOF_USE_EXIF_SUBJ_DIST, MENUITEM_BOOL, &conf.dof_use_exif_subj_dist, 0 ), |
| 638 | | MENU_ITEM (0x5c,LANG_MENU_DOF_SUBJ_DIST_IN_MISC, MENUITEM_BOOL, &conf.dof_subj_dist_in_misc, 0 ), |
| 639 | | MENU_ITEM (0x5c,LANG_MENU_DOF_NEAR_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_near_limit_in_misc, 0 ), |
| 640 | | MENU_ITEM (0x5c,LANG_MENU_DOF_FAR_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_far_limit_in_misc, 0 ), |
| 641 | | MENU_ITEM (0x5c,LANG_MENU_DOF_HYPERFOCAL_IN_MISC, MENUITEM_BOOL, &conf.dof_hyperfocal_in_misc, 0 ), |
| 642 | | MENU_ITEM (0x5c,LANG_MENU_DOF_DEPTH_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_depth_in_misc, 0 ), |
| 643 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 644 | | {0} |
| 645 | | }; |
| 646 | | static CMenu dof_submenu = {0x31,LANG_MENU_DOF_TITLE, /*cb_dof_menu_change*/ NULL, dof_submenu_items }; |
| 647 | | |
| 648 | | static const char* gui_zoom_value_modes[] = { "X", "FL", "EFL" }; |
| 649 | | static const char* gui_show_values_modes[] = { "Don't", "Always", "Shoot" }; |
| 650 | | static CMenuItem values_submenu_items[] = { |
| 651 | | MENU_ENUM2 (0x5f,LANG_MENU_OSD_SHOW_MISC_VALUES, &conf.show_values, gui_show_values_modes ), |
| 652 | | MENU_ITEM (0x5c,LANG_MENU_SHOW_VALUES_IN_VIDEO, MENUITEM_BOOL, &conf.show_values_in_video, 0 ), |
| 653 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_ZOOM, MENUITEM_BOOL, &conf.values_show_zoom, 0 ), |
| 654 | | MENU_ENUM2 (0x5f,LANG_MENU_OSD_ZOOM_VALUE, &conf.zoom_value, gui_zoom_value_modes ), |
| 655 | | MENU_ITEM (0x60,LANG_MENU_OSD_ZOOM_SCALE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zoom_scale, MENU_MINMAX(0, 1000) ), |
| 656 | | MENU_ITEM (0x62,LANG_MENU_VALUES_SHOW_REAL_APERTURE, MENUITEM_BOOL, &conf.values_show_real_aperture, 0 ), |
| 657 | | MENU_ITEM (0x74,LANG_MENU_VALUES_SHOW_REAL_ISO, MENUITEM_BOOL, &conf.values_show_real_iso, 0 ), |
| 658 | | MENU_ITEM (0x74,LANG_MENU_VALUES_SHOW_MARKET_ISO, MENUITEM_BOOL, &conf.values_show_market_iso, 0 ), |
| 659 | | MENU_ITEM (0x2d,LANG_MENU_SHOW_ISO_ONLY_IN_AUTOISO_MODE, MENUITEM_BOOL, &conf.values_show_iso_only_in_autoiso_mode, 0 ), |
| 660 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_EV_SETED, MENUITEM_BOOL, &conf.values_show_ev_seted, 0 ), |
| 661 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_EV_MEASURED, MENUITEM_BOOL, &conf.values_show_ev_measured, 0 ), |
| 662 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_BV_SETED, MENUITEM_BOOL, &conf.values_show_bv_seted, 0 ), |
| 663 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_BV_MEASURED, MENUITEM_BOOL, &conf.values_show_bv_measured, 0 ), |
| 664 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_OVEREXPOSURE, MENUITEM_BOOL, &conf.values_show_overexposure, 0 ), |
| 665 | | MENU_ITEM (0x5c,LANG_MENU_SHOW_CANON_OVEREXPOSURE, MENUITEM_BOOL, &conf.values_show_canon_overexposure, 0 ), |
| 666 | | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_LUMINANCE, MENUITEM_BOOL, &conf.values_show_luminance, 0 ), |
| 667 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 668 | | {0} |
| 669 | | }; |
| 670 | | static CMenu values_submenu = {0x28,LANG_MENU_OSD_VALUES_TITLE, /*cb_values_menu_change*/ NULL, values_submenu_items }; |
| 671 | | |
| 672 | | static const char* gui_show_clock_modes[]= { "Don't", "Normal", "Seconds"}; |
| 673 | | static const char* gui_clock_format_modes[] = { "24h", "12h"}; |
| 674 | | static const char* gui_clock_indicator_modes[] = { "PM", "P", "."}; |
| 675 | | static const char* gui_clock_halfpress_modes[] = { "Full", "Seconds", "Don't"}; |
| 676 | | static CMenuItem clock_submenu_items[] = { |
| 677 | | MENU_ENUM2 (0x5f,LANG_MENU_OSD_SHOW_CLOCK, &conf.show_clock, gui_show_clock_modes ), |
| 678 | | MENU_ENUM2 (0x6d,LANG_MENU_OSD_CLOCK_FORMAT, &conf.clock_format, gui_clock_format_modes ), |
| 679 | | MENU_ENUM2 (0x6c,LANG_MENU_OSD_CLOCK_INDICATOR, &conf.clock_indicator, gui_clock_indicator_modes ), |
| 680 | | MENU_ENUM2 (0x6e,LANG_MENU_OSD_CLOCK_HALFPRESS, &conf.clock_halfpress, gui_clock_halfpress_modes ), |
| 681 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 682 | | {0} |
| 683 | | }; |
| 684 | | static CMenu clock_submenu = {0x34,LANG_MENU_OSD_CLOCK_PARAMS_TITLE, NULL, clock_submenu_items }; |
| 685 | | |
| 686 | | |
| 687 | | static const char* gui_show_movie_time_modes[] = { "Don't", "hh:mm:ss", "KB/s","both"}; |
| 688 | | #if !CAM_VIDEO_QUALITY_ONLY |
| 689 | | static const char* gui_video_mode_modes[] = { "Bitrate", "Quality"}; |
| 690 | | #else |
| 691 | | static const char* gui_video_mode_modes[] = { "Default", "Quality"}; |
| 692 | | #endif |
| 693 | | static CMenuItem video_submenu_items[] = { |
| 694 | | #if CAM_CHDK_HAS_EXT_VIDEO_MENU |
| 695 | | MENU_ENUM2 (0x23,LANG_MENU_VIDEO_MODE, &conf.video_mode, gui_video_mode_modes ), |
| 696 | | #if !CAM_VIDEO_QUALITY_ONLY |
| 697 | | MENU_ITEM (0x5e,LANG_MENU_VIDEO_BITRATE, MENUITEM_ENUM, gui_video_bitrate_enum, 0 ), |
| 698 | | #endif |
| 699 | | MENU_ITEM (0x60,LANG_MENU_VIDEO_QUALITY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.video_quality, MENU_MINMAX(1, 99) ), |
| 700 | | #if CAM_CHDK_HAS_EXT_VIDEO_TIME |
| 701 | | MENU_ITEM (0x5c,LANG_MENU_VIDEO_EXT_TIME, MENUITEM_BOOL, &conf.ext_video_time, 0 ), |
| 702 | | #endif |
| 703 | | MENU_ITEM (0x5c,LANG_MENU_CLEAR_VIDEO_VALUES, MENUITEM_BOOL, &conf.clear_video, 0 ), |
| 704 | | #endif |
| 705 | | #if CAM_VIDEO_CONTROL |
| 706 | | MENU_ITEM (0x5c,LANG_MENU_FAST_SWITCH_VIDEO, MENUITEM_BOOL, &conf.fast_movie_control, 0 ), |
| 707 | | #endif |
| 708 | | #if CAM_CHDK_HAS_EXT_VIDEO_MENU |
| 709 | | MENU_ITEM (0x5c,LANG_MENU_FAST_SWITCH_QUALITY_VIDEO, MENUITEM_BOOL, &conf.fast_movie_quality_control, 0 ), |
| 710 | | #endif |
| 711 | | #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO |
| 712 | | MENU_ITEM (0x5c,LANG_MENU_OPTICAL_ZOOM_IN_VIDEO, MENUITEM_BOOL, &conf.unlock_optical_zoom_for_video, 0 ), |
| 713 | | #endif |
| 714 | | #if CAM_CAN_MUTE_MICROPHONE |
| 715 | | MENU_ITEM (0x83,LANG_MENU_MUTE_ON_ZOOM, MENUITEM_BOOL, &conf.mute_on_zoom, 0 ), |
| 716 | | #endif |
| 717 | | #if CAM_AF_SCAN_DURING_VIDEO_RECORD |
| 718 | | MENU_ITEM (0x82,LANG_MENU_VIDEO_AF_KEY, MENUITEM_ENUM, gui_video_af_key_enum, 0 ), |
| 719 | | #endif |
| 720 | | MENU_ENUM2 (0x5c,LANG_MENU_OSD_SHOW_VIDEO_TIME, &conf.show_movie_time, gui_show_movie_time_modes ), |
| 721 | | MENU_ITEM (0x60,LANG_MENU_OSD_SHOW_VIDEO_REFRESH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.show_movie_refresh, MENU_MINMAX(1, 20) ), |
| 722 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 723 | | {0} |
| 724 | | }; |
| 725 | | static CMenu video_submenu = {0x23,LANG_MENU_VIDEO_PARAM_TITLE, NULL, video_submenu_items }; |
| 726 | | |
| 727 | | static const char* gui_bracket_values_modes[] = { "Off", "1/3 Ev","2/3 Ev", "1 Ev", "1 1/3Ev", "1 2/3Ev", "2 Ev", "2 1/3Ev", "2 2/3Ev", "3 Ev", "3 1/3Ev", "3 2/3Ev", "4 Ev"}; |
| 728 | | static const char* gui_override_koef_modes[] = { "Off", "1", "10", "100", "1000" }; |
| 729 | | static const char* gui_bracket_type_modes[] = { "+/-", "-","+"}; |
| 730 | | static CMenuItem bracketing_in_continuous_submenu_items[] = { |
| 731 | | MENU_ENUM2 (0x63,LANG_MENU_TV_BRACKET_VALUE, &conf.tv_bracket_value, gui_bracket_values_modes ), |
| 732 | | #if CAM_HAS_IRIS_DIAPHRAGM |
| 733 | | MENU_ENUM2 (0x62,LANG_MENU_AV_BRACKET_VALUE, &conf.av_bracket_value, gui_bracket_values_modes ), |
| 734 | | #endif |
| 735 | | #if CAM_CAN_SD_OVERRIDE |
| 736 | | MENU_ITEM (0x5e,LANG_MENU_SUBJ_DIST_BRACKET_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.subj_dist_bracket_value, MENU_MINMAX(0, 100) ), |
| 737 | | MENU_ENUM2 (0x5f,LANG_MENU_SUBJ_DIST_BRACKET_KOEF, &conf.subj_dist_bracket_koef, gui_override_koef_modes ), |
| 738 | | #endif |
| 739 | | MENU_ITEM (0x74,LANG_MENU_ISO_BRACKET_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.iso_bracket_value, MENU_MINMAX(0, 100) ), |
| 740 | | MENU_ENUM2a (0x5f,LANG_MENU_ISO_BRACKET_KOEF, &conf.iso_bracket_koef, gui_override_koef_modes, 4 ), |
| 741 | | MENU_ENUM2 (0x60,LANG_MENU_BRACKET_TYPE, &conf.bracket_type, gui_bracket_type_modes ), |
| 742 | | MENU_ITEM (0x5b,LANG_MENU_CLEAR_BRACKET_VALUES, MENUITEM_BOOL, &conf.clear_bracket, 0 ), |
| 743 | | MENU_ITEM (0x5c,LANG_MENU_BRACKETING_ADD_RAW_SUFFIX, MENUITEM_BOOL, &conf.bracketing_add_raw_suffix, 0 ), |
| 744 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 745 | | {0} |
| 746 | | }; |
| 747 | | static CMenu bracketing_in_continuous_submenu = {0x2c,LANG_MENU_BRACKET_IN_CONTINUOUS_TITLE, NULL, bracketing_in_continuous_submenu_items }; |
| 748 | | |
| 749 | | // "Extra Photo Operations" Menu |
| 750 | | static const char* gui_override_disable_modes[] = { "Off", "On", "Disabled" }; |
| 751 | | static const char* gui_nd_filter_state_modes[] = { "Off", "In", "Out" }; |
| 752 | | static const char* gui_fast_ev_step_modes[] = { "1/6 Ev","1/3 Ev","1/2 Ev", "2/3 Ev","5/6 Ev","1 Ev","1 1/6 Ev","1 1/3 Ev","1 1/2 Ev", "1 2/3 Ev","1 5/6 Ev","2 Ev","2 1/6 Ev","2 1/3 Ev","2 1/2 Ev", "2 2/3 Ev","2 5/6 Ev","3 Ev","3 1/6 Ev","3 1/3 Ev","3 1/2 Ev", "3 2/3 Ev","3 5/6 Ev","4 Ev"}; |
| 753 | | static const char* gui_fast_image_quality_modes[] = { "sup.fine", "fine", "normal", "off" }; |
| 754 | | static CMenuItem operation_submenu_items[] = { |
| 755 | | MENU_ENUM2 (0x5f,LANG_MENU_OVERRIDE_DISABLE, &conf.override_disable, gui_override_disable_modes ), |
| 756 | | MENU_ITEM (0x5c,LANG_MENU_OVERRIDE_DISABLE_ALL, MENUITEM_BOOL, &conf.override_disable_all, 0 ), |
| 757 | | MENU_ITEM (0x61,LANG_MENU_OVERRIDE_TV_VALUE, MENUITEM_ENUM, gui_tv_override_value_enum, 0 ), |
| 758 | | MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_TV_KOEF, MENUITEM_ENUM, gui_tv_override_koef_enum, 0 ), |
| 759 | | MENU_ITEM (0x59,LANG_MENU_TV_ENUM_TYPE, MENUITEM_ENUM, gui_tv_enum_type_enum, 0 ), |
| 760 | | #if CAM_HAS_IRIS_DIAPHRAGM |
| 761 | | MENU_ITEM (0x62,LANG_MENU_OVERRIDE_AV_VALUE, MENUITEM_ENUM, gui_av_override_enum, 0 ), |
| 762 | | #endif |
| 763 | | #if CAM_HAS_ND_FILTER |
| 764 | | MENU_ENUM2 (0x5f,LANG_MENU_OVERRIDE_ND_FILTER, &conf.nd_filter_state, gui_nd_filter_state_modes ), |
| 765 | | #endif |
| 766 | | #if CAM_CAN_SD_OVERRIDE |
| 767 | | MENU_ITEM (0x5e,LANG_MENU_OVERRIDE_SUBJ_DIST_VALUE, MENUITEM_ENUM, gui_subj_dist_override_value_enum, 0 ), |
| 768 | | MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_SUBJ_DIST_KOEF, MENUITEM_ENUM, gui_subj_dist_override_koef_enum, 0 ), |
| 769 | | #endif |
| 770 | | MENU_ITEM (0x74,LANG_MENU_OVERRIDE_ISO_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.iso_override_value, MENU_MINMAX(0, 800) ), |
| 771 | | MENU_ENUM2a (0x5f,LANG_MENU_OVERRIDE_ISO_KOEF, &conf.iso_override_koef, gui_override_koef_modes, 4 ), |
| 772 | | #if ZOOM_OVERRIDE |
| 773 | | MENU_ITEM (0x5c,LANG_MENU_OVERRIDE_ZOOM, MENUITEM_BOOL, &conf.zoom_override, 0 ), |
| 774 | | MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_ZOOM_VALUE, MENUITEM_ENUM, gui_zoom_override_enum, 0 ), |
| 775 | | |
| 776 | | MENU_ITEM (0x5c,LANG_MENU_CLEAR_ZOOM_OVERRIDE_VALUES, MENUITEM_BOOL, &conf.clear_zoom_override, 0 ), |
| 777 | | #endif |
| 778 | | MENU_ITEM (0x2c,LANG_MENU_BRACKET_IN_CONTINUOUS, MENUITEM_SUBMENU, &bracketing_in_continuous_submenu, 0 ), |
| 779 | | MENU_ITEM (0x2d,LANG_MENU_AUTOISO, MENUITEM_SUBMENU, &autoiso_submenu, 0 ), |
| 780 | | MENU_ITEM (0x5b,LANG_MENU_CLEAR_OVERRIDE_VALUES, MENUITEM_BOOL, &conf.clear_override, 0 ), |
| 781 | | MENU_ITEM (0x5c,LANG_MENU_MISC_FAST_EV, MENUITEM_BOOL, &conf.fast_ev, 0 ), |
| 782 | | MENU_ENUM2 (0x5f,LANG_MENU_MISC_FAST_EV_STEP, &conf.fast_ev_step, gui_fast_ev_step_modes ), |
| 783 | | #if CAM_REAR_CURTAIN |
| 784 | | MENU_ITEM (0x5c, LANG_MENU_REAR_CURTAIN, MENUITEM_BOOL, &conf.flash_sync_curtain, 0 ), |
| 785 | | #endif |
| 786 | | MENU_ITEM (0x5c, LANG_MENU_FLASH_MANUAL_OVERRIDE, MENUITEM_BOOL, &conf.flash_manual_override, 0 ), |
| 787 | | MENU_ITEM (0x5f, LANG_MENU_FLASH_VIDEO_OVERRIDE_POWER,MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.flash_video_override_power, MENU_MINMAX(0, 2) ), |
| 788 | | #if CAM_HAS_VIDEO_BUTTON |
| 789 | | MENU_ITEM (0x5c, LANG_MENU_FLASH_VIDEO_OVERRIDE, MENUITEM_BOOL, &conf.flash_video_override, 0 ), |
| 790 | | #endif |
| 791 | | #if CAM_QUALITY_OVERRIDE |
| 792 | | MENU_ENUM2 (0x5c,LANG_MENU_MISC_IMAGE_QUALITY, &conf.fast_image_quality, gui_fast_image_quality_modes ), |
| 793 | | #endif |
| 794 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 795 | | {0} |
| 796 | | }; |
| 797 | | static CMenu operation_submenu = {0x21,LANG_MENU_OPERATION_PARAM_TITLE, NULL, operation_submenu_items }; |
| 798 | | |
| 799 | | //------------------------------------------------------------------- |
| 800 | | |
| 801 | | #ifdef OPT_EDGEOVERLAY |
| 802 | | static void gui_load_edge_selected( const char* fn ) |
| 803 | | { |
| 804 | | if (fn) |
| 805 | | if (module_edgeovr_load()) |
| 806 | | libedgeovr->load_edge_overlay(fn); |
| 807 | | } |
| 808 | | |
| 809 | | void gui_menuproc_edge_save(int arg) |
| 810 | | { |
| 811 | | if (module_edgeovr_load()) |
| 812 | | libedgeovr->save_edge_overlay(); |
| 813 | | } |
| 814 | | |
| 815 | | void gui_menuproc_edge_load(int arg) { |
| 816 | | module_fselect_init(LANG_MENU_EDGE_LOAD, EDGE_SAVE_DIR, EDGE_SAVE_DIR, gui_load_edge_selected); |
| 817 | | } |
| 818 | | |
| 819 | | static const char* gui_edge_pano_modes[] = { "Off", "Right", "Down", "Left", "Up", "Free" }; |
| 820 | | static CMenuItem edge_overlay_submenu_items[] = { |
| 821 | | MENU_ITEM (0x5c,LANG_MENU_EDGE_OVERLAY_ENABLE, MENUITEM_BOOL, &conf.edge_overlay_enable, 0 ), |
| 822 | | MENU_ITEM (0x5c,LANG_MENU_EDGE_FILTER, MENUITEM_BOOL, &conf.edge_overlay_filter, 0 ), |
| 823 | | MENU_ENUM2 (0x5f,LANG_MENU_EDGE_PANO, &conf.edge_overlay_pano, gui_edge_pano_modes ), |
| 824 | | MENU_ITEM (0x5e,LANG_MENU_EDGE_PANO_OVERLAP, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.edge_overlay_pano_overlap, MENU_MINMAX(0, 100) ), |
| 825 | | MENU_ITEM (0x5c,LANG_MENU_EDGE_SHOW, MENUITEM_BOOL, &conf.edge_overlay_show, 0 ), |
| 826 | | MENU_ITEM (0x5e,LANG_MENU_EDGE_OVERLAY_TRESH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.edge_overlay_thresh, MENU_MINMAX(0, 255) ), |
| 827 | | MENU_ITEM (0x65,LANG_MENU_EDGE_OVERLAY_COLOR, MENUITEM_COLOR_FG, &conf.edge_overlay_color, 0 ), |
| 828 | | MENU_ITEM (0x5c,LANG_MENU_EDGE_PLAY, MENUITEM_BOOL, &conf.edge_overlay_play, 0 ), //does not work on cams like s-series, which dont have a real "hardware" play/rec switch, need a workaround, probably another button |
| 829 | | MENU_ITEM (0x33,LANG_MENU_EDGE_SAVE, MENUITEM_PROC, gui_menuproc_edge_save, 0 ), |
| 830 | | MENU_ITEM (0x5c,LANG_MENU_EDGE_ZOOM, MENUITEM_BOOL, &conf.edge_overlay_zoom, 0 ), |
| 831 | | MENU_ITEM (0x33,LANG_MENU_EDGE_LOAD, MENUITEM_PROC, gui_menuproc_edge_load, 0 ), |
| 832 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 833 | | {0} |
| 834 | | }; |
| 835 | | static CMenu edge_overlay_submenu = {0x7f,LANG_MENU_EDGE_OVERLAY_TITLE, NULL, edge_overlay_submenu_items }; |
| 836 | | #endif |
| 837 | | |
| 838 | | //------------------------------------------------------------------- |
| 839 | | |
| 840 | | static void gui_grid_lines_load_selected(const char *fn) { |
| 841 | | if (fn) |
| 842 | | if (module_grids_load()) |
| 843 | | libgrids->grid_lines_load(fn); |
| 844 | | } |
| 845 | | void gui_grid_lines_load(int arg) { |
| 846 | | module_fselect_init(LANG_STR_SELECT_GRID_FILE, conf.grid_lines_file, "A/CHDK/GRIDS", gui_grid_lines_load_selected); |
| 847 | | } |
| 848 | | |
| 849 | | static CMenuItem grid_submenu_items[] = { |
| 850 | | MENU_ITEM(0x2f,LANG_MENU_SHOW_GRID, MENUITEM_BOOL, &conf.show_grid_lines, 0 ), |
| 851 | | MENU_ITEM(0x35,LANG_MENU_GRID_LOAD, MENUITEM_PROC, gui_grid_lines_load, 0 ), |
| 852 | | MENU_ITEM(0x0,LANG_MENU_GRID_CURRENT, MENUITEM_SEPARATOR, 0, 0 ), |
| 853 | | MENU_ITEM(0x0,(int)conf.grid_title, MENUITEM_TEXT, 0, 0 ), |
| 854 | | MENU_ITEM(0x0,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| 855 | | MENU_ITEM(0x5c,LANG_MENU_GRID_FORCE_COLOR, MENUITEM_BOOL, &conf.grid_force_color, 0 ), |
| 856 | | MENU_ITEM(0x65,LANG_MENU_GRID_COLOR_LINE, MENUITEM_COLOR_FG, &conf.grid_color, 0 ), |
| 857 | | MENU_ITEM(0x65,LANG_MENU_GRID_COLOR_FILL, MENUITEM_COLOR_BG, &conf.grid_color, 0 ), |
| 858 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 859 | | {0} |
| 860 | | }; |
| 861 | | static CMenu grid_submenu = {0x2f,LANG_MENU_GRID_TITLE, NULL, grid_submenu_items }; |
| 862 | | |
| 863 | | //------------------------------------------------------------------- |
| 864 | | |
| 865 | | static const char* gui_text_box_charmap[] = { "Default", "German", "Russian" }; |
| 866 | | |
| 867 | | //------------------------------------------------------------------- |
| 868 | | |
| 869 | | static CMenuItem visual_submenu_items[] = { |
| 870 | | MENU_ITEM(0x35,LANG_MENU_VIS_LANG, MENUITEM_PROC, gui_draw_load_lang, 0 ), |
| 871 | | MENU_ITEM(0x5f,LANG_MENU_VIS_OSD_FONT, MENUITEM_ENUM, gui_font_enum, 0 ), |
| 872 | | MENU_ITEM(0x35,LANG_MENU_VIS_MENU_FONT, MENUITEM_PROC, gui_draw_load_menu_rbf, 0 ), |
| 873 | | MENU_ITEM(0x35,LANG_MENU_VIS_MENU_SYMBOL_FONT, MENUITEM_PROC, gui_draw_load_symbol_rbf, 0 ), |
| 874 | | MENU_ENUM2(0x5f,LANG_MENU_VIS_CHARMAP, &conf.tbox_char_map, gui_text_box_charmap ), |
| 875 | | MENU_ITEM(0x80,LANG_MENU_RESET_FILES, MENUITEM_PROC, gui_menuproc_reset_files, 0 ), |
| 876 | | MENU_ITEM(0x0,LANG_MENU_VIS_COLORS, MENUITEM_SEPARATOR, 0, 0 ), |
| 877 | | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_TEXT, MENUITEM_COLOR_FG, &conf.osd_color, 0 ), |
| 878 | | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_BKG, MENUITEM_COLOR_BG, &conf.osd_color, 0 ), |
| 879 | | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_WARNING, MENUITEM_COLOR_FG, &conf.osd_color_warn, 0 ), |
| 880 | | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_WARNING_BKG, MENUITEM_COLOR_BG, &conf.osd_color_warn, 0 ), |
| 881 | | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO, MENUITEM_COLOR_FG, &conf.histo_color, 0 ), |
| 882 | | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO_BKG, MENUITEM_COLOR_BG, &conf.histo_color, 0 ), |
| 883 | | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO_BORDER, MENUITEM_COLOR_FG, &conf.histo_color2, 0 ), |
| 884 | | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO_MARKERS, MENUITEM_COLOR_BG, &conf.histo_color2, 0 ), |
| 885 | | MENU_ITEM(0x65,LANG_MENU_VIS_ZEBRA_UNDER, MENUITEM_COLOR_BG, &conf.zebra_color, 0 ), |
| 886 | | MENU_ITEM(0x65,LANG_MENU_VIS_ZEBRA_OVER, MENUITEM_COLOR_FG, &conf.zebra_color, 0 ), |
| 887 | | //MENU_ITEM(0x65,LANG_MENU_VIS_BATT_ICON, MENUITEM_COLOR_FG, &conf.batt_icon_color, 0 ), |
| 888 | | MENU_ITEM(0x65,LANG_MENU_VIS_SPACE_ICON, MENUITEM_COLOR_FG, &conf.space_color, 0 ), |
| 889 | | MENU_ITEM(0x65,LANG_MENU_VIS_SPACE_ICON_BKG, MENUITEM_COLOR_BG, &conf.space_color, 0 ), |
| 890 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_TEXT, MENUITEM_COLOR_FG, &conf.menu_color, 0 ), |
| 891 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_BKG, MENUITEM_COLOR_BG, &conf.menu_color, 0 ), |
| 892 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_TITLE_TEXT, MENUITEM_COLOR_FG, &conf.menu_title_color, 0 ), |
| 893 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_TITLE_BKG, MENUITEM_COLOR_BG, &conf.menu_title_color, 0 ), |
| 894 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_CURSOR_TEXT, MENUITEM_COLOR_FG, &conf.menu_cursor_color, 0 ), |
| 895 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_CURSOR_BKG, MENUITEM_COLOR_BG, &conf.menu_cursor_color, 0 ), |
| 896 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_SYMBOL_TEXT, MENUITEM_COLOR_FG, &conf.menu_symbol_color, 0 ), |
| 897 | | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_SYMBOL_BKG, MENUITEM_COLOR_BG, &conf.menu_symbol_color, 0 ), |
| 898 | | MENU_ITEM(0x65,LANG_MENU_VIS_READER_TEXT, MENUITEM_COLOR_FG, &conf.reader_color, 0 ), |
| 899 | | MENU_ITEM(0x65,LANG_MENU_VIS_READER_BKG, MENUITEM_COLOR_BG, &conf.reader_color, 0 ), |
| 900 | | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_OVERRIDE, MENUITEM_COLOR_FG, &conf.osd_color_override, 0 ), |
| 901 | | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_OVERRIDE_BKG, MENUITEM_COLOR_BG, &conf.osd_color_override, 0 ), |
| 902 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 903 | | {0} |
| 904 | | }; |
| 905 | | static CMenu visual_submenu = {0x28,LANG_MENU_VIS_TITLE, NULL, visual_submenu_items }; |
| 906 | | |
| 907 | | static CMenuItem raw_state_submenu_items[] = { |
| 908 | | MENU_ITEM (0x5c,LANG_MENU_OSD_SHOW_RAW_STATE, MENUITEM_BOOL, &conf.show_raw_state, 0 ), |
| 909 | | MENU_ITEM (0x5c,LANG_MENU_OSD_SHOW_REMAINING_RAW, MENUITEM_BOOL, &conf.show_remaining_raw, 0 ), |
| 910 | | MENU_ITEM (0x60,LANG_MENU_OSD_RAW_TRESHOLD, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.remaining_raw_treshold, MENU_MINMAX(0, 200) ), |
| 911 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 912 | | {0} |
| 913 | | }; |
| 914 | | |
| 915 | | static CMenu raw_state_submenu = {0x24,LANG_MENU_OSD_RAW_STATE_PARAMS_TITLE, NULL, raw_state_submenu_items }; |
| 916 | | |
| 917 | | #ifdef CAM_TOUCHSCREEN_UI |
| 918 | | static const char* gui_touchscreen_disable_modes[]= { "Enable", "Disable" }; |
| 919 | | static CMenuItem touchscreen_submenu_items[] = { |
| 920 | | MENU_ENUM2 (0x5f,LANG_MENU_TS_VIDEO_AE_DISABLE, &conf.touchscreen_disable_video_controls, gui_touchscreen_disable_modes ), |
| 921 | | MENU_ENUM2 (0x5f,LANG_MENU_TS_ALT_SHORTCUTS_DISABLE, &conf.touchscreen_disable_shortcut_controls, gui_touchscreen_disable_modes ), |
| 922 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 923 | | {0} |
| 924 | | }; |
| 925 | | static CMenu touchscreen_submenu = {0x28,LANG_MENU_TOUCHSCREEN_VALUES, /*cb_values_menu_change*/ NULL, touchscreen_submenu_items }; |
| 926 | | #endif |
| 927 | | |
| 930 | | #ifdef CAM_HAS_CMOS |
| 931 | | static const char* gui_temp_mode_modes[] = { "Off", "Optical", "CMOS", "Battery", "all" }; |
| 932 | | #else |
| 933 | | static const char* gui_temp_mode_modes[] = { "Off", "Optical", "CCD", "Battery", "all" }; |
| 934 | | #endif |
| 935 | | static const char* gui_hide_osd_modes[] = { "Don't", "In Playback", "On Disp Press", "Both" }; |
| 936 | | static const char* gui_show_usb_info_modes[] = { "Off", "Icon", "Text" }; |
| 937 | | static CMenuItem osd_submenu_items[] = { |
| 938 | | MENU_ITEM(0x5c,LANG_MENU_OSD_SHOW, MENUITEM_BOOL, &conf.show_osd, 0 ), |
| 939 | | MENU_ENUM2(0x5c,LANG_MENU_OSD_HIDE_PLAYBACK, &conf.hide_osd, gui_hide_osd_modes ), |
| 940 | | MENU_ITEM(0x81,LANG_MENU_VIS_MENU_CENTER, MENUITEM_BOOL, &conf.menu_center, 0 ), |
| 941 | | MENU_ITEM(0x81,LANG_MENU_SELECT_FIRST_ENTRY, MENUITEM_BOOL, &conf.menu_select_first_entry, 0 ), |
| 942 | | MENU_ITEM(0x64,LANG_MENU_VIS_SYMBOL, MENUITEM_BOOL, &conf.menu_symbol_enable, 0 ), |
| 943 | | MENU_ITEM(0x2e,LANG_MENU_USER_MENU, MENUITEM_SUBMENU, &user_submenu, 0 ), |
| 944 | | MENU_ITEM(0x5f,LANG_MENU_USER_MENU_ENABLE, MENUITEM_ENUM, gui_user_menu_show_enum, 0 ), |
| 945 | | MENU_ITEM(0x5c,LANG_MENU_USER_MENU_AS_ROOT, MENUITEM_BOOL, &conf.user_menu_as_root, 0 ), |
| 946 | | MENU_ITEM(0x5f,LANG_MENU_OSD_SHOW_STATES, MENUITEM_BOOL, &conf.show_state, 0 ), |
| 947 | | MENU_ENUM2(0x5f,LANG_MENU_OSD_SHOW_TEMP, &conf.show_temp, gui_temp_mode_modes ), |
| 948 | | MENU_ITEM(0x59,LANG_MENU_OSD_TEMP_FAHRENHEIT, MENUITEM_BOOL, &conf.temperature_unit, 0 ), |
| 949 | | MENU_ENUM2(0x71,LANG_MENU_USB_SHOW_INFO, &conf.usb_info_enable, gui_show_usb_info_modes ), |
| 950 | | MENU_ITEM(0x72,LANG_MENU_OSD_LAYOUT_EDITOR, MENUITEM_PROC, gui_menu_run_fltmodule, "_osd_le.flt" ), |
| 951 | | MENU_ITEM(0x2f,LANG_MENU_OSD_GRID_PARAMS, MENUITEM_SUBMENU, &grid_submenu, 0 ), |
| 952 | | MENU_ITEM(0x22,LANG_MENU_OSD_VALUES, MENUITEM_SUBMENU, &values_submenu, 0 ), |
| 953 | | MENU_ITEM(0x31,LANG_MENU_OSD_DOF_CALC, MENUITEM_SUBMENU, &dof_submenu, 0 ), |
| 954 | | MENU_ITEM(0x24,LANG_MENU_OSD_RAW_STATE_PARAMS, MENUITEM_SUBMENU, &raw_state_submenu, 0 ), |
| 955 | | MENU_ITEM(0x32,LANG_MENU_OSD_BATT_PARAMS, MENUITEM_SUBMENU, &battery_submenu, 0 ), |
| 956 | | MENU_ITEM(0x33,LANG_MENU_OSD_SPACE_PARAMS, MENUITEM_SUBMENU, &space_submenu, 0 ), |
| 957 | | MENU_ITEM(0x34,LANG_MENU_OSD_CLOCK_PARAMS, MENUITEM_SUBMENU, &clock_submenu, 0 ), |
| 958 | | MENU_ITEM(0x59,LANG_MENU_OSD_SHOW_IN_REVIEW, MENUITEM_BOOL, &conf.show_osd_in_review, 0 ), |
| 959 | | #ifndef OPTIONS_AUTOSAVE |
| 960 | | MENU_ITEM (0x5c,LANG_MENU_MAIN_SAVE_OPTIONS, MENUITEM_PROC, gui_menuproc_save, 0 ), |
| 961 | | #endif |
| 962 | | #ifdef CAM_TOUCHSCREEN_UI |
| 963 | | MENU_ITEM (0x22,LANG_MENU_TOUCHSCREEN_VALUES, MENUITEM_SUBMENU, &touchscreen_submenu, 0 ), |
| 964 | | #endif |
| 965 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 966 | | {0} |
| 967 | | }; |
| 968 | | |
| 969 | | static CMenu osd_submenu = {0x22,LANG_MENU_OSD_TITLE, NULL, osd_submenu_items }; |
| 970 | | |
| 971 | | static const char* gui_histo_show_modes[] = { "Don't", "Always", "Shoot" }; |
| 972 | | static const char* gui_histo_view_modes[]={ "RGB", "Y", "RGB Y", "R G B", "RGB all", "Y all", "Blend", "Blend Y"}; |
| 973 | | static const char* gui_histo_transform_modes[]={ "Linear", "Log" }; |
| 974 | | static CMenuItem histo_submenu_items[] = { |
| 975 | | MENU_ENUM2(0x5f,LANG_MENU_HISTO_SHOW, &conf.show_histo, gui_histo_show_modes ), |
| 976 | | MENU_ENUM2(0x6f,LANG_MENU_HISTO_LAYOUT, &conf.histo_layout, gui_histo_view_modes ), |
| 977 | | MENU_ENUM2(0x5f,LANG_MENU_HISTO_MODE, &conf.histo_mode, gui_histo_transform_modes ), |
| 978 | | MENU_ITEM(0x5c,LANG_MENU_HISTO_EXP, MENUITEM_BOOL, &conf.show_overexp, 0 ), |
| 979 | | MENU_ITEM(0x70,LANG_MENU_HISTO_IGNORE_PEAKS, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.histo_ignore_boundary, MENU_MINMAX(0, 32) ), |
| 980 | | MENU_ITEM(0x5c,LANG_MENU_HISTO_MAGNIFY, MENUITEM_BOOL, &conf.histo_auto_ajust, 0 ), |
| 981 | | MENU_ITEM(0x5c,LANG_MENU_HISTO_SHOW_EV_GRID, MENUITEM_BOOL, &conf.histo_show_ev_grid, 0 ), |
| 982 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 983 | | {0} |
| 984 | | }; |
| 985 | | static CMenu histo_submenu = {0x25,LANG_MENU_HISTO_TITLE, NULL, histo_submenu_items }; |
| 986 | | |
| 987 | | static CMenuItem raw_exceptions_submenu_items[] = { |
| 988 | | #if defined CAM_HAS_VIDEO_BUTTON |
| 989 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_VIDEO, MENUITEM_BOOL, &conf.save_raw_in_video, 0 ), |
| 990 | | #endif |
| 991 | | #if defined(CAMERA_s3is) |
| 992 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_SPORTS, MENUITEM_BOOL, &conf.save_raw_in_sports, 0 ), |
| 993 | | #endif |
| 994 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_BURST, MENUITEM_BOOL, &conf.save_raw_in_burst, 0 ), |
| 995 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_TIMER, MENUITEM_BOOL, &conf.save_raw_in_timer, 0 ), |
| 996 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_EDGEOVERLAY, MENUITEM_BOOL, &conf.save_raw_in_edgeoverlay, 0 ), |
| 997 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_AUTO, MENUITEM_BOOL, &conf.save_raw_in_auto, 0 ), |
| 998 | | #if CAM_BRACKETING |
| 999 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_EV_BRACKETING, MENUITEM_BOOL, &conf.save_raw_in_ev_bracketing, 0 ), |
| 1000 | | #endif |
| 1001 | | MENU_ITEM (0x5c,LANG_MENU_RAW_WARN, MENUITEM_BOOL, &conf.raw_exceptions_warn, 0 ), |
| 1002 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 1003 | | {0} |
| 1004 | | }; |
| 1005 | | static CMenu raw_exceptions_submenu = {0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS_TITLE, NULL, raw_exceptions_submenu_items }; |
| 1006 | | |
| 1007 | | static const char* gui_raw_nr_modes[] = { "Auto", "Off", "On"}; |
| 1008 | | static CMenuItem raw_submenu_items[] = { |
| 1009 | | #if DNG_SUPPORT |
| 1010 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, (int)cb_change_dng ), |
| 1011 | | #else |
| 1012 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, 0 ), |
| 1013 | | #endif |
| 1014 | | MENU_ITEM (0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS, MENUITEM_SUBMENU, &raw_exceptions_submenu, 0 ), |
| 1015 | | MENU_ENUM2 (0x5f,LANG_MENU_RAW_NOISE_REDUCTION, &conf.raw_nr, gui_raw_nr_modes ), |
| 1016 | | MENU_ITEM (0x5c,LANG_MENU_RAW_FIRST_ONLY, MENUITEM_BOOL, &conf.raw_save_first_only, 0 ), |
| 1017 | | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_DIR, MENUITEM_BOOL, &conf.raw_in_dir, 0 ), |
| 1018 | | MENU_ENUM2a (0x5f,LANG_MENU_RAW_PREFIX, &conf.raw_prefix, img_prefixes, NUM_IMG_PREFIXES ), |
| 1019 | | MENU_ENUM2a (0x5f,LANG_MENU_RAW_EXTENSION, &conf.raw_ext, img_exts, NUM_IMG_EXTS ), |
| 1020 | | MENU_ENUM2a (0x5f,LANG_MENU_SUB_PREFIX, &conf.sub_batch_prefix, img_prefixes, NUM_IMG_PREFIXES ), |
| 1021 | | MENU_ENUM2a (0x5f,LANG_MENU_SUB_EXTENSION, &conf.sub_batch_ext, img_exts, NUM_IMG_EXTS ), |
| 1022 | | // MENU_ITEM (0x60,LANG_MENU_SUB_IN_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_in_dark_value, MENU_MINMAX(0, 1023) ), |
| 1023 | | // MENU_ITEM (0x60,LANG_MENU_SUB_OUT_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_out_dark_value, MENU_MINMAX(0, 1023) ), |
| 1024 | | MENU_ITEM (0x2a,LANG_MENU_RAW_DEVELOP, MENUITEM_PROC, gui_raw_develop, 0 ), |
| 1025 | | MENU_ITEM (0x5c,LANG_MENU_BAD_PIXEL_REMOVAL, MENUITEM_ENUM, gui_bad_pixel_enum, 0 ), |
| 1026 | | MENU_ITEM (0x5c,LANG_MENU_RAW_CACHED, MENUITEM_BOOL, &conf.raw_cache, 0 ), |
| 1027 | | #if DNG_SUPPORT |
| 1028 | | MENU_ITEM (0x0 ,(int)"DNG", MENUITEM_SEPARATOR, 0, 0 ), |
| 1029 | | MENU_ITEM (0x5c,LANG_MENU_DNG_FORMAT, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_raw , (int)cb_change_dng ), |
| 1030 | | MENU_ITEM (0x5c,LANG_MENU_RAW_DNG_EXT, MENUITEM_BOOL, &conf.raw_dng_ext, 0 ), |
| 1031 | | MENU_ITEM (0x5f,LANG_MENU_DNG_VERSION, MENUITEM_ENUM, gui_dng_version, 0), |
| 1032 | | MENU_ITEM (0x2a,LANG_MENU_BADPIXEL_CREATE, MENUITEM_PROC, gui_menuproc_badpixel_create, 0 ), |
| 1033 | | #endif |
| 1034 | | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 1035 | | {0} |
| 1036 | | }; |
| 1037 | | static CMenu raw_submenu = {0x24,LANG_MENU_RAW_TITLE, NULL, raw_submenu_items }; |
| 1038 | | |
| 1039 | | //------------------------------------------------------------------- |
| 1040 | | #if defined(OPT_CURVES) |
| 1041 | | |
| 1042 | | const char* gui_conf_curve_enum(int change, int arg) { |
| 1043 | | static const char* modes[]={ "None", "Custom", "+1EV", "+2EV", "Auto DR" }; |
| 1044 | | |
| 1045 | | gui_enum_value_change(&conf.curve_enable,change,sizeof(modes)/sizeof(modes[0])); |
| 1046 | | |
| 1047 | | if (change) |
| 1048 | | if (module_curves_load()) |
| 1049 | | libcurves->curve_init_mode(); |
| 1050 | | return modes[conf.curve_enable]; |
| 1051 | | } |
| 1052 | | |
| 1053 | | static void gui_load_curve_selected(const char *fn) { |
| 1054 | | if (fn) { |
| 1055 | | // TODO we could sanity check here, but curve_set_type should fail gracefullish |
| 1056 | | strcpy(conf.curve_file,fn); |
| 1057 | | if (conf.curve_enable == 1) |
| 1058 | | if (module_curves_load()) |
| 1059 | | libcurves->curve_init_mode(); |
| 1060 | | } |
| 1061 | | } |
| 1062 | | |
| 1063 | | void gui_load_curve(int arg) { |
| 1064 | | module_fselect_init(LANG_STR_SELECT_CURVE_FILE, conf.curve_file, CURVE_DIR, gui_load_curve_selected); |
| 1065 | | } |
| 1066 | | |
| 1067 | | static CMenuItem curve_submenu_items[] = { |
| 1068 | | MENU_ITEM(0x5f,LANG_MENU_CURVE_ENABLE, MENUITEM_ENUM, gui_conf_curve_enum, 0 ), |
| 1069 | | MENU_ITEM(0x35,LANG_MENU_CURVE_LOAD, MENUITEM_PROC, gui_load_curve, 0 ), |
| 1070 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 1071 | | {0} |
| 1072 | | }; |
| 1073 | | static CMenu curve_submenu = {0x85,LANG_MENU_CURVE_PARAM_TITLE, NULL, curve_submenu_items }; |
| 1074 | | |
| 1075 | | #endif |
| 1076 | | //------------------------------------------------------------------- |
| 1077 | | |
| 1078 | | void cb_zebra_restore_screen() { |
| 1079 | | if (!conf.zebra_restore_screen) |
| 1080 | | conf.zebra_restore_osd = 0; |
| 1081 | | } |
| 1082 | | |
| 1083 | | void cb_zebra_restore_osd() { |
| 1084 | | if (conf.zebra_restore_osd) |
| 1085 | | conf.zebra_restore_screen = 1; |
| 1086 | | } |
| 1087 | | |
| 1088 | | static const char* gui_zebra_mode_modes[] = { "Blink 1", "Blink 2", "Blink 3", "Solid", "Zebra 1", "Zebra 2" }; |
| 1089 | | static const char* gui_zebra_draw_osd_modes[] = { "Nothing", "Histo", "OSD" }; |
| 1090 | | static CMenuItem zebra_submenu_items[] = { |
| 1091 | | MENU_ITEM(0x5c,LANG_MENU_ZEBRA_DRAW, MENUITEM_BOOL, &conf.zebra_draw, 0 ), |
| 1092 | | MENU_ENUM2(0x5f,LANG_MENU_ZEBRA_MODE, &conf.zebra_mode, gui_zebra_mode_modes ), |
| 1093 | | MENU_ITEM(0x58,LANG_MENU_ZEBRA_UNDER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zebra_under, MENU_MINMAX(0, 32) ), |
| 1094 | | MENU_ITEM(0x57,LANG_MENU_ZEBRA_OVER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zebra_over, MENU_MINMAX(0, 32) ), |
| 1095 | | MENU_ITEM(0x28,LANG_MENU_ZEBRA_RESTORE_SCREEN, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.zebra_restore_screen, cb_zebra_restore_screen ), |
| 1096 | | MENU_ITEM(0x5c,LANG_MENU_ZEBRA_RESTORE_OSD, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.zebra_restore_osd, cb_zebra_restore_osd ), |
| 1097 | | MENU_ENUM2(0x5f,LANG_MENU_ZEBRA_DRAW_OVER, &conf.zebra_draw_osd, gui_zebra_draw_osd_modes ), |
| 1098 | | MENU_ITEM(0x5c,LANG_MENU_ZEBRA_MULTICHANNEL, MENUITEM_BOOL, &conf.zebra_multichannel, 0 ), |
| 1099 | | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| 1100 | | {0} |
| 1101 | | }; |
| 1102 | | static CMenu zebra_submenu = {0x26,LANG_MENU_ZEBRA_TITLE, NULL, zebra_submenu_items }; |
| 1103 | | |
| 1104 | | //------------------------------------------------------------------- |
| 1105 | | |
| 1106 | | static CMenuItem root_menu_items[] = { |
| 1107 | | MENU_ITEM (0x21,LANG_MENU_OPERATION_PARAM, MENUITEM_SUBMENU, &operation_submenu, 0 ), |
| 1108 | | MENU_ITEM (0x23,LANG_MENU_VIDEO_PARAM, MENUITEM_SUBMENU, &video_submenu, 0 ), |
| 1109 | | MENU_ITEM (0x24,LANG_MENU_MAIN_RAW_PARAM, MENUITEM_SUBMENU, &raw_submenu, 0 ), |
| 1110 | | #ifdef OPT_EDGEOVERLAY |
| 1111 | | MENU_ITEM (0x7f,LANG_MENU_EDGE_OVERLAY, MENUITEM_SUBMENU, &edge_overlay_submenu, 0 ), |
| 1112 | | #endif |
| 1113 | | #ifdef OPT_CURVES |
| 1114 | | MENU_ITEM (0x85,LANG_MENU_CURVE_PARAM, MENUITEM_SUBMENU, &curve_submenu, 0 ), |
| 1115 | | #endif |
| 1116 | | MENU_ITEM (0x25,LANG_MENU_MAIN_HISTO_PARAM, MENUITEM_SUBMENU, &histo_submenu, 0 ), |
| 1117 | | MENU_ITEM (0x26,LANG_MENU_MAIN_ZEBRA_PARAM, MENUITEM_SUBMENU, &zebra_submenu, 0 ), |
| 1118 | | MENU_ITEM (0x22,LANG_MENU_MAIN_OSD_PARAM, MENUITEM_SUBMENU, &osd_submenu, 0 ), |
| 1119 | | MENU_ITEM (0x28,LANG_MENU_MAIN_VISUAL_PARAM, MENUITEM_SUBMENU, &visual_submenu, 0 ), |
| 1120 | | #ifdef OPT_SCRIPTING |
| 1121 | | MENU_ITEM (0x27,LANG_MENU_MAIN_SCRIPT_PARAM, MENUITEM_SUBMENU, &script_submenu, 0 ), |
| 1122 | | #endif |
| 1123 | | MENU_ITEM (0x29,LANG_MENU_MAIN_MISC, MENUITEM_SUBMENU, &misc_submenu, 0 ), |
| 1124 | | #ifndef OPTIONS_AUTOSAVE |
| 1125 | | MENU_ITEM (0x33,LANG_MENU_MAIN_SAVE_OPTIONS, MENUITEM_PROC, gui_menuproc_save, 0 ), |
| 1126 | | #endif |
| 1127 | | #ifdef CAM_HAS_GPS |
| 1128 | | MENU_ITEM (0x2a,LANG_MENU_GPS, MENUITEM_SUBMENU, &gps_submenu, 0 ), |
| 1129 | | #endif |
| 1130 | | {0} |
| 1131 | | }; |
| 1132 | | |
| 1133 | | CMenu root_menu = {0x20,LANG_MENU_MAIN_TITLE, NULL, root_menu_items }; |
| 1134 | | |
| 1135 | | static int gui_user_menu_flag; |
| 1136 | | |
| 1137 | | static char buf[256]; |
| 1138 | | |
| 1139 | | //------------------------------------------------------------------- |
| 1140 | | #ifdef CAM_HAS_GPS |
| 1141 | | |
| 1142 | | void gpx_start_stop(int arg) { |
| 1143 | | int i = 0; |
| 1144 | | while( gps_submenu_items[i].value != (int*)gpx_start_stop ) i++; //find entry |
| 1145 | | if( gps_submenu_items[i].text == LANG_MENU_GPS_TRACK_START ) { //toggle text |
| 1146 | | gps_submenu_items[i].text = LANG_MENU_GPS_TRACK_STOP; |
| 1147 | | exit_gpx_record = 0; |
| 1148 | | init_gpx_record_task(); |
| 1149 | | |
| 1150 | | } else { |
| 1151 | | gps_submenu_items[i].text = LANG_MENU_GPS_TRACK_START; |
| 1152 | | exit_gpx_record = 1; |
| 1153 | | } |
| 1154 | | } |
| 1155 | | |
| 1156 | | void show_kompass(int arg){ |
| 1157 | | int i = 0; |
| 1158 | | while( gps_submenu_items[i].value != (int*)show_kompass ) i++; //find entry |
| 1159 | | if( gps_submenu_items[i].text == LANG_MENU_GPS_KOMPASS_SHOW ) { //toggle text |
| 1160 | | gps_submenu_items[i].text = LANG_MENU_GPS_KOMPASS_HIDE; |
| 1161 | | exit_gps_kompass = 0; |
| 1162 | | init_gps_kompass_task(); |
| 1163 | | |
| 1164 | | } else { |
| 1165 | | gps_submenu_items[i].text = LANG_MENU_GPS_KOMPASS_SHOW; |
| 1166 | | exit_gps_kompass = 1; |
| 1167 | | } |
| 1168 | | } |
| 1169 | | |
| 1170 | | void show_navi(int arg){ |
| 1171 | | int i = 0; |
| 1172 | | while( gps_submenu_items[i].value != (int*)show_navi ) i++; //find entry |
| 1173 | | if( gps_submenu_items[i].text == LANG_MENU_GPS_NAVI_SHOW ) { //toggle text |
| 1174 | | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HIDE; |
| 1175 | | exit_gpx_record = 0; |
| 1176 | | exit_gps_navi = 0; |
| 1177 | | exit_gps_kompass = 0; |
| 1178 | | init_gps_trackback_task(); |
| 1179 | | |
| 1180 | | } else { |
| 1181 | | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_SHOW; |
| 1182 | | exit_gps_navi = 1; |
| 1183 | | exit_gps_kompass = 1; |
| 1184 | | exit_gpx_record = 1; |
| 1185 | | } |
| 1186 | | } |
| 1187 | | |
| 1188 | | void navigate_home(int arg){ |
| 1189 | | int i = 0; |
| 1190 | | while( gps_submenu_items[i].value != (int*)navigate_home ) i++; //find entry |
| 1191 | | if( gps_submenu_items[i].text == LANG_MENU_GPS_NAVI_HOME ) { //toggle text |
| 1192 | | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HOME_END; |
| 1193 | | exit_gpx_record = 0; |
| 1194 | | exit_gps_navi = 0; |
| 1195 | | exit_gps_kompass = 0; |
| 1196 | | gps_navigate_home(); |
| 1197 | | |
| 1198 | | } else { |
| 1199 | | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HOME; |
| 1200 | | exit_gps_navi = 1; |
| 1201 | | exit_gps_kompass = 1; |
| 1202 | | exit_gpx_record = 1; |
| 1203 | | } |
| 1204 | | } |
| 1205 | | |
| 1206 | | void mark_timezone(int arg){ |
| 1207 | | write_timezone(); |
| 1208 | | } |
| 1209 | | |
| 1210 | | void mark_home(int arg){ |
| 1211 | | write_home(); |
| 1212 | | } |
| 1213 | | |
| 1214 | | #endif |
| 1215 | | |
| 1216 | | //------------------------------------------------------------------- |
| 1217 | | void cb_step_25() { |
| 1218 | | voltage_step = (conf.batt_step_25)?25:1; |
| 1219 | | } |
| 1220 | | |
| 1221 | | void cb_perc() { |
| 1222 | | conf.batt_volts_show=0; |
| 1223 | | } |
| 1224 | | |
| 1225 | | void cb_volts() { |
| 1226 | | conf.batt_perc_show=0; |
| 1227 | | } |
| 1228 | | |
| 1229 | | void cb_space_perc() { |
| 1230 | | conf.space_mb_show=0; |
| 1231 | | } |
| 1232 | | |
| 1233 | | void cb_space_mb() { |
| 1234 | | conf.space_perc_show=0; |
| 1235 | | } |
| 1236 | | |
| 1237 | | void cb_battery_menu_change(unsigned int item) { |
| 1238 | | switch (item) { |
| 1239 | | case 0: //Voltage MAX |
| 1240 | | if (conf.batt_volts_max<conf.batt_volts_min+25) { |
| 1241 | | conf.batt_volts_min = conf.batt_volts_max-25; |
| 1242 | | } |
| 1243 | | break; |
| 1244 | | case 1: //Voltage MIN |
| 1245 | | if (conf.batt_volts_min>conf.batt_volts_max-25) { |
| 1246 | | conf.batt_volts_max = conf.batt_volts_min+25; |
| 1247 | | } |
| 1248 | | break; |
| 1249 | | default: |
| 1250 | | break; |
| 1251 | | } |
| 1252 | | } |
| 1253 | | |
| 1254 | | #if DNG_SUPPORT |
| 1255 | | void cb_change_dng(){ |
| 1256 | | int old=conf.dng_version; |
| 1257 | | conf_change_dng(); |
| 1258 | | if ((old==1) && (conf.dng_version==0)) gui_mbox_init(LANG_ERROR, LANG_CANNOT_OPEN_BADPIXEL_FILE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| 1259 | | } |
| 1260 | | |
| 1261 | | const char* gui_dng_version(int change, int arg) |
| 1262 | | { |
| 1263 | | static const char* modes[]={ "1.3", "1.1" }; |
| 1264 | | |
| 1265 | | gui_enum_value_change(&conf.dng_version,change,sizeof(modes)/sizeof(modes[0])); |
| 1266 | | cb_change_dng(); |
| 1267 | | |
| 1268 | | return modes[conf.dng_version]; |
| 1269 | | } |
| 1270 | | |
| 1271 | | void gui_menuproc_badpixel_create(int arg) { |
| 1272 | | // After this action module will not be unloaded until reboot |
| 1273 | | // because not clear when it finished |
| 1274 | | if ( module_dng_load(LIBDNG_OWNED_BY_CREATEBADPIXEL) ) |
| 1275 | | libdng->create_badpixel_bin(); |
| 1276 | | } |
| 1277 | | #endif |
| 1278 | | |
| 1279 | | #if defined (DNG_EXT_FROM) |
| 1280 | | void cb_change_dng_usb_ext(){ |
| 1281 | | if (conf.dng_usb_ext) change_ext_to_dng(); else change_ext_to_default(); |
| 1282 | | } |
| 1283 | | #endif |
| 1284 | | |
| 1285 | | void cb_autoiso_menu_change(unsigned int item) |
| 1286 | | { |
| 1287 | | conf.autoiso_min_shutter_numerator = shutter1_values[conf.autoiso_shutter_enum]; |
| 1288 | | conf.autoiso2_min_shutter_numerator = shutter2_values[conf.autoiso2_shutter_enum]; |
| 1289 | | |
| 1290 | | conf.autoiso_max_iso_auto_real=0; // set invalid value of real autoiso as flag 'need recalc' |
| 1291 | | } |
| | 75 | //------------------------------------------------------------------- |
| | 76 | |
| | 77 | // Run a module directly from a menu |
| | 78 | void gui_menu_run_fltmodule(int arg) |
| | 79 | { |
| | 80 | module_run((char*)arg, 0, 0,0, UNLOAD_IF_ERR); |
| | 81 | } |
| | 82 | |
| | 83 | //------------------------------------------------------------------- |
| 1388 | | //------------------------------------------------------------------- |
| 1389 | | static void gui_load_script_selected(const char *fn) { |
| 1390 | | if (fn) |
| 1391 | | script_load(fn, 1); |
| 1392 | | } |
| 1393 | | |
| 1394 | | void gui_load_script(int arg) { |
| 1395 | | module_fselect_init(LANG_STR_SELECT_SCRIPT_FILE, conf.script_file, "A/CHDK/SCRIPTS", gui_load_script_selected); |
| 1396 | | } |
| 1397 | | |
| 1398 | | void gui_load_script_default(int arg) { |
| 1399 | | script_load(conf.script_file, 0); |
| 1400 | | if (conf.script_param_save) { |
| 1401 | | save_params_values(1); |
| 1402 | | } |
| 1403 | | } |
| 1404 | | #endif |
| 1405 | | |
| 1406 | | //------------------------------------------------------------------- |
| 1407 | | const char* gui_override_disable_enum(int change, int arg) { |
| 1408 | | return gui_change_simple_enum(&conf.override_disable,change,gui_override_disable_modes,sizeof(gui_override_disable_modes)/sizeof(gui_override_disable_modes[0])); |
| 1409 | | } |
| 1410 | | |
| 1411 | | //------------------------------------------------------------------- |
| 1412 | | const char* gui_font_enum(int change, int arg) { |
| 1413 | | static const char* fonts[]={ "Win1250", "Win1251", "Win1252", "Win1253", "Win1254", "Win1257"}; |
| 1414 | | |
| 1415 | | gui_enum_value_change(&conf.font_cp,change,sizeof(fonts)/sizeof(fonts[0])); |
| 1416 | | |
| 1417 | | if (change != 0) { |
| 1418 | | font_set(conf.font_cp); |
| 1419 | | rbf_load_from_file(conf.menu_rbf_file, FONT_CP_WIN); |
| 1420 | | gui_menu_init(NULL); |
| 1421 | | } |
| 1422 | | |
| 1423 | | return fonts[conf.font_cp]; |
| 1424 | | } |
| 1425 | | |
| 1426 | | //------------------------------------------------------------------- |
| 1427 | | #ifdef CAM_TOUCHSCREEN_UI |
| 1428 | | |
| 1429 | | const char* gui_on_off_enum(int change, int *conf_val) |
| 1430 | | { |
| 1431 | | static const char* modes[]={ "Off", "On"}; |
| 1432 | | return gui_change_simple_enum(conf_val,change,modes,sizeof(modes)/sizeof(modes[0])); |
| 1433 | | } |
| 1434 | | |
| 1435 | | #endif |
| 1436 | | |
| 1437 | | //------------------------------------------------------------------- |
| 1438 | | const char* gui_nd_filter_state_enum(int change, int arg) { |
| 1439 | | return gui_change_simple_enum(&conf.nd_filter_state,change,gui_nd_filter_state_modes,sizeof(gui_nd_filter_state_modes)/sizeof(gui_nd_filter_state_modes[0])); |
| 1440 | | } |
| 1441 | | |
| 1442 | | const char* gui_histo_show_enum(int change, int arg) { |
| 1443 | | return gui_change_simple_enum(&conf.show_histo,change,gui_histo_show_modes,sizeof(gui_histo_show_modes)/sizeof(gui_histo_show_modes[0])); |
| 1444 | | } |
| 1445 | | |
| 1446 | | //------------------------------------------------------------------- |
| 1447 | | #if CAM_ADJUSTABLE_ALT_BUTTON |
| 1448 | | const char* gui_alt_mode_button_enum(int change, int arg) { |
| 1449 | | #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_s5is) |
| 1450 | | static const char* names[]={ "Shrtcut", "Flash", "Timer", "ISO", "Video" }; |
| 1451 | | static const int keys[]={ KEY_PRINT, KEY_FLASH, KEY_TIMER, KEY_ISO, KEY_VIDEO }; |
| 1452 | | #elif defined(CAMERA_g7) || defined(CAMERA_g9) |
| 1453 | | static const char* names[]={ "Print", "FE"}; |
| 1454 | | static const int keys[]={ KEY_PRINT, KEY_MICROPHONE }; |
| 1455 | | #elif defined(CAMERA_g10) || defined(CAMERA_g12) |
| 1456 | | static const char* names[]={ "Print", "Disp", "AE Lock", "Jump" }; |
| 1457 | | static const int keys[]={ KEY_PRINT, KEY_DISPLAY, KEY_AE_LOCK, KEY_METERING}; |
| 1458 | | #elif defined(CAMERA_g11) |
| 1459 | | static const char* names[]={ "Print", "Disp", "AE Lock", "Jump" }; |
| 1460 | | static const int keys[]={ KEY_PRINT, KEY_DISPLAY, KEY_MICROPHONE, KEY_METERING}; |
| 1461 | | #elif defined(CAMERA_a650) |
| 1462 | | static const char* names[]={ "Print", "ISO"}; |
| 1463 | | static const int keys[]={ KEY_PRINT, KEY_ISO }; |
| 1464 | | #elif defined(CAMERA_a3300) |
| 1465 | | static const char* names[]={ "Print", "Face", "Disp"}; |
| 1466 | | static const int keys[]={ KEY_PRINT, KEY_FACE, KEY_DISPLAY }; |
| 1467 | | #elif defined(CAMERA_sx100is) || defined(CAMERA_sx110is) |
| 1468 | | static const char* names[]={ "Print", "Face"}; |
| 1469 | | static const int keys[]={ KEY_PRINT, KEY_FACE }; |
| 1470 | | #elif defined(CAMERA_sx10) || defined(CAMERA_sx1) || defined(CAMERA_sx20) || defined(CAMERA_sx30) || defined(CAMERA_sx40hs) |
| 1471 | | static const char* names[]={ "Shrtcut", "Flash", "Video"}; |
| 1472 | | static const int keys[]={ KEY_PRINT, KEY_FLASH, KEY_VIDEO }; |
| 1473 | | #elif defined(CAMERA_a410) || defined(CAMERA_a430) || defined(CAMERA_a420) || defined(CAMERA_a530) || defined(CAMERA_a540) || defined(CAMERA_a570) || defined(CAMERA_a580) || defined(CAMERA_a590) ||defined(CAMERA_a630) || defined(CAMERA_a640) || defined(CAMERA_a610) || defined(CAMERA_a620) || defined(CAMERA_a700) || defined(CAMERA_a710) || defined(CAMERA_a720) || defined(CAMERA_ixus65_sd630) || defined(CAMERA_ixus800_sd700) |
| 1474 | | static const char* names[]={ "Print", "Display"}; |
| 1475 | | static const int keys[] = {KEY_PRINT, KEY_DISPLAY}; |
| 1476 | | #elif defined(CAMERA_sx150is) || (CAMERA_sx220hs) || defined(CAMERA_sx230hs) || defined(CAMERA_s100) |
| 1477 | | static const char* names[]={ "Playback", "Video", "Display" }; |
| 1478 | | static const int keys[] = {KEY_PRINT, KEY_VIDEO, KEY_DISPLAY}; |
| 1479 | | #elif defined(CAMERA_ixus220_elph300hs) || defined(CAMERA_ixus230_elph310hs) |
| 1480 | | static const char* names[]={ "Video", "Display", "Playback", "Video"}; |
| 1481 | | static const int keys[] = {KEY_PRINT, KEY_DISPLAY, KEY_PLAYBACK, KEY_VIDEO}; |
| 1482 | | #else |
| 1483 | | #error camera alt-buttons not defined |
| 1484 | | #endif |
| 1485 | | int i; |
| 1486 | | |
| 1487 | | for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { |
| 1488 | | if (conf.alt_mode_button==keys[i]) { |
| 1489 | | break; |
| 1490 | | } |
| 1491 | | } |
| 1492 | | |
| 1493 | | i+=change; |
| 1494 | | if (i<0) |
| 1495 | | i=(sizeof(names)/sizeof(names[0]))-1; |
| 1496 | | else if (i>=(sizeof(names)/sizeof(names[0]))) |
| 1497 | | i=0; |
| 1498 | | |
| 1499 | | conf.alt_mode_button = keys[i]; |
| 1500 | | kbd_set_alt_mode_key_mask(conf.alt_mode_button); |
| 1501 | | return names[i]; |
| 1502 | | } |
| 1503 | | #endif |
| 1504 | | |
| 1505 | | //------------------------------------------------------------------- |
| 1506 | | const char* gui_alt_power_enum(int change, int arg) { |
| 1507 | | // Script option is retained even if scripting is disabled, otherwise conf values will change |
| 1508 | | // Equivalent to ALT |
| 1509 | | static const char* modes[]={ "Never", "Alt", "Script", "Always" }; |
| 1510 | | |
| 1511 | | gui_enum_value_change(&conf.alt_prevent_shutdown,change,sizeof(modes)/sizeof(modes[0])); |
| 1512 | | |
| 1513 | | return modes[conf.alt_prevent_shutdown]; |
| 1514 | | } |
| 1515 | | |
| 1516 | | //------------------------------------------------------------------- |
| 1517 | | #if !CAM_VIDEO_QUALITY_ONLY |
| 1518 | | const char* gui_video_bitrate_enum(int change, int arg) { |
| 1519 | | static const char *modes[]={ "0.25x", "0.5x","0.75x", "1x", "1.25x", "1.5x", "1.75x", "2x", "2.5x", "3x"}; |
| 1520 | | gui_enum_value_change(&conf.video_bitrate,change,sizeof(modes)/sizeof(modes[0])); |
| 1521 | | |
| 1522 | | if (change) |
| 1523 | | shooting_video_bitrate_change(conf.video_bitrate); |
| 1524 | | |
| 1525 | | return modes[conf.video_bitrate]; |
| 1526 | | } |
| 1527 | | #endif |
| 1528 | | |
| 1529 | | //------------------------------------------------------------------- |
| 1530 | | const char* gui_tv_bracket_values_enum(int change, int arg) { |
| 1531 | | static const char* modes[]={ "Off", "1/3 Ev","2/3 Ev", "1 Ev", "1 1/3Ev", "1 2/3Ev", "2 Ev", "2 1/3Ev", "2 2/3Ev", "3 Ev", "3 1/3Ev", "3 2/3Ev", "4 Ev"}; |
| 1532 | | |
| 1533 | | return gui_change_simple_enum(&conf.tv_bracket_value,change,modes,sizeof(modes)/sizeof(modes[0])); |
| 1534 | | } |
| 1535 | | |
| 1536 | | const char* gui_tv_override_koef_enum(int change, int arg) { |
| 1537 | | static const char* modes[]={"Off", "1/100K", "1/10000", "1/1000","1/100","1/10", "1","10","100"}; |
| 1538 | | |
| 1539 | | if (conf.tv_enum_type && change) |
| 1540 | | { |
| 1541 | | if (conf.tv_override_koef == 6) |
| 1542 | | conf.tv_override_koef = 0; |
| 1543 | | else |
| 1544 | | conf.tv_override_koef = 6; |
| 1545 | | } |
| 1546 | | else |
| 1547 | | gui_enum_value_change(&conf.tv_override_koef,change,sizeof(modes)/sizeof(modes[0])); |
| 1548 | | |
| 1549 | | return modes[conf.tv_override_koef]; |
| 1550 | | } |
| 1551 | | |
| 1552 | | const char* gui_tv_override_value_enum(int change, int arg) { |
| 1553 | | /* |
| 1554 | | static const char* modes[]={ |
| 1555 | | // add very long time exposures as approximately powers of 2, adding 15 exposures |
| 1556 | | "2048","1625","1290","1024","812","645","512","406","322","256","203","161","128","101","80", |
| 1557 | | "64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"}; |
| 1558 | | */ |
| 1559 | | |
| 1560 | | // XXX This array above is redundant with platform/generic/shooting.c, this should be avoided! |
| 1561 | | conf.tv_override_value+=change; |
| 1562 | | if (conf.tv_enum_type) { |
| 1563 | | if (conf.tv_override_value<0) { |
| 1564 | | conf.tv_override_value=tv_override_amount-1; |
| 1565 | | } |
| 1566 | | else if ((unsigned)conf.tv_override_value>=(tv_override_amount)) |
| 1567 | | conf.tv_override_value=0; |
| 1568 | | return tv_override[conf.tv_override_value]; |
| 1569 | | } |
| 1570 | | else { |
| 1571 | | if (conf.tv_override_value<0) { |
| 1572 | | conf.tv_override_value=100; |
| 1573 | | } |
| 1574 | | else if (conf.tv_override_value>100) conf.tv_override_value=0; |
| 1575 | | sprintf(buf, "%d", conf.tv_override_value); |
| 1576 | | return buf; |
| 1577 | | } |
| 1578 | | } |
| 1579 | | |
| 1580 | | const char* gui_tv_enum_type_enum(int change, int arg) { |
| 1581 | | static const char* modes[]={"Factor", "Ev Step"}; |
| 1582 | | |
| 1583 | | gui_enum_value_change(&conf.tv_enum_type,change,sizeof(modes)/sizeof(modes[0])); |
| 1584 | | if (change) { |
| 1585 | | conf.tv_override_koef=6; |
| 1586 | | if (conf.tv_enum_type) |
| 1587 | | conf.tv_override_value=tv_override_zero_shift; |
| 1588 | | else conf.tv_override_value=1; |
| 1589 | | } |
| 1590 | | return modes[conf.tv_enum_type]; |
| 1591 | | } |
| 1592 | | |
| 1593 | | const char* gui_subj_dist_override_value_enum(int change, int arg) { |
| 1594 | | int koef = shooting_get_subject_distance_override_koef(); |
| 1595 | | static char buf[9]; |
| 1596 | | if (koef == -1) |
| 1597 | | { |
| 1598 | | // If 'Infinity' selected in the 'koef' setting then set SD to the infinity value |
| 1599 | | // technically the same as MAX_DIST when it's sent to the firmware function |
| 1600 | | // in the camera; but used here to alter the CHDK OSD display. |
| 1601 | | conf.subj_dist_override_value = INFINITY_DIST; |
| 1602 | | } |
| 1603 | | else |
| 1604 | | { |
| 1605 | | // Increment / decrement the SD value, wrapping around from MIN_DIST to MAX_DIST |
| 1606 | | conf.subj_dist_override_value += (change*koef); |
| 1607 | | if (conf.subj_dist_override_value < MIN_DIST) |
| 1608 | | conf.subj_dist_override_value = MAX_DIST; |
| 1609 | | else if (conf.subj_dist_override_value > MAX_DIST) |
| 1610 | | conf.subj_dist_override_value = MIN_DIST; |
| 1611 | | } |
| 1612 | | if (conf.subj_dist_override_value == INFINITY_DIST) |
| 1613 | | strcpy(buf,"Inf."); |
| 1614 | | else |
| 1615 | | sprintf(buf, "%d", shooting_get_subject_distance_override_value()); |
| 1616 | | return buf; |
| 1617 | | } |
| 1618 | | |
| 1619 | | const char* gui_subj_dist_override_koef_enum(int change, int arg) { |
| 1620 | | // Define the adjustment factor values for the subject distance override |
| 1621 | | #if MAX_DIST > 1000000 // Superzoom - e.g. SX30, SX40 |
| 1622 | | static const char* modes[] = { "Off", "1", "10", "100", "1000", "10K", "100K", "1M", "Inf." }; |
| 1623 | | #elif MAX_DIST > 100000 // G12, IXUS310 |
| 1624 | | static const char* modes[] = { "Off", "1", "10", "100", "1000", "10K", "100K", "Inf." }; |
| 1625 | | #else // Original values (MAX_DIST = 65535) |
| 1626 | | static const char* modes[] = { "Off", "1", "10", "100", "1000" }; |
| 1627 | | #endif |
| 1628 | | const char *rv = gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0])); |
| 1629 | | // If we've selected 'Infinity' focus then set the SD override value |
| 1630 | | // Otherwise if we had previously selected 'Infinity' then reset back to MAX_DIST |
| 1631 | | if (shooting_get_subject_distance_override_koef() == -1) |
| 1632 | | conf.subj_dist_override_value = INFINITY_DIST; |
| 1633 | | else if (conf.subj_dist_override_value == INFINITY_DIST) |
| 1634 | | conf.subj_dist_override_value = MAX_DIST; |
| 1635 | | return rv; |
| 1636 | | } |
| 1637 | | |
| 1638 | | const char* gui_av_override_enum(int change, int arg) |
| 1639 | | { |
| 1640 | | conf.av_override_value+=change; |
| 1641 | | if (conf.av_override_value<0) conf.av_override_value=shooting_get_aperture_sizes_table_size()+6; |
| 1642 | | else if (conf.av_override_value>shooting_get_aperture_sizes_table_size()+6) conf.av_override_value=0; |
| 1643 | | |
| 1644 | | if (conf.av_override_value == 0) |
| 1645 | | return "Off"; |
| 1646 | | else |
| 1647 | | { |
| 1648 | | short prop_id=shooting_get_aperture_from_av96(shooting_get_av96_override_value()); |
| 1649 | | sprintf(buf, "%d.%02d", (int)prop_id/100, (int)prop_id%100 ); |
| 1650 | | return buf; |
| 1651 | | } |
| 1652 | | } |
| 1653 | | |
| 1654 | | #if ZOOM_OVERRIDE |
| 1655 | | const char* gui_zoom_override_enum(int change, int arg) { |
| 1656 | | conf.zoom_override_value+=change; |
| 1657 | | if (conf.zoom_override_value<0) conf.zoom_override_value=zoom_points-1; |
| 1658 | | else if (conf.zoom_override_value>zoom_points-1) conf.zoom_override_value=0; |
| 1659 | | sprintf(buf,"%i",conf.zoom_override_value); |
| 1660 | | return buf; |
| 1661 | | } |
| 1662 | | #endif |
| 1663 | | |
| 1664 | | const char* gui_user_menu_show_enum(int change, int arg) { |
| 1665 | | static const char* modes[]={ "Off", "On","On Direct", "Edit" }; |
| 1666 | | |
| 1667 | | if (conf.user_menu_enable == 3) user_menu_save(); |
| 1668 | | |
| 1669 | | return gui_change_simple_enum(&conf.user_menu_enable,change,modes,sizeof(modes)/sizeof(modes[0])); |
| 1670 | | } |
| 1671 | | |
| 1672 | | const char* gui_video_af_key_enum(int change, int arg) { |
| 1673 | | #if CAMERA_g12 |
| 1674 | | static const char* names[]={ "", "Shutter", "Set", "AE Lock"}; |
| 1675 | | static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET, KEY_AE_LOCK }; |
| 1676 | | #else |
| 1677 | | static const char* names[]={ "", "Shutter", "Set"}; |
| 1678 | | static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET }; |
| 1679 | | #endif |
| 1680 | | int i; |
| 1681 | | |
| 1682 | | for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { |
| 1683 | | if (conf.video_af_key==keys[i]) { |
| 1684 | | break; |
| 1685 | | } |
| 1686 | | } |
| 1687 | | |
| 1688 | | i+=change; |
| 1689 | | if (i<0) |
| 1690 | | i=(sizeof(names)/sizeof(names[0]))-1; |
| 1691 | | else if (i>=(sizeof(names)/sizeof(names[0]))) |
| 1692 | | i=0; |
| 1693 | | |
| 1694 | | conf.video_af_key = keys[i]; |
| 1695 | | return names[i]; |
| 1696 | | } |
| 1697 | | |
| 1698 | | const char* gui_bad_pixel_enum(int change, int arg) { |
| 1699 | | int modes[]={LANG_MENU_BAD_PIXEL_OFF, LANG_MENU_BAD_PIXEL_INTERPOLATION, LANG_MENU_BAD_PIXEL_RAW_CONVERTER}; |
| 1700 | | |
| 1701 | | return lang_str((int)gui_change_simple_enum(&conf.bad_pixel_removal,change,(const char**)modes,sizeof(modes)/sizeof(modes[0]))); |
| 1702 | | } |
| 1703 | | |
| 1704 | | //------------------------------------------------------------------- |
| 1705 | | void raw_fselect_cb(const char * filename){ |
| 1706 | | struct stat st; |
| 1707 | | if (!filename) return; |
| 1708 | | stat((char*)filename,&st); |
| 1709 | | if (st.st_size!=hook_raw_size()) return; |
| 1710 | | gui_mbox_init((int)"", LANG_RAW_DEVELOP_MESSAGE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| 1711 | | raw_prepare_develop((char*)filename); |
| 1712 | | } |
| 1713 | | |
| 1714 | | //------------------------------------------------------------------- |
| 1715 | | void gui_raw_develop(int arg){ |
| 1716 | | module_fselect_init(LANG_RAW_DEVELOP_SELECT_FILE, "A/DCIM", "A", raw_fselect_cb); |
| 1717 | | } |
| 1718 | | |
| 1719 | | //------------------------------------------------------------------- |
| 1720 | | static void gui_menuproc_reset_files(int arg) |
| 1721 | | { |
| 1722 | | conf.lang_file[0] = 0; |
| 1723 | | strcpy(conf.menu_symbol_rbf_file,DEFAULT_SYMBOL_FILE); |
| 1724 | | conf.menu_rbf_file[0] = 0; |
| 1725 | | conf_save(); |
| 1726 | | gui_mbox_init(LANG_INFORMATION, LANG_MENU_RESTART_CAMERA, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| 1727 | | } |
| 1728 | | |
| 1729 | | //------------------------------------------------------------------- |
| | 262 | #endif |
| | 263 | |
| | 264 | //------------------------------------------------------------------- |
| | 265 | |
| | 266 | static const char* gui_autoiso_shutter_modes[] = { "Auto", "1/8s", "1/15s", "1/30s", "1/60s", "1/125s", "1/250s", "1/500s", "1/1000s" }; |
| | 267 | static const int shutter1_values[]={0, 8, 15, 30, 60, 125, 250, 500, 1000 }; |
| | 268 | |
| | 269 | static const char* gui_autoiso2_shutter_modes[]={ "Off", "1/4s", "1/6s", "1/8s", "1/12s", "1/15s", "1/20s", "1/25s", "1/30s", |
| | 270 | "1/40s", "1/50s", "1/60s", "1/80s", "1/100s", "1/125s", "1/160s", "1/250s", "1/500s", "1/1000s"}; |
| | 271 | static const int shutter2_values[]={0, 4, 6, 8, 12, 15, 20, 25, 30, 40, 50, 60, 80, 100, 125, 160, 200, 250, 500, 1000 }; |
| | 272 | |
| | 273 | static const char* gui_overexp_ev_modes[]={ "Off", "-1/3 Ev", "-2/3 Ev", "-1 Ev", "-1 1/3Ev", "-1 2/3Ev", "-2 Ev" }; |
| | 274 | |
| | 275 | void cb_autoiso_menu_change(unsigned int item) |
| | 276 | { |
| | 277 | conf.autoiso_min_shutter_numerator = shutter1_values[conf.autoiso_shutter_enum]; |
| | 278 | conf.autoiso2_min_shutter_numerator = shutter2_values[conf.autoiso2_shutter_enum]; |
| | 279 | |
| | 280 | conf.autoiso_max_iso_auto_real=0; // set invalid value of real autoiso as flag 'need recalc' |
| | 281 | } |
| | 282 | |
| | 283 | static CMenuItem autoiso_submenu_items[] = { |
| | 284 | MENU_ITEM (0x5c,LANG_MENU_AUTOISO_ENABLED, MENUITEM_BOOL, &conf.autoiso_enable, 0 ), |
| | 285 | MENU_ENUM2 (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER, &conf.autoiso_shutter_enum, gui_autoiso_shutter_modes ), |
| | 286 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_USER_FACTOR, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_user_factor, MENU_MINMAX(1, 8) ), |
| | 287 | |
| | 288 | #if CAM_HAS_IS |
| | 289 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_IS_FACTOR, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_is_factor, MENU_MINMAX(1, 8) ), |
| | 290 | #endif |
| | 291 | |
| | 292 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MIN_ISO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_min_iso, MENU_MINMAX(1, 20) ), |
| | 293 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MAX_ISO_AUTO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_auto, MENU_MINMAX(10, 320) ), |
| | 294 | |
| | 295 | //@tsv |
| | 296 | MENU_ENUM2 (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER2, &conf.autoiso2_shutter_enum, gui_autoiso2_shutter_modes ), |
| | 297 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MAX_ISO2, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_max_iso_auto, MENU_MINMAX(10, 320) ), |
| | 298 | |
| | 299 | #if !defined(CAMERA_sx230hs) |
| | 300 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_MAX_ISO_HI, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_hi, MENU_MINMAX(20, 320) ), |
| | 301 | #endif |
| | 302 | |
| | 303 | MENU_ENUM2 (0x5f,LANG_MENU_AUTOISO_OVEREXP_EV, &conf.overexp_ev_enum, gui_overexp_ev_modes ), |
| | 304 | MENU_ITEM (0x57,LANG_MENU_ZEBRA_OVER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_over, MENU_MINMAX(0, 32) ), |
| | 305 | MENU_ITEM (0x5f,LANG_MENU_AUTOISO_OVEREXP_THRES, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.overexp_threshold, MENU_MINMAX(1, 20) ), |
| | 306 | |
| | 307 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 308 | {0} |
| | 309 | }; |
| | 310 | |
| | 311 | static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, cb_autoiso_menu_change, autoiso_submenu_items }; |
| | 312 | |
| | 313 | //------------------------------------------------------------------- |
| | 314 | |
| 1731 | | #define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen |
| 1732 | | #define TASKLIST_NUM_TASKS 64 // should be enough ? |
| 1733 | | static void gui_debug_draw_tasklist(void) { |
| 1734 | | #ifndef CAM_DRYOS |
| 1735 | | int tasklist[TASKLIST_NUM_TASKS]; // max number of tasks we will look at |
| 1736 | | int n_tasks,n_show_tasks,show_start; |
| 1737 | | const char *name; |
| 1738 | | int i; |
| 1739 | | n_tasks = task_id_list_get(tasklist,sizeof(tasklist)/sizeof(tasklist[0])); |
| 1740 | | show_start = debug_tasklist_start; |
| 1741 | | n_show_tasks = n_tasks - show_start; |
| 1742 | | // auto adjust to show the last N tasks |
| 1743 | | if(n_show_tasks < TASKLIST_MAX_LINES) { |
| 1744 | | show_start = n_tasks - TASKLIST_MAX_LINES; |
| 1745 | | if(show_start<0) |
| 1746 | | show_start = 0; |
| 1747 | | n_show_tasks = n_tasks - show_start; |
| 1748 | | } |
| 1749 | | else if( n_show_tasks > TASKLIST_MAX_LINES ) { |
| 1750 | | n_show_tasks = TASKLIST_MAX_LINES; |
| 1751 | | } |
| 1752 | | sprintf(buf,"%d-%d of %d tasks %c",show_start,show_start+n_show_tasks,n_tasks,debug_display_direction > 0?'+':'-'); |
| 1753 | | draw_string(64,0,buf, conf.osd_color); |
| 1754 | | for( i = 0; i < n_show_tasks; i++ ) { |
| 1755 | | // TODO get full task info |
| 1756 | | name = task_name(tasklist[show_start+i]); |
| 1757 | | if ( !name || !*name ) { |
| 1758 | | name = "(unknown)"; |
| 1759 | | } |
| 1760 | | sprintf(buf,"%10s %8X",name,tasklist[show_start+i]); |
| 1761 | | draw_string(64,16+16*i,buf, conf.osd_color); |
| 1762 | | } |
| 1763 | | #endif //CAM_DRYOS |
| 1764 | | } |
| 1765 | | |
| 1766 | | #define DEBUG_DISPLAY_NONE 0 |
| 1767 | | #define DEBUG_DISPLAY_PROPS 1 |
| 1768 | | #define DEBUG_DISPLAY_PARAMS 2 |
| 1769 | | #ifndef CAM_DRYOS |
| 1770 | | #define DEBUG_DISPLAY_TASKS 3 |
| 1771 | | #endif |
| 1772 | | |
| 1773 | | static void gui_debug_shortcut(void) { |
| 1774 | | static int lastcall = -1; |
| 1775 | | int t=get_tick_count(); |
| 1776 | | if ( lastcall != -1) { |
| 1777 | | if (t-lastcall <= 400) |
| 1778 | | debug_display_direction = -debug_display_direction; |
| 1779 | | } |
| 1780 | | lastcall=t; |
| 1781 | | switch(conf.debug_shortcut_action) { |
| 1782 | | case 1: |
| 1783 | | dump_memory(); |
| 1784 | | break; |
| 1785 | | case 2: |
| 1786 | | #ifndef CAM_DRYOS |
| 1787 | | if(conf.debug_display == DEBUG_DISPLAY_TASKS) { |
| 1788 | | debug_tasklist_start += debug_display_direction*(TASKLIST_MAX_LINES-2); // a little intentional overlap |
| 1789 | | if(debug_tasklist_start >= TASKLIST_NUM_TASKS || debug_tasklist_start < 0) |
| 1790 | | debug_tasklist_start = 0; |
| 1791 | | } |
| 1792 | | else |
| 1793 | | #endif |
| 1794 | | if (conf.debug_display == DEBUG_DISPLAY_PROPS || conf.debug_display == DEBUG_DISPLAY_PARAMS) { |
| 1795 | | conf.debug_propcase_page += debug_display_direction*1; |
| 1796 | | if(conf.debug_propcase_page > 128 || conf.debug_propcase_page < 0) |
| 1797 | | conf.debug_propcase_page = 0; |
| 1798 | | } |
| 1799 | | break; |
| 1800 | | case 3: |
| 1801 | | gui_compare_props(1); |
| 1802 | | break; |
| 1803 | | } |
| 1804 | | } |
| 1805 | | |
| 1806 | | #endif |
| 1807 | | |
| 1808 | | //------------------------------------------------------------------- |
| 1809 | | |
| 1810 | | #if CAM_MULTIPART |
| 1811 | | void card_break_proc(unsigned int btn) |
| 1812 | | { |
| 1813 | | if (btn==MBOX_BTN_YES) create_partitions(); |
| 1814 | | } |
| 1815 | | |
| 1816 | | #ifdef OPT_DEBUGGING |
| 1817 | | static void gui_menuproc_break_card(int arg) |
| 1818 | | { |
| 1819 | | gui_mbox_init(LANG_WARNING, LANG_PARTITIONS_CREATE_WARNING, MBOX_BTN_YES_NO|MBOX_DEF_BTN2|MBOX_TEXT_CENTER, card_break_proc); |
| 1820 | | } |
| 1821 | | #endif |
| 1822 | | |
| 1823 | | const char* gui_menuproc_swap_partitions_enum(int change, int arg) |
| 1824 | | { |
| 1825 | | int new_partition; |
| 1826 | | int partition_count = get_part_count(); |
| 1827 | | char vBuf[16]; |
| 1828 | | if(partitions_enum) |
| 1829 | | { |
| 1830 | | free(partitions_enum); |
| 1831 | | partitions_enum=NULL; |
| 1832 | | } |
| 1833 | | new_partition= get_active_partition()+change; |
| 1834 | | if( new_partition <=0) |
| 1835 | | { |
| 1836 | | new_partition = partition_count; |
| 1837 | | } |
| 1838 | | else if( new_partition > partition_count) |
| 1839 | | { |
| 1840 | | new_partition = 1; |
| 1841 | | } |
| 1842 | | sprintf(vBuf,"%d/%d",new_partition, partition_count); |
| 1843 | | partitions_enum=malloc((strlen(vBuf)+1)*sizeof(char)); |
| 1844 | | strcpy(partitions_enum,vBuf); |
| 1845 | | |
| 1846 | | if(change != 0) |
| 1847 | | { |
| 1848 | | swap_partitions(new_partition); |
| 1849 | | } |
| 1850 | | return partitions_enum; |
| 1851 | | } |
| 1852 | | #endif |
| 1853 | | |
| 1854 | | //------------------------------------------------------------------- |
| 1855 | | static gui_handler *gui_mode; // current gui mode. pointer to gui_handler structure |
| 1856 | | |
| 1857 | | static volatile int gui_restore; |
| 1858 | | static volatile int gui_in_redraw; |
| 1859 | | static int gui_splash, gui_splash_mode; |
| 1860 | | |
| 1861 | | //------------------------------------------------------------------- |
| 1862 | | void gui_init() |
| 1863 | | { |
| 1864 | | gui_set_mode(&defaultGuiHandler); |
| 1865 | | gui_restore = 0; |
| 1866 | | gui_in_redraw = 0; |
| 1867 | | if (conf.start_sound>0) |
| 1868 | | { |
| 1869 | | play_sound(4); |
| 1870 | | } |
| 1871 | | gui_splash = (conf.splash_show)?SPLASH_TIME:0; |
| 1872 | | draw_init(); |
| 1873 | | |
| 1874 | | voltage_step = (conf.batt_step_25)?25:1; |
| 1875 | | load_from_file( "A/CHDK/badpixel", make_pixel_list ); |
| 1876 | | load_from_file( "A/CHDK/badpixel.txt", make_pixel_list ); |
| 1877 | | |
| 1878 | | #if ZOOM_OVERRIDE |
| 1879 | | // reyalp - need to do this in capt_seq |
| 1880 | | // if (conf.zoom_override) shooting_set_zoom(conf.zoom_override_value); |
| 1881 | | #endif |
| 1882 | | } |
| 1883 | | |
| 1884 | | |
| 1885 | | //------------------------------------------------------------------- |
| 1886 | | //void gui_modules_menu_load(){ |
| 1887 | | // |
| 1888 | | // misc_submenu_items[1].type=MENUITEM_TEXT; |
| 1889 | | // |
| 1890 | | // unsigned int argv[] ={ (unsigned int)MODULES_PATH, |
| 1891 | | // (unsigned int)(&misc_submenu_items[1]) |
| 1892 | | // }; |
| 1893 | | // module_run("modmenu.flt", 0, 2,argv, UNLOAD_IF_ERR ); |
| 1894 | | //} |
| 1895 | | |
| 1896 | | //------------------------------------------------------------------- |
| 1897 | | gui_mode_t gui_get_mode() { return ((gui_handler*)gui_mode)->mode; } |
| 1898 | | |
| 1899 | | //------------------------------------------------------------------- |
| 1900 | | // Set new GUI mode, returns old mode |
| 1901 | | gui_handler* gui_set_mode(gui_handler *mode) |
| 1902 | | { |
| 1903 | | if ( gui_mode == mode ) |
| 1904 | | return gui_mode; |
| 1905 | | |
| 1906 | | // Sanity check for case module pointer - is this really gui_handler |
| 1907 | | if ( mode->magicnum != GUI_MODE_MAGICNUM ) { |
| 1908 | | // If sanity failed (module is unload) - set to default mode |
| 1909 | | gui_mode = &defaultGuiHandler; |
| 1910 | | draw_restore(); |
| 1911 | | return gui_mode; |
| 1912 | | } |
| 1913 | | |
| 1914 | | #ifdef CAM_TOUCHSCREEN_UI |
| 1915 | | if (((gui_mode->mode == GUI_MODE_NONE) != (mode->mode == GUI_MODE_NONE)) || // Change from GUI_MODE_NONE to any other or vice-versa |
| 1916 | | ((gui_mode->mode > GUI_MODE_MENU) != (mode->mode > GUI_MODE_MENU))) // Switch in & out of menu mode |
| 1917 | | redraw_buttons = 1; |
| 1918 | | #endif |
| 1919 | | |
| 1920 | | gui_handler *old_mode = gui_mode; |
| 1921 | | gui_mode = mode; |
| 1922 | | |
| 1923 | | return old_mode; |
| 1924 | | } |
| 1925 | | |
| 1926 | | //------------------------------------------------------------------- |
| 1927 | | void gui_force_restore() { |
| 1928 | | gui_restore = gui_in_redraw; |
| 1929 | | } |
| 1930 | | |
| 1931 | | static void gui_handle_splash(void) { |
| 1932 | | static char *logo = NULL; |
| 1933 | | static int logo_size; |
| 1934 | | if (gui_splash) { |
| 1935 | | static int need_logo=1; // don't use logo ptr, since we don't want to keep re-trying |
| 1936 | | if(need_logo) { |
| 1937 | | #if defined(VER_CHDK) |
| 1938 | | const char *logo_name="A/CHDK/DATA/logo.dat"; |
| 1939 | | #else // CHDK-DE |
| 1940 | | const char *logo_name="A/CHDK/DATA/logo_de.dat"; |
| 1941 | | #endif |
| 1942 | | FILE *fd; |
| 1943 | | struct stat st; |
| 1944 | | need_logo=0; |
| 1945 | | if (stat(logo_name,&st) == 0) { |
| 1946 | | logo_size=st.st_size; |
| 1947 | | logo=malloc(logo_size); |
| 1948 | | if(logo) { |
| 1949 | | fd = fopen(logo_name, "rb"); |
| 1950 | | if(fd){ |
| 1951 | | fread(logo,1,logo_size,fd); |
| 1952 | | fclose(fd); |
| 1953 | | } |
| 1954 | | else { |
| 1955 | | free(logo); |
| 1956 | | logo=NULL; |
| 1957 | | need_logo=1; |
| 1958 | | } |
| 1959 | | } |
| 1960 | | } |
| 1961 | | } |
| 1962 | | if (gui_splash>(SPLASH_TIME-4)) { |
| 1963 | | gui_draw_splash(logo,logo_size); |
| 1964 | | // conf.show_osd = 0; |
| 1965 | | } else if (gui_splash==1 && (mode_get()&MODE_MASK) == gui_splash_mode && (gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT)) { |
| 1966 | | draw_restore(); |
| 1967 | | // conf.show_osd = 1; //had to uncomment in order to fix a bug with disappearing osd... |
| 1968 | | } |
| 1969 | | --gui_splash; |
| 1970 | | if(!gui_splash) { |
| 1971 | | free(logo); |
| 1972 | | logo=NULL; |
| 1973 | | need_logo=1; |
| 1974 | | } |
| 1975 | | } |
| 1976 | | } |
| 1977 | | |
| 1978 | | //------------------------------------------------------------------- |
| 1979 | | #ifdef OPTIONS_AUTOSAVE |
| 1980 | | |
| 1981 | | static Conf old_conf; |
| 1982 | | |
| 1983 | | static void conf_store_old_settings() |
| 1984 | | { |
| 1985 | | old_conf = conf; |
| 1986 | | } |
| 1987 | | |
| 1988 | | static int conf_save_new_settings_if_changed() |
| 1989 | | { |
| 1990 | | if (memcmp(&old_conf, &conf, sizeof(Conf)) != 0) |
| 1991 | | { |
| 1992 | | user_menu_save(); |
| 1993 | | conf_save(); |
| 1994 | | conf_store_old_settings(); |
| 1995 | | return 1; |
| 1996 | | } |
| 1997 | | return 0; |
| 1998 | | } |
| 1999 | | |
| 2000 | | #endif |
| 2001 | | |
| 2002 | | //------------------------------------------------------------------- |
| 2003 | | void gui_chdk_draw() |
| 2004 | | { |
| 2005 | | static int show_md_grid=0; |
| 2006 | | |
| 2007 | | gui_draw_osd(); |
| 2008 | | |
| 2009 | | #ifdef CAM_DISP_ALT_TEXT |
| 2010 | | draw_string(((CAM_SCREEN_WIDTH/2)-(FONT_WIDTH*5/2)), (CAM_SCREEN_HEIGHT-FONT_HEIGHT), "<ALT>", MAKE_COLOR(COLOR_RED, COLOR_WHITE)); |
| 2011 | | #endif |
| 2012 | | |
| 2013 | | #ifdef OPT_SCRIPTING |
| 2014 | | if ((mode_get()&MODE_MASK) == MODE_REC || (mode_get()&MODE_MASK) == MODE_PLAY) |
| 2015 | | { |
| 2016 | | draw_txt_string(0, 14, script_title, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| 2017 | | if (state_kbd_script_run) show_md_grid=5; |
| 2018 | | if (show_md_grid) |
| 2019 | | { |
| 2020 | | --show_md_grid; |
| 2021 | | // If motion detect library loaded then display the MD grid |
| 2022 | | // Don't call 'module_mdetect_load' here as we don't want to load |
| 2023 | | // the module, just see if it was already loaded. |
| 2024 | | if (libmotiondetect) |
| 2025 | | libmotiondetect->md_draw_grid(); |
| 2026 | | } |
| 2027 | | } |
| 2028 | | #endif |
| 2029 | | |
| 2030 | | console_draw(); |
| 2031 | | } |
| 2032 | | |
| 2033 | | //------------------------------------------------------------------- |
| 2034 | | // Handler for Menu button press default - enter Menu mode |
| 2035 | | void gui_default_kbd_process_menu_btn() |
| 2036 | | { |
| 2037 | | gui_set_mode(&menuGuiHandler); |
| 2038 | | draw_restore(); |
| 2039 | | } |
| 2040 | | |
| 2041 | | // Change SD override factor, direction = 1 to increase, -1 to decrease |
| 2042 | | // Only applies if camera has a Zoom lever |
| 2043 | | #if CAM_HAS_ZOOM_LEVER |
| 2044 | | static void sd_override_koef(int direction) |
| 2045 | | { |
| 2046 | | gui_subj_dist_override_koef_enum(direction,0); |
| 2047 | | #if !CAM_HAS_MANUAL_FOCUS |
| 2048 | | if (conf.subj_dist_override_koef==0) gui_subj_dist_override_koef_enum(direction,0); |
| 2049 | | #endif |
| 2050 | | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
| 2051 | | } |
| 2052 | | #endif |
| 2053 | | |
| 2054 | | // Change SD override by factor amount, direction = 1 to increase (zoom in), -1 to decrease (zoom out) |
| 2055 | | static void sd_override(int direction) |
| 2056 | | { |
| 2057 | | gui_subj_dist_override_value_enum(direction,0); |
| 2058 | | shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); |
| 2059 | | } |
| 2060 | | |
| 2061 | | // Main button processing for CHDK Alt mode (not in MENU mode) |
| 2062 | | // This needs to be cleaned up, re-organised and commented !!!! |
| 2063 | | void gui_chdk_kbd_process() |
| 2064 | | { |
| 2065 | | #if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE // ALT RAW toggle kbd processing if camera has SD override but no erase button |
| 2066 | | if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) |
| 2067 | | { |
| 2068 | | if (conf.debug_shortcut_action > 0) |
| 2069 | | { |
| 2070 | | #ifdef OPT_DEBUGGING |
| 2071 | | gui_debug_shortcut(); |
| 2072 | | #endif |
| 2073 | | } |
| 2074 | | // Check in manual focus mode |
| 2075 | | else if (!shooting_get_common_focus_mode()) |
| 2076 | | { |
| 2077 | | // Not manual focus mode so just update RAW save setting |
| 2078 | | conf.save_raw = !conf.save_raw; |
| 2079 | | draw_restore(); |
| 2080 | | } |
| 2081 | | else |
| 2082 | | { |
| 2083 | | // In manual focus mode so update shooting distance |
| 2084 | | #if CAM_HAS_ZOOM_LEVER |
| 2085 | | conf.subj_dist_override_value=MAX_DIST; |
| 2086 | | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
| 2087 | | #else |
| 2088 | | gui_subj_dist_override_koef_enum(1,0); |
| 2089 | | #endif |
| 2090 | | } |
| 2091 | | } |
| 2092 | | #else // ALT RAW toggle kbd processing if can't SD override or has erase button |
| 2093 | | if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) |
| 2094 | | { |
| 2095 | | if (conf.debug_shortcut_action > 0) |
| 2096 | | { |
| 2097 | | #ifdef OPT_DEBUGGING |
| 2098 | | gui_debug_shortcut(); |
| 2099 | | #endif |
| 2100 | | } |
| 2101 | | else |
| 2102 | | { |
| 2103 | | // Change RAW save state |
| 2104 | | conf.save_raw = !conf.save_raw; |
| 2105 | | draw_restore(); |
| 2106 | | } |
| 2107 | | } |
| 2108 | | #endif |
| 2109 | | #ifdef OPT_SCRIPTING // ALT Set button processing if scripting enabled - open script menu |
| 2110 | | else if (kbd_is_key_clicked(KEY_SET)) |
| 2111 | | { |
| 2112 | | gui_menu_init(&script_submenu); |
| 2113 | | gui_default_kbd_process_menu_btn(); |
| 2114 | | } |
| 2115 | | #endif |
| 2116 | | #if CAM_CAN_SD_OVERRIDE // ALT button processing if camera has SD override |
| 2117 | | else |
| 2118 | | { |
| 2119 | | #if !CAM_HAS_MANUAL_FOCUS |
| 2120 | | if (kbd_is_key_clicked(SHORTCUT_MF_TOGGLE)) // Camera does not have manual focus |
| 2121 | | { |
| 2122 | | if (conf.subj_dist_override_koef>0) |
| 2123 | | conf.subj_dist_override_koef=0; |
| 2124 | | else conf.subj_dist_override_koef=1; |
| 2125 | | draw_restore(); |
| 2126 | | } |
| 2127 | | else |
| 2128 | | #endif |
| 2129 | | if (shooting_get_common_focus_mode()) // Check in manual focus mode |
| 2130 | | { |
| 2131 | | #if CAM_HAS_ZOOM_LEVER // Camera has zoom lever, use left & right to change factor,up to set infinity |
| 2132 | | if (kbd_is_key_clicked(KEY_RIGHT)) |
| 2133 | | { |
| 2134 | | sd_override_koef(1); |
| 2135 | | } |
| 2136 | | else if (kbd_is_key_clicked(KEY_LEFT)) |
| 2137 | | { |
| 2138 | | sd_override_koef(-1); |
| 2139 | | } |
| 2140 | | else if (kbd_is_key_clicked(SHORTCUT_SET_INFINITY)) |
| 2141 | | { |
| 2142 | | conf.subj_dist_override_value=MAX_DIST; |
| 2143 | | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
| 2144 | | } |
| 2145 | | else |
| 2146 | | #endif |
| 2147 | | if (kbd_is_key_clicked(SHORTCUT_SET_HYPERFOCAL)) // Set hyperfocal distance if down pressed |
| 2148 | | { |
| 2149 | | int m=mode_get()&MODE_SHOOTING_MASK; |
| 2150 | | if ((m==MODE_M) || (m==MODE_AV)) |
| 2151 | | conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance_1e3_f(shooting_get_aperture_from_av96(shooting_get_user_av96()),get_focal_length(lens_get_zoom_point()))/1000; |
| 2152 | | else conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance(); |
| 2153 | | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
| 2154 | | } |
| 2155 | | else |
| 2156 | | { |
| 2157 | | switch (kbd_get_autoclicked_key()) |
| 2158 | | { |
| 2159 | | #if CAM_HAS_ZOOM_LEVER |
| 2160 | | case KEY_ZOOM_IN: |
| 2161 | | #else |
| 2162 | | case KEY_RIGHT: |
| 2163 | | #endif |
| 2164 | | sd_override(1); |
| 2165 | | break; |
| 2166 | | #if CAM_HAS_ZOOM_LEVER |
| 2167 | | case KEY_ZOOM_OUT: |
| 2168 | | #else |
| 2169 | | case KEY_LEFT: |
| 2170 | | #endif |
| 2171 | | sd_override(-1); |
| 2172 | | break; |
| 2173 | | } |
| 2174 | | } |
| 2175 | | } |
| 2176 | | } |
| 2177 | | #endif |
| 2178 | | } |
| 2179 | | |
| 2180 | | //------------------------------------------------------------------- |
| 2181 | | // Handler for Menu button press in CHDK Alt mode (not in Menu mode) |
| 2182 | | // Enter main menu or user menu based on configuration |
| 2183 | | void gui_chdk_kbd_process_menu_btn() |
| 2184 | | { |
| 2185 | | if (conf.user_menu_as_root && (conf.user_menu_enable != 0)) { |
| 2186 | | if (kbd_is_key_pressed(KEY_SHOOT_HALF)) |
| 2187 | | gui_menu_init(&root_menu); |
| 2188 | | else |
| 2189 | | gui_menu_init(&user_submenu); |
| 2190 | | } |
| 2191 | | else { |
| 2192 | | if ((conf.user_menu_enable != 0) && kbd_is_key_pressed(KEY_SHOOT_HALF)) |
| 2193 | | gui_menu_init(&user_submenu); |
| 2194 | | else |
| 2195 | | gui_menu_init(&root_menu); |
| 2196 | | } |
| 2197 | | gui_default_kbd_process_menu_btn(); |
| 2198 | | } |
| 2199 | | |
| 2200 | | // Menu button handler for Menu mode |
| 2201 | | void gui_menu_kbd_process_menu_btn() |
| 2202 | | { |
| 2203 | | gui_menu_unload_module_menus(); |
| 2204 | | #ifdef OPTIONS_AUTOSAVE |
| 2205 | | conf_save_new_settings_if_changed(); |
| 2206 | | #endif |
| 2207 | | if (gui_user_menu_flag) |
| 2208 | | { |
| 2209 | | gui_set_mode(&menuGuiHandler); |
| 2210 | | gui_user_menu_flag = 0; |
| 2211 | | gui_menu_init(&root_menu); |
| 2212 | | } |
| 2213 | | else |
| 2214 | | gui_set_mode(&altGuiHandler); |
| 2215 | | draw_restore(); |
| 2216 | | } |
| 2217 | | |
| 2218 | | //------------------------------------------------------------------- |
| 2219 | | // GUI handlers |
| 2220 | | gui_handler defaultGuiHandler = { GUI_MODE_NONE, gui_draw_osd, 0, 0, 0, GUI_MODE_MAGICNUM }; |
| 2221 | | gui_handler altGuiHandler = { GUI_MODE_ALT, gui_chdk_draw, gui_chdk_kbd_process, gui_chdk_kbd_process_menu_btn, 0, GUI_MODE_MAGICNUM }; |
| 2222 | | gui_handler menuGuiHandler = { GUI_MODE_MENU, gui_menu_draw, gui_menu_kbd_process, gui_menu_kbd_process_menu_btn, 0, GUI_MODE_MAGICNUM }; |
| 2223 | | |
| 2224 | | //------------------------------------------------------------------- |
| 2225 | | // Main GUI redraw function, perform common initialisation then calls the redraw handler for the mode |
| 2226 | | void gui_redraw() |
| 2227 | | { |
| 2228 | | static gui_mode_t gui_mode_prev_tick = GUI_MODE_NONE; |
| 2229 | | gui_mode_t gui_mode_old; |
| 2230 | | |
| 2231 | | static int flag_gui_enforce_redraw = 0; |
| 2232 | | |
| 2233 | | #ifdef CAM_DETECT_SCREEN_ERASE |
| 2234 | | if (!draw_test_guard() && gui_get_mode()) // Attempt to detect screen erase in <Alt> mode, redraw if needed |
| 2235 | | { |
| 2236 | | draw_set_guard(); |
| 2237 | | |
| 2238 | | flag_gui_enforce_redraw |= GUI_REDRAWFLAG_ERASEGUARD; |
| 2239 | | //gui_menu_force_redraw(); |
| 2240 | | #ifdef CAM_TOUCHSCREEN_UI |
| 2241 | | extern int redraw_buttons; |
| 2242 | | redraw_buttons = 1; |
| 2243 | | #endif |
| 2244 | | } |
| 2245 | | #endif |
| 2246 | | |
| 2247 | | gui_handle_splash(); |
| 2248 | | |
| 2249 | | gui_in_redraw = 1; |
| 2250 | | gui_mode_old = gui_get_mode(); |
| 2251 | | |
| 2252 | | #ifdef CAM_TOUCHSCREEN_UI |
| 2253 | | extern void virtual_buttons(); |
| 2254 | | virtual_buttons(); |
| 2255 | | #endif |
| 2256 | | |
| 2257 | | // Call redraw handler |
| 2258 | | if (gui_mode->redraw) gui_mode->redraw(flag_gui_enforce_redraw); |
| 2259 | | flag_gui_enforce_redraw=0; |
| 2260 | | |
| 2261 | | // Forced redraw if needed |
| 2262 | | gui_in_redraw = 0; |
| 2263 | | if ((gui_mode_old != gui_get_mode() |
| 2264 | | && (gui_mode_old != GUI_MODE_NONE && gui_mode_old != GUI_MODE_ALT) |
| 2265 | | && !(gui_mode->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH)) |
| 2266 | | || gui_restore ) |
| 2267 | | { |
| 2268 | | if (gui_restore) |
| 2269 | | flag_gui_enforce_redraw |= GUI_REDRAWFLAG_DRAW_RESTORED; |
| 2270 | | gui_restore = 0; |
| 2271 | | |
| 2272 | | if ( !( gui_mode->flags & GUI_MODE_FLAG_NODRAWRESTORE) ) |
| 2273 | | draw_restore(); |
| 2274 | | } |
| 2275 | | |
| 2276 | | if ( gui_mode_prev_tick != gui_get_mode() ) { |
| 2277 | | flag_gui_enforce_redraw |= GUI_REDRAWFLAG_MODE_WAS_CHANGED; |
| 2278 | | gui_mode_prev_tick = gui_get_mode(); |
| 2279 | | } |
| 2280 | | } |
| 2281 | | |
| 2282 | | //------------------------------------------------------------------- |
| 2283 | | // Main kbd processing for GUI modes |
| 2284 | | void gui_kbd_process() |
| 2285 | | { |
| 2286 | | // Call menu button handler if menu button pressed |
| 2287 | | if (kbd_is_key_clicked(KEY_MENU)) |
| 2288 | | { |
| 2289 | | if (gui_mode->kbd_process_menu_btn) gui_mode->kbd_process_menu_btn(); |
| 2290 | | return; |
| 2291 | | } |
| 2292 | | |
| 2293 | | // Call mode handler for other buttons |
| 2294 | | if (gui_mode->kbd_process) gui_mode->kbd_process(); |
| 2295 | | } |
| 2296 | | |
| 2297 | | //------------------------------------------------------------------- |
| 2298 | | void gui_kbd_enter() |
| 2299 | | { |
| 2300 | | // XXX set custom palette |
| 2301 | | #ifdef OPTIONS_AUTOSAVE |
| 2302 | | conf_store_old_settings(); |
| 2303 | | #endif |
| 2304 | | gui_set_mode(&altGuiHandler); |
| 2305 | | |
| 2306 | | conf_update_prevent_shutdown(); |
| 2307 | | |
| 2308 | | vid_turn_off_updates(); |
| 2309 | | |
| 2310 | | // If user menu set to start automatically when <ALT> mode entered |
| 2311 | | // then enter user menu mode, unless a script was paused by exiting |
| 2312 | | // <ALT> mode when the script was running. |
| 2313 | | gui_user_menu_flag = 0; |
| 2314 | | if ((conf.user_menu_enable == 2) && !state_kbd_script_run) { |
| 2315 | | gui_menu_init(&user_submenu); |
| 2316 | | gui_set_mode(&menuGuiHandler); |
| 2317 | | draw_restore(); |
| 2318 | | gui_user_menu_flag = 1; |
| 2319 | | } |
| 2320 | | |
| 2321 | | } |
| 2322 | | |
| 2323 | | //------------------------------------------------------------------- |
| 2324 | | // Flag to tell SpyTask to unload GUI menu modules |
| 2325 | | static int unload_gui_modules = 0; |
| 2326 | | |
| 2327 | | // Unload GUI menu modules in SpyTask |
| 2328 | | void gui_kbd_unload_modules() |
| 2329 | | { |
| 2330 | | if (unload_gui_modules) |
| 2331 | | { |
| 2332 | | // Unload all modules which are marked as safe to unload, or loaded for menus |
| 2333 | | gui_menu_unload_module_menus(); |
| 2334 | | module_async_unload_allrunned(0); |
| 2335 | | unload_gui_modules = 0; |
| 2336 | | } |
| 2337 | | } |
| 2338 | | |
| 2339 | | void gui_kbd_leave() |
| 2340 | | { |
| 2341 | | // XXX restore palette |
| 2342 | | #ifdef OPTIONS_AUTOSAVE |
| 2343 | | conf_save_new_settings_if_changed(); |
| 2344 | | #endif |
| 2345 | | #ifdef OPT_UBASIC |
| 2346 | | ubasic_error = UBASIC_E_NONE; |
| 2347 | | #endif |
| 2348 | | draw_restore(); |
| 2349 | | rbf_set_codepage(FONT_CP_WIN); |
| 2350 | | vid_turn_on_updates(); |
| 2351 | | gui_set_mode(&defaultGuiHandler); |
| 2352 | | |
| 2353 | | // This is called from the keyboard task |
| 2354 | | // Flag any modules loaded via menus or gui to be unloaded in SpyTask |
| 2355 | | // Unloading them here can lead to conflicts and crashes |
| 2356 | | unload_gui_modules = 1; |
| 2357 | | |
| 2358 | | conf_update_prevent_shutdown(); |
| 2359 | | } |
| 2360 | | |
| 2361 | | //------------------------------------------------------------------- |
| 2362 | | void other_kbd_process(){ |
| 2363 | | int key; |
| 2364 | | #if CAM_AF_SCAN_DURING_VIDEO_RECORD |
| 2365 | | |
| 2366 | | if (is_video_recording()) { |
| 2367 | | if (kbd_is_key_clicked(conf.video_af_key)) MakeAFScan(); |
| 2368 | | } |
| 2369 | | |
| 2370 | | #endif |
| 2371 | | |
| 2372 | | #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO |
| 2373 | | // return from digital to optical zoom in video |
| 2374 | | #if CAM_HAS_ZOOM_LEVER |
| 2375 | | key=KEY_ZOOM_OUT; |
| 2376 | | #else |
| 2377 | | key=KEY_DOWN; |
| 2378 | | #endif |
| 2379 | | if (conf.unlock_optical_zoom_for_video && is_video_recording() && kbd_is_key_clicked(key)){ |
| 2380 | | short x; |
| 2381 | | get_property_case(PROPCASE_DIGITAL_ZOOM_STATE, &x, sizeof(x)); |
| 2382 | | if (x) { |
| 2383 | | get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION, &x, sizeof(x)); |
| 2384 | | #if defined (CAMERA_s90) || defined (CAMERA_s95) || defined (CAMERA_g12) || defined (CAMERA_a3000) || defined (CAMERA_a800) |
| 2385 | | if (x==0) zoom_status=ZOOM_OPTICAL_MAX; //ERR99: No zoom back from digital to optical zoom possible if set to medium |
| 2386 | | #else |
| 2387 | | if (x==0) zoom_status=ZOOM_OPTICAL_MEDIUM; |
| 2388 | | #endif |
| 2389 | | |
| 2390 | | } |
| 2391 | | } |
| 2392 | | #endif |
| 2393 | | |
| 2394 | | #if CAM_EV_IN_VIDEO |
| 2395 | | if (is_video_recording() && !kbd_is_key_pressed(KEY_SHOOT_HALF)){ |
| 2396 | | #if CAM_HAS_ERASE_BUTTON |
| 2397 | | if (kbd_is_key_clicked(KEY_ERASE)){ |
| 2398 | | #else |
| 2399 | | #if !defined (CAMERA_a480) && !defined (CAMERA_a495) |
| 2400 | | if (kbd_is_key_clicked(KEY_DISPLAY)){ |
| 2401 | | #else |
| 2402 | | if (kbd_is_key_clicked(KEY_MENU)){ |
| 2403 | | #endif |
| 2404 | | #endif |
| 2405 | | set_ev_video_avail(!get_ev_video_avail()); |
| 2406 | | #ifdef CAM_TOUCHSCREEN_UI |
| 2407 | | redraw_buttons = 1; |
| 2408 | | #endif |
| 2409 | | } |
| 2410 | | if (get_ev_video_avail()) { |
| 2411 | | if (kbd_is_key_clicked(KEY_LEFT)) { |
| 2412 | | set_ev_video(get_ev_video()-1); |
| 2413 | | } |
| 2414 | | if (kbd_is_key_clicked(KEY_RIGHT)){ |
| 2415 | | set_ev_video(get_ev_video()+1); |
| 2416 | | } |
| 2417 | | } |
| 2418 | | } |
| 2419 | | #endif |
| 2420 | | } |
| 2421 | | |
| 2422 | | void gui_draw_debug_vals_osd() { |
| 2423 | | #ifdef OPT_DEBUGGING |
| 2424 | | |
| 2425 | | #if defined(OPT_EXMEM_TESTING) |
| 2426 | | // Only do memory corruption testing if not recording video |
| 2427 | | if (!MODE_IS_VIDEO(mode_get())) |
| 2428 | | { |
| 2429 | | // If defined the exmem memory is allocated; but not used for CHDK. |
| 2430 | | // It is filled with a guard value (see wrappers.c) which is checked here |
| 2431 | | // Any corruption is reported, otherwise 'OK' is displayed on screen (along with the exmem memory start address). |
| 2432 | | extern void *exmem_start, *exmem_end; |
| 2433 | | // check exmem allocated memory for corruption |
| 2434 | | unsigned long* p = (unsigned long*)exmem_start; |
| 2435 | | unsigned long *f = 0, *l = 0; |
| 2436 | | long cnt = 0; |
| 2437 | | while (p < (unsigned long*)exmem_end) |
| 2438 | | { |
| 2439 | | if (p[0] != 0xDEADBEEF) |
| 2440 | | { |
| 2441 | | l = p; |
| 2442 | | if (f == 0) f = p; |
| 2443 | | cnt++; |
| 2444 | | } |
| 2445 | | p++; |
| 2446 | | } |
| 2447 | | if (cnt != 0) |
| 2448 | | { |
| 2449 | | sprintf(buf, "s:%8x e:%8x", exmem_start, exmem_end); |
| 2450 | | draw_txt_string(2, 12, buf, conf.osd_color); |
| 2451 | | sprintf(buf, "f:%8x l:%8x c:%d", f, l, cnt); |
| 2452 | | } |
| 2453 | | else |
| 2454 | | { |
| 2455 | | sprintf(buf, "OK 0x%x", exmem_start); |
| 2456 | | } |
| 2457 | | draw_txt_string(2, 13, buf, conf.osd_color); |
| 2458 | | // end of check |
| 2459 | | } |
| 2460 | | #endif |
| 2461 | | |
| 2462 | | // DEBUG: "Show misc. values" |
| 2463 | | // change ROW to fit values on screen in draw_txt_string(COLUMN, ROW, ...) |
| 2464 | | // uncomment gui_draw_debug_vals_osd() below if you want debug values always on top |
| 2465 | | if (conf.debug_misc_vals_show) { |
| 2466 | | // show value of Memory Address selected with Memory Browser |
| 2467 | | sprintf(buf, "MEM: %#8x", (void*) (*(int*)conf.mem_view_addr_init)); // show value in Hexadecimal integer |
| 2468 | | //sprintf(buf, "MEM: %8u", (void*) (*(int*)conf.mem_view_addr_init)); // show value in Decimal integer |
| 2469 | | draw_txt_string(28, 9, buf, conf.osd_color); |
| 2470 | | |
| 2471 | | // show Autofocus status (if AF is working) |
| 2472 | | extern volatile long focus_busy; |
| 2473 | | sprintf(buf, "FB: %8u", focus_busy); |
| 2474 | | draw_txt_string(28, 10, buf, conf.osd_color); |
| 2475 | | |
| 2476 | | // show Zoom status (if Lens is moving) |
| 2477 | | extern volatile long zoom_busy; |
| 2478 | | sprintf(buf, "ZB: %8u", zoom_busy); |
| 2479 | | draw_txt_string(28, 11, buf, conf.osd_color); |
| 2480 | | |
| 2481 | | // show USB-Power status to debug remote / sync |
| 2482 | | sprintf(buf, "USB: %8u", get_usb_power(1)); |
| 2483 | | draw_txt_string(28, 12, buf, conf.osd_color); |
| 2484 | | |
| 2485 | | /* |
| 2486 | | // some cameras missing zoom_status |
| 2487 | | sprintf(buf, "ZS: %#8x", zoom_status); |
| 2488 | | draw_txt_string(28, 13, buf, conf.osd_color); |
| 2489 | | */ |
| 2490 | | |
| 2491 | | /* |
| 2492 | | sprintf(buf, "VP: %#8x", vid_get_viewport_fb_d()); |
| 2493 | | draw_txt_string(28, 14, buf, conf.osd_color); |
| 2494 | | */ |
| 2495 | | |
| 2496 | | /* |
| 2497 | | // debug keymap, KEYS_MASKx, SD_READONLY_FLAG, USB_MASK |
| 2498 | | extern long physw_status[3]; |
| 2499 | | sprintf(buf, "PS1: %#8x", physw_status[0]); |
| 2500 | | draw_txt_string(28, 10, buf, conf.osd_color); |
| 2501 | | |
| 2502 | | sprintf(buf, "PS2: %#8x", physw_status[1]); |
| 2503 | | draw_txt_string(28, 11, buf, conf.osd_color); |
| 2504 | | |
| 2505 | | sprintf(buf, "PS3: %#8x", physw_status[2]); |
| 2506 | | draw_txt_string(28, 12, buf, conf.osd_color); |
| 2507 | | */ |
| 2508 | | |
| 2509 | | /* |
| 2510 | | long v=get_file_counter(); |
| 2511 | | sprintf(buf, "1:%03d-%04d", (v>>18)&0x3FF, (v>>4)&0x3FFF); |
| 2512 | | sprintf(buf, "1:%d, %08X", xxxx, eeee); |
| 2513 | | */ |
| 2514 | | } |
| 2515 | | { |
| 2516 | | int r,i, p, len; |
| 2517 | | if (conf.debug_display == DEBUG_DISPLAY_PROPS){ |
| 2518 | | |
| 2519 | | for (i=0;i<10;i++){ |
| 2520 | | r = 0; |
| 2521 | | p = conf.debug_propcase_page*10+i; |
| 2522 | | get_property_case(p, &r, 4); |
| 2523 | | sprintf(buf, "%3d: %d ", p, r); |
| 2524 | | buf[20]=0; |
| 2525 | | draw_string(64,16+16*i,buf, conf.osd_color); |
| 2526 | | } |
| 2527 | | } |
| 2528 | | |
| 2529 | | if (conf.debug_display == DEBUG_DISPLAY_PARAMS){ |
| 2530 | | extern long* FlashParamsTable[]; |
| 2531 | | char s[30]; |
| 2532 | | int count; |
| 2533 | | |
| 2534 | | for (i=0;i<10;i++){ |
| 2535 | | r = 0; |
| 2536 | | p = conf.debug_propcase_page*10+i; |
| 2537 | | if (p>=get_flash_params_count()) { |
| 2538 | | sprintf(buf, "%3d: This parameter does not exists", p); |
| 2539 | | } else { |
| 2540 | | len=FlashParamsTable[p][1]>>16; |
| 2541 | | if ((len==1)||(len==2)||(len==4)){ |
| 2542 | | get_parameter_data(p, &r, len); |
| 2543 | | sprintf(buf, "%3d: %30d :%2d ", p, r,len); |
| 2544 | | } |
| 2545 | | else { |
| 2546 | | if (len>=sizeof(s)) count=sizeof(s)-1; else count=len; |
| 2547 | | get_parameter_data(p, &s, count); |
| 2548 | | s[count]=0; |
| 2549 | | sprintf(buf, "%3d: %30s :%2d ", p, s,len); |
| 2550 | | } |
| 2551 | | } |
| 2552 | | draw_string(16,16+16*i,buf, conf.osd_color); |
| 2553 | | } |
| 2554 | | } |
| 2555 | | } |
| 2556 | | |
| 2557 | | #ifndef CAM_DRYOS |
| 2558 | | if(conf.debug_display == DEBUG_DISPLAY_TASKS) |
| 2559 | | gui_debug_draw_tasklist(); |
| 2560 | | #endif |
| 2561 | | #endif |
| 2562 | | } |
| 2563 | | |
| 2564 | | //------------------------------------------------------------------- |
| 2565 | | // int osd_visible( uint playmode ) // playmode = m&MODE_MASK from gui_draw_osd() |
| 2566 | | // // hide_osd = 0=Don't, 1=In Playback, 2=On Disp Press, 3=Both |
| 2567 | | //------------------------------------------------------------------- |
| 2568 | | int osd_visible(unsigned int playmode) |
| 2569 | | { |
| 2570 | | if ( conf.hide_osd == 0 ) return(1) ; |
| 2571 | | |
| 2572 | | if( !kbd_is_key_pressed(KEY_SHOOT_HALF)) |
| 2573 | | { |
| 2574 | | if (playmode == MODE_REC) |
| 2575 | | { |
| 2576 | | if ( conf.hide_osd < 2 ) return( 1 ) ; |
| 2577 | | |
| 2578 | | #if defined(PARAM_DISPLAY_MODE1) && defined(PARAM_DISPLAY_MODE2) |
| 2579 | | |
| 2580 | | short disp_key_mode ; |
| 2581 | | if (recreview_hold==0) |
| 2582 | | { |
| 2583 | | if ( shooting_get_display_mode() == 0) return( 1 ); |
| 2584 | | } |
| 2585 | | else |
| 2586 | | { |
| 2587 | | if (conf.show_osd_in_review ) |
| 2588 | | { |
| 2589 | | get_parameter_data(PARAM_DISPLAY_MODE2, &disp_key_mode, 2); |
| 2590 | | if (disp_key_mode == 0 ) return( 1 ) ; |
| 2591 | | } |
| 2592 | | } |
| 2593 | | } |
| 2594 | | else |
| 2595 | | { |
| 2596 | | if (conf.hide_osd == 2 ) |
| 2597 | | { |
| 2598 | | short disp_key_mode ; |
| 2599 | | |
| 2600 | | get_parameter_data(PARAM_DISPLAY_MODE1, &disp_key_mode, 2); |
| 2601 | | if (disp_key_mode == 1 ) return( 1 ) ; |
| 2602 | | } |
| 2603 | | } |
| 2604 | | } |
| 2605 | | #else |
| 2606 | | if ( shooting_get_display_mode() == 0) return( 1 ); |
| 2607 | | } |
| 2608 | | } |
| 2609 | | #endif |
| 2610 | | |
| 2611 | | return( 0 ) ; |
| 2612 | | |
| 2613 | | } |
| 2614 | | |
| 2615 | | //------------------------------------------------------------------- |
| 2616 | | // void gui_draw_osd() |
| 2617 | | //------------------------------------------------------------------- |
| 2618 | | void gui_draw_osd() { |
| 2619 | | unsigned int m, mode_photo, mode_video; |
| 2620 | | #if CAM_SWIVEL_SCREEN |
| 2621 | | static int flashlight = 0; |
| 2622 | | #endif |
| 2623 | | static int pressed = 0; |
| 2624 | | static int half_disp_press_old=0; |
| 2625 | | int half_disp_press; |
| 2626 | | int need_restore = 0; |
| 2627 | | m = mode_get(); |
| 2628 | | |
| 2629 | | // DEBUG: uncomment if you want debug values always on top |
| 2630 | | //gui_draw_debug_vals_osd(); |
| 2631 | | |
| 2632 | | #if CAM_SWIVEL_SCREEN |
| 2633 | | if (conf.flashlight && (m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED) && (gui_get_mode()==GUI_MODE_NONE /* || gui_get_mode()==GUI_MODE_ALT */)) { |
| 2634 | | draw_filled_rect(0, 0, camera_screen.width-1, camera_screen.height-1, MAKE_COLOR(COLOR_WHITE, COLOR_WHITE)); |
| 2635 | | flashlight = 1; |
| 2636 | | } |
| 2637 | | if (flashlight) { |
| 2638 | | if ((!((m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED))) || (gui_get_mode()!=GUI_MODE_NONE /* && gui_get_mode()!=GUI_MODE_ALT */)) { |
| 2639 | | flashlight = 0; |
| 2640 | | need_restore = 1; |
| 2641 | | } else { |
| 2642 | | return; |
| 2643 | | } |
| 2644 | | } |
| 2645 | | #endif |
| 2646 | | |
| 2647 | | if (kbd_is_key_pressed(KEY_SHOOT_HALF)) { |
| 2648 | | if (kbd_is_key_pressed(SHORTCUT_TOGGLE_ZEBRA)) { |
| 2649 | | if (!pressed) { |
| 2650 | | conf.zebra_draw = !conf.zebra_draw; |
| 2651 | | if (!conf.zebra_draw) { |
| 2652 | | need_restore = 1; |
| 2653 | | } |
| 2654 | | pressed = 1; |
| 2655 | | } |
| 2656 | | } else if (kbd_is_key_pressed(SHORTCUT_TOGGLE_HISTO)) { |
| 2657 | | if (!pressed) { |
| 2658 | | if (++conf.show_histo>SHOW_HALF) conf.show_histo=0; |
| 2659 | | if (!conf.show_histo) { |
| 2660 | | need_restore = 1; |
| 2661 | | } |
| 2662 | | pressed = 1; |
| 2663 | | } |
| 2664 | | } else if (kbd_is_key_pressed(SHORTCUT_TOGGLE_OSD)) { |
| 2665 | | if (!pressed) { |
| 2666 | | conf.show_osd = !conf.show_osd; |
| 2667 | | if (!conf.show_osd) { |
| 2668 | | need_restore = 1; |
| 2669 | | } |
| 2670 | | pressed = 1; |
| 2671 | | } |
| 2672 | | } else if (kbd_is_key_pressed(SHORTCUT_DISABLE_OVERRIDES)) { |
| 2673 | | if (!pressed) { |
| 2674 | | if (conf.override_disable < 2) conf.override_disable = !conf.override_disable; |
| 2675 | | if (!conf.show_osd) { |
| 2676 | | need_restore = 1; |
| 2677 | | } |
| 2678 | | pressed = 1; |
| 2679 | | } |
| 2680 | | } |
| 2681 | | #if !CAM_HAS_MANUAL_FOCUS && CAM_HAS_ZOOM_LEVER && CAM_CAN_SD_OVERRIDE |
| 2682 | | // Todo, check for AF and if its running, don't override |
| 2683 | | else if (kbd_is_key_pressed(SHORTCUT_SD_SUB)) { |
| 2684 | | if (!pressed) { |
| 2685 | | if (!(conf.override_disable==1) && shooting_can_focus() && shooting_get_common_focus_mode()) { |
| 2686 | | gui_subj_dist_override_value_enum(-1,0); |
| 2687 | | shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); |
| 2688 | | //pressed = 1; |
| 2689 | | } |
| 2690 | | } |
| 2691 | | } else if (kbd_is_key_pressed(SHORTCUT_SD_ADD)) { |
| 2692 | | if (!pressed) { |
| 2693 | | if (!(conf.override_disable==1) && shooting_can_focus() && shooting_get_common_focus_mode()) { |
| 2694 | | gui_subj_dist_override_value_enum(1,0); |
| 2695 | | shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); |
| 2696 | | //pressed = 1; |
| 2697 | | } |
| 2698 | | } |
| 2699 | | } |
| 2700 | | #endif |
| 2701 | | else { |
| 2702 | | pressed = 0; |
| 2703 | | } |
| 2704 | | } else { |
| 2705 | | pressed = 0; |
| 2706 | | } |
| 2707 | | |
| 2708 | | // TODO some of the ifs below should probably use this |
| 2709 | | mode_video = MODE_IS_VIDEO(m); |
| 2710 | | |
| 2711 | | mode_photo = (m&MODE_MASK) == MODE_PLAY || |
| 2712 | | !( mode_video || |
| 2713 | | (m&MODE_SHOOTING_MASK)==MODE_STITCH); |
| 2714 | | |
| 2715 | | half_disp_press=mode_photo && kbd_is_key_pressed(KEY_SHOOT_HALF) && kbd_is_key_pressed(KEY_DISPLAY); |
| 2716 | | if (half_disp_press && ! half_disp_press_old) |
| 2717 | | need_restore = 1; |
| 2718 | | half_disp_press_old=half_disp_press; |
| 2719 | | |
| 2720 | | if (need_restore) |
| 2721 | | draw_restore(); |
| 2722 | | |
| 2723 | | if (half_disp_press) |
| 2724 | | return; |
| 2725 | | |
| 2726 | | if (conf.zebra_draw) |
| 2727 | | if (module_zebra_load()) |
| 2728 | | if (libzebra->gui_osd_draw_zebra(conf.zebra_draw && gui_get_mode()==GUI_MODE_NONE && |
| 2729 | | kbd_is_key_pressed(KEY_SHOOT_HALF) && mode_photo && |
| 2730 | | !state_kbd_script_run)) {// no zebra when script running, to save mem |
| 2731 | | return; // if zebra drawn, we're done |
| 2732 | | } |
| 2733 | | #if !CAM_SHOW_OSD_IN_SHOOT_MENU |
| 2734 | | if (!(conf.show_osd && (canon_menu_active==(int)&canon_menu_active-4) && (canon_shoot_menu_active==0))) return; |
| 2735 | | #else |
| 2736 | | if (!(conf.show_osd && (canon_menu_active==(int)&canon_menu_active-4) /*&& (canon_shoot_menu_active==0)*/ )) return; |
| 2737 | | #endif |
| 2738 | | |
| 2739 | | |
| 2740 | | if ((gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT) && ( |
| 2741 | | (kbd_is_key_pressed(KEY_SHOOT_HALF) && ((conf.show_histo==SHOW_HALF)/* || (m&MODE_MASK) == MODE_PLAY*/)) || |
| 2742 | | ((conf.show_histo==SHOW_ALWAYS) && /* !((m&MODE_MASK) == MODE_PLAY) && */ (recreview_hold==0)) |
| 2743 | | ) && |
| 2744 | | (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH)) { |
| 2745 | | gui_osd_draw_histo(); |
| 2746 | | } |
| 2747 | | |
| 2748 | | if ((m&MODE_MASK) == MODE_REC && (recreview_hold==0 || conf.show_osd_in_review) ) { |
| 2749 | | if (conf.show_grid_lines) |
| 2750 | | if (module_grids_load()) |
| 2751 | | libgrids->gui_grid_draw_osd(1); |
| 2752 | | if ((gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT) && (((kbd_is_key_pressed(KEY_SHOOT_HALF) || (state_kbd_script_run) || (shooting_get_common_focus_mode())) && (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH )) || ((mode_video || is_video_recording()) && conf.show_values_in_video) )) { |
| 2753 | | |
| 2754 | | if (conf.show_dof!=DOF_DONT_SHOW) gui_osd_calc_dof(); |
| 2755 | | |
| 2756 | | if ((conf.show_dof==DOF_SHOW_IN_DOF) || (conf.show_dof==DOF_SHOW_IN_DOF_EX)) gui_osd_draw_dof(); |
| 2757 | | |
| 2758 | | if (conf.values_show_real_iso || conf.values_show_market_iso || conf.values_show_ev_seted || conf.values_show_ev_measured || conf.values_show_bv_measured || conf.values_show_bv_seted || conf.values_show_overexposure || conf.values_show_canon_overexposure || conf.values_show_luminance) gui_osd_calc_expo_param(); |
| 2759 | | } |
| 2760 | | if (conf.show_state) gui_osd_draw_state(); |
| 2761 | | if (conf.save_raw && conf.show_raw_state && !mode_video && (!kbd_is_key_pressed(KEY_SHOOT_HALF))) gui_osd_draw_raw_info(); |
| 2762 | | |
| 2763 | | if ((conf.show_values==SHOW_ALWAYS && mode_photo) || ((mode_video || is_video_recording())&& conf.show_values_in_video) || ((kbd_is_key_pressed(KEY_SHOOT_HALF) || (recreview_hold==1)) && (conf.show_values==SHOW_HALF))) |
| 2764 | | gui_osd_draw_values(1); |
| 2765 | | else if (shooting_get_common_focus_mode() && mode_photo && conf.show_values && !((conf.show_dof==DOF_SHOW_IN_DOF) || (conf.show_dof==DOF_SHOW_IN_DOF_EX))) |
| 2766 | | gui_osd_draw_values(2); |
| 2767 | | else if (conf.show_values==SHOW_HALF) |
| 2768 | | gui_osd_draw_values(0); |
| 2769 | | } |
| 2770 | | |
| 2771 | | if ( osd_visible(m&MODE_MASK) ) |
| 2772 | | { |
| 2773 | | gui_batt_draw_osd(); |
| 2774 | | gui_space_draw_osd(); |
| 2775 | | gui_usb_draw_osd(); |
| 2776 | | if(conf.show_temp>0) gui_osd_draw_temp(); |
| 2777 | | #ifdef CAM_HAS_GPS |
| 2778 | | if (((int)conf.gps_on_off ==1) && (exit_gps_data==1)) |
| 2779 | | { |
| 2780 | | _CreateTask("GPSDATA", 0x19, 0x400, gps_get_data, 0); |
| 2781 | | exit_gps_data=0; |
| 2782 | | } |
| 2783 | | #endif |
| 2784 | | if (conf.fast_ev && !mode_video && (m&MODE_MASK) == MODE_REC ) gui_osd_draw_ev(); |
| 2785 | | } |
| 2786 | | |
| 2787 | | if ( conf.show_clock ) |
| 2788 | | { |
| 2789 | | if ( osd_visible(m&MODE_MASK) || ( kbd_is_key_pressed(KEY_SHOOT_HALF) && conf.clock_halfpress==0) ) gui_osd_draw_clock(0,0,0); |
| 2790 | | else if ( kbd_is_key_pressed(KEY_SHOOT_HALF) && conf.clock_halfpress==1 ) gui_osd_draw_seconds(); |
| 2791 | | } |
| 2792 | | |
| 2793 | | if ( conf.show_movie_time > 0 && (mode_video || is_video_recording())) gui_osd_draw_movie_time_left(); |
| 2794 | | |
| 2795 | | #if CAM_DRAW_EXPOSITION |
| 2796 | | if (gui_get_mode()==GUI_MODE_NONE && kbd_is_key_pressed(KEY_SHOOT_HALF) && ((m&MODE_MASK)==MODE_REC) && ((m&MODE_SHOOTING_MASK))!=MODE_VIDEO_STD && (m&MODE_SHOOTING_MASK)!=MODE_VIDEO_COMPACT) { |
| 2797 | | strcpy(buf,shooting_get_tv_str()); |
| 2798 | | strcat(buf,"\" F"); |
| 2799 | | strcat(buf,shooting_get_av_str()); |
| 2800 | | draw_txt_string(22-strlen(buf)/2, 14, buf, conf.osd_color); |
| 2801 | | } |
| 2802 | | #endif |
| 2803 | | |
| 2804 | | #if CAM_EV_IN_VIDEO |
| 2805 | | if (is_video_recording()) gui_osd_draw_ev_video(get_ev_video_avail()); |
| 2806 | | #endif |
| 2807 | | |
| 2808 | | gui_draw_debug_vals_osd(); |
| 2809 | | |
| 2810 | | #ifdef OPT_UBASIC |
| 2811 | | if (ubasic_error){ |
| 2812 | | const char *msg; |
| 2813 | | if (ubasic_error >= UBASIC_E_ENDMARK) { |
| 2814 | | msg = ubasic_errstrings[UBASIC_E_UNKNOWN_ERROR]; |
| 2815 | | } else { |
| 2816 | | msg = ubasic_errstrings[ubasic_error]; |
| 2817 | | } |
| 2818 | | sprintf(buf, "uBASIC:%d %s ", ubasic_linenumber(), msg); |
| 2819 | | draw_txt_string(0, 0, buf, MAKE_COLOR(COLOR_RED, COLOR_YELLOW)); |
| 2820 | | } |
| 2821 | | #endif |
| 2822 | | } |
| 2823 | | |
| 2824 | | #ifndef OPTIONS_AUTOSAVE |
| 2825 | | //------------------------------------------------------------------- |
| 2826 | | void gui_menuproc_save(int arg) |
| 2827 | | { |
| 2828 | | conf_save(); |
| 2829 | | } |
| 2830 | | #endif |
| 2831 | | |
| 2832 | | //------------------------------------------------------------------- |
| 2833 | | static void gui_menuproc_reset_selected(unsigned int btn) { |
| 2834 | | if (btn==MBOX_BTN_YES) |
| 2835 | | conf_load_defaults(); |
| 2836 | | } |
| 2837 | | |
| 2838 | | void gui_menuproc_reset(int arg) |
| 2839 | | { |
| 2840 | | gui_mbox_init(LANG_MSG_RESET_OPTIONS_TITLE, |
| 2841 | | LANG_MSG_RESET_OPTIONS_TEXT, |
| 2842 | | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER|MBOX_BTN_YES_NO|MBOX_DEF_BTN2, gui_menuproc_reset_selected); |
| 2843 | | } |
| 2844 | | |
| 2845 | | //------------------------------------------------------------------- |
| 2846 | | void gui_show_build_info(int arg) { |
| 2847 | | static char comp[64]; |
| 2848 | | |
| 2849 | | #ifdef __GNUC__ |
| 2850 | | # ifndef __GNUC_PATCHLEVEL__ |
| 2851 | | # define __GNUC_PATCHLEVEL 0 |
| 2852 | | # endif |
| 2853 | | sprintf(comp, "GCC %d.%d.%d", __GNUC__ ,__GNUC_MINOR__,__GNUC_PATCHLEVEL__ ); |
| 2854 | | #else |
| 2855 | | sprintf(comp, "UNKNOWN" ); |
| 2856 | | #endif |
| 2857 | | sprintf(buf, lang_str(LANG_MSG_BUILD_INFO_TEXT), HDK_VERSION, BUILD_NUMBER, BUILD_SVNREV, __DATE__, __TIME__, PLATFORM, PLATFORMSUB, comp); |
| 2858 | | gui_mbox_init(LANG_MSG_BUILD_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_LEFT, NULL); |
| 2859 | | } |
| 2860 | | |
| 2861 | | //------------------------------------------------------------------- |
| 2862 | | void gui_show_memory_info(int arg) { |
| 2863 | | sprintf(buf, lang_str(LANG_MSG_MEMORY_INFO_TEXT), core_get_free_memory(), MEMISOSIZE, &_start, &_end); |
| 2864 | | gui_mbox_init(LANG_MSG_MEMORY_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
| 2865 | | } |
| 2866 | | |
| 2867 | | //------------------------------------------------------------------- |
| 2868 | | void gui_menu_run_fltmodule(int arg) { |
| 2869 | | module_run((char*)arg, 0, 0,0, UNLOAD_IF_ERR); |
| 2870 | | } |
| 2871 | | |
| 2872 | | //------------------------------------------------------------------- |
| 2873 | | #if defined(VER_CHDK) |
| 2874 | | #define LOGO_WIDTH 149 |
| 2875 | | #define LOGO_HEIGHT 84 |
| 2876 | | #else |
| 2877 | | #define LOGO_WIDTH 169 |
| 2878 | | #define LOGO_HEIGHT 74 |
| 2879 | | #endif |
| 2880 | | |
| 2881 | | void gui_draw_splash(char* logo, int logo_size) { |
| 2882 | | coord w, h, x, y; |
| 2883 | | static const char *text[] = { |
| 2884 | | "CHDK Version '" HDK_VERSION " " BUILD_NUMBER "-" BUILD_SVNREV "'" , |
| 2885 | | "Build: " __DATE__ " " __TIME__ , |
| 2886 | | "Camera: " PLATFORM " - " PLATFORMSUB }; |
| 2887 | | int i, l; |
| 2888 | | color cl = MAKE_COLOR(COLOR_RED, COLOR_WHITE); |
| 2889 | | |
| 2890 | | gui_splash_mode = (mode_get()&MODE_MASK); |
| 2891 | | |
| 2892 | | h=sizeof(text)/sizeof(text[0])*FONT_HEIGHT+8; |
| 2893 | | w=0; |
| 2894 | | for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { |
| 2895 | | l=strlen(text[i]); |
| 2896 | | if (l>w) w=l; |
| 2897 | | } |
| 2898 | | w=w*FONT_WIDTH+10; |
| 2899 | | |
| 2900 | | x = (camera_screen.width-w)>>1; y = ((camera_screen.height-h)>>1) + 20; |
| 2901 | | draw_filled_round_rect(x, y, x+w, y+h, MAKE_COLOR(COLOR_RED, COLOR_RED)); |
| 2902 | | for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { |
| 2903 | | draw_string(x+((w-strlen(text[i])*FONT_WIDTH)>>1), y+i*FONT_HEIGHT+4, text[i], cl); |
| 2904 | | } |
| 2905 | | if(logo){ |
| 2906 | | int pos; |
| 2907 | | int mx=0; |
| 2908 | | int my=0; |
| 2909 | | int offset_x = (CAM_SCREEN_WIDTH-LOGO_WIDTH)>>1; |
| 2910 | | int offset_y = ((CAM_SCREEN_HEIGHT-LOGO_HEIGHT)>>1) - 42; |
| 2911 | | const color color_lookup[8] = {COLOR_BLACK, |
| 2912 | | COLOR_SPLASH_RED/*0x2E redish*/, |
| 2913 | | COLOR_RED, |
| 2914 | | COLOR_GREY /*0x3D*/, |
| 2915 | | COLOR_SPLASH_GREY /*0x1F*/, |
| 2916 | | COLOR_SPLASH_PINK /*0x21 pinkish*/, |
| 2917 | | COLOR_TRANSPARENT /*0x00*/, |
| 2918 | | COLOR_WHITE /*0x11*/}; |
| 2919 | | for(pos=0; pos<logo_size; pos++){ |
| 2920 | | char data = logo[pos]; |
| 2921 | | color c = color_lookup[(data>>5) & 0x07]; |
| 2922 | | for(i=0; i<(data&0x1F)+1; i++){ |
| 2923 | | if (c!=0x00){ |
| 2924 | | draw_pixel(offset_x+mx,offset_y+my,c); |
| 2925 | | } |
| 2926 | | if (mx==LOGO_WIDTH){ |
| 2927 | | mx=0; |
| 2928 | | my++; |
| 2929 | | }else{ |
| 2930 | | mx++; |
| 2931 | | } |
| 2932 | | } |
| 2933 | | } |
| 2934 | | } |
| 2935 | | } |
| 2936 | | |
| 2937 | | //------------------------------------------------------------------- |
| 2938 | | void gui_draw_fselect(int arg) { |
| 2939 | | module_fselect_init(LANG_STR_FILE_BROWSER, "A", "A", NULL); |
| 2940 | | } |
| 2941 | | |
| 2942 | | //------------------------------------------------------------------- |
| 2943 | | void gui_menuproc_mkbootdisk(int arg) { |
| 2944 | | mark_filesystem_bootable(); |
| 2945 | | gui_mbox_init(LANG_INFORMATION, LANG_CONSOLE_TEXT_FINISHED, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| 2946 | | } |
| 2947 | | |
| 2948 | | //------------------------------------------------------------------- |
| 2949 | | static void gui_draw_menu_rbf_selected(const char *fn) { |
| 2950 | | if (fn) { |
| 2951 | | strcpy(conf.menu_rbf_file, fn); |
| 2952 | | rbf_load_from_file(conf.menu_rbf_file, FONT_CP_WIN); |
| 2953 | | gui_menu_init(NULL); |
| 2954 | | } |
| 2955 | | } |
| 2956 | | void gui_draw_load_menu_rbf(int arg) { |
| 2957 | | module_fselect_init(LANG_STR_SELECT_FONT_FILE, conf.menu_rbf_file, "A/CHDK/FONTS", gui_draw_menu_rbf_selected); |
| 2958 | | } |
| 2959 | | |
| 2960 | | //------------------------------------------------------------------- |
| 2961 | | static void gui_draw_symbol_rbf_selected(const char *fn) { |
| 2962 | | if (fn) { |
| 2963 | | strcpy(conf.menu_symbol_rbf_file, fn); |
| 2964 | | if(!rbf_load_symbol(conf.menu_symbol_rbf_file)) conf.menu_symbol_enable=0; //AKA |
| 2965 | | gui_menu_init(NULL); |
| 2966 | | } |
| 2967 | | } |
| 2968 | | void gui_draw_load_symbol_rbf(int arg) { |
| 2969 | | module_fselect_init(LANG_STR_SELECT_SYMBOL_FILE, conf.menu_symbol_rbf_file, "A/CHDK/SYMBOLS", gui_draw_symbol_rbf_selected); |
| 2970 | | } |
| 2971 | | |
| 2972 | | //------------------------------------------------------------------- |
| 2973 | | static void gui_draw_lang_selected(const char *fn) { |
| 2974 | | if (fn) { |
| 2975 | | strcpy(conf.lang_file, fn); |
| 2976 | | lang_load_from_file(conf.lang_file); |
| 2977 | | gui_menu_init(NULL); |
| 2978 | | } |
| 2979 | | } |
| 2980 | | void gui_draw_load_lang(int arg) { |
| 2981 | | module_fselect_init(LANG_STR_SELECT_LANG_FILE, conf.lang_file, "A/CHDK/LANG", gui_draw_lang_selected); |
| 2982 | | } |
| 2983 | | |
| 2984 | | #ifdef OPT_DEBUGGING |
| 2985 | | |
| 2986 | | void gui_compare_props(int arg) |
| | 316 | |
| | 317 | static void gui_compare_props(int arg) |
| 3069 | | #endif |
| | 400 | static const char* gui_debug_shortcut_modes[] = { "None", "DmpRAM", "Page", "CmpProps"}; |
| | 401 | #ifdef CAM_DRYOS |
| | 402 | static const char* gui_debug_display_modes[] = { "None", "Props", "Params" }; |
| | 403 | #else |
| | 404 | static const char* gui_debug_display_modes[] = { "None", "Props", "Params", "Tasks"}; |
| | 405 | #endif |
| | 406 | |
| | 407 | static CMenuItem debug_submenu_items[] = { |
| | 408 | MENU_ENUM2 (0x5c,LANG_MENU_DEBUG_DISPLAY, &conf.debug_display, gui_debug_display_modes ), |
| | 409 | MENU_ITEM (0x2a,LANG_MENU_DEBUG_PROPCASE_PAGE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.debug_propcase_page, MENU_MINMAX(0, 128) ), |
| | 410 | #ifndef CAM_DRYOS |
| | 411 | MENU_ITEM (0x2a,LANG_MENU_DEBUG_TASKLIST_START, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &debug_tasklist_start, MENU_MINMAX(0, 63) ), |
| | 412 | #endif |
| | 413 | MENU_ITEM (0x5c,LANG_MENU_DEBUG_SHOW_MISC_VALS, MENUITEM_BOOL, &conf.debug_misc_vals_show, 0 ), |
| | 414 | MENU_ITEM (0x2a,LANG_MENU_DEBUG_MEMORY_BROWSER, MENUITEM_PROC, gui_menu_run_fltmodule, "memview.flt" ), |
| | 415 | MENU_ITEM (0x2a,LANG_MENU_DEBUG_BENCHMARK, MENUITEM_PROC, gui_menu_run_fltmodule, "benchm.flt" ), |
| | 416 | MENU_ENUM2 (0x5c,LANG_MENU_DEBUG_SHORTCUT_ACTION, &conf.debug_shortcut_action, gui_debug_shortcut_modes ), |
| | 417 | #ifdef OPT_LUA |
| | 418 | MENU_ITEM (0x5c,LANG_MENU_LUA_RESTART, MENUITEM_BOOL, &conf.debug_lua_restart_on_error, 0 ), |
| | 419 | #endif |
| | 420 | MENU_ITEM (0x2a,LANG_SAVE_ROMLOG, MENUITEM_PROC, save_romlog, 0 ), |
| | 421 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 422 | {0} |
| | 423 | }; |
| | 424 | |
| | 425 | static CMenu debug_submenu = {0x2a,LANG_MENU_DEBUG_TITLE, NULL, debug_submenu_items }; |
| | 426 | |
| | 427 | #endif |
| | 428 | |
| | 429 | //------------------------------------------------------------------- |
| | 430 | |
| | 431 | #ifdef CAM_HAS_GPS |
| | 432 | |
| | 433 | // forward reference |
| | 434 | static CMenuItem gps_submenu_items[]; |
| | 435 | |
| | 436 | int exit_gpx_record=1; |
| | 437 | int exit_gps_kompass=1; |
| | 438 | int exit_gps_navi=1; |
| | 439 | |
| | 440 | static void gpx_start_stop(int arg) |
| | 441 | { |
| | 442 | int i = 0; |
| | 443 | while( gps_submenu_items[i].value != (int*)gpx_start_stop ) i++; //find entry |
| | 444 | if( gps_submenu_items[i].text == LANG_MENU_GPS_TRACK_START ) { //toggle text |
| | 445 | gps_submenu_items[i].text = LANG_MENU_GPS_TRACK_STOP; |
| | 446 | exit_gpx_record = 0; |
| | 447 | init_gpx_record_task(); |
| | 448 | |
| | 449 | } else { |
| | 450 | gps_submenu_items[i].text = LANG_MENU_GPS_TRACK_START; |
| | 451 | exit_gpx_record = 1; |
| | 452 | } |
| | 453 | } |
| | 454 | |
| | 455 | static void show_kompass(int arg) |
| | 456 | { |
| | 457 | int i = 0; |
| | 458 | while( gps_submenu_items[i].value != (int*)show_kompass ) i++; //find entry |
| | 459 | if( gps_submenu_items[i].text == LANG_MENU_GPS_KOMPASS_SHOW ) { //toggle text |
| | 460 | gps_submenu_items[i].text = LANG_MENU_GPS_KOMPASS_HIDE; |
| | 461 | exit_gps_kompass = 0; |
| | 462 | init_gps_kompass_task(); |
| | 463 | |
| | 464 | } else { |
| | 465 | gps_submenu_items[i].text = LANG_MENU_GPS_KOMPASS_SHOW; |
| | 466 | exit_gps_kompass = 1; |
| | 467 | } |
| | 468 | } |
| | 469 | |
| | 470 | static void show_navi(int arg) |
| | 471 | { |
| | 472 | int i = 0; |
| | 473 | while( gps_submenu_items[i].value != (int*)show_navi ) i++; //find entry |
| | 474 | if( gps_submenu_items[i].text == LANG_MENU_GPS_NAVI_SHOW ) { //toggle text |
| | 475 | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HIDE; |
| | 476 | exit_gpx_record = 0; |
| | 477 | exit_gps_navi = 0; |
| | 478 | exit_gps_kompass = 0; |
| | 479 | init_gps_trackback_task(); |
| | 480 | |
| | 481 | } else { |
| | 482 | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_SHOW; |
| | 483 | exit_gps_navi = 1; |
| | 484 | exit_gps_kompass = 1; |
| | 485 | exit_gpx_record = 1; |
| | 486 | } |
| | 487 | } |
| | 488 | |
| | 489 | static void navigate_home(int arg) |
| | 490 | { |
| | 491 | int i = 0; |
| | 492 | while( gps_submenu_items[i].value != (int*)navigate_home ) i++; //find entry |
| | 493 | if( gps_submenu_items[i].text == LANG_MENU_GPS_NAVI_HOME ) { //toggle text |
| | 494 | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HOME_END; |
| | 495 | exit_gpx_record = 0; |
| | 496 | exit_gps_navi = 0; |
| | 497 | exit_gps_kompass = 0; |
| | 498 | gps_navigate_home(); |
| | 499 | |
| | 500 | } else { |
| | 501 | gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HOME; |
| | 502 | exit_gps_navi = 1; |
| | 503 | exit_gps_kompass = 1; |
| | 504 | exit_gpx_record = 1; |
| | 505 | } |
| | 506 | } |
| | 507 | |
| | 508 | static void mark_timezone(int arg) |
| | 509 | { |
| | 510 | write_timezone(); |
| | 511 | } |
| | 512 | |
| | 513 | static void mark_home(int arg) |
| | 514 | { |
| | 515 | write_home(); |
| | 516 | } |
| | 517 | |
| | 518 | static CMenuItem gps_logging_items[] = { |
| | 519 | MENU_ITEM (0x2a,LANG_MENU_GPS_TRACK_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_track_time, MENU_MINMAX(1, 60) ), |
| | 520 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 521 | MENU_ITEM (0x2a,LANG_MENU_GPS_TRACK_SYMBOL, MENUITEM_BOOL, &conf.gps_track_symbol, 0 ), |
| | 522 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 523 | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_SET_1, MENUITEM_BOOL, &conf.gps_rec_play_set_1, 0 ), |
| | 524 | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_TIME_1, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_rec_play_time_1, MENU_MINMAX(1, 60) ), |
| | 525 | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_SET_1, MENUITEM_BOOL, &conf.gps_play_dark_set_1, 0 ), |
| | 526 | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_TIME_1, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_play_dark_time_1, MENU_MINMAX(1, 60) ), |
| | 527 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 528 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 529 | {0} |
| | 530 | }; |
| | 531 | |
| | 532 | static CMenu gps_logging_submenu = {0x86,LANG_MENU_GPS_LOGGING, NULL, gps_logging_items }; |
| | 533 | |
| | 534 | static CMenuItem gps_tagging_items[] = { |
| | 535 | MENU_ITEM (0x5c,LANG_MENU_GPS_WAYPOINT_SAVE, MENUITEM_BOOL, &conf.gps_waypoint_save, 0 ), |
| | 536 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 537 | MENU_ITEM (0x2a,LANG_MENU_GPS_WAIT_FOR_SIGNAL, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_wait_for_signal, MENU_MINMAX(1, 599) ), |
| | 538 | MENU_ITEM (0x2a,LANG_MENU_GPS_WAIT_FOR_SIGNAL_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_wait_for_signal_time, MENU_MINMAX(1, 60) ), |
| | 539 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 540 | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_SET, MENUITEM_BOOL, &conf.gps_rec_play_set, 0 ), |
| | 541 | MENU_ITEM (0x2a,LANG_MENU_GPS_REC_PLAY_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_rec_play_time, MENU_MINMAX(1, 60) ), |
| | 542 | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_SET, MENUITEM_BOOL, &conf.gps_play_dark_set, 0 ), |
| | 543 | MENU_ITEM (0x2a,LANG_MENU_GPS_PLAY_DARK_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_play_dark_time, MENU_MINMAX(1, 60) ), |
| | 544 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 545 | MENU_ITEM (0x5c,LANG_MENU_GPS_COUNTDOWN, MENUITEM_BOOL, &conf.gps_countdown , 0 ), |
| | 546 | // MENU_ITEM (0x5c,LANG_MENU_GPS_COUNTDOWN_BLINK, MENUITEM_BOOL, &conf.gps_countdown_blink, 0 ), |
| | 547 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 548 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 549 | {0} |
| | 550 | }; |
| | 551 | |
| | 552 | static CMenu gps_tagging_submenu = {0x86,LANG_MENU_GPS_TAGGING, NULL, gps_tagging_items }; |
| | 553 | |
| | 554 | static CMenuItem gps_navigation_items[] = { |
| | 555 | MENU_ITEM (0x2a,LANG_MENU_GPS_KOMPASS_SMOOTH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_kompass_smooth, MENU_MINMAX(1, 40) ), |
| | 556 | MENU_ITEM (0x2a,LANG_MENU_GPS_KOMPASS_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_kompass_time, MENU_MINMAX(1, 60) ), |
| | 557 | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVI_TIME, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_navi_time, MENU_MINMAX(1, 60) ), |
| | 558 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 559 | MENU_ITEM (0x2a,LANG_MENU_GPS_MARK_HOME, MENUITEM_PROC, (int*)mark_home, 0 ), |
| | 560 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 561 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 562 | {0} |
| | 563 | }; |
| | 564 | |
| | 565 | static CMenu gps_navigation_submenu = {0x86,LANG_MENU_GPS_NAVIGATION, NULL, gps_navigation_items }; |
| | 566 | |
| | 567 | static const char* gui_gps_sat_fix[] = { "immer", "2D", "3D", "2D/3D" }; |
| | 568 | |
| | 569 | static CMenuItem gps_values_items[] = { |
| | 570 | MENU_ITEM (0x2a,LANG_MENU_GPS_BATT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.gps_batt, MENU_MINMAX(0, 99) ), |
| | 571 | MENU_ITEM (0x2a,LANG_MENU_GPS_BATT_WARNING, MENUITEM_BOOL, &conf.gps_batt_warn, 0 ), |
| | 572 | MENU_ITEM (0x2a,LANG_MENU_GPS_BEEP_WARNING, MENUITEM_BOOL, &conf.gps_beep_warn, 0 ), |
| | 573 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 574 | MENU_ENUM2 (0x69,LANG_MENU_GPS_2D_3D_FIX, &conf.gps_2D_3D_fix, gui_gps_sat_fix ), |
| | 575 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 576 | MENU_ITEM (0x2a,LANG_MENU_GPS_SYMBOL_SHOW, MENUITEM_BOOL, &conf.gps_show_symbol, 0 ), |
| | 577 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 578 | MENU_ITEM (0x2a,LANG_MENU_GPS_TEST_TIMEZONE, MENUITEM_BOOL, &conf.gps_test_timezone, 0 ), |
| | 579 | MENU_ITEM (0x2a,LANG_MENU_GPS_MARK_TIMEZONE, MENUITEM_PROC, (int*)mark_timezone, 0 ), |
| | 580 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 581 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 582 | {0} |
| | 583 | }; |
| | 584 | |
| | 585 | static CMenu gps_values_submenu = {0x86,LANG_MENU_GPS_VALUES, NULL, gps_values_items }; |
| | 586 | |
| | 587 | static CMenuItem gps_submenu_items[] = { |
| | 588 | MENU_ITEM (0x2a,LANG_MENU_GPS_ON_OFF, MENUITEM_BOOL, &conf.gps_on_off, 0 ), |
| | 589 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 590 | MENU_ITEM (0x2a,LANG_MENU_GPS_KOMPASS_SHOW, MENUITEM_PROC, (int*)show_kompass, 0 ), |
| | 591 | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVI_SHOW, MENUITEM_PROC, (int*)show_navi, 0 ), |
| | 592 | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVI_HOME, MENUITEM_PROC, (int*)navigate_home, 0 ), |
| | 593 | MENU_ITEM (0x2a,LANG_MENU_GPS_TRACK_START, MENUITEM_PROC, (int*)gpx_start_stop, 0 ), |
| | 594 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 595 | MENU_ITEM (0x2a,LANG_MENU_GPS_VALUES, MENUITEM_SUBMENU, &gps_values_submenu, 0 ), |
| | 596 | MENU_ITEM (0x2a,LANG_MENU_GPS_LOGGING, MENUITEM_SUBMENU, &gps_logging_submenu, 0 ), |
| | 597 | MENU_ITEM (0x2a,LANG_MENU_GPS_TAGGING, MENUITEM_SUBMENU, &gps_tagging_submenu, 0 ), |
| | 598 | MENU_ITEM (0x2a,LANG_MENU_GPS_NAVIGATION, MENUITEM_SUBMENU, &gps_navigation_submenu, 0 ), |
| | 599 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 600 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 601 | {0} |
| | 602 | }; |
| | 603 | |
| | 604 | static CMenu gps_submenu = {0x2a,LANG_MENU_GPS, NULL, gps_submenu_items }; |
| | 605 | |
| | 606 | #endif |
| | 607 | |
| | 608 | //------------------------------------------------------------------- |
| | 609 | |
| | 610 | static void gui_draw_read_selected(const char *fn) |
| | 611 | { |
| | 612 | if (fn) { |
| | 613 | unsigned int argv[] ={ (unsigned int)fn }; |
| | 614 | module_run("txtread.flt", 0, sizeof(argv)/sizeof(argv[0]), argv, UNLOAD_IF_ERR); |
| | 615 | } |
| | 616 | } |
| | 617 | |
| | 618 | static void gui_draw_read(int arg) |
| | 619 | { |
| | 620 | module_fselect_init_w_mode(LANG_STR_SELECT_TEXT_FILE, conf.reader_file, "A/CHDK/BOOKS", gui_draw_read_selected, 1); |
| | 621 | } |
| | 622 | |
| | 623 | static void gui_draw_read_last(int arg) |
| | 624 | { |
| | 625 | struct stat st; |
| | 626 | if (stat(conf.reader_file,&st) == 0) { |
| | 627 | gui_draw_read_selected(conf.reader_file); |
| | 628 | } else { |
| | 629 | gui_draw_read(arg); |
| | 630 | } |
| | 631 | } |
| | 632 | |
| | 633 | static void gui_draw_rbf_selected(const char *fn) |
| | 634 | { |
| | 635 | if (fn) { |
| | 636 | strcpy(conf.reader_rbf_file, fn); |
| | 637 | } |
| | 638 | } |
| | 639 | |
| | 640 | static void gui_draw_load_rbf(int arg) |
| | 641 | { |
| | 642 | module_fselect_init(LANG_STR_SELECT_FONT_FILE, conf.reader_rbf_file, "A/CHDK/FONTS", gui_draw_rbf_selected); |
| | 643 | } |
| | 644 | |
| | 645 | static const char* gui_reader_codepage_cps[] = { "Win1251", "DOS"}; |
| | 646 | static CMenuItem reader_submenu_items[] = { |
| | 647 | MENU_ITEM(0x35,LANG_MENU_READ_OPEN_NEW, MENUITEM_PROC, gui_draw_read, 0 ), |
| | 648 | MENU_ITEM(0x35,LANG_MENU_READ_OPEN_LAST, MENUITEM_PROC, gui_draw_read_last, 0 ), |
| | 649 | MENU_ITEM(0x35,LANG_MENU_READ_SELECT_FONT, MENUITEM_PROC, gui_draw_load_rbf, 0 ), |
| | 650 | MENU_ENUM2(0x5f,LANG_MENU_READ_CODEPAGE, &conf.reader_codepage, gui_reader_codepage_cps ), |
| | 651 | MENU_ITEM(0x5c,LANG_MENU_READ_WORD_WRAP, MENUITEM_BOOL, &conf.reader_wrap_by_words, 0 ), |
| | 652 | MENU_ITEM(0x5c,LANG_MENU_READ_AUTOSCROLL, MENUITEM_BOOL, &conf.reader_autoscroll, 0 ), |
| | 653 | MENU_ITEM(0x5f,LANG_MENU_READ_AUTOSCROLL_DELAY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.reader_autoscroll_delay, MENU_MINMAX(0, 60) ), |
| | 654 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 655 | {0} |
| | 656 | }; |
| | 657 | |
| | 658 | static CMenu reader_submenu = {0x37,LANG_MENU_READ_TITLE, NULL, reader_submenu_items }; |
| | 659 | |
| | 660 | //------------------------------------------------------------------- |
| | 661 | #if defined (OPT_GAMES) |
| | 662 | |
| | 663 | static CMenuItem games_submenu_items[] = { |
| | 664 | MENU_ITEM(0x38,LANG_MENU_GAMES_REVERSI, MENUITEM_PROC, gui_menu_run_fltmodule, "reversi.flt" ), |
| | 665 | MENU_ITEM(0x38,LANG_MENU_GAMES_SOKOBAN, MENUITEM_PROC, gui_menu_run_fltmodule, "sokoban.flt" ), |
| | 666 | MENU_ITEM(0x38,LANG_MENU_GAMES_CONNECT4, MENUITEM_PROC, gui_menu_run_fltmodule, "4wins.flt" ), |
| | 667 | MENU_ITEM(0x38,LANG_MENU_GAMES_MASTERMIND, MENUITEM_PROC, gui_menu_run_fltmodule, "mastmind.flt" ), |
| | 668 | MENU_ITEM(0x38,"Snake" , MENUITEM_PROC, gui_menu_run_fltmodule, "snake.flt" ), |
| | 669 | MENU_ITEM(0x38,"Tetris", MENUITEM_PROC, gui_menu_run_fltmodule, "tetris.flt" ), |
| | 670 | MENU_ITEM(0x38,"Sudoku", MENUITEM_PROC, gui_menu_run_fltmodule, "sudoku.flt" ), |
| | 671 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 672 | {0} |
| | 673 | }; |
| | 674 | |
| | 675 | static CMenu games_submenu = {0x38,LANG_MENU_GAMES_TITLE, NULL, games_submenu_items }; |
| | 676 | |
| | 677 | #endif |
| | 678 | //------------------------------------------------------------------- |
| | 679 | |
| | 680 | static void gui_menuproc_mkbootdisk(int arg) |
| | 681 | { |
| | 682 | mark_filesystem_bootable(); |
| | 683 | gui_mbox_init(LANG_INFORMATION, LANG_CONSOLE_TEXT_FINISHED, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| | 684 | } |
| | 685 | |
| | 686 | #if CAM_MULTIPART |
| | 687 | |
| | 688 | static void card_break_proc(unsigned int btn) |
| | 689 | { |
| | 690 | if (btn==MBOX_BTN_YES) create_partitions(); |
| | 691 | } |
| | 692 | |
| | 693 | static void gui_menuproc_break_card(int arg) |
| | 694 | { |
| | 695 | gui_mbox_init(LANG_WARNING, LANG_PARTITIONS_CREATE_WARNING, MBOX_BTN_YES_NO|MBOX_DEF_BTN2|MBOX_TEXT_CENTER, card_break_proc); |
| | 696 | } |
| | 697 | |
| | 698 | static char* partitions_enum=NULL; |
| | 699 | |
| | 700 | static const char* gui_menuproc_swap_partitions_enum(int change, int arg) |
| | 701 | { |
| | 702 | int new_partition; |
| | 703 | int partition_count = get_part_count(); |
| | 704 | char vBuf[16]; |
| | 705 | if(partitions_enum) |
| | 706 | { |
| | 707 | free(partitions_enum); |
| | 708 | partitions_enum=NULL; |
| | 709 | } |
| | 710 | new_partition= get_active_partition()+change; |
| | 711 | if( new_partition <=0) |
| | 712 | { |
| | 713 | new_partition = partition_count; |
| | 714 | } |
| | 715 | else if( new_partition > partition_count) |
| | 716 | { |
| | 717 | new_partition = 1; |
| | 718 | } |
| | 719 | sprintf(vBuf,"%d/%d",new_partition, partition_count); |
| | 720 | partitions_enum=malloc((strlen(vBuf)+1)*sizeof(char)); |
| | 721 | strcpy(partitions_enum,vBuf); |
| | 722 | |
| | 723 | if(change != 0) |
| | 724 | { |
| | 725 | swap_partitions(new_partition); |
| | 726 | } |
| | 727 | return partitions_enum; |
| | 728 | } |
| | 729 | |
| | 730 | #endif |
| | 731 | |
| | 732 | static CMenuItem sdcard_submenu_items[] = { |
| | 733 | MENU_ITEM (0x33,LANG_MENU_DEBUG_MAKE_BOOTABLE, MENUITEM_PROC, gui_menuproc_mkbootdisk, 0 ), |
| | 734 | #if CAM_MULTIPART |
| | 735 | MENU_ITEM (0x33,LANG_MENU_DEBUG_CREATE_MULTIPART , MENUITEM_PROC, gui_menuproc_break_card, 0 ), |
| | 736 | MENU_ITEM (0x33,LANG_MENU_DEBUG_SWAP_PART, MENUITEM_ENUM, gui_menuproc_swap_partitions_enum, 0 ), |
| | 737 | #endif |
| | 738 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 739 | {0}, |
| | 740 | }; |
| | 741 | |
| | 742 | static CMenu sdcard_submenu = {0x33,(int)"SD Card", NULL, sdcard_submenu_items }; |
| | 743 | |
| | 744 | //------------------------------------------------------------------- |
| | 745 | |
| | 746 | static void gui_draw_fselect(int arg) |
| | 747 | { |
| | 748 | module_fselect_init(LANG_STR_FILE_BROWSER, "A", "A", NULL); |
| | 749 | } |
| | 750 | |
| | 751 | static void gui_show_build_info(int arg) |
| | 752 | { |
| | 753 | static char comp[64]; |
| | 754 | |
| | 755 | #ifdef __GNUC__ |
| | 756 | # ifndef __GNUC_PATCHLEVEL__ |
| | 757 | # define __GNUC_PATCHLEVEL 0 |
| | 758 | # endif |
| | 759 | sprintf(comp, "GCC %d.%d.%d", __GNUC__ ,__GNUC_MINOR__,__GNUC_PATCHLEVEL__ ); |
| | 760 | #else |
| | 761 | sprintf(comp, "UNKNOWN" ); |
| | 762 | #endif |
| | 763 | sprintf(buf, lang_str(LANG_MSG_BUILD_INFO_TEXT), HDK_VERSION, BUILD_NUMBER, BUILD_SVNREV, __DATE__, __TIME__, PLATFORM, PLATFORMSUB, comp); |
| | 764 | gui_mbox_init(LANG_MSG_BUILD_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_LEFT, NULL); |
| | 765 | } |
| | 766 | |
| | 767 | static void gui_show_memory_info(int arg) |
| | 768 | { |
| | 769 | sprintf(buf, lang_str(LANG_MSG_MEMORY_INFO_TEXT), core_get_free_memory(), MEMISOSIZE, &_start, &_end); |
| | 770 | gui_mbox_init(LANG_MSG_MEMORY_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
| | 771 | } |
| | 772 | |
| | 773 | static void gui_menuproc_reset_selected(unsigned int btn) |
| | 774 | { |
| | 775 | if (btn==MBOX_BTN_YES) |
| | 776 | conf_load_defaults(); |
| | 777 | } |
| | 778 | |
| | 779 | static void gui_menuproc_reset(int arg) |
| | 780 | { |
| | 781 | gui_mbox_init(LANG_MSG_RESET_OPTIONS_TITLE, |
| | 782 | LANG_MSG_RESET_OPTIONS_TEXT, |
| | 783 | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER|MBOX_BTN_YES_NO|MBOX_DEF_BTN2, gui_menuproc_reset_selected); |
| | 784 | } |
| | 785 | |
| | 786 | static CMenuItem misc_submenu_items[] = { |
| | 787 | MENU_ITEM (0x35,LANG_MENU_MISC_FILE_BROWSER, MENUITEM_PROC, gui_draw_fselect, 0 ), |
| | 788 | MENU_ITEM (0x80,(int)"Module Inspector", MENUITEM_PROC, gui_menu_run_fltmodule, "modinsp.flt" ), |
| | 789 | #ifdef OPT_CALENDAR |
| | 790 | MENU_ITEM (0x36,LANG_MENU_MISC_CALENDAR, MENUITEM_PROC, gui_menu_run_fltmodule, "calend.flt" ), |
| | 791 | #endif |
| | 792 | #ifdef OPT_TEXTREADER |
| | 793 | MENU_ITEM (0x37,LANG_MENU_MISC_TEXT_READER, MENUITEM_SUBMENU, &reader_submenu, 0 ), |
| | 794 | #endif |
| | 795 | #if defined (OPT_GAMES) |
| | 796 | MENU_ITEM (0x38,LANG_MENU_MISC_GAMES, MENUITEM_SUBMENU, &games_submenu, 0 ), |
| | 797 | #endif |
| | 798 | MENU_ITEM (0x80,LANG_MENU_MISC_BUILD_INFO, MENUITEM_PROC, gui_show_build_info, 0 ), |
| | 799 | MENU_ITEM (0x80,LANG_MENU_MISC_MEMORY_INFO, MENUITEM_PROC, gui_show_memory_info, 0 ), |
| | 800 | MENU_ITEM (0x2b,LANG_MENU_MAIN_RESET_OPTIONS, MENUITEM_PROC, gui_menuproc_reset, 0 ), |
| | 801 | MENU_ITEM (0x33,(int)"SD Card", MENUITEM_SUBMENU, &sdcard_submenu, 0 ), |
| | 802 | #ifdef OPT_DEBUGGING |
| | 803 | MENU_ITEM (0x2a,LANG_MENU_MAIN_DEBUG, MENUITEM_SUBMENU, &debug_submenu, 0 ), |
| | 804 | #endif |
| | 805 | MENU_ITEM (0x86,LANG_MENU_REMOTE_PARAM, MENUITEM_SUBMENU, &remote_submenu, 0 ), |
| | 806 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 807 | {0}, |
| | 808 | }; |
| | 809 | |
| | 810 | static CMenu misc_submenu = {0x29,LANG_MENU_MISC_TITLE, NULL, misc_submenu_items }; |
| | 811 | |
| | 812 | //------------------------------------------------------------------- |
| | 813 | |
| | 814 | static void cb_perc() |
| | 815 | { |
| | 816 | conf.batt_volts_show=0; |
| | 817 | } |
| | 818 | |
| | 819 | static void cb_volts() |
| | 820 | { |
| | 821 | conf.batt_perc_show=0; |
| | 822 | } |
| | 823 | |
| | 824 | static void cb_battery_menu_change(unsigned int item) |
| | 825 | { |
| | 826 | switch (item) { |
| | 827 | case 0: //Voltage MAX |
| | 828 | if (conf.batt_volts_max<conf.batt_volts_min+25) { |
| | 829 | conf.batt_volts_min = conf.batt_volts_max-25; |
| | 830 | } |
| | 831 | break; |
| | 832 | case 1: //Voltage MIN |
| | 833 | if (conf.batt_volts_min>conf.batt_volts_max-25) { |
| | 834 | conf.batt_volts_max = conf.batt_volts_min+25; |
| | 835 | } |
| | 836 | break; |
| | 837 | default: |
| | 838 | break; |
| | 839 | } |
| | 840 | } |
| | 841 | |
| | 842 | static CMenuItem battery_submenu_items[] = { |
| | 843 | MENU_ITEM (0x66,LANG_MENU_BATT_VOLT_MAX, MENUITEM_INT, &conf.batt_volts_max, 0 ), |
| | 844 | MENU_ITEM (0x67,LANG_MENU_BATT_VOLT_MIN, MENUITEM_INT, &conf.batt_volts_min, 0 ), |
| | 845 | MENU_ITEM (0x0 ,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 846 | MENU_ITEM (0x73,LANG_MENU_BATT_SHOW_PERCENT, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_perc_show, (int)cb_perc ), |
| | 847 | MENU_ITEM (0x73,LANG_MENU_BATT_SHOW_VOLTS, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_volts_show, (int)cb_volts ), |
| | 848 | MENU_ITEM (0x32,LANG_MENU_BATT_SHOW_ICON, MENUITEM_BOOL, &conf.batt_icon_show, 0 ), |
| | 849 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 850 | {0} |
| | 851 | }; |
| | 852 | |
| | 853 | static CMenu battery_submenu = {0x32,LANG_MENU_BATT_TITLE, cb_battery_menu_change, battery_submenu_items }; |
| | 854 | |
| | 855 | //------------------------------------------------------------------- |
| | 856 | |
| | 857 | void cb_space_perc() |
| | 858 | { |
| | 859 | conf.space_mb_show=0; |
| | 860 | } |
| | 861 | |
| | 862 | void cb_space_mb() |
| | 863 | { |
| | 864 | conf.space_perc_show=0; |
| | 865 | } |
| | 866 | |
| | 867 | static const char* gui_space_bar_modes[] = { "Don't", "Horizontal", "Vertical"}; |
| | 868 | static const char* gui_space_bar_size_modes[] = { "1/4", "1/2", "1"}; |
| | 869 | static const char* gui_space_bar_width_modes[] = { "1", "2", "3","4","5","6","7","8","9","10"}; |
| | 870 | static const char* gui_space_warn_type_modes[] = { "Percent", "MB", "Don't"}; |
| | 871 | |
| | 872 | static CMenuItem space_submenu_items[] = { |
| | 873 | MENU_ITEM (0x5c,LANG_MENU_SPACE_SHOW_ICON, MENUITEM_BOOL, &conf.space_icon_show, 0 ), |
| | 874 | MENU_ENUM2 (0x69,LANG_MENU_SPACE_SHOW_BAR, &conf.space_bar_show, gui_space_bar_modes ), |
| | 875 | MENU_ENUM2 (0x6a,LANG_MENU_SPACE_BAR_SIZE, &conf.space_bar_size, gui_space_bar_size_modes ), |
| | 876 | MENU_ENUM2 (0x6b,LANG_MENU_SPACE_BAR_WIDTH, &conf.space_bar_width, gui_space_bar_width_modes ), |
| | 877 | MENU_ITEM (0x5c,LANG_MENU_SPACE_SHOW_PERCENT, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_perc_show, (int)cb_space_perc ), |
| | 878 | MENU_ITEM (0x5c,LANG_MENU_SPACE_SHOW_MB, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_mb_show, (int)cb_space_mb ), |
| | 879 | #if CAM_MULTIPART |
| | 880 | MENU_ITEM (0x5c,LANG_MENU_SHOW_PARTITION_NR, MENUITEM_BOOL, &conf.show_partition_nr, 0 ), |
| | 881 | #endif |
| | 882 | MENU_ENUM2 (0x5f,LANG_MENU_SPACE_WARN_TYPE, &conf.space_warn_type, gui_space_warn_type_modes ), |
| | 883 | MENU_ITEM (0x58,LANG_MENU_SPACE_WARN_PERCENT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.space_perc_warn, MENU_MINMAX(1, 99) ), |
| | 884 | MENU_ITEM (0x58,LANG_MENU_SPACE_WARN_MB, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.space_mb_warn, MENU_MINMAX(1, 4000) ), |
| | 885 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 886 | {0} |
| | 887 | }; |
| | 888 | |
| | 889 | static CMenu space_submenu = {0x33,LANG_MENU_OSD_SPACE_PARAMS_TITLE, NULL, space_submenu_items}; |
| | 890 | |
| | 891 | //------------------------------------------------------------------- |
| | 892 | |
| | 893 | static const char* gui_dof_show_value_modes[] = { "Don't", "Separate", "+Separate", "In Misc", "+In Misc" }; |
| | 894 | |
| | 895 | static CMenuItem dof_submenu_items[] = { |
| | 896 | MENU_ENUM2 (0x5f,LANG_MENU_OSD_SHOW_DOF_CALC, &conf.show_dof, gui_dof_show_value_modes ), |
| | 897 | MENU_ITEM (0x5c,LANG_MENU_DOF_SUBJ_DIST_AS_NEAR_LIMIT,MENUITEM_BOOL, &conf.dof_subj_dist_as_near_limit, 0 ), |
| | 898 | MENU_ITEM (0x5c,LANG_MENU_DOF_USE_EXIF_SUBJ_DIST, MENUITEM_BOOL, &conf.dof_use_exif_subj_dist, 0 ), |
| | 899 | MENU_ITEM (0x5c,LANG_MENU_DOF_SUBJ_DIST_IN_MISC, MENUITEM_BOOL, &conf.dof_subj_dist_in_misc, 0 ), |
| | 900 | MENU_ITEM (0x5c,LANG_MENU_DOF_NEAR_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_near_limit_in_misc, 0 ), |
| | 901 | MENU_ITEM (0x5c,LANG_MENU_DOF_FAR_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_far_limit_in_misc, 0 ), |
| | 902 | MENU_ITEM (0x5c,LANG_MENU_DOF_HYPERFOCAL_IN_MISC, MENUITEM_BOOL, &conf.dof_hyperfocal_in_misc, 0 ), |
| | 903 | MENU_ITEM (0x5c,LANG_MENU_DOF_DEPTH_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_depth_in_misc, 0 ), |
| | 904 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 905 | {0} |
| | 906 | }; |
| | 907 | |
| | 908 | static CMenu dof_submenu = {0x31,LANG_MENU_DOF_TITLE, /*cb_dof_menu_change*/ NULL, dof_submenu_items }; |
| | 909 | |
| | 910 | //------------------------------------------------------------------- |
| | 911 | |
| | 912 | static const char* gui_zoom_value_modes[] = { "X", "FL", "EFL" }; |
| | 913 | static const char* gui_show_values_modes[] = { "Don't", "Always", "Shoot" }; |
| | 914 | |
| | 915 | static CMenuItem values_submenu_items[] = { |
| | 916 | MENU_ENUM2 (0x5f,LANG_MENU_OSD_SHOW_MISC_VALUES, &conf.show_values, gui_show_values_modes ), |
| | 917 | MENU_ITEM (0x5c,LANG_MENU_SHOW_VALUES_IN_VIDEO, MENUITEM_BOOL, &conf.show_values_in_video, 0 ), |
| | 918 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_ZOOM, MENUITEM_BOOL, &conf.values_show_zoom, 0 ), |
| | 919 | MENU_ENUM2 (0x5f,LANG_MENU_OSD_ZOOM_VALUE, &conf.zoom_value, gui_zoom_value_modes ), |
| | 920 | MENU_ITEM (0x60,LANG_MENU_OSD_ZOOM_SCALE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zoom_scale, MENU_MINMAX(0, 1000) ), |
| | 921 | MENU_ITEM (0x62,LANG_MENU_VALUES_SHOW_REAL_APERTURE, MENUITEM_BOOL, &conf.values_show_real_aperture, 0 ), |
| | 922 | MENU_ITEM (0x74,LANG_MENU_VALUES_SHOW_REAL_ISO, MENUITEM_BOOL, &conf.values_show_real_iso, 0 ), |
| | 923 | MENU_ITEM (0x74,LANG_MENU_VALUES_SHOW_MARKET_ISO, MENUITEM_BOOL, &conf.values_show_market_iso, 0 ), |
| | 924 | MENU_ITEM (0x2d,LANG_MENU_SHOW_ISO_ONLY_IN_AUTOISO_MODE, MENUITEM_BOOL, &conf.values_show_iso_only_in_autoiso_mode, 0 ), |
| | 925 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_EV_SETED, MENUITEM_BOOL, &conf.values_show_ev_seted, 0 ), |
| | 926 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_EV_MEASURED, MENUITEM_BOOL, &conf.values_show_ev_measured, 0 ), |
| | 927 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_BV_SETED, MENUITEM_BOOL, &conf.values_show_bv_seted, 0 ), |
| | 928 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_BV_MEASURED, MENUITEM_BOOL, &conf.values_show_bv_measured, 0 ), |
| | 929 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_OVEREXPOSURE, MENUITEM_BOOL, &conf.values_show_overexposure, 0 ), |
| | 930 | MENU_ITEM (0x5c,LANG_MENU_SHOW_CANON_OVEREXPOSURE, MENUITEM_BOOL, &conf.values_show_canon_overexposure, 0 ), |
| | 931 | MENU_ITEM (0x5c,LANG_MENU_VALUES_SHOW_LUMINANCE, MENUITEM_BOOL, &conf.values_show_luminance, 0 ), |
| | 932 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 933 | {0} |
| | 934 | }; |
| | 935 | |
| | 936 | static CMenu values_submenu = {0x28,LANG_MENU_OSD_VALUES_TITLE, /*cb_values_menu_change*/ NULL, values_submenu_items }; |
| | 937 | |
| | 938 | //------------------------------------------------------------------- |
| | 939 | |
| | 940 | static const char* gui_show_clock_modes[]= { "Don't", "Normal", "Seconds"}; |
| | 941 | static const char* gui_clock_format_modes[] = { "24h", "12h"}; |
| | 942 | static const char* gui_clock_indicator_modes[] = { "PM", "P", "."}; |
| | 943 | static const char* gui_clock_halfpress_modes[] = { "Full", "Seconds", "Don't"}; |
| | 944 | |
| | 945 | static CMenuItem clock_submenu_items[] = { |
| | 946 | MENU_ENUM2 (0x5f,LANG_MENU_OSD_SHOW_CLOCK, &conf.show_clock, gui_show_clock_modes ), |
| | 947 | MENU_ENUM2 (0x6d,LANG_MENU_OSD_CLOCK_FORMAT, &conf.clock_format, gui_clock_format_modes ), |
| | 948 | MENU_ENUM2 (0x6c,LANG_MENU_OSD_CLOCK_INDICATOR, &conf.clock_indicator, gui_clock_indicator_modes ), |
| | 949 | MENU_ENUM2 (0x6e,LANG_MENU_OSD_CLOCK_HALFPRESS, &conf.clock_halfpress, gui_clock_halfpress_modes ), |
| | 950 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 951 | {0} |
| | 952 | }; |
| | 953 | |
| | 954 | static CMenu clock_submenu = {0x34,LANG_MENU_OSD_CLOCK_PARAMS_TITLE, NULL, clock_submenu_items }; |
| | 955 | |
| | 956 | //------------------------------------------------------------------- |
| | 957 | |
| | 958 | #if !CAM_VIDEO_QUALITY_ONLY |
| | 959 | const char* gui_video_bitrate_enum(int change, int arg) |
| | 960 | { |
| | 961 | static const char *modes[]={ "0.25x", "0.5x","0.75x", "1x", "1.25x", "1.5x", "1.75x", "2x", "2.5x", "3x"}; |
| | 962 | gui_enum_value_change(&conf.video_bitrate,change,sizeof(modes)/sizeof(modes[0])); |
| | 963 | |
| | 964 | if (change) |
| | 965 | shooting_video_bitrate_change(conf.video_bitrate); |
| | 966 | |
| | 967 | return modes[conf.video_bitrate]; |
| | 968 | } |
| | 969 | #endif |
| | 970 | |
| | 971 | #if CAM_AF_SCAN_DURING_VIDEO_RECORD |
| | 972 | static const char* gui_video_af_key_enum(int change, int arg) |
| | 973 | { |
| | 974 | #if CAMERA_g12 |
| | 975 | static const char* names[]={ "", "Shutter", "Set", "AE Lock"}; |
| | 976 | static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET, KEY_AE_LOCK }; |
| | 977 | #else |
| | 978 | static const char* names[]={ "", "Shutter", "Set"}; |
| | 979 | static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET }; |
| | 980 | #endif |
| | 981 | int i; |
| | 982 | |
| | 983 | for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { |
| | 984 | if (conf.video_af_key==keys[i]) { |
| | 985 | break; |
| | 986 | } |
| | 987 | } |
| | 988 | |
| | 989 | i+=change; |
| | 990 | if (i<0) |
| | 991 | i=(sizeof(names)/sizeof(names[0]))-1; |
| | 992 | else if (i>=(sizeof(names)/sizeof(names[0]))) |
| | 993 | i=0; |
| | 994 | |
| | 995 | conf.video_af_key = keys[i]; |
| | 996 | return names[i]; |
| | 997 | } |
| | 998 | #endif |
| | 999 | |
| | 1000 | static const char* gui_show_movie_time_modes[] = { "Don't", "hh:mm:ss", "KB/s","both"}; |
| | 1001 | #if !CAM_VIDEO_QUALITY_ONLY |
| | 1002 | static const char* gui_video_mode_modes[] = { "Bitrate", "Quality"}; |
| | 1003 | #else |
| | 1004 | static const char* gui_video_mode_modes[] = { "Default", "Quality"}; |
| | 1005 | #endif |
| | 1006 | |
| | 1007 | static CMenuItem video_submenu_items[] = { |
| | 1008 | #if CAM_CHDK_HAS_EXT_VIDEO_MENU |
| | 1009 | MENU_ENUM2 (0x23,LANG_MENU_VIDEO_MODE, &conf.video_mode, gui_video_mode_modes ), |
| | 1010 | #if !CAM_VIDEO_QUALITY_ONLY |
| | 1011 | MENU_ITEM (0x5e,LANG_MENU_VIDEO_BITRATE, MENUITEM_ENUM, gui_video_bitrate_enum, 0 ), |
| | 1012 | #endif |
| | 1013 | MENU_ITEM (0x60,LANG_MENU_VIDEO_QUALITY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.video_quality, MENU_MINMAX(1, 99) ), |
| | 1014 | #if CAM_CHDK_HAS_EXT_VIDEO_TIME |
| | 1015 | MENU_ITEM (0x5c,LANG_MENU_VIDEO_EXT_TIME, MENUITEM_BOOL, &conf.ext_video_time, 0 ), |
| | 1016 | #endif |
| | 1017 | MENU_ITEM (0x5c,LANG_MENU_CLEAR_VIDEO_VALUES, MENUITEM_BOOL, &conf.clear_video, 0 ), |
| | 1018 | #endif |
| | 1019 | #if CAM_VIDEO_CONTROL |
| | 1020 | MENU_ITEM (0x5c,LANG_MENU_FAST_SWITCH_VIDEO, MENUITEM_BOOL, &conf.fast_movie_control, 0 ), |
| | 1021 | #endif |
| | 1022 | #if CAM_CHDK_HAS_EXT_VIDEO_MENU |
| | 1023 | MENU_ITEM (0x5c,LANG_MENU_FAST_SWITCH_QUALITY_VIDEO, MENUITEM_BOOL, &conf.fast_movie_quality_control, 0 ), |
| | 1024 | #endif |
| | 1025 | #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO |
| | 1026 | MENU_ITEM (0x5c,LANG_MENU_OPTICAL_ZOOM_IN_VIDEO, MENUITEM_BOOL, &conf.unlock_optical_zoom_for_video, 0 ), |
| | 1027 | #endif |
| | 1028 | #if CAM_CAN_MUTE_MICROPHONE |
| | 1029 | MENU_ITEM (0x83,LANG_MENU_MUTE_ON_ZOOM, MENUITEM_BOOL, &conf.mute_on_zoom, 0 ), |
| | 1030 | #endif |
| | 1031 | #if CAM_AF_SCAN_DURING_VIDEO_RECORD |
| | 1032 | MENU_ITEM (0x82,LANG_MENU_VIDEO_AF_KEY, MENUITEM_ENUM, gui_video_af_key_enum, 0 ), |
| | 1033 | #endif |
| | 1034 | MENU_ENUM2 (0x5c,LANG_MENU_OSD_SHOW_VIDEO_TIME, &conf.show_movie_time, gui_show_movie_time_modes ), |
| | 1035 | MENU_ITEM (0x60,LANG_MENU_OSD_SHOW_VIDEO_REFRESH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.show_movie_refresh, MENU_MINMAX(1, 20) ), |
| | 1036 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1037 | {0} |
| | 1038 | }; |
| | 1039 | |
| | 1040 | static CMenu video_submenu = {0x23,LANG_MENU_VIDEO_PARAM_TITLE, NULL, video_submenu_items }; |
| | 1041 | |
| | 1042 | //------------------------------------------------------------------- |
| | 1043 | // "Extra Photo Operations" Menu |
| | 1044 | |
| | 1045 | static const char* gui_tv_override_koef_enum(int change, int arg) |
| | 1046 | { |
| | 1047 | static const char* modes[]={"Off", "1/100K", "1/10000", "1/1000","1/100","1/10", "1","10","100"}; |
| | 1048 | |
| | 1049 | if (conf.tv_enum_type && change) |
| | 1050 | { |
| | 1051 | if (conf.tv_override_koef == 6) |
| | 1052 | conf.tv_override_koef = 0; |
| | 1053 | else |
| | 1054 | conf.tv_override_koef = 6; |
| | 1055 | } |
| | 1056 | else |
| | 1057 | gui_enum_value_change(&conf.tv_override_koef,change,sizeof(modes)/sizeof(modes[0])); |
| | 1058 | |
| | 1059 | return modes[conf.tv_override_koef]; |
| | 1060 | } |
| | 1061 | |
| | 1062 | static const char* gui_tv_override_value_enum(int change, int arg) |
| | 1063 | { |
| | 1064 | /* |
| | 1065 | static const char* modes[]={ |
| | 1066 | // add very long time exposures as approximately powers of 2, adding 15 exposures |
| | 1067 | "2048","1625","1290","1024","812","645","512","406","322","256","203","161","128","101","80", |
| | 1068 | "64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"}; |
| | 1069 | */ |
| | 1070 | |
| | 1071 | // XXX This array above is redundant with platform/generic/shooting.c, this should be avoided! |
| | 1072 | conf.tv_override_value+=change; |
| | 1073 | if (conf.tv_enum_type) { |
| | 1074 | if (conf.tv_override_value<0) { |
| | 1075 | conf.tv_override_value=tv_override_amount-1; |
| | 1076 | } |
| | 1077 | else if ((unsigned)conf.tv_override_value>=(tv_override_amount)) |
| | 1078 | conf.tv_override_value=0; |
| | 1079 | return tv_override[conf.tv_override_value]; |
| | 1080 | } |
| | 1081 | else { |
| | 1082 | if (conf.tv_override_value<0) { |
| | 1083 | conf.tv_override_value=100; |
| | 1084 | } |
| | 1085 | else if (conf.tv_override_value>100) conf.tv_override_value=0; |
| | 1086 | sprintf(buf, "%d", conf.tv_override_value); |
| | 1087 | return buf; |
| | 1088 | } |
| | 1089 | } |
| | 1090 | |
| | 1091 | static const char* gui_tv_enum_type_enum(int change, int arg) |
| | 1092 | { |
| | 1093 | static const char* modes[]={"Factor", "Ev Step"}; |
| | 1094 | |
| | 1095 | gui_enum_value_change(&conf.tv_enum_type,change,sizeof(modes)/sizeof(modes[0])); |
| | 1096 | if (change) { |
| | 1097 | conf.tv_override_koef=6; |
| | 1098 | if (conf.tv_enum_type) |
| | 1099 | conf.tv_override_value=tv_override_zero_shift; |
| | 1100 | else conf.tv_override_value=1; |
| | 1101 | } |
| | 1102 | return modes[conf.tv_enum_type]; |
| | 1103 | } |
| | 1104 | |
| | 1105 | #if CAM_HAS_IRIS_DIAPHRAGM |
| | 1106 | const char* gui_av_override_enum(int change, int arg) |
| | 1107 | { |
| | 1108 | conf.av_override_value+=change; |
| | 1109 | if (conf.av_override_value<0) conf.av_override_value=shooting_get_aperture_sizes_table_size()+6; |
| | 1110 | else if (conf.av_override_value>shooting_get_aperture_sizes_table_size()+6) conf.av_override_value=0; |
| | 1111 | |
| | 1112 | if (conf.av_override_value == 0) |
| | 1113 | return "Off"; |
| | 1114 | else |
| | 1115 | { |
| | 1116 | short prop_id=shooting_get_aperture_from_av96(shooting_get_av96_override_value()); |
| | 1117 | sprintf(buf, "%d.%02d", (int)prop_id/100, (int)prop_id%100 ); |
| | 1118 | return buf; |
| | 1119 | } |
| | 1120 | } |
| | 1121 | #endif |
| | 1122 | |
| | 1123 | #if ZOOM_OVERRIDE |
| | 1124 | const char* gui_zoom_override_enum(int change, int arg) |
| | 1125 | { |
| | 1126 | conf.zoom_override_value+=change; |
| | 1127 | if (conf.zoom_override_value<0) conf.zoom_override_value=zoom_points-1; |
| | 1128 | else if (conf.zoom_override_value>zoom_points-1) conf.zoom_override_value=0; |
| | 1129 | sprintf(buf,"%i",conf.zoom_override_value); |
| | 1130 | return buf; |
| | 1131 | } |
| | 1132 | #endif |
| | 1133 | |
| | 1134 | const char* gui_subj_dist_override_value_enum(int change, int arg) |
| | 1135 | { |
| | 1136 | int koef = shooting_get_subject_distance_override_koef(); |
| | 1137 | static char buf[9]; |
| | 1138 | if (koef == -1) |
| | 1139 | { |
| | 1140 | // If 'Infinity' selected in the 'koef' setting then set SD to the infinity value |
| | 1141 | // technically the same as MAX_DIST when it's sent to the firmware function |
| | 1142 | // in the camera; but used here to alter the CHDK OSD display. |
| | 1143 | conf.subj_dist_override_value = INFINITY_DIST; |
| | 1144 | } |
| | 1145 | else |
| | 1146 | { |
| | 1147 | // Increment / decrement the SD value, wrapping around from MIN_DIST to MAX_DIST |
| | 1148 | conf.subj_dist_override_value += (change*koef); |
| | 1149 | if (conf.subj_dist_override_value < MIN_DIST) |
| | 1150 | conf.subj_dist_override_value = MAX_DIST; |
| | 1151 | else if (conf.subj_dist_override_value > MAX_DIST) |
| | 1152 | conf.subj_dist_override_value = MIN_DIST; |
| | 1153 | } |
| | 1154 | if (conf.subj_dist_override_value == INFINITY_DIST) |
| | 1155 | strcpy(buf,"Inf."); |
| | 1156 | else |
| | 1157 | sprintf(buf, "%d", shooting_get_subject_distance_override_value()); |
| | 1158 | return buf; |
| | 1159 | } |
| | 1160 | |
| | 1161 | const char* gui_subj_dist_override_koef_enum(int change, int arg) |
| | 1162 | { |
| | 1163 | // Define the adjustment factor values for the subject distance override |
| | 1164 | #if MAX_DIST > 1000000 // Superzoom - e.g. SX30, SX40 |
| | 1165 | static const char* modes[] = { "Off", "1", "10", "100", "1000", "10K", "100K", "1M", "Inf." }; |
| | 1166 | #elif MAX_DIST > 100000 // G12, IXUS310 |
| | 1167 | static const char* modes[] = { "Off", "1", "10", "100", "1000", "10K", "100K", "Inf." }; |
| | 1168 | #else // Original values (MAX_DIST = 65535) |
| | 1169 | static const char* modes[] = { "Off", "1", "10", "100", "1000" }; |
| | 1170 | #endif |
| | 1171 | const char *rv = gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0])); |
| | 1172 | // If we've selected 'Infinity' focus then set the SD override value |
| | 1173 | // Otherwise if we had previously selected 'Infinity' then reset back to MAX_DIST |
| | 1174 | if (shooting_get_subject_distance_override_koef() == -1) |
| | 1175 | conf.subj_dist_override_value = INFINITY_DIST; |
| | 1176 | else if (conf.subj_dist_override_value == INFINITY_DIST) |
| | 1177 | conf.subj_dist_override_value = MAX_DIST; |
| | 1178 | return rv; |
| | 1179 | } |
| | 1180 | |
| | 1181 | static const char* gui_override_disable_modes[] = { "No", "Yes" }; |
| | 1182 | #if CAM_HAS_ND_FILTER |
| | 1183 | static const char* gui_nd_filter_state_modes[] = { "Off", "In", "Out" }; |
| | 1184 | #endif |
| | 1185 | static const char* gui_fast_ev_step_modes[] = { "1/6 Ev","1/3 Ev","1/2 Ev", "2/3 Ev","5/6 Ev","1 Ev","1 1/6 Ev","1 1/3 Ev","1 1/2 Ev", "1 2/3 Ev","1 5/6 Ev","2 Ev","2 1/6 Ev","2 1/3 Ev","2 1/2 Ev", "2 2/3 Ev","2 5/6 Ev","3 Ev","3 1/6 Ev","3 1/3 Ev","3 1/2 Ev", "3 2/3 Ev","3 5/6 Ev","4 Ev"}; |
| | 1186 | #if CAM_QUALITY_OVERRIDE |
| | 1187 | static const char* gui_fast_image_quality_modes[] = { "sup.fine", "fine", "normal", "off" }; |
| | 1188 | #endif |
| | 1189 | |
| | 1190 | static CMenuItem operation_submenu_items[] = { |
| | 1191 | MENU_ENUM2 (0x5f,LANG_MENU_OVERRIDE_DISABLE, &conf.override_disable, gui_override_disable_modes ), |
| | 1192 | MENU_ITEM (0x5c,LANG_MENU_OVERRIDE_DISABLE_ALL, MENUITEM_BOOL, &conf.override_disable_all, 0 ), |
| | 1193 | MENU_ITEM (0x61,LANG_MENU_OVERRIDE_TV_VALUE, MENUITEM_ENUM, gui_tv_override_value_enum, 0 ), |
| | 1194 | MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_TV_KOEF, MENUITEM_ENUM, gui_tv_override_koef_enum, 0 ), |
| | 1195 | MENU_ITEM (0x59,LANG_MENU_TV_ENUM_TYPE, MENUITEM_ENUM, gui_tv_enum_type_enum, 0 ), |
| | 1196 | #if CAM_HAS_IRIS_DIAPHRAGM |
| | 1197 | MENU_ITEM (0x62,LANG_MENU_OVERRIDE_AV_VALUE, MENUITEM_ENUM, gui_av_override_enum, 0 ), |
| | 1198 | #endif |
| | 1199 | #if CAM_HAS_ND_FILTER |
| | 1200 | MENU_ENUM2 (0x5f,LANG_MENU_OVERRIDE_ND_FILTER, &conf.nd_filter_state, gui_nd_filter_state_modes ), |
| | 1201 | #endif |
| | 1202 | #if CAM_CAN_SD_OVERRIDE |
| | 1203 | MENU_ITEM (0x5e,LANG_MENU_OVERRIDE_SUBJ_DIST_VALUE, MENUITEM_ENUM, gui_subj_dist_override_value_enum, 0 ), |
| | 1204 | MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_SUBJ_DIST_KOEF, MENUITEM_ENUM, gui_subj_dist_override_koef_enum, 0 ), |
| | 1205 | #endif |
| | 1206 | MENU_ITEM (0x74,LANG_MENU_OVERRIDE_ISO_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.iso_override_value, MENU_MINMAX(0, 800) ), |
| | 1207 | MENU_ENUM2a (0x5f,LANG_MENU_OVERRIDE_ISO_KOEF, &conf.iso_override_koef, gui_override_koef_modes, 4 ), |
| | 1208 | #if ZOOM_OVERRIDE |
| | 1209 | MENU_ITEM (0x5c,LANG_MENU_OVERRIDE_ZOOM, MENUITEM_BOOL, &conf.zoom_override, 0 ), |
| | 1210 | MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_ZOOM_VALUE, MENUITEM_ENUM, gui_zoom_override_enum, 0 ), |
| | 1211 | MENU_ITEM (0x5c,LANG_MENU_CLEAR_ZOOM_OVERRIDE_VALUES, MENUITEM_BOOL, &conf.clear_zoom_override, 0 ), |
| | 1212 | #endif |
| | 1213 | MENU_ITEM (0x2c,LANG_MENU_BRACKET_IN_CONTINUOUS, MENUITEM_SUBMENU, &bracketing_in_continuous_submenu, 0 ), |
| | 1214 | MENU_ITEM (0x2d,LANG_MENU_AUTOISO, MENUITEM_SUBMENU, &autoiso_submenu, 0 ), |
| | 1215 | MENU_ITEM (0x5b,LANG_MENU_CLEAR_OVERRIDE_VALUES, MENUITEM_BOOL, &conf.clear_override, 0 ), |
| | 1216 | MENU_ITEM (0x5c,LANG_MENU_MISC_FAST_EV, MENUITEM_BOOL, &conf.fast_ev, 0 ), |
| | 1217 | MENU_ENUM2 (0x5f,LANG_MENU_MISC_FAST_EV_STEP, &conf.fast_ev_step, gui_fast_ev_step_modes ), |
| | 1218 | #if CAM_REAR_CURTAIN |
| | 1219 | MENU_ITEM (0x5c, LANG_MENU_REAR_CURTAIN, MENUITEM_BOOL, &conf.flash_sync_curtain, 0 ), |
| | 1220 | #endif |
| | 1221 | MENU_ITEM (0x5c, LANG_MENU_FLASH_MANUAL_OVERRIDE, MENUITEM_BOOL, &conf.flash_manual_override, 0 ), |
| | 1222 | MENU_ITEM (0x5f, LANG_MENU_FLASH_VIDEO_OVERRIDE_POWER,MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.flash_video_override_power, MENU_MINMAX(0, 2) ), |
| | 1223 | #if CAM_HAS_VIDEO_BUTTON |
| | 1224 | MENU_ITEM (0x5c, LANG_MENU_FLASH_VIDEO_OVERRIDE, MENUITEM_BOOL, &conf.flash_video_override, 0 ), |
| | 1225 | #endif |
| | 1226 | #if CAM_QUALITY_OVERRIDE |
| | 1227 | MENU_ENUM2 (0x5c,LANG_MENU_MISC_IMAGE_QUALITY, &conf.fast_image_quality, gui_fast_image_quality_modes ), |
| | 1228 | #endif |
| | 1229 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1230 | {0} |
| | 1231 | }; |
| | 1232 | |
| | 1233 | static CMenu operation_submenu = {0x21,LANG_MENU_OPERATION_PARAM_TITLE, NULL, operation_submenu_items }; |
| | 1234 | |
| | 1235 | //------------------------------------------------------------------- |
| | 1236 | |
| | 1237 | #ifdef OPT_EDGEOVERLAY |
| | 1238 | |
| | 1239 | static void gui_load_edge_selected( const char* fn ) |
| | 1240 | { |
| | 1241 | if (fn) |
| | 1242 | if (module_edgeovr_load()) |
| | 1243 | libedgeovr->load_edge_overlay(fn); |
| | 1244 | } |
| | 1245 | |
| | 1246 | static void gui_menuproc_edge_save(int arg) |
| | 1247 | { |
| | 1248 | if (module_edgeovr_load()) |
| | 1249 | libedgeovr->save_edge_overlay(); |
| | 1250 | } |
| | 1251 | |
| | 1252 | static void gui_menuproc_edge_load(int arg) |
| | 1253 | { |
| | 1254 | module_fselect_init(LANG_MENU_EDGE_LOAD, EDGE_SAVE_DIR, EDGE_SAVE_DIR, gui_load_edge_selected); |
| | 1255 | } |
| | 1256 | |
| | 1257 | static const char* gui_edge_pano_modes[] = { "Off", "Right", "Down", "Left", "Up", "Free" }; |
| | 1258 | static CMenuItem edge_overlay_submenu_items[] = { |
| | 1259 | MENU_ITEM (0x5c,LANG_MENU_EDGE_OVERLAY_ENABLE, MENUITEM_BOOL, &conf.edge_overlay_enable, 0 ), |
| | 1260 | MENU_ITEM (0x5c,LANG_MENU_EDGE_FILTER, MENUITEM_BOOL, &conf.edge_overlay_filter, 0 ), |
| | 1261 | MENU_ENUM2 (0x5f,LANG_MENU_EDGE_PANO, &conf.edge_overlay_pano, gui_edge_pano_modes ), |
| | 1262 | MENU_ITEM (0x5e,LANG_MENU_EDGE_PANO_OVERLAP, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.edge_overlay_pano_overlap, MENU_MINMAX(0, 100) ), |
| | 1263 | MENU_ITEM (0x5c,LANG_MENU_EDGE_SHOW, MENUITEM_BOOL, &conf.edge_overlay_show, 0 ), |
| | 1264 | MENU_ITEM (0x5e,LANG_MENU_EDGE_OVERLAY_TRESH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.edge_overlay_thresh, MENU_MINMAX(0, 255) ), |
| | 1265 | MENU_ITEM (0x5c,LANG_MENU_EDGE_PLAY, MENUITEM_BOOL, &conf.edge_overlay_play, 0 ), //does not work on cams like s-series, which dont have a real "hardware" play/rec switch, need a workaround, probably another button |
| | 1266 | MENU_ITEM (0x33,LANG_MENU_EDGE_SAVE, MENUITEM_PROC, gui_menuproc_edge_save, 0 ), |
| | 1267 | MENU_ITEM (0x5c,LANG_MENU_EDGE_ZOOM, MENUITEM_BOOL, &conf.edge_overlay_zoom, 0 ), |
| | 1268 | MENU_ITEM (0x33,LANG_MENU_EDGE_LOAD, MENUITEM_PROC, gui_menuproc_edge_load, 0 ), |
| | 1269 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1270 | {0} |
| | 1271 | }; |
| | 1272 | |
| | 1273 | static CMenu edge_overlay_submenu = {0x7f,LANG_MENU_EDGE_OVERLAY_TITLE, NULL, edge_overlay_submenu_items }; |
| | 1274 | |
| | 1275 | #endif |
| | 1276 | |
| | 1277 | //------------------------------------------------------------------- |
| | 1278 | |
| | 1279 | static void gui_grid_lines_load_selected(const char *fn) |
| | 1280 | { |
| | 1281 | if (fn) |
| | 1282 | if (module_grids_load()) |
| | 1283 | libgrids->grid_lines_load(fn); |
| | 1284 | } |
| | 1285 | |
| | 1286 | static void gui_grid_lines_load(int arg) |
| | 1287 | { |
| | 1288 | module_fselect_init(LANG_STR_SELECT_GRID_FILE, conf.grid_lines_file, "A/CHDK/GRIDS", gui_grid_lines_load_selected); |
| | 1289 | } |
| | 1290 | |
| | 1291 | static CMenuItem grid_submenu_items[] = { |
| | 1292 | MENU_ITEM(0x2f,LANG_MENU_SHOW_GRID, MENUITEM_BOOL, &conf.show_grid_lines, 0 ), |
| | 1293 | MENU_ITEM(0x35,LANG_MENU_GRID_LOAD, MENUITEM_PROC, gui_grid_lines_load, 0 ), |
| | 1294 | MENU_ITEM(0x0,LANG_MENU_GRID_CURRENT, MENUITEM_SEPARATOR, 0, 0 ), |
| | 1295 | MENU_ITEM(0x0,(int)conf.grid_title, MENUITEM_TEXT, 0, 0 ), |
| | 1296 | MENU_ITEM(0x0,(int)"", MENUITEM_SEPARATOR, 0, 0 ), |
| | 1297 | MENU_ITEM(0x5c,LANG_MENU_GRID_FORCE_COLOR, MENUITEM_BOOL, &conf.grid_force_color, 0 ), |
| | 1298 | MENU_ITEM(0x65,LANG_MENU_GRID_COLOR_LINE, MENUITEM_COLOR_FG, &conf.grid_color, 0 ), |
| | 1299 | MENU_ITEM(0x65,LANG_MENU_GRID_COLOR_FILL, MENUITEM_COLOR_BG, &conf.grid_color, 0 ), |
| | 1300 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1301 | {0} |
| | 1302 | }; |
| | 1303 | |
| | 1304 | static CMenu grid_submenu = {0x2f,LANG_MENU_GRID_TITLE, NULL, grid_submenu_items }; |
| | 1305 | |
| | 1306 | //------------------------------------------------------------------- |
| | 1307 | |
| | 1308 | static void gui_draw_lang_selected(const char *fn) |
| | 1309 | { |
| | 1310 | if (fn) { |
| | 1311 | strcpy(conf.lang_file, fn); |
| | 1312 | lang_load_from_file(conf.lang_file); |
| | 1313 | gui_menu_init(NULL); |
| | 1314 | } |
| | 1315 | } |
| | 1316 | |
| | 1317 | static void gui_draw_load_lang(int arg) |
| | 1318 | { |
| | 1319 | module_fselect_init(LANG_STR_SELECT_LANG_FILE, conf.lang_file, "A/CHDK/LANG", gui_draw_lang_selected); |
| | 1320 | } |
| | 1321 | |
| | 1322 | static const char* gui_font_enum(int change, int arg) |
| | 1323 | { |
| | 1324 | static const char* fonts[]={ "Win1250", "Win1251", "Win1252", "Win1253", "Win1254", "Win1257"}; |
| | 1325 | |
| | 1326 | gui_enum_value_change(&conf.font_cp,change,sizeof(fonts)/sizeof(fonts[0])); |
| | 1327 | |
| | 1328 | if (change != 0) { |
| | 1329 | font_set(conf.font_cp); |
| | 1330 | rbf_load_from_file(conf.menu_rbf_file, FONT_CP_WIN); |
| | 1331 | gui_menu_init(NULL); |
| | 1332 | } |
| | 1333 | |
| | 1334 | return fonts[conf.font_cp]; |
| | 1335 | } |
| | 1336 | |
| | 1337 | static void gui_draw_menu_rbf_selected(const char *fn) |
| | 1338 | { |
| | 1339 | if (fn) { |
| | 1340 | strcpy(conf.menu_rbf_file, fn); |
| | 1341 | rbf_load_from_file(conf.menu_rbf_file, FONT_CP_WIN); |
| | 1342 | gui_menu_init(NULL); |
| | 1343 | } |
| | 1344 | } |
| | 1345 | |
| | 1346 | static void gui_draw_load_menu_rbf(int arg) |
| | 1347 | { |
| | 1348 | module_fselect_init(LANG_STR_SELECT_FONT_FILE, conf.menu_rbf_file, "A/CHDK/FONTS", gui_draw_menu_rbf_selected); |
| | 1349 | } |
| | 1350 | |
| | 1351 | static void gui_draw_symbol_rbf_selected(const char *fn) |
| | 1352 | { |
| | 1353 | if (fn) { |
| | 1354 | strcpy(conf.menu_symbol_rbf_file, fn); |
| | 1355 | if(!rbf_load_symbol(conf.menu_symbol_rbf_file)) conf.menu_symbol_enable=0; //AKA |
| | 1356 | gui_menu_init(NULL); |
| | 1357 | } |
| | 1358 | } |
| | 1359 | |
| | 1360 | static void gui_draw_load_symbol_rbf(int arg) |
| | 1361 | { |
| | 1362 | module_fselect_init(LANG_STR_SELECT_SYMBOL_FILE, conf.menu_symbol_rbf_file, "A/CHDK/SYMBOLS", gui_draw_symbol_rbf_selected); |
| | 1363 | } |
| | 1364 | |
| | 1365 | static void gui_menuproc_reset_files(int arg) |
| | 1366 | { |
| | 1367 | conf.lang_file[0] = 0; |
| | 1368 | strcpy(conf.menu_symbol_rbf_file,DEFAULT_SYMBOL_FILE); |
| | 1369 | conf.menu_rbf_file[0] = 0; |
| | 1370 | conf_save(); |
| | 1371 | gui_mbox_init(LANG_INFORMATION, LANG_MENU_RESTART_CAMERA, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| | 1372 | } |
| | 1373 | |
| | 1374 | static const char* gui_text_box_charmap[] = { "Default", "German", "Russian" }; |
| | 1375 | |
| | 1376 | static CMenuItem visual_submenu_items[] = { |
| | 1377 | MENU_ITEM(0x35,LANG_MENU_VIS_LANG, MENUITEM_PROC, gui_draw_load_lang, 0 ), |
| | 1378 | MENU_ITEM(0x5f,LANG_MENU_VIS_OSD_FONT, MENUITEM_ENUM, gui_font_enum, 0 ), |
| | 1379 | MENU_ITEM(0x35,LANG_MENU_VIS_MENU_FONT, MENUITEM_PROC, gui_draw_load_menu_rbf, 0 ), |
| | 1380 | MENU_ITEM(0x64,LANG_MENU_VIS_SYMBOL, MENUITEM_BOOL, &conf.menu_symbol_enable, 0 ), |
| | 1381 | MENU_ITEM(0x35,LANG_MENU_VIS_MENU_SYMBOL_FONT, MENUITEM_PROC, gui_draw_load_symbol_rbf, 0 ), |
| | 1382 | MENU_ENUM2(0x5f,LANG_MENU_VIS_CHARMAP, &conf.tbox_char_map, gui_text_box_charmap ), |
| | 1383 | MENU_ITEM(0x80,LANG_MENU_RESET_FILES, MENUITEM_PROC, gui_menuproc_reset_files, 0 ), |
| | 1384 | MENU_ITEM(0x0,LANG_MENU_VIS_COLORS, MENUITEM_SEPARATOR, 0, 0 ), |
| | 1385 | MENU_ITEM(0x65,LANG_MENU_MISC_PALETTE, MENUITEM_PROC, gui_menu_run_fltmodule, "palette.flt" ), |
| | 1386 | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_TEXT, MENUITEM_COLOR_FG, &conf.osd_color, 0 ), |
| | 1387 | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_BKG, MENUITEM_COLOR_BG, &conf.osd_color, 0 ), |
| | 1388 | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_WARNING, MENUITEM_COLOR_FG, &conf.osd_color_warn, 0 ), |
| | 1389 | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_WARNING_BKG, MENUITEM_COLOR_BG, &conf.osd_color_warn, 0 ), |
| | 1390 | #ifdef OPT_EDGEOVERLAY |
| | 1391 | MENU_ITEM(0x65,LANG_MENU_EDGE_OVERLAY_COLOR, MENUITEM_COLOR_FG, &conf.edge_overlay_color, 0 ), |
| | 1392 | #endif |
| | 1393 | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO, MENUITEM_COLOR_FG, &conf.histo_color, 0 ), |
| | 1394 | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO_BKG, MENUITEM_COLOR_BG, &conf.histo_color, 0 ), |
| | 1395 | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO_BORDER, MENUITEM_COLOR_FG, &conf.histo_color2, 0 ), |
| | 1396 | MENU_ITEM(0x65,LANG_MENU_VIS_HISTO_MARKERS, MENUITEM_COLOR_BG, &conf.histo_color2, 0 ), |
| | 1397 | MENU_ITEM(0x65,LANG_MENU_VIS_ZEBRA_UNDER, MENUITEM_COLOR_BG, &conf.zebra_color, 0 ), |
| | 1398 | MENU_ITEM(0x65,LANG_MENU_VIS_ZEBRA_OVER, MENUITEM_COLOR_FG, &conf.zebra_color, 0 ), |
| | 1399 | //MENU_ITEM(0x65,LANG_MENU_VIS_BATT_ICON, MENUITEM_COLOR_FG, &conf.batt_icon_color, 0 ), |
| | 1400 | MENU_ITEM(0x65,LANG_MENU_VIS_SPACE_ICON, MENUITEM_COLOR_FG, &conf.space_color, 0 ), |
| | 1401 | MENU_ITEM(0x65,LANG_MENU_VIS_SPACE_ICON_BKG, MENUITEM_COLOR_BG, &conf.space_color, 0 ), |
| | 1402 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_TEXT, MENUITEM_COLOR_FG, &conf.menu_color, 0 ), |
| | 1403 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_BKG, MENUITEM_COLOR_BG, &conf.menu_color, 0 ), |
| | 1404 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_TITLE_TEXT, MENUITEM_COLOR_FG, &conf.menu_title_color, 0 ), |
| | 1405 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_TITLE_BKG, MENUITEM_COLOR_BG, &conf.menu_title_color, 0 ), |
| | 1406 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_CURSOR_TEXT, MENUITEM_COLOR_FG, &conf.menu_cursor_color, 0 ), |
| | 1407 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_CURSOR_BKG, MENUITEM_COLOR_BG, &conf.menu_cursor_color, 0 ), |
| | 1408 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_SYMBOL_TEXT, MENUITEM_COLOR_FG, &conf.menu_symbol_color, 0 ), |
| | 1409 | MENU_ITEM(0x65,LANG_MENU_VIS_MENU_SYMBOL_BKG, MENUITEM_COLOR_BG, &conf.menu_symbol_color, 0 ), |
| | 1410 | MENU_ITEM(0x65,LANG_MENU_VIS_READER_TEXT, MENUITEM_COLOR_FG, &conf.reader_color, 0 ), |
| | 1411 | MENU_ITEM(0x65,LANG_MENU_VIS_READER_BKG, MENUITEM_COLOR_BG, &conf.reader_color, 0 ), |
| | 1412 | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_OVERRIDE, MENUITEM_COLOR_FG, &conf.osd_color_override, 0 ), |
| | 1413 | MENU_ITEM(0x65,LANG_MENU_VIS_OSD_OVERRIDE_BKG, MENUITEM_COLOR_BG, &conf.osd_color_override, 0 ), |
| | 1414 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1415 | {0} |
| | 1416 | }; |
| | 1417 | |
| | 1418 | static CMenu visual_submenu = {0x28,LANG_MENU_VIS_TITLE, NULL, visual_submenu_items }; |
| | 1419 | |
| | 1420 | //------------------------------------------------------------------- |
| | 1421 | |
| | 1422 | static CMenuItem raw_state_submenu_items[] = { |
| | 1423 | MENU_ITEM (0x5c,LANG_MENU_OSD_SHOW_RAW_STATE, MENUITEM_BOOL, &conf.show_raw_state, 0 ), |
| | 1424 | MENU_ITEM (0x5c,LANG_MENU_OSD_SHOW_REMAINING_RAW, MENUITEM_BOOL, &conf.show_remaining_raw, 0 ), |
| | 1425 | MENU_ITEM (0x60,LANG_MENU_OSD_RAW_TRESHOLD, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.remaining_raw_treshold, MENU_MINMAX(0, 200) ), |
| | 1426 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1427 | {0} |
| | 1428 | }; |
| | 1429 | |
| | 1430 | static CMenu raw_state_submenu = {0x24,LANG_MENU_OSD_RAW_STATE_PARAMS_TITLE, NULL, raw_state_submenu_items }; |
| | 1431 | |
| | 1432 | //------------------------------------------------------------------- |
| | 1433 | |
| | 1434 | #ifdef CAM_TOUCHSCREEN_UI |
| | 1435 | |
| | 1436 | static const char* gui_touchscreen_disable_modes[]= { "Enable", "Disable" }; |
| | 1437 | |
| | 1438 | static CMenuItem touchscreen_submenu_items[] = { |
| | 1439 | MENU_ENUM2 (0x5f,LANG_MENU_TS_VIDEO_AE_DISABLE, &conf.touchscreen_disable_video_controls, gui_touchscreen_disable_modes ), |
| | 1440 | MENU_ENUM2 (0x5f,LANG_MENU_TS_ALT_SHORTCUTS_DISABLE, &conf.touchscreen_disable_shortcut_controls, gui_touchscreen_disable_modes ), |
| | 1441 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1442 | {0} |
| | 1443 | }; |
| | 1444 | |
| | 1445 | static CMenu touchscreen_submenu = {0x28,LANG_MENU_TOUCHSCREEN_VALUES, NULL, touchscreen_submenu_items }; |
| | 1446 | |
| | 1447 | #endif |
| | 1448 | |
| | 1449 | //------------------------------------------------------------------- |
| | 1450 | |
| | 1451 | #ifdef CAM_HAS_CMOS |
| | 1452 | static const char* gui_temp_mode_modes[] = { "Off", "Optical", "CMOS", "Battery", "all" }; |
| | 1453 | #else |
| | 1454 | static const char* gui_temp_mode_modes[] = { "Off", "Optical", "CCD", "Battery", "all" }; |
| | 1455 | #endif |
| | 1456 | static const char* gui_hide_osd_modes[] = { "Don't", "In Playback", "On Disp Press", "Both" }; |
| | 1457 | static const char* gui_show_usb_info_modes[] = { "Off", "Icon", "Text" }; |
| | 1458 | |
| | 1459 | static CMenuItem osd_submenu_items[] = { |
| | 1460 | MENU_ITEM(0x5c,LANG_MENU_OSD_SHOW, MENUITEM_BOOL, &conf.show_osd, 0 ), |
| | 1461 | MENU_ENUM2(0x5c,LANG_MENU_OSD_HIDE_PLAYBACK, &conf.hide_osd, gui_hide_osd_modes ), |
| | 1462 | MENU_ITEM(0x5f,LANG_MENU_OSD_SHOW_STATES, MENUITEM_BOOL, &conf.show_state, 0 ), |
| | 1463 | MENU_ENUM2(0x5f,LANG_MENU_OSD_SHOW_TEMP, &conf.show_temp, gui_temp_mode_modes ), |
| | 1464 | MENU_ITEM(0x59,LANG_MENU_OSD_TEMP_FAHRENHEIT, MENUITEM_BOOL, &conf.temperature_unit, 0 ), |
| | 1465 | MENU_ENUM2(0x71,LANG_MENU_USB_SHOW_INFO, &conf.usb_info_enable, gui_show_usb_info_modes ), |
| | 1466 | MENU_ITEM(0x72,LANG_MENU_OSD_LAYOUT_EDITOR, MENUITEM_PROC, gui_menu_run_fltmodule, "_osd_le.flt" ), |
| | 1467 | MENU_ITEM(0x2f,LANG_MENU_OSD_GRID_PARAMS, MENUITEM_SUBMENU, &grid_submenu, 0 ), |
| | 1468 | MENU_ITEM(0x22,LANG_MENU_OSD_VALUES, MENUITEM_SUBMENU, &values_submenu, 0 ), |
| | 1469 | MENU_ITEM(0x31,LANG_MENU_OSD_DOF_CALC, MENUITEM_SUBMENU, &dof_submenu, 0 ), |
| | 1470 | MENU_ITEM(0x24,LANG_MENU_OSD_RAW_STATE_PARAMS, MENUITEM_SUBMENU, &raw_state_submenu, 0 ), |
| | 1471 | MENU_ITEM(0x32,LANG_MENU_OSD_BATT_PARAMS, MENUITEM_SUBMENU, &battery_submenu, 0 ), |
| | 1472 | MENU_ITEM(0x33,LANG_MENU_OSD_SPACE_PARAMS, MENUITEM_SUBMENU, &space_submenu, 0 ), |
| | 1473 | MENU_ITEM(0x34,LANG_MENU_OSD_CLOCK_PARAMS, MENUITEM_SUBMENU, &clock_submenu, 0 ), |
| | 1474 | MENU_ITEM(0x59,LANG_MENU_OSD_SHOW_IN_REVIEW, MENUITEM_BOOL, &conf.show_osd_in_review, 0 ), |
| | 1475 | #ifdef CAM_TOUCHSCREEN_UI |
| | 1476 | MENU_ITEM (0x22,LANG_MENU_TOUCHSCREEN_VALUES, MENUITEM_SUBMENU, &touchscreen_submenu, 0 ), |
| | 1477 | #endif |
| | 1478 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1479 | {0} |
| | 1480 | }; |
| | 1481 | |
| | 1482 | static CMenu osd_submenu = {0x22,LANG_MENU_OSD_TITLE, NULL, osd_submenu_items }; |
| | 1483 | |
| | 1484 | //------------------------------------------------------------------- |
| | 1485 | |
| | 1486 | static const char* gui_histo_show_modes[] = { "Don't", "Always", "Shoot" }; |
| | 1487 | static const char* gui_histo_view_modes[]={ "RGB", "Y", "RGB Y", "R G B", "RGB all", "Y all", "Blend", "Blend Y"}; |
| | 1488 | static const char* gui_histo_transform_modes[]={ "Linear", "Log" }; |
| | 1489 | |
| | 1490 | static CMenuItem histo_submenu_items[] = { |
| | 1491 | MENU_ENUM2(0x5f,LANG_MENU_HISTO_SHOW, &conf.show_histo, gui_histo_show_modes ), |
| | 1492 | MENU_ENUM2(0x6f,LANG_MENU_HISTO_LAYOUT, &conf.histo_layout, gui_histo_view_modes ), |
| | 1493 | MENU_ENUM2(0x5f,LANG_MENU_HISTO_MODE, &conf.histo_mode, gui_histo_transform_modes ), |
| | 1494 | MENU_ITEM(0x5c,LANG_MENU_HISTO_EXP, MENUITEM_BOOL, &conf.show_overexp, 0 ), |
| | 1495 | MENU_ITEM(0x70,LANG_MENU_HISTO_IGNORE_PEAKS, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.histo_ignore_boundary, MENU_MINMAX(0, 32) ), |
| | 1496 | MENU_ITEM(0x5c,LANG_MENU_HISTO_MAGNIFY, MENUITEM_BOOL, &conf.histo_auto_ajust, 0 ), |
| | 1497 | MENU_ITEM(0x5c,LANG_MENU_HISTO_SHOW_EV_GRID, MENUITEM_BOOL, &conf.histo_show_ev_grid, 0 ), |
| | 1498 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1499 | {0} |
| | 1500 | }; |
| | 1501 | |
| | 1502 | static CMenu histo_submenu = {0x25,LANG_MENU_HISTO_TITLE, NULL, histo_submenu_items }; |
| | 1503 | |
| | 1504 | //------------------------------------------------------------------- |
| | 1505 | |
| | 1506 | static CMenuItem raw_exceptions_submenu_items[] = { |
| | 1507 | #if defined CAM_HAS_VIDEO_BUTTON |
| | 1508 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_VIDEO, MENUITEM_BOOL, &conf.save_raw_in_video, 0 ), |
| | 1509 | #endif |
| | 1510 | #if defined(CAMERA_s3is) |
| | 1511 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_SPORTS, MENUITEM_BOOL, &conf.save_raw_in_sports, 0 ), |
| | 1512 | #endif |
| | 1513 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_BURST, MENUITEM_BOOL, &conf.save_raw_in_burst, 0 ), |
| | 1514 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_TIMER, MENUITEM_BOOL, &conf.save_raw_in_timer, 0 ), |
| | 1515 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_EDGEOVERLAY, MENUITEM_BOOL, &conf.save_raw_in_edgeoverlay, 0 ), |
| | 1516 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_AUTO, MENUITEM_BOOL, &conf.save_raw_in_auto, 0 ), |
| | 1517 | #if CAM_BRACKETING |
| | 1518 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_EV_BRACKETING, MENUITEM_BOOL, &conf.save_raw_in_ev_bracketing, 0 ), |
| | 1519 | #endif |
| | 1520 | MENU_ITEM (0x5c,LANG_MENU_RAW_WARN, MENUITEM_BOOL, &conf.raw_exceptions_warn, 0 ), |
| | 1521 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1522 | {0} |
| | 1523 | }; |
| | 1524 | |
| | 1525 | static CMenu raw_exceptions_submenu = {0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS_TITLE, NULL, raw_exceptions_submenu_items }; |
| | 1526 | |
| | 1527 | //------------------------------------------------------------------- |
| | 1528 | |
| | 1529 | #if DNG_SUPPORT |
| | 1530 | |
| | 1531 | static void cb_change_dng() |
| | 1532 | { |
| | 1533 | int old=conf.dng_version; |
| | 1534 | conf_change_dng(); |
| | 1535 | if ((old==1) && (conf.dng_version==0)) gui_mbox_init(LANG_ERROR, LANG_CANNOT_OPEN_BADPIXEL_FILE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| | 1536 | } |
| | 1537 | |
| | 1538 | static const char* gui_dng_version(int change, int arg) |
| | 1539 | { |
| | 1540 | static const char* modes[]={ "1.3", "1.1" }; |
| | 1541 | |
| | 1542 | gui_enum_value_change(&conf.dng_version,change,sizeof(modes)/sizeof(modes[0])); |
| | 1543 | cb_change_dng(); |
| | 1544 | |
| | 1545 | return modes[conf.dng_version]; |
| | 1546 | } |
| | 1547 | |
| | 1548 | static void gui_menuproc_badpixel_create(int arg) |
| | 1549 | { |
| | 1550 | // After this action module will not be unloaded until reboot |
| | 1551 | // because not clear when it finished |
| | 1552 | if ( module_dng_load(LIBDNG_OWNED_BY_CREATEBADPIXEL) ) |
| | 1553 | libdng->create_badpixel_bin(); |
| | 1554 | } |
| | 1555 | |
| | 1556 | #endif |
| | 1557 | |
| | 1558 | static void raw_fselect_cb(const char * filename) |
| | 1559 | { |
| | 1560 | struct stat st; |
| | 1561 | if (!filename) return; |
| | 1562 | stat((char*)filename,&st); |
| | 1563 | if (st.st_size!=hook_raw_size()) return; |
| | 1564 | gui_mbox_init((int)"", LANG_RAW_DEVELOP_MESSAGE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
| | 1565 | raw_prepare_develop((char*)filename); |
| | 1566 | } |
| | 1567 | |
| | 1568 | static void gui_raw_develop(int arg) |
| | 1569 | { |
| | 1570 | module_fselect_init(LANG_RAW_DEVELOP_SELECT_FILE, "A/DCIM", "A", raw_fselect_cb); |
| | 1571 | } |
| | 1572 | |
| | 1573 | static const char* gui_bad_pixel_enum(int change, int arg) |
| | 1574 | { |
| | 1575 | int modes[]={LANG_MENU_BAD_PIXEL_OFF, LANG_MENU_BAD_PIXEL_INTERPOLATION, LANG_MENU_BAD_PIXEL_RAW_CONVERTER}; |
| | 1576 | |
| | 1577 | return lang_str((int)gui_change_simple_enum(&conf.bad_pixel_removal,change,(const char**)modes,sizeof(modes)/sizeof(modes[0]))); |
| | 1578 | } |
| | 1579 | |
| | 1580 | #if defined (DNG_EXT_FROM) |
| | 1581 | static void cb_change_dng_usb_ext() |
| | 1582 | { |
| | 1583 | if (conf.dng_usb_ext) change_ext_to_dng(); |
| | 1584 | else change_ext_to_default(); |
| | 1585 | } |
| | 1586 | #endif |
| | 1587 | |
| | 1588 | static const char* gui_raw_nr_modes[] = { "Auto", "Off", "On"}; |
| | 1589 | |
| | 1590 | static CMenuItem raw_submenu_items[] = { |
| | 1591 | #if DNG_SUPPORT |
| | 1592 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, (int)cb_change_dng ), |
| | 1593 | #else |
| | 1594 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, 0 ), |
| | 1595 | #endif |
| | 1596 | MENU_ITEM (0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS, MENUITEM_SUBMENU, &raw_exceptions_submenu, 0 ), |
| | 1597 | MENU_ENUM2 (0x5f,LANG_MENU_RAW_NOISE_REDUCTION, &conf.raw_nr, gui_raw_nr_modes ), |
| | 1598 | MENU_ITEM (0x5c,LANG_MENU_RAW_FIRST_ONLY, MENUITEM_BOOL, &conf.raw_save_first_only, 0 ), |
| | 1599 | MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_DIR, MENUITEM_BOOL, &conf.raw_in_dir, 0 ), |
| | 1600 | MENU_ENUM2a (0x5f,LANG_MENU_RAW_PREFIX, &conf.raw_prefix, img_prefixes, NUM_IMG_PREFIXES ), |
| | 1601 | MENU_ENUM2a (0x5f,LANG_MENU_RAW_EXTENSION, &conf.raw_ext, img_exts, NUM_IMG_EXTS ), |
| | 1602 | MENU_ENUM2a (0x5f,LANG_MENU_SUB_PREFIX, &conf.sub_batch_prefix, img_prefixes, NUM_IMG_PREFIXES ), |
| | 1603 | MENU_ENUM2a (0x5f,LANG_MENU_SUB_EXTENSION, &conf.sub_batch_ext, img_exts, NUM_IMG_EXTS ), |
| | 1604 | // MENU_ITEM (0x60,LANG_MENU_SUB_IN_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_in_dark_value, MENU_MINMAX(0, 1023) ), |
| | 1605 | // MENU_ITEM (0x60,LANG_MENU_SUB_OUT_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_out_dark_value, MENU_MINMAX(0, 1023) ), |
| | 1606 | MENU_ITEM (0x2a,LANG_MENU_RAW_DEVELOP, MENUITEM_PROC, gui_raw_develop, 0 ), |
| | 1607 | MENU_ITEM (0x5c,LANG_MENU_BAD_PIXEL_REMOVAL, MENUITEM_ENUM, gui_bad_pixel_enum, 0 ), |
| | 1608 | MENU_ITEM (0x5c,LANG_MENU_RAW_CACHED, MENUITEM_BOOL, &conf.raw_cache, 0 ), |
| | 1609 | #ifdef OPT_DEBUGGING |
| | 1610 | MENU_ITEM (0x5c,LANG_MENU_RAW_TIMER, MENUITEM_BOOL, &conf.raw_timer, 0 ), |
| | 1611 | #endif |
| | 1612 | #if DNG_SUPPORT |
| | 1613 | MENU_ITEM (0x0 ,(int)"DNG", MENUITEM_SEPARATOR, 0, 0 ), |
| | 1614 | MENU_ITEM (0x5c,LANG_MENU_DNG_FORMAT, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_raw , (int)cb_change_dng ), |
| | 1615 | MENU_ITEM (0x5c,LANG_MENU_RAW_DNG_EXT, MENUITEM_BOOL, &conf.raw_dng_ext, 0 ), |
| | 1616 | MENU_ITEM (0x5f,LANG_MENU_DNG_VERSION, MENUITEM_ENUM, gui_dng_version, 0), |
| | 1617 | MENU_ITEM (0x2a,LANG_MENU_BADPIXEL_CREATE, MENUITEM_PROC, gui_menuproc_badpixel_create, 0 ), |
| | 1618 | #endif |
| | 1619 | #if defined (DNG_EXT_FROM) |
| | 1620 | MENU_ITEM (0x71,LANG_MENU_DNG_VIA_USB, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_usb_ext , (int)cb_change_dng_usb_ext ), |
| | 1621 | #endif |
| | 1622 | MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1623 | {0} |
| | 1624 | }; |
| | 1625 | |
| | 1626 | static CMenu raw_submenu = {0x24,LANG_MENU_RAW_TITLE, NULL, raw_submenu_items }; |
| | 1627 | |
| | 1628 | //------------------------------------------------------------------- |
| | 1629 | |
| | 1630 | #if defined(OPT_CURVES) |
| | 1631 | |
| | 1632 | static const char* gui_conf_curve_enum(int change, int arg) { |
| | 1633 | static const char* modes[]={ "None", "Custom", "+1EV", "+2EV", "Auto DR" }; |
| | 1634 | |
| | 1635 | gui_enum_value_change(&conf.curve_enable,change,sizeof(modes)/sizeof(modes[0])); |
| | 1636 | |
| | 1637 | if (change) |
| | 1638 | if (module_curves_load()) |
| | 1639 | libcurves->curve_init_mode(); |
| | 1640 | return modes[conf.curve_enable]; |
| | 1641 | } |
| | 1642 | |
| | 1643 | static void gui_load_curve_selected(const char *fn) |
| | 1644 | { |
| | 1645 | if (fn) { |
| | 1646 | // TODO we could sanity check here, but curve_set_type should fail gracefullish |
| | 1647 | strcpy(conf.curve_file,fn); |
| | 1648 | if (conf.curve_enable == 1) |
| | 1649 | if (module_curves_load()) |
| | 1650 | libcurves->curve_init_mode(); |
| | 1651 | } |
| | 1652 | } |
| | 1653 | |
| | 1654 | static void gui_load_curve(int arg) |
| | 1655 | { |
| | 1656 | module_fselect_init(LANG_STR_SELECT_CURVE_FILE, conf.curve_file, CURVE_DIR, gui_load_curve_selected); |
| | 1657 | } |
| | 1658 | |
| | 1659 | static CMenuItem curve_submenu_items[] = { |
| | 1660 | MENU_ITEM(0x5f,LANG_MENU_CURVE_ENABLE, MENUITEM_ENUM, gui_conf_curve_enum, 0 ), |
| | 1661 | MENU_ITEM(0x35,LANG_MENU_CURVE_LOAD, MENUITEM_PROC, gui_load_curve, 0 ), |
| | 1662 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1663 | {0} |
| | 1664 | }; |
| | 1665 | |
| | 1666 | static CMenu curve_submenu = {0x85,LANG_MENU_CURVE_PARAM_TITLE, NULL, curve_submenu_items }; |
| | 1667 | |
| | 1668 | #endif |
| | 1669 | //------------------------------------------------------------------- |
| | 1670 | |
| | 1671 | void cb_zebra_restore_screen() |
| | 1672 | { |
| | 1673 | if (!conf.zebra_restore_screen) |
| | 1674 | conf.zebra_restore_osd = 0; |
| | 1675 | } |
| | 1676 | |
| | 1677 | void cb_zebra_restore_osd() |
| | 1678 | { |
| | 1679 | if (conf.zebra_restore_osd) |
| | 1680 | conf.zebra_restore_screen = 1; |
| | 1681 | } |
| | 1682 | |
| | 1683 | static const char* gui_zebra_mode_modes[] = { "Blink 1", "Blink 2", "Blink 3", "Solid", "Zebra 1", "Zebra 2" }; |
| | 1684 | static const char* gui_zebra_draw_osd_modes[] = { "Nothing", "Histo", "OSD" }; |
| | 1685 | |
| | 1686 | static CMenuItem zebra_submenu_items[] = { |
| | 1687 | MENU_ITEM(0x5c,LANG_MENU_ZEBRA_DRAW, MENUITEM_BOOL, &conf.zebra_draw, 0 ), |
| | 1688 | MENU_ENUM2(0x5f,LANG_MENU_ZEBRA_MODE, &conf.zebra_mode, gui_zebra_mode_modes ), |
| | 1689 | MENU_ITEM(0x58,LANG_MENU_ZEBRA_UNDER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zebra_under, MENU_MINMAX(0, 32) ), |
| | 1690 | MENU_ITEM(0x57,LANG_MENU_ZEBRA_OVER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zebra_over, MENU_MINMAX(0, 32) ), |
| | 1691 | MENU_ITEM(0x28,LANG_MENU_ZEBRA_RESTORE_SCREEN, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.zebra_restore_screen, cb_zebra_restore_screen ), |
| | 1692 | MENU_ITEM(0x5c,LANG_MENU_ZEBRA_RESTORE_OSD, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.zebra_restore_osd, cb_zebra_restore_osd ), |
| | 1693 | MENU_ENUM2(0x5f,LANG_MENU_ZEBRA_DRAW_OVER, &conf.zebra_draw_osd, gui_zebra_draw_osd_modes ), |
| | 1694 | MENU_ITEM(0x5c,LANG_MENU_ZEBRA_MULTICHANNEL, MENUITEM_BOOL, &conf.zebra_multichannel, 0 ), |
| | 1695 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1696 | {0} |
| | 1697 | }; |
| | 1698 | |
| | 1699 | static CMenu zebra_submenu = {0x26,LANG_MENU_ZEBRA_TITLE, NULL, zebra_submenu_items }; |
| | 1700 | |
| | 1701 | //------------------------------------------------------------------- |
| | 1702 | |
| | 1703 | #if CAM_ADJUSTABLE_ALT_BUTTON |
| | 1704 | |
| | 1705 | static const char* gui_alt_mode_button_enum(int change, int arg) |
| | 1706 | { |
| | 1707 | #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_s5is) |
| | 1708 | static const char* names[]={ "Shrtcut", "Flash", "Timer", "ISO", "Video" }; |
| | 1709 | static const int keys[]={ KEY_PRINT, KEY_FLASH, KEY_TIMER, KEY_ISO, KEY_VIDEO }; |
| | 1710 | #elif defined(CAMERA_g7) || defined(CAMERA_g9) |
| | 1711 | static const char* names[]={ "Print", "FE"}; |
| | 1712 | static const int keys[]={ KEY_PRINT, KEY_MICROPHONE }; |
| | 1713 | #elif defined(CAMERA_g10) || defined(CAMERA_g12) |
| | 1714 | static const char* names[]={ "Print", "Disp", "AE Lock", "Jump" }; |
| | 1715 | static const int keys[]={ KEY_PRINT, KEY_DISPLAY, KEY_AE_LOCK, KEY_METERING}; |
| | 1716 | #elif defined(CAMERA_g11) |
| | 1717 | static const char* names[]={ "Print", "Disp", "AE Lock", "Jump" }; |
| | 1718 | static const int keys[]={ KEY_PRINT, KEY_DISPLAY, KEY_MICROPHONE, KEY_METERING}; |
| | 1719 | #elif defined(CAMERA_a650) |
| | 1720 | static const char* names[]={ "Print", "ISO"}; |
| | 1721 | static const int keys[]={ KEY_PRINT, KEY_ISO }; |
| | 1722 | #elif defined(CAMERA_a3300) |
| | 1723 | static const char* names[]={ "Print", "Face", "Disp"}; |
| | 1724 | static const int keys[]={ KEY_PRINT, KEY_FACE, KEY_DISPLAY }; |
| | 1725 | #elif defined(CAMERA_sx100is) || defined(CAMERA_sx110is) |
| | 1726 | static const char* names[]={ "Print", "Face"}; |
| | 1727 | static const int keys[]={ KEY_PRINT, KEY_FACE }; |
| | 1728 | #elif defined(CAMERA_sx10) || defined(CAMERA_sx1) || defined(CAMERA_sx20) || defined(CAMERA_sx30) || defined(CAMERA_sx40hs) |
| | 1729 | static const char* names[]={ "Shrtcut", "Flash", "Video"}; |
| | 1730 | static const int keys[]={ KEY_PRINT, KEY_FLASH, KEY_VIDEO }; |
| | 1731 | #elif defined(CAMERA_a410) || defined(CAMERA_a430) || defined(CAMERA_a420) || defined(CAMERA_a530) || defined(CAMERA_a540) || defined(CAMERA_a570) || defined(CAMERA_a580) || defined(CAMERA_a590) ||defined(CAMERA_a630) || defined(CAMERA_a640) || defined(CAMERA_a610) || defined(CAMERA_a620) || defined(CAMERA_a700) || defined(CAMERA_a710) || defined(CAMERA_a720) || defined(CAMERA_ixus65_sd630) || defined(CAMERA_ixus800_sd700) |
| | 1732 | static const char* names[]={ "Print", "Display"}; |
| | 1733 | static const int keys[] = {KEY_PRINT, KEY_DISPLAY}; |
| | 1734 | #elif defined(CAMERA_sx150is) || (CAMERA_sx220hs) || defined(CAMERA_sx230hs) || defined(CAMERA_s100) |
| | 1735 | static const char* names[]={ "Playback", "Video", "Display" }; |
| | 1736 | static const int keys[] = {KEY_PRINT, KEY_VIDEO, KEY_DISPLAY}; |
| | 1737 | #elif defined(CAMERA_ixus220_elph300hs) || defined(CAMERA_ixus230_elph310hs) |
| | 1738 | static const char* names[]={ "Video", "Display", "Playback", "Video"}; |
| | 1739 | static const int keys[] = {KEY_PRINT, KEY_DISPLAY, KEY_PLAYBACK, KEY_VIDEO}; |
| | 1740 | #else |
| | 1741 | #error camera alt-buttons not defined |
| | 1742 | #endif |
| | 1743 | int i; |
| | 1744 | |
| | 1745 | for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { |
| | 1746 | if (conf.alt_mode_button==keys[i]) { |
| | 1747 | break; |
| | 1748 | } |
| | 1749 | } |
| | 1750 | |
| | 1751 | i+=change; |
| | 1752 | if (i<0) |
| | 1753 | i=(sizeof(names)/sizeof(names[0]))-1; |
| | 1754 | else if (i>=(sizeof(names)/sizeof(names[0]))) |
| | 1755 | i=0; |
| | 1756 | |
| | 1757 | conf.alt_mode_button = keys[i]; |
| | 1758 | kbd_set_alt_mode_key_mask(conf.alt_mode_button); |
| | 1759 | return names[i]; |
| | 1760 | } |
| | 1761 | #endif |
| | 1762 | |
| | 1763 | static const char* gui_alt_power_enum(int change, int arg) |
| | 1764 | { |
| | 1765 | // Script option is retained even if scripting is disabled, otherwise conf values will change |
| | 1766 | // Equivalent to ALT |
| | 1767 | static const char* modes[]={ "Never", "Alt", "Script", "Always" }; |
| | 1768 | |
| | 1769 | gui_enum_value_change(&conf.alt_prevent_shutdown,change,sizeof(modes)/sizeof(modes[0])); |
| | 1770 | |
| | 1771 | return modes[conf.alt_prevent_shutdown]; |
| | 1772 | } |
| | 1773 | |
| | 1774 | static CMenuItem settings_submenu_items[] = { |
| | 1775 | #if CAM_SWIVEL_SCREEN |
| | 1776 | MENU_ITEM(0x28,LANG_MENU_MISC_FLASHLIGHT, MENUITEM_BOOL, &conf.flashlight, 0 ), |
| | 1777 | #endif |
| | 1778 | MENU_ITEM(0x5c,LANG_MENU_MISC_SHOW_SPLASH, MENUITEM_BOOL, &conf.splash_show, 0 ), |
| | 1779 | MENU_ITEM(0x5c,LANG_MENU_MISC_START_SOUND, MENUITEM_BOOL, &conf.start_sound, 0 ), |
| | 1780 | #if CAM_USE_ZOOM_FOR_MF |
| | 1781 | MENU_ITEM(0x59,LANG_MENU_MISC_ZOOM_FOR_MF, MENUITEM_BOOL, &conf.use_zoom_mf, 0 ), |
| | 1782 | #endif |
| | 1783 | #if CAM_ADJUSTABLE_ALT_BUTTON |
| | 1784 | MENU_ITEM(0x22,LANG_MENU_MISC_ALT_BUTTON, MENUITEM_ENUM, gui_alt_mode_button_enum, 0 ), |
| | 1785 | #endif |
| | 1786 | #if defined(CAM_ZOOM_ASSIST_BUTTON_CONTROL) |
| | 1787 | MENU_ITEM(0x5c,LANG_MENU_MISC_ZOOM_ASSIST, MENUITEM_BOOL, &conf.zoom_assist_button_disable, 0 ), |
| | 1788 | #endif |
| | 1789 | MENU_ITEM(0x5d,LANG_MENU_MISC_DISABLE_LCD_OFF, MENUITEM_ENUM, gui_alt_power_enum, 0 ), |
| | 1790 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1791 | {0} |
| | 1792 | }; |
| | 1793 | |
| | 1794 | static CMenu settings_submenu = {0x26,LANG_MENU_OTHER_SETTINGS, NULL, settings_submenu_items }; |
| | 1795 | |
| | 1796 | //------------------------------------------------------------------- |
| | 1797 | |
| | 1798 | static const char* gui_user_menu_show_enum(int change, int arg) |
| | 1799 | { |
| | 1800 | static const char* modes[]={ "Off", "On","On Direct", "Edit" }; |
| | 1801 | |
| | 1802 | if (conf.user_menu_enable == 3) user_menu_save(); |
| | 1803 | |
| | 1804 | return gui_change_simple_enum(&conf.user_menu_enable,change,modes,sizeof(modes)/sizeof(modes[0])); |
| | 1805 | } |
| | 1806 | |
| | 1807 | static CMenuItem menu_settings_submenu_items[] = { |
| | 1808 | MENU_ITEM(0x5f,LANG_MENU_USER_MENU_ENABLE, MENUITEM_ENUM, gui_user_menu_show_enum, 0 ), |
| | 1809 | MENU_ITEM(0x5c,LANG_MENU_USER_MENU_AS_ROOT, MENUITEM_BOOL, &conf.user_menu_as_root, 0 ), |
| | 1810 | MENU_ITEM(0x81,LANG_MENU_VIS_MENU_CENTER, MENUITEM_BOOL, &conf.menu_center, 0 ), |
| | 1811 | MENU_ITEM(0x81,LANG_MENU_SELECT_FIRST_ENTRY, MENUITEM_BOOL, &conf.menu_select_first_entry, 0 ), |
| | 1812 | MENU_ITEM(0x5c,LANG_MENU_SHOW_ALT_HELP, MENUITEM_BOOL, &conf.show_alt_helper, 0 ), |
| | 1813 | MENU_ITEM(0x58,LANG_MENU_SHOW_ALT_HELP_DELAY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.show_alt_helper_delay, MENU_MINMAX(0, 10) ), |
| | 1814 | MENU_ITEM(0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), |
| | 1815 | {0} |
| | 1816 | }; |
| | 1817 | |
| | 1818 | static CMenu menu_settings_submenu = {0x26,LANG_MENU_MENU_SETTINGS, NULL, menu_settings_submenu_items }; |
| | 1819 | |
| | 1820 | //------------------------------------------------------------------- |
| | 1821 | |
| | 1822 | static CMenuItem root_menu_items[] = { |
| | 1823 | MENU_ITEM (0x21,LANG_MENU_OPERATION_PARAM, MENUITEM_SUBMENU, &operation_submenu, 0 ), |
| | 1824 | MENU_ITEM (0x23,LANG_MENU_VIDEO_PARAM, MENUITEM_SUBMENU, &video_submenu, 0 ), |
| | 1825 | MENU_ITEM (0x24,LANG_MENU_MAIN_RAW_PARAM, MENUITEM_SUBMENU, &raw_submenu, 0 ), |
| | 1826 | #ifdef OPT_EDGEOVERLAY |
| | 1827 | MENU_ITEM (0x7f,LANG_MENU_EDGE_OVERLAY, MENUITEM_SUBMENU, &edge_overlay_submenu, 0 ), |
| | 1828 | #endif |
| | 1829 | #ifdef OPT_CURVES |
| | 1830 | MENU_ITEM (0x85,LANG_MENU_CURVE_PARAM, MENUITEM_SUBMENU, &curve_submenu, 0 ), |
| | 1831 | #endif |
| | 1832 | MENU_ITEM (0x25,LANG_MENU_MAIN_HISTO_PARAM, MENUITEM_SUBMENU, &histo_submenu, 0 ), |
| | 1833 | MENU_ITEM (0x26,LANG_MENU_MAIN_ZEBRA_PARAM, MENUITEM_SUBMENU, &zebra_submenu, 0 ), |
| | 1834 | #ifdef OPT_SCRIPTING |
| | 1835 | MENU_ITEM (0x27,LANG_MENU_MAIN_SCRIPT_PARAM, MENUITEM_SUBMENU, &script_submenu, 0 ), |
| | 1836 | #endif |
| | 1837 | MENU_ITEM (0x22,LANG_MENU_MAIN_OSD_PARAM, MENUITEM_SUBMENU, &osd_submenu, 0 ), |
| | 1838 | MENU_ITEM (0x28,LANG_MENU_MAIN_VISUAL_PARAM, MENUITEM_SUBMENU, &visual_submenu, 0 ), |
| | 1839 | MENU_ITEM (0x28,LANG_MENU_MENU_SETTINGS, MENUITEM_SUBMENU, &menu_settings_submenu, 0 ), |
| | 1840 | MENU_ITEM (0x28,LANG_MENU_OTHER_SETTINGS, MENUITEM_SUBMENU, &settings_submenu, 0 ), |
| | 1841 | MENU_ITEM (0x29,LANG_MENU_MAIN_MISC, MENUITEM_SUBMENU, &misc_submenu, 0 ), |
| | 1842 | #ifdef CAM_HAS_GPS |
| | 1843 | MENU_ITEM (0x2a,LANG_MENU_GPS, MENUITEM_SUBMENU, &gps_submenu, 0 ), |
| | 1844 | #endif |
| | 1845 | MENU_ITEM(0x2e,LANG_MENU_USER_MENU, MENUITEM_SUBMENU, &user_submenu, 0 ), |
| | 1846 | {0} |
| | 1847 | }; |
| | 1848 | |
| | 1849 | CMenu root_menu = {0x20,LANG_MENU_MAIN_TITLE, NULL, root_menu_items }; |
| | 1850 | |
| | 1851 | //------------------------------------------------------------------- |
| | 1852 | |
| | 1853 | const char* gui_on_off_enum(int change, int *conf_val) |
| | 1854 | { |
| | 1855 | static const char* modes[]={ "Off", "On"}; |
| | 1856 | return gui_change_simple_enum(conf_val,change,modes,sizeof(modes)/sizeof(modes[0])); |
| | 1857 | } |
| | 1858 | |
| | 1859 | #ifdef CAM_TOUCHSCREEN_UI |
| | 1860 | |
| | 1861 | const char* gui_override_disable_enum(int change, int arg) |
| | 1862 | { |
| | 1863 | return gui_change_simple_enum(&conf.override_disable,change,gui_override_disable_modes,sizeof(gui_override_disable_modes)/sizeof(gui_override_disable_modes[0])); |
| | 1864 | } |
| | 1865 | |
| | 1866 | const char* gui_nd_filter_state_enum(int change, int arg) |
| | 1867 | { |
| | 1868 | return gui_change_simple_enum(&conf.nd_filter_state,change,gui_nd_filter_state_modes,sizeof(gui_nd_filter_state_modes)/sizeof(gui_nd_filter_state_modes[0])); |
| | 1869 | } |
| | 1870 | |
| | 1871 | const char* gui_histo_show_enum(int change, int arg) |
| | 1872 | { |
| | 1873 | return gui_change_simple_enum(&conf.show_histo,change,gui_histo_show_modes,sizeof(gui_histo_show_modes)/sizeof(gui_histo_show_modes[0])); |
| | 1874 | } |
| | 1875 | |
| | 1876 | #endif |
| | 1877 | |
| | 1878 | //------------------------------------------------------------------- |
| | 1879 | static gui_handler *gui_mode=0; // current gui mode. pointer to gui_handler structure |
| | 1880 | |
| | 1881 | static int gui_osd_need_restore = 0; // Set when screen needs to be erase and redrawn |
| | 1882 | static int gui_mode_need_redraw = 0; // Set if current mode needs to redraw itself |
| | 1883 | static int gui_splash, gui_splash_mode; |
| | 1884 | |
| | 1885 | //------------------------------------------------------------------- |
| | 1886 | |
| | 1887 | void gui_set_need_restore() |
| | 1888 | { |
| | 1889 | gui_osd_need_restore = 1; |
| | 1890 | } |
| | 1891 | |
| | 1892 | void gui_set_need_redraw() |
| | 1893 | { |
| | 1894 | gui_mode_need_redraw = 1; |
| | 1895 | } |
| | 1896 | |
| | 1897 | //------------------------------------------------------------------- |
| | 1898 | void gui_init() |
| | 1899 | { |
| | 1900 | gui_set_mode(&defaultGuiHandler); |
| | 1901 | if (conf.start_sound>0) |
| | 1902 | { |
| | 1903 | play_sound(4); |
| | 1904 | } |
| | 1905 | gui_splash = (conf.splash_show)?SPLASH_TIME:0; |
| | 1906 | draw_init(); |
| | 1907 | |
| | 1908 | load_from_file( "A/CHDK/badpixel", make_pixel_list ); |
| | 1909 | load_from_file( "A/CHDK/badpixel.txt", make_pixel_list ); |
| | 1910 | } |
| | 1911 | |
| | 1912 | //------------------------------------------------------------------- |
| | 1913 | gui_mode_t gui_get_mode() { return gui_mode->mode; } |
| | 1914 | |
| | 1915 | //------------------------------------------------------------------- |
| | 1916 | // Set new GUI mode, returns old mode |
| | 1917 | gui_handler* gui_set_mode(gui_handler *mode) |
| | 1918 | { |
| | 1919 | if ( gui_mode == mode ) |
| | 1920 | return gui_mode; |
| | 1921 | |
| | 1922 | // Sanity check for case module pointer - is this really gui_handler |
| | 1923 | if ( mode->magicnum != GUI_MODE_MAGICNUM ) { |
| | 1924 | // If sanity failed (module is unload) - set to default mode |
| | 1925 | gui_mode = &defaultGuiHandler; |
| | 1926 | gui_set_need_restore(); |
| | 1927 | return gui_mode; |
| | 1928 | } |
| | 1929 | |
| | 1930 | #ifdef CAM_TOUCHSCREEN_UI |
| | 1931 | if (((gui_mode->mode == GUI_MODE_NONE) != (mode->mode == GUI_MODE_NONE)) || // Change from GUI_MODE_NONE to any other or vice-versa |
| | 1932 | ((gui_mode->mode > GUI_MODE_MENU) != (mode->mode > GUI_MODE_MENU))) // Switch in & out of menu mode |
| | 1933 | redraw_buttons = 1; |
| | 1934 | #endif |
| | 1935 | |
| | 1936 | gui_handler *old_mode = gui_mode; |
| | 1937 | gui_mode = mode; |
| | 1938 | |
| | 1939 | // Flag for screen erase/redraw unless mode is marked not to (e.g. menu box popup) |
| | 1940 | if (((gui_mode->flags & (GUI_MODE_FLAG_NODRAWRESTORE|GUI_MODE_FLAG_NORESTORE_ON_SWITCH)) == 0) && |
| | 1941 | ((old_mode->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH) == 0)) |
| | 1942 | gui_set_need_restore(); |
| | 1943 | // If old mode did not erase screen on exit then force current mode to redraw itself (e.g. exit menu popup back to file select) |
| | 1944 | if ((old_mode->flags & (GUI_MODE_FLAG_NORESTORE_ON_SWITCH)) != 0) |
| | 1945 | gui_set_need_redraw(); |
| | 1946 | |
| | 1947 | return old_mode; |
| | 1948 | } |
| | 1949 | |
| | 1950 | //------------------------------------------------------------------- |
| | 1951 | #if defined(VER_CHDK) |
| | 1952 | #define LOGO_WIDTH 149 |
| | 1953 | #define LOGO_HEIGHT 84 |
| | 1954 | #else |
| | 1955 | #define LOGO_WIDTH 169 |
| | 1956 | #define LOGO_HEIGHT 74 |
| | 1957 | #endif |
| | 1958 | |
| | 1959 | static void gui_draw_splash(char* logo, int logo_size) { |
| | 1960 | coord w, h, x, y; |
| | 1961 | static const char *text[] = { |
| | 1962 | "CHDK Version '" HDK_VERSION " " BUILD_NUMBER "-" BUILD_SVNREV "'" , |
| | 1963 | "Build: " __DATE__ " " __TIME__ , |
| | 1964 | "Camera: " PLATFORM " - " PLATFORMSUB }; |
| | 1965 | int i, l; |
| | 1966 | color cl = MAKE_COLOR(COLOR_RED, COLOR_WHITE); |
| | 1967 | |
| | 1968 | gui_splash_mode = (mode_get()&MODE_MASK); |
| | 1969 | |
| | 1970 | h=sizeof(text)/sizeof(text[0])*FONT_HEIGHT+8; |
| | 1971 | w=0; |
| | 1972 | for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { |
| | 1973 | l=strlen(text[i]); |
| | 1974 | if (l>w) w=l; |
| | 1975 | } |
| | 1976 | w=w*FONT_WIDTH+10; |
| | 1977 | |
| | 1978 | x = (camera_screen.width-w)>>1; y = ((camera_screen.height-h)>>1) + 20; |
| | 1979 | draw_filled_round_rect(x, y, x+w, y+h, MAKE_COLOR(COLOR_RED, COLOR_RED)); |
| | 1980 | for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { |
| | 1981 | draw_string(x+((w-strlen(text[i])*FONT_WIDTH)>>1), y+i*FONT_HEIGHT+4, text[i], cl); |
| | 1982 | } |
| | 1983 | if(logo){ |
| | 1984 | int pos; |
| | 1985 | int mx=0; |
| | 1986 | int my=0; |
| | 1987 | int offset_x = (CAM_SCREEN_WIDTH-LOGO_WIDTH)>>1; |
| | 1988 | int offset_y = ((CAM_SCREEN_HEIGHT-LOGO_HEIGHT)>>1) - 42; |
| | 1989 | const color color_lookup[8] = {COLOR_BLACK, |
| | 1990 | COLOR_SPLASH_RED/*0x2E redish*/, |
| | 1991 | COLOR_RED, |
| | 1992 | COLOR_GREY /*0x3D*/, |
| | 1993 | COLOR_SPLASH_GREY /*0x1F*/, |
| | 1994 | COLOR_SPLASH_PINK /*0x21 pinkish*/, |
| | 1995 | COLOR_TRANSPARENT /*0x00*/, |
| | 1996 | COLOR_WHITE /*0x11*/}; |
| | 1997 | for(pos=0; pos<logo_size; pos++){ |
| | 1998 | char data = logo[pos]; |
| | 1999 | color c = color_lookup[(data>>5) & 0x07]; |
| | 2000 | for(i=0; i<(data&0x1F)+1; i++){ |
| | 2001 | if (c!=0x00){ |
| | 2002 | draw_pixel(offset_x+mx,offset_y+my,c); |
| | 2003 | } |
| | 2004 | if (mx==LOGO_WIDTH){ |
| | 2005 | mx=0; |
| | 2006 | my++; |
| | 2007 | }else{ |
| | 2008 | mx++; |
| | 2009 | } |
| | 2010 | } |
| | 2011 | } |
| | 2012 | } |
| | 2013 | } |
| | 2014 | |
| | 2015 | static void gui_handle_splash(void) { |
| | 2016 | static char *logo = NULL; |
| | 2017 | static int logo_size; |
| | 2018 | if (gui_splash) { |
| | 2019 | static int need_logo=1; // don't use logo ptr, since we don't want to keep re-trying |
| | 2020 | if(need_logo) { |
| | 2021 | #if defined(VER_CHDK) |
| | 2022 | const char *logo_name="A/CHDK/DATA/logo.dat"; |
| | 2023 | #else // CHDK-DE |
| | 2024 | const char *logo_name="A/CHDK/DATA/logo_de.dat"; |
| | 2025 | #endif |
| | 2026 | FILE *fd; |
| | 2027 | struct stat st; |
| | 2028 | need_logo=0; |
| | 2029 | if (stat(logo_name,&st) == 0) { |
| | 2030 | logo_size=st.st_size; |
| | 2031 | logo=malloc(logo_size); |
| | 2032 | if(logo) { |
| | 2033 | fd = fopen(logo_name, "rb"); |
| | 2034 | if(fd){ |
| | 2035 | fread(logo,1,logo_size,fd); |
| | 2036 | fclose(fd); |
| | 2037 | } |
| | 2038 | else { |
| | 2039 | free(logo); |
| | 2040 | logo=NULL; |
| | 2041 | need_logo=1; |
| | 2042 | } |
| | 2043 | } |
| | 2044 | } |
| | 2045 | } |
| | 2046 | if (gui_splash>(SPLASH_TIME-4)) { |
| | 2047 | gui_draw_splash(logo,logo_size); |
| | 2048 | // conf.show_osd = 0; |
| | 2049 | } else if (gui_splash==1 && (mode_get()&MODE_MASK) == gui_splash_mode && (gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT)) { |
| | 2050 | gui_set_need_restore(); |
| | 2051 | // conf.show_osd = 1; //had to uncomment in order to fix a bug with disappearing osd... |
| | 2052 | } |
| | 2053 | --gui_splash; |
| | 2054 | if(!gui_splash) { |
| | 2055 | free(logo); |
| | 2056 | logo=NULL; |
| | 2057 | need_logo=1; |
| | 2058 | } |
| | 2059 | } |
| | 2060 | } |
| | 2061 | |
| | 2062 | //------------------------------------------------------------------- |
| | 2063 | |
| | 2064 | #ifdef CAM_DISP_ALT_TEXT |
| | 2065 | |
| | 2066 | static char* gui_shortcut_text(int button) |
| | 2067 | { |
| | 2068 | switch (button) |
| | 2069 | { |
| | 2070 | case KEY_DISPLAY: |
| | 2071 | #if defined(CAMERA_g1x) |
| | 2072 | return "METER"; |
| | 2073 | #else |
| | 2074 | return "DISP"; |
| | 2075 | #endif |
| | 2076 | case KEY_UP: |
| | 2077 | return "UP"; |
| | 2078 | case KEY_DOWN: |
| | 2079 | return "DOWN"; |
| | 2080 | case KEY_LEFT: |
| | 2081 | return "LEFT"; |
| | 2082 | case KEY_RIGHT: |
| | 2083 | return "RIGHT"; |
| | 2084 | case KEY_ERASE: |
| | 2085 | return "ERASE"; |
| | 2086 | case KEY_MENU: |
| | 2087 | return "MENU"; |
| | 2088 | default: |
| | 2089 | return "?"; |
| | 2090 | } |
| | 2091 | } |
| | 2092 | |
| | 2093 | static void shortcut_text(int button, int func_str, const char *state) |
| | 2094 | { |
| | 2095 | buf[0] = 0; |
| | 2096 | sprintf(buf,"%-5s %20s",gui_shortcut_text(button),lang_str(func_str)); |
| | 2097 | buf[26] = 0; |
| | 2098 | if (state) |
| | 2099 | { |
| | 2100 | sprintf(buf+strlen(buf)," [%6s",state); |
| | 2101 | buf[34] = 0; |
| | 2102 | strcat(buf,"]"); |
| | 2103 | } |
| | 2104 | else |
| | 2105 | strcat(buf," "); |
| | 2106 | } |
| | 2107 | |
| | 2108 | static int gui_helper_displayat = 0; |
| | 2109 | |
| | 2110 | static void gui_draw_alt_helper() |
| | 2111 | { |
| | 2112 | extern int kbd_any_key_pressed; |
| | 2113 | |
| | 2114 | if ((kbd_any_key_pressed != 0) || (state_kbd_script_run != 0) || (console_displayed != 0)) |
| | 2115 | { |
| | 2116 | if (gui_helper_displayat <= get_tick_count()) |
| | 2117 | gui_set_need_restore(); |
| | 2118 | gui_helper_displayat = get_tick_count() + (conf.show_alt_helper_delay * 1000); |
| | 2119 | } |
| | 2120 | |
| | 2121 | if ((conf.show_alt_helper == 0) || (gui_helper_displayat > get_tick_count())) |
| | 2122 | { |
| | 2123 | gui_draw_osd(); |
| | 2124 | return; |
| | 2125 | } |
| | 2126 | |
| | 2127 | int y = 2 * FONT_HEIGHT; |
| | 2128 | int x = ((CAM_SCREEN_WIDTH/2)-(FONT_WIDTH*35/2)); |
| | 2129 | |
| | 2130 | draw_string(x, y, "Shortcuts MENU = CHDK Menu", MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); |
| | 2131 | y += FONT_HEIGHT; |
| | 2132 | draw_string(x, y, "SET = Script Menu ", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2133 | y += FONT_HEIGHT; |
| | 2134 | draw_string(x, y, "Shutter= Run Active Script ", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2135 | y += FONT_HEIGHT; |
| | 2136 | |
| | 2137 | #ifdef OPT_DEBUGGING |
| | 2138 | if (conf.debug_shortcut_action) |
| | 2139 | { |
| | 2140 | shortcut_text(SHORTCUT_TOGGLE_RAW,LANG_MENU_DEBUG_SHORTCUT_ACTION,gui_debug_shortcut_modes[conf.debug_shortcut_action]); |
| | 2141 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2142 | y += FONT_HEIGHT; |
| | 2143 | } |
| | 2144 | else |
| | 2145 | #endif |
| | 2146 | { |
| | 2147 | shortcut_text(SHORTCUT_TOGGLE_RAW,LANG_MENU_RAW_SAVE,(conf.save_raw?(conf.dng_raw?"DNG":"RAW"):"Off")); |
| | 2148 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2149 | y += FONT_HEIGHT; |
| | 2150 | } |
| | 2151 | |
| | 2152 | #if defined(SHORTCUT_MF_TOGGLE) |
| | 2153 | shortcut_text(SHORTCUT_MF_TOGGLE,(int)"Manual Focus",gui_on_off_enum(0,&conf.subj_dist_override_koef)); |
| | 2154 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2155 | y += FONT_HEIGHT; |
| | 2156 | #endif |
| | 2157 | |
| | 2158 | if (shooting_get_common_focus_mode()) // Check in manual focus mode |
| | 2159 | { |
| | 2160 | shortcut_text(SHORTCUT_SET_INFINITY,(int)"Set Infinity Focus",0); |
| | 2161 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2162 | y += FONT_HEIGHT; |
| | 2163 | |
| | 2164 | shortcut_text(SHORTCUT_SET_HYPERFOCAL,(int)"Set HyperFocal Focus",0); |
| | 2165 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2166 | y += FONT_HEIGHT; |
| | 2167 | |
| | 2168 | } |
| | 2169 | |
| | 2170 | y += 4; |
| | 2171 | draw_string(x, y, "Shutter Half Press + ", MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); |
| | 2172 | y += FONT_HEIGHT; |
| | 2173 | |
| | 2174 | shortcut_text(SHORTCUT_DISABLE_OVERRIDES,LANG_MENU_OVERRIDE_DISABLE,gui_override_disable_modes[conf.override_disable]); |
| | 2175 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2176 | y += FONT_HEIGHT; |
| | 2177 | |
| | 2178 | shortcut_text(SHORTCUT_TOGGLE_HISTO,LANG_MENU_HISTO_SHOW,gui_histo_show_modes[conf.show_histo]); |
| | 2179 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2180 | y += FONT_HEIGHT; |
| | 2181 | |
| | 2182 | shortcut_text(SHORTCUT_TOGGLE_ZEBRA,LANG_MENU_ZEBRA_DRAW,gui_on_off_enum(0,&conf.zebra_draw)); |
| | 2183 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2184 | y += FONT_HEIGHT; |
| | 2185 | |
| | 2186 | shortcut_text(SHORTCUT_TOGGLE_OSD,LANG_MENU_OSD_SHOW,gui_on_off_enum(0,&conf.show_osd)); |
| | 2187 | draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2188 | y += FONT_HEIGHT; |
| | 2189 | } |
| | 2190 | |
| | 2191 | #endif |
| | 2192 | |
| | 2193 | //------------------------------------------------------------------- |
| | 2194 | void gui_chdk_draw() |
| | 2195 | { |
| | 2196 | static int show_md_grid=0; |
| | 2197 | |
| | 2198 | #ifdef CAM_DISP_ALT_TEXT |
| | 2199 | gui_draw_alt_helper(); |
| | 2200 | draw_string(((CAM_SCREEN_WIDTH/2)-(FONT_WIDTH*5/2)), (CAM_SCREEN_HEIGHT-FONT_HEIGHT), "<ALT>", MAKE_COLOR(COLOR_RED, COLOR_WHITE)); |
| | 2201 | #else |
| | 2202 | gui_draw_osd(); |
| | 2203 | #endif |
| | 2204 | |
| | 2205 | #ifdef OPT_SCRIPTING |
| | 2206 | if ((mode_get()&MODE_MASK) == MODE_REC || (mode_get()&MODE_MASK) == MODE_PLAY) |
| | 2207 | { |
| | 2208 | draw_txt_string(0, 14, script_title, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
| | 2209 | if (state_kbd_script_run) show_md_grid=5; |
| | 2210 | if (show_md_grid) |
| | 2211 | { |
| | 2212 | --show_md_grid; |
| | 2213 | // If motion detect library loaded then display the MD grid |
| | 2214 | // Don't call 'module_mdetect_load' here as we don't want to load |
| | 2215 | // the module, just see if it was already loaded. |
| | 2216 | if (libmotiondetect) |
| | 2217 | libmotiondetect->md_draw_grid(); |
| | 2218 | } |
| | 2219 | } |
| | 2220 | #endif |
| | 2221 | |
| | 2222 | console_draw(); |
| | 2223 | } |
| | 2224 | |
| | 2225 | //------------------------------------------------------------------- |
| | 2226 | #ifdef OPT_DEBUGGING |
| | 2227 | |
| | 2228 | static void gui_debug_shortcut(void) |
| | 2229 | { |
| | 2230 | static int lastcall = -1; |
| | 2231 | int t=get_tick_count(); |
| | 2232 | if ( lastcall != -1) { |
| | 2233 | if (t-lastcall <= 400) |
| | 2234 | debug_display_direction = -debug_display_direction; |
| | 2235 | } |
| | 2236 | lastcall=t; |
| | 2237 | switch(conf.debug_shortcut_action) { |
| | 2238 | case 1: |
| | 2239 | dump_memory(); |
| | 2240 | break; |
| | 2241 | case 2: |
| | 2242 | #ifndef CAM_DRYOS |
| | 2243 | if(conf.debug_display == DEBUG_DISPLAY_TASKS) { |
| | 2244 | debug_tasklist_start += debug_display_direction*(TASKLIST_MAX_LINES-2); // a little intentional overlap |
| | 2245 | if(debug_tasklist_start >= TASKLIST_NUM_TASKS || debug_tasklist_start < 0) |
| | 2246 | debug_tasklist_start = 0; |
| | 2247 | } |
| | 2248 | else |
| | 2249 | #endif |
| | 2250 | if (conf.debug_display == DEBUG_DISPLAY_PROPS || conf.debug_display == DEBUG_DISPLAY_PARAMS) { |
| | 2251 | conf.debug_propcase_page += debug_display_direction*1; |
| | 2252 | if(conf.debug_propcase_page > 128 || conf.debug_propcase_page < 0) |
| | 2253 | conf.debug_propcase_page = 0; |
| | 2254 | } |
| | 2255 | break; |
| | 2256 | case 3: |
| | 2257 | gui_compare_props(1); |
| | 2258 | break; |
| | 2259 | } |
| | 2260 | } |
| | 2261 | |
| | 2262 | #endif |
| | 2263 | |
| | 2264 | //------------------------------------------------------------------- |
| | 2265 | // Handler for Menu button press default - enter Menu mode |
| | 2266 | void gui_default_kbd_process_menu_btn() |
| | 2267 | { |
| | 2268 | gui_set_mode(&menuGuiHandler); |
| | 2269 | } |
| | 2270 | |
| | 2271 | // Change SD override factor, direction = 1 to increase, -1 to decrease |
| | 2272 | // Only applies if camera has a Zoom lever |
| | 2273 | #if CAM_HAS_ZOOM_LEVER |
| | 2274 | static void sd_override_koef(int direction) |
| | 2275 | { |
| | 2276 | gui_subj_dist_override_koef_enum(direction,0); |
| | 2277 | #if !CAM_HAS_MANUAL_FOCUS |
| | 2278 | if (conf.subj_dist_override_koef==0) gui_subj_dist_override_koef_enum(direction,0); |
| | 2279 | #endif |
| | 2280 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
| | 2281 | } |
| | 2282 | #endif |
| | 2283 | |
| | 2284 | // Change SD override by factor amount, direction = 1 to increase (zoom in), -1 to decrease (zoom out) |
| | 2285 | static void sd_override(int direction) |
| | 2286 | { |
| | 2287 | gui_subj_dist_override_value_enum(direction,0); |
| | 2288 | shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); |
| | 2289 | } |
| | 2290 | |
| | 2291 | static int alt_mode_script_run() |
| | 2292 | { |
| | 2293 | #ifdef OPT_SCRIPTING |
| | 2294 | int remote_script_start_ready = 0; |
| | 2295 | |
| | 2296 | // Start the current script if script_start is enabled, we are in <ALT> mode and there is a pulse longer than 100mSec on USB port |
| | 2297 | if (conf.remote_enable && conf.remote_enable_scripts && get_usb_power(SINGLE_PULSE) > 5) |
| | 2298 | |