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