| 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_palette.h" |
|---|
| 14 | #include "gui_mbox.h" |
|---|
| 15 | #include "gui_mpopup.h" |
|---|
| 16 | #include "gui_reversi.h" |
|---|
| 17 | #include "gui_sokoban.h" |
|---|
| 18 | #include "gui_4wins.h" |
|---|
| 19 | #include "gui_mastermind.h" |
|---|
| 20 | #include "console.h" |
|---|
| 21 | #ifdef OPT_DEBUGGING |
|---|
| 22 | #include "gui_debug.h" |
|---|
| 23 | #endif |
|---|
| 24 | #include "gui_fselect.h" |
|---|
| 25 | #include "gui_batt.h" |
|---|
| 26 | #include "gui_space.h" |
|---|
| 27 | #include "gui_osd.h" |
|---|
| 28 | #ifdef OPT_TEXTREADER |
|---|
| 29 | #include "gui_read.h" |
|---|
| 30 | #endif |
|---|
| 31 | #ifdef OPT_CALENDAR |
|---|
| 32 | #include "gui_calendar.h" |
|---|
| 33 | #endif |
|---|
| 34 | #ifdef OPT_DEBUGGING |
|---|
| 35 | #include "gui_bench.h" |
|---|
| 36 | #endif |
|---|
| 37 | #include "gui_grid.h" |
|---|
| 38 | #include "histogram.h" |
|---|
| 39 | #include "motion_detector.h" |
|---|
| 40 | #include "raw.h" |
|---|
| 41 | #ifdef OPT_CURVES |
|---|
| 42 | #include "curves.h" |
|---|
| 43 | #endif |
|---|
| 44 | #ifdef OPT_EDGEOVERLAY |
|---|
| 45 | #include "edgeoverlay.h" |
|---|
| 46 | #endif |
|---|
| 47 | #ifdef OPT_SCRIPTING |
|---|
| 48 | #include "script.h" |
|---|
| 49 | int script_params_has_changed=0; |
|---|
| 50 | #endif |
|---|
| 51 | //------------------------------------------------------------------- |
|---|
| 52 | |
|---|
| 53 | #define OPTIONS_AUTOSAVE |
|---|
| 54 | #define SPLASH_TIME 20 |
|---|
| 55 | |
|---|
| 56 | //shortcuts |
|---|
| 57 | //------------------------------------------------------------------ |
|---|
| 58 | // #define KEY_NONE (KEY_DUMMY+1) |
|---|
| 59 | |
|---|
| 60 | #if !CAM_HAS_ERASE_BUTTON |
|---|
| 61 | //Alt mode |
|---|
| 62 | #define SHORTCUT_TOGGLE_RAW KEY_DISPLAY |
|---|
| 63 | #define SHORTCUT_MF_TOGGLE KEY_UP |
|---|
| 64 | //Half press shoot button |
|---|
| 65 | #define SHORTCUT_TOGGLE_HISTO KEY_DOWN |
|---|
| 66 | #define SHORTCUT_TOGGLE_ZEBRA KEY_MENU |
|---|
| 67 | #define SHORTCUT_TOGGLE_OSD KEY_RIGHT |
|---|
| 68 | #define SHORTCUT_DISABLE_OVERRIDES KEY_LEFT |
|---|
| 69 | //Alt mode & Manual mode |
|---|
| 70 | #define SHORTCUT_SET_INFINITY KEY_DISPLAY |
|---|
| 71 | #define SHORTCUT_SET_HYPERFOCAL KEY_DOWN |
|---|
| 72 | // For models without ZOOM_LEVER (#if !CAM_HAS_ZOOM_LEVER) |
|---|
| 73 | // SHORTCUT_SET_INFINITY is not used |
|---|
| 74 | // KEY_DISPLAY is used for gui_subj_dist_override_koef_enum; |
|---|
| 75 | // KEY_LEFT/KEY_RIGHT is used for gui_subj_dist_override_value_enum (because of no separate ZOOM_IN/OUT) |
|---|
| 76 | |
|---|
| 77 | #elif defined(CAMERA_g7) || defined(CAMERA_sx10) || defined(CAMERA_sx1) || defined(CAMERA_sx20) || defined(CAMERA_sx30) |
|---|
| 78 | //Alt mode |
|---|
| 79 | #define SHORTCUT_TOGGLE_RAW KEY_ERASE |
|---|
| 80 | //Half press shoot button |
|---|
| 81 | #define SHORTCUT_TOGGLE_HISTO KEY_DOWN |
|---|
| 82 | #define SHORTCUT_TOGGLE_ZEBRA KEY_LEFT |
|---|
| 83 | #define SHORTCUT_TOGGLE_OSD KEY_RIGHT |
|---|
| 84 | #define SHORTCUT_DISABLE_OVERRIDES KEY_UP |
|---|
| 85 | //Alt mode & Manual mode |
|---|
| 86 | #define SHORTCUT_SET_INFINITY KEY_UP |
|---|
| 87 | #define SHORTCUT_SET_HYPERFOCAL KEY_DOWN |
|---|
| 88 | |
|---|
| 89 | #elif defined(CAMERA_sx100is) ||defined(CAMERA_sx110is) |
|---|
| 90 | //Alt mode |
|---|
| 91 | #define SHORTCUT_TOGGLE_RAW KEY_ERASE |
|---|
| 92 | //Half press shoot button |
|---|
| 93 | #define SHORTCUT_TOGGLE_HISTO KEY_UP |
|---|
| 94 | #define SHORTCUT_TOGGLE_ZEBRA KEY_DOWN |
|---|
| 95 | #define SHORTCUT_TOGGLE_OSD KEY_RIGHT |
|---|
| 96 | #define SHORTCUT_DISABLE_OVERRIDES KEY_LEFT |
|---|
| 97 | //Alt mode & Manual mode |
|---|
| 98 | #define SHORTCUT_SET_INFINITY KEY_UP |
|---|
| 99 | #define SHORTCUT_SET_HYPERFOCAL KEY_DOWN |
|---|
| 100 | |
|---|
| 101 | #else |
|---|
| 102 | |
|---|
| 103 | //Alt mode |
|---|
| 104 | #define SHORTCUT_TOGGLE_RAW KEY_ERASE |
|---|
| 105 | //Half press shoot button |
|---|
| 106 | #define SHORTCUT_TOGGLE_HISTO KEY_UP |
|---|
| 107 | #define SHORTCUT_TOGGLE_ZEBRA KEY_LEFT |
|---|
| 108 | #define SHORTCUT_TOGGLE_OSD KEY_RIGHT |
|---|
| 109 | #define SHORTCUT_DISABLE_OVERRIDES KEY_DOWN |
|---|
| 110 | //Alt mode & Manual mode |
|---|
| 111 | #define SHORTCUT_SET_INFINITY KEY_UP |
|---|
| 112 | #define SHORTCUT_SET_HYPERFOCAL KEY_DOWN |
|---|
| 113 | #ifndef CAM_HAS_MANUAL_FOCUS |
|---|
| 114 | #define SHORTCUT_MF_TOGGLE KEY_DISPLAY |
|---|
| 115 | #endif |
|---|
| 116 | #endif |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | // forward declarations |
|---|
| 120 | //------------------------------------------------------------------- |
|---|
| 121 | extern void dump_memory(); |
|---|
| 122 | // both from platform/generic/shooting.c |
|---|
| 123 | extern const char* tv_override[]; |
|---|
| 124 | extern const int tv_override_amount; |
|---|
| 125 | extern const int tv_override_zero_shift; |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | static void gui_draw_osd(); |
|---|
| 129 | |
|---|
| 130 | static void gui_draw_splash(char* logo, int logo_size); |
|---|
| 131 | |
|---|
| 132 | void user_menu_save(); |
|---|
| 133 | void user_menu_restore(); |
|---|
| 134 | // Menu procs |
|---|
| 135 | //------------------------------------------------------------------- |
|---|
| 136 | static void gui_show_build_info(int arg); |
|---|
| 137 | static void gui_show_memory_info(int arg); |
|---|
| 138 | static void gui_draw_palette(int arg); |
|---|
| 139 | static void gui_draw_reversi(int arg); |
|---|
| 140 | static void gui_draw_sokoban(int arg); |
|---|
| 141 | static void gui_draw_4wins(int arg); |
|---|
| 142 | static void gui_draw_mastermind(int arg); |
|---|
| 143 | #ifdef OPT_DEBUGGING |
|---|
| 144 | static void gui_draw_debug(int arg); |
|---|
| 145 | static void gui_draw_bench(int arg); |
|---|
| 146 | #endif |
|---|
| 147 | static void gui_draw_fselect(int arg); |
|---|
| 148 | static void gui_draw_osd_le(int arg); |
|---|
| 149 | #ifdef OPT_TEXTREADER |
|---|
| 150 | static void gui_draw_read(int arg); |
|---|
| 151 | static void gui_draw_read_last(int arg); |
|---|
| 152 | #endif |
|---|
| 153 | static void gui_draw_load_menu_rbf(int arg); |
|---|
| 154 | static void gui_draw_load_symbol_rbf(int arg); //AKA |
|---|
| 155 | #ifdef OPT_TEXTREADER |
|---|
| 156 | static void gui_draw_load_rbf(int arg); |
|---|
| 157 | #endif |
|---|
| 158 | #ifdef OPT_CALENDAR |
|---|
| 159 | static void gui_draw_calendar(int arg); |
|---|
| 160 | #endif |
|---|
| 161 | static void gui_draw_load_lang(int arg); |
|---|
| 162 | static void gui_menuproc_mkbootdisk(int arg); |
|---|
| 163 | #ifdef OPT_DEBUGGING |
|---|
| 164 | void gui_compare_props(int arg); |
|---|
| 165 | #endif |
|---|
| 166 | #ifndef OPTIONS_AUTOSAVE |
|---|
| 167 | static void gui_menuproc_save(int arg); |
|---|
| 168 | #endif |
|---|
| 169 | static void gui_menuproc_reset(int arg); |
|---|
| 170 | static void gui_grid_lines_load(int arg); |
|---|
| 171 | static void gui_raw_develop(int arg); |
|---|
| 172 | #ifdef OPT_DEBUGGING |
|---|
| 173 | static void gui_menuproc_break_card(int arg); |
|---|
| 174 | #endif |
|---|
| 175 | static void gui_menuproc_swap_patitons(int arg); |
|---|
| 176 | static void gui_menuproc_reset_files(int arg); |
|---|
| 177 | #ifdef OPT_CURVES |
|---|
| 178 | static void gui_load_curve_selected(const char *fn); |
|---|
| 179 | static void gui_load_curve(int arg); |
|---|
| 180 | #endif |
|---|
| 181 | static const char* gui_histo_show_enum(int change, int arg); |
|---|
| 182 | static const char* gui_histo_mode_enum(int change, int arg); |
|---|
| 183 | static const char* gui_temp_mode_enum(int change, int arg); |
|---|
| 184 | static const char* gui_histo_layout_enum(int change, int arg); |
|---|
| 185 | static const char* gui_zebra_mode_enum(int change, int arg); |
|---|
| 186 | static const char* gui_zebra_draw_osd_enum(int change, int arg); |
|---|
| 187 | static const char* gui_font_enum(int change, int arg); |
|---|
| 188 | static const char* gui_raw_prefix_enum(int change, int arg); |
|---|
| 189 | static const char* gui_raw_ext_enum(int change, int arg); |
|---|
| 190 | static const char* gui_sub_batch_prefix_enum(int change, int arg); |
|---|
| 191 | static const char* gui_sub_batch_ext_enum(int change, int arg); |
|---|
| 192 | |
|---|
| 193 | static const char* gui_raw_nr_enum(int change, int arg); |
|---|
| 194 | static const char* gui_autoiso_shutter_enum(int change, int arg); |
|---|
| 195 | #ifdef OPT_TEXTREADER |
|---|
| 196 | static const char* gui_reader_codepage_enum(int change, int arg); |
|---|
| 197 | #endif |
|---|
| 198 | static const char* gui_zoom_value_enum(int change, int arg); |
|---|
| 199 | static const char* gui_show_values_enum(int change, int arg); |
|---|
| 200 | static const char* gui_dof_show_value_enum(int change, int arg); |
|---|
| 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_video_mode_enum(int change, int arg); |
|---|
| 206 | static const char* gui_fast_ev_step(int change, int arg); |
|---|
| 207 | #if CAM_QUALITY_OVERRIDE |
|---|
| 208 | static const char* gui_fast_image_quality(int change, int arg); |
|---|
| 209 | #endif |
|---|
| 210 | static const char* gui_video_bitrate_enum(int change, int arg); |
|---|
| 211 | static const char* gui_tv_bracket_values_enum(int change, int arg); |
|---|
| 212 | static const char* gui_av_bracket_values_enum(int change, int arg); |
|---|
| 213 | static const char* gui_iso_bracket_koef_enum(int change, int arg); |
|---|
| 214 | static const char* gui_subj_dist_bracket_koef_enum(int change, int arg); |
|---|
| 215 | static const char* gui_bracket_type_enum(int change, int arg); |
|---|
| 216 | static const char* gui_av_override_enum(int change, int arg); |
|---|
| 217 | #if ZOOM_OVERRIDE |
|---|
| 218 | static const char* gui_zoom_override_enum(int change, int arg); |
|---|
| 219 | #endif |
|---|
| 220 | static const char* gui_iso_override_koef_enum(int change, int arg); |
|---|
| 221 | static const char* gui_tv_override_koef_enum(int change, int arg); |
|---|
| 222 | static const char* gui_tv_override_value_enum(int change, int arg); |
|---|
| 223 | static const char* gui_tv_enum_type_enum(int change, int arg); |
|---|
| 224 | static const char* gui_subj_dist_override_value_enum(int change, int arg); |
|---|
| 225 | static const char* gui_subj_dist_override_koef_enum(int change, int arg); |
|---|
| 226 | /* |
|---|
| 227 | static const char* gui_tv_exposure_order_enum(int change, int arg); |
|---|
| 228 | static const char* gui_av_exposure_order_enum(int change, int arg); |
|---|
| 229 | static const char* gui_iso_exposure_order_enum(int change, int arg); |
|---|
| 230 | */ |
|---|
| 231 | static const char* gui_nd_filter_state_enum(int change, int arg); |
|---|
| 232 | //static const char* gui_tv_enum(int change, int arg); |
|---|
| 233 | const char* gui_user_menu_show_enum(int change, int arg); |
|---|
| 234 | static const char* gui_hide_osd_enum(int change, int arg); |
|---|
| 235 | static const char* gui_show_clock_enum(int change, int arg); |
|---|
| 236 | static const char* gui_clock_format_enum(int change, int arg); |
|---|
| 237 | static const char* gui_clock_indicator_enum(int change, int arg); |
|---|
| 238 | static const char* gui_clock_halfpress_enum(int change, int arg); |
|---|
| 239 | static const char* gui_space_bar_enum(int change, int arg); |
|---|
| 240 | static const char* gui_space_bar_size_enum(int change, int arg); |
|---|
| 241 | static const char* gui_space_bar_width_enum(int change, int arg); |
|---|
| 242 | static const char* gui_space_warn_type_enum(int change, int arg); |
|---|
| 243 | static const char* gui_bad_pixel_enum(int change, int arg); |
|---|
| 244 | static const char* gui_video_af_key_enum(int change, int arg); |
|---|
| 245 | static const char* gui_show_movie_time(int change, int arg); |
|---|
| 246 | static const char* gui_override_disable_enum(int change, int arg); |
|---|
| 247 | #ifdef OPT_CURVES |
|---|
| 248 | static const char* gui_conf_curve_enum(int change, int arg); |
|---|
| 249 | #endif |
|---|
| 250 | #ifdef OPT_DEBUGGING |
|---|
| 251 | static const char* gui_debug_shortcut_enum(int change, int arg); |
|---|
| 252 | static const char* gui_debug_display_enum(int change, int arg); |
|---|
| 253 | static void gui_debug_shortcut(void); |
|---|
| 254 | #endif |
|---|
| 255 | |
|---|
| 256 | #ifdef OPT_EDGEOVERLAY |
|---|
| 257 | static void gui_menuproc_edge_save(int arg); |
|---|
| 258 | static void gui_menuproc_edge_load(int arg); |
|---|
| 259 | static const char* gui_edge_pano_enum(int change, int arg); |
|---|
| 260 | #endif |
|---|
| 261 | |
|---|
| 262 | #ifdef OPT_SCRIPTING |
|---|
| 263 | static void gui_load_script(int arg); |
|---|
| 264 | static void gui_load_script_default(int arg); |
|---|
| 265 | static const char* gui_script_autostart_enum(int change, int arg); |
|---|
| 266 | static const char* gui_script_param_set_enum(int change, int arg); |
|---|
| 267 | #endif |
|---|
| 268 | |
|---|
| 269 | void rinit(); |
|---|
| 270 | |
|---|
| 271 | |
|---|
| 272 | // Menu callbacks |
|---|
| 273 | //------------------------------------------------------------------- |
|---|
| 274 | static void cb_step_25(); |
|---|
| 275 | static void cb_perc(); |
|---|
| 276 | static void cb_volts(); |
|---|
| 277 | static void cb_space_perc(); |
|---|
| 278 | static void cb_space_mb(); |
|---|
| 279 | static void cb_battery_menu_change(unsigned int item); |
|---|
| 280 | static void cb_zebra_restore_screen(); |
|---|
| 281 | static void cb_zebra_restore_osd(); |
|---|
| 282 | #if DNG_SUPPORT |
|---|
| 283 | static void cb_change_dng(); |
|---|
| 284 | #endif |
|---|
| 285 | #if defined (DNG_EXT_FROM) |
|---|
| 286 | static void cb_change_dng_usb_ext(); |
|---|
| 287 | #endif |
|---|
| 288 | |
|---|
| 289 | // for memory info, duplicated from lowlevel |
|---|
| 290 | extern const char _start,_end; |
|---|
| 291 | |
|---|
| 292 | #ifdef OPT_DEBUGGING |
|---|
| 293 | static int debug_tasklist_start; |
|---|
| 294 | static int debug_display_direction=1; |
|---|
| 295 | #endif |
|---|
| 296 | // Menu definition |
|---|
| 297 | //------------------------------------------------------------------- |
|---|
| 298 | static CMenuItem remote_submenu_items[] = { |
|---|
| 299 | {0x71,LANG_MENU_REMOTE_ENABLE, MENUITEM_BOOL, &conf.remote_enable}, |
|---|
| 300 | {0x0,LANG_MENU_SYNCHABLE_REMOTE, MENUITEM_SEPARATOR }, |
|---|
| 301 | {0x71,LANG_MENU_SYNCHABLE_REMOTE_ENABLE, MENUITEM_BOOL, &conf.ricoh_ca1_mode }, |
|---|
| 302 | {0x5c,LANG_MENU_SYNCH_ENABLE, MENUITEM_BOOL, &conf.synch_enable }, |
|---|
| 303 | {0x5c,LANG_MENU_SYNCH_DELAY_ENABLE, MENUITEM_BOOL, &conf.synch_delay_enable }, |
|---|
| 304 | {0x5c,LANG_MENU_SYNCH_DELAY_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED, &conf.synch_delay_value }, |
|---|
| 305 | {0x5c,LANG_MENU_SYNCH_DELAY_COARSE_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED, &conf.synch_delay_coarse_value }, |
|---|
| 306 | {0x5c,LANG_MENU_REMOTE_ZOOM_ENABLE, MENUITEM_BOOL, &conf.remote_zoom_enable }, |
|---|
| 307 | {0x5f,LANG_MENU_REMOTE_ZOOM_TIMEOUT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zoom_timeout, MENU_MINMAX(2,10)}, |
|---|
| 308 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 309 | {0} |
|---|
| 310 | }; |
|---|
| 311 | static CMenu remote_submenu = {0x86,LANG_MENU_REMOTE_PARAM_TITLE, NULL, remote_submenu_items }; |
|---|
| 312 | |
|---|
| 313 | |
|---|
| 314 | #ifdef OPT_SCRIPTING |
|---|
| 315 | static CMenuItem script_submenu_items_top[] = { |
|---|
| 316 | {0x35,LANG_MENU_SCRIPT_LOAD, MENUITEM_PROC, (int*)gui_load_script }, |
|---|
| 317 | {0x5f,LANG_MENU_SCRIPT_DELAY, MENUITEM_INT|MENUITEM_F_UNSIGNED, &conf.script_shoot_delay }, |
|---|
| 318 | // remote autostart |
|---|
| 319 | {0x5f,LANG_MENU_SCRIPT_AUTOSTART, MENUITEM_ENUM, (int*)gui_script_autostart_enum }, |
|---|
| 320 | |
|---|
| 321 | #if CAM_REMOTE |
|---|
| 322 | {0x86,LANG_MENU_REMOTE_PARAM, MENUITEM_SUBMENU, (int*)&remote_submenu }, |
|---|
| 323 | //{0x71,LANG_MENU_SCRIPT_REMOTE_ENABLE, MENUITEM_BOOL, &conf.remote_enable}, |
|---|
| 324 | #endif |
|---|
| 325 | {0x5d,LANG_MENU_SCRIPT_DEFAULT_VAL, MENUITEM_PROC, (int*)gui_load_script_default }, |
|---|
| 326 | {0x5e,LANG_MENU_SCRIPT_PARAM_SET, MENUITEM_ENUM, (int*)gui_script_param_set_enum }, |
|---|
| 327 | {0x5c,LANG_MENU_SCRIPT_PARAM_SAVE, MENUITEM_BOOL, &conf.script_param_save }, |
|---|
| 328 | {0x0,(int)script_title, MENUITEM_SEPARATOR }, |
|---|
| 329 | // {0x0,LANG_MENU_SCRIPT_CURRENT, MENUITEM_SEPARATOR }, |
|---|
| 330 | // {0x0,(int)script_title, MENUITEM_TEXT }, |
|---|
| 331 | // {0x0,LANG_MENU_SCRIPT_PARAMS, MENUITEM_SEPARATOR } |
|---|
| 332 | }; |
|---|
| 333 | |
|---|
| 334 | static CMenuItem script_submenu_items_bottom[] = { |
|---|
| 335 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 336 | {0} |
|---|
| 337 | }; |
|---|
| 338 | |
|---|
| 339 | static CMenuItem script_submenu_items[sizeof(script_submenu_items_top)/sizeof(script_submenu_items_top[0])+SCRIPT_NUM_PARAMS+ |
|---|
| 340 | sizeof(script_submenu_items_bottom)/sizeof(script_submenu_items_bottom[0])]; |
|---|
| 341 | static CMenu script_submenu = {0x27,LANG_MENU_SCRIPT_TITLE, NULL, script_submenu_items }; |
|---|
| 342 | #endif |
|---|
| 343 | |
|---|
| 344 | static CMenuItem games_submenu_items[] = { |
|---|
| 345 | #ifdef OPT_GAME_REVERSI |
|---|
| 346 | {0x38,LANG_MENU_GAMES_REVERSI, MENUITEM_PROC, (int*)gui_draw_reversi }, |
|---|
| 347 | #endif |
|---|
| 348 | #ifdef OPT_GAME_SOKOBAN |
|---|
| 349 | {0x38,LANG_MENU_GAMES_SOKOBAN, MENUITEM_PROC, (int*)gui_draw_sokoban }, |
|---|
| 350 | #endif |
|---|
| 351 | #ifdef OPT_GAME_CONNECT4 |
|---|
| 352 | {0x38,LANG_MENU_GAMES_CONNECT4, MENUITEM_PROC, (int*)gui_draw_4wins }, |
|---|
| 353 | #endif |
|---|
| 354 | #ifdef OPT_GAME_MASTERMIND |
|---|
| 355 | {0x38,LANG_MENU_GAMES_MASTERMIND, MENUITEM_PROC, (int*)gui_draw_mastermind }, |
|---|
| 356 | #endif |
|---|
| 357 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 358 | {0} |
|---|
| 359 | }; |
|---|
| 360 | static CMenu games_submenu = {0x38,LANG_MENU_GAMES_TITLE, NULL, games_submenu_items }; |
|---|
| 361 | |
|---|
| 362 | static CMenuItem autoiso_submenu_items[] = { |
|---|
| 363 | {0x5c,LANG_MENU_AUTOISO_ENABLED, MENUITEM_BOOL, &conf.autoiso_enable}, |
|---|
| 364 | {0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER, MENUITEM_ENUM, (int*)gui_autoiso_shutter_enum }, |
|---|
| 365 | {0x5f,LANG_MENU_AUTOISO_USER_FACTOR, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_user_factor, MENU_MINMAX(1, 8) }, |
|---|
| 366 | #if CAM_HAS_IS |
|---|
| 367 | {0x5f,LANG_MENU_AUTOISO_IS_FACTOR, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_is_factor, MENU_MINMAX(1, 8) }, |
|---|
| 368 | #endif |
|---|
| 369 | {0x5f,LANG_MENU_AUTOISO_MAX_ISO_HI, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_hi, MENU_MINMAX(20, 160) }, |
|---|
| 370 | {0x5f,LANG_MENU_AUTOISO_MAX_ISO_AUTO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_auto, MENU_MINMAX(10, 80) }, |
|---|
| 371 | {0x5f,LANG_MENU_AUTOISO_MIN_ISO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_min_iso, MENU_MINMAX(1, 20) }, |
|---|
| 372 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 373 | {0} |
|---|
| 374 | }; |
|---|
| 375 | static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, NULL, autoiso_submenu_items }; |
|---|
| 376 | |
|---|
| 377 | |
|---|
| 378 | #ifdef OPT_TEXTREADER |
|---|
| 379 | static CMenuItem reader_submenu_items[] = { |
|---|
| 380 | {0x35,LANG_MENU_READ_OPEN_NEW, MENUITEM_PROC, (int*)gui_draw_read }, |
|---|
| 381 | {0x35,LANG_MENU_READ_OPEN_LAST, MENUITEM_PROC, (int*)gui_draw_read_last }, |
|---|
| 382 | {0x35,LANG_MENU_READ_SELECT_FONT, MENUITEM_PROC, (int*)gui_draw_load_rbf }, |
|---|
| 383 | {0x5f,LANG_MENU_READ_CODEPAGE, MENUITEM_ENUM, (int*)gui_reader_codepage_enum }, |
|---|
| 384 | {0x5c,LANG_MENU_READ_WORD_WRAP, MENUITEM_BOOL, &conf.reader_wrap_by_words }, |
|---|
| 385 | {0x5c,LANG_MENU_READ_AUTOSCROLL, MENUITEM_BOOL, &conf.reader_autoscroll }, |
|---|
| 386 | {0x5f,LANG_MENU_READ_AUTOSCROLL_DELAY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.reader_autoscroll_delay, MENU_MINMAX(0, 60) }, |
|---|
| 387 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 388 | {0} |
|---|
| 389 | }; |
|---|
| 390 | static CMenu reader_submenu = {0x37,LANG_MENU_READ_TITLE, NULL, reader_submenu_items }; |
|---|
| 391 | #endif |
|---|
| 392 | |
|---|
| 393 | #ifdef OPT_DEBUGGING |
|---|
| 394 | static CMenuItem debug_submenu_items[] = { |
|---|
| 395 | {0x5c,LANG_MENU_DEBUG_DISPLAY, MENUITEM_ENUM, (int*)gui_debug_display_enum }, |
|---|
| 396 | {0x2a,LANG_MENU_DEBUG_PROPCASE_PAGE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.debug_propcase_page, MENU_MINMAX(0, 128) }, |
|---|
| 397 | {0x2a,LANG_MENU_DEBUG_TASKLIST_START, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &debug_tasklist_start, MENU_MINMAX(0, 63) }, |
|---|
| 398 | {0x5c,LANG_MENU_DEBUG_SHOW_MISC_VALS, MENUITEM_BOOL, &conf.debug_misc_vals_show }, |
|---|
| 399 | {0x2a,LANG_MENU_DEBUG_MEMORY_BROWSER, MENUITEM_PROC, (int*)gui_draw_debug }, |
|---|
| 400 | {0x2a,LANG_MENU_DEBUG_BENCHMARK, MENUITEM_PROC, (int*)gui_draw_bench }, |
|---|
| 401 | {0x5c,LANG_MENU_DEBUG_SHORTCUT_ACTION, MENUITEM_ENUM, (int*)gui_debug_shortcut_enum }, |
|---|
| 402 | {0x5c,LANG_MENU_RAW_TIMER, MENUITEM_BOOL, &conf.raw_timer }, |
|---|
| 403 | #ifdef OPT_LUA |
|---|
| 404 | {0x5c,LANG_MENU_LUA_RESTART, MENUITEM_BOOL, &conf.debug_lua_restart_on_error }, |
|---|
| 405 | #endif |
|---|
| 406 | #if CAM_MULTIPART |
|---|
| 407 | {0x33,LANG_MENU_DEBUG_CREATE_MULTIPART , MENUITEM_PROC, (int*)gui_menuproc_break_card }, |
|---|
| 408 | #endif |
|---|
| 409 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 410 | {0} |
|---|
| 411 | }; |
|---|
| 412 | static CMenu debug_submenu = {0x2a,LANG_MENU_DEBUG_TITLE, NULL, debug_submenu_items }; |
|---|
| 413 | #endif |
|---|
| 414 | |
|---|
| 415 | |
|---|
| 416 | static CMenuItem misc_submenu_items[] = { |
|---|
| 417 | {0x35,LANG_MENU_MISC_FILE_BROWSER, MENUITEM_PROC, (int*)gui_draw_fselect }, |
|---|
| 418 | #ifdef OPT_CALENDAR |
|---|
| 419 | {0x36,LANG_MENU_MISC_CALENDAR, MENUITEM_PROC, (int*)gui_draw_calendar }, |
|---|
| 420 | #endif |
|---|
| 421 | #ifdef OPT_TEXTREADER |
|---|
| 422 | {0x37,LANG_MENU_MISC_TEXT_READER, MENUITEM_SUBMENU, (int*)&reader_submenu }, |
|---|
| 423 | #endif |
|---|
| 424 | #if defined (OPT_GAME_REVERSI) || (OPT_GAME_SOKOBAN || (OPT_GAME_CONNECT4) || OPT_GAME_MASTERMIND) |
|---|
| 425 | {0x38,LANG_MENU_MISC_GAMES, MENUITEM_SUBMENU, (int*)&games_submenu }, |
|---|
| 426 | #endif |
|---|
| 427 | #if CAM_SWIVEL_SCREEN |
|---|
| 428 | {0x28,LANG_MENU_MISC_FLASHLIGHT, MENUITEM_BOOL, &conf.flashlight }, |
|---|
| 429 | #endif |
|---|
| 430 | {0x5c,LANG_MENU_MISC_SHOW_SPLASH, MENUITEM_BOOL, &conf.splash_show }, |
|---|
| 431 | {0x5c,LANG_MENU_MISC_START_SOUND, MENUITEM_BOOL, &conf.start_sound }, |
|---|
| 432 | #if CAM_USE_ZOOM_FOR_MF |
|---|
| 433 | {0x59,LANG_MENU_MISC_ZOOM_FOR_MF, MENUITEM_BOOL, &conf.use_zoom_mf }, |
|---|
| 434 | #endif |
|---|
| 435 | #if CAM_ADJUSTABLE_ALT_BUTTON |
|---|
| 436 | {0x22,LANG_MENU_MISC_ALT_BUTTON, MENUITEM_ENUM, (int*)gui_alt_mode_button_enum }, |
|---|
| 437 | #endif |
|---|
| 438 | {0x5d,LANG_MENU_MISC_DISABLE_LCD_OFF, MENUITEM_ENUM, (int*)gui_alt_power_enum }, |
|---|
| 439 | {0x65,LANG_MENU_MISC_PALETTE, MENUITEM_PROC, (int*)gui_draw_palette }, |
|---|
| 440 | {0x80,LANG_MENU_MISC_BUILD_INFO, MENUITEM_PROC, (int*)gui_show_build_info }, |
|---|
| 441 | {0x80,LANG_MENU_MISC_MEMORY_INFO, MENUITEM_PROC, (int*)gui_show_memory_info }, |
|---|
| 442 | {0x33,LANG_MENU_DEBUG_MAKE_BOOTABLE, MENUITEM_PROC, (int*)gui_menuproc_mkbootdisk }, |
|---|
| 443 | #if CAM_MULTIPART |
|---|
| 444 | {0x33,LANG_MENU_DEBUG_SWAP_PART, MENUITEM_PROC, (int*)gui_menuproc_swap_patitons }, |
|---|
| 445 | #endif |
|---|
| 446 | {0x2b,LANG_MENU_MAIN_RESET_OPTIONS, MENUITEM_PROC, (int*)gui_menuproc_reset }, |
|---|
| 447 | #ifdef OPT_DEBUGGING |
|---|
| 448 | {0x2a,LANG_MENU_MAIN_DEBUG, MENUITEM_SUBMENU, (int*)&debug_submenu }, |
|---|
| 449 | #endif |
|---|
| 450 | {0x86,LANG_MENU_REMOTE_PARAM, MENUITEM_SUBMENU, (int*)&remote_submenu }, |
|---|
| 451 | #if defined (DNG_EXT_FROM) |
|---|
| 452 | {0x71,LANG_MENU_DNG_VIA_USB, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_usb_ext , (int)cb_change_dng_usb_ext}, |
|---|
| 453 | #endif |
|---|
| 454 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 455 | {0}, |
|---|
| 456 | }; |
|---|
| 457 | static CMenu misc_submenu = {0x29,LANG_MENU_MISC_TITLE, NULL, misc_submenu_items }; |
|---|
| 458 | |
|---|
| 459 | static int voltage_step; |
|---|
| 460 | static CMenuItem battery_submenu_items[] = { |
|---|
| 461 | {0x66,LANG_MENU_BATT_VOLT_MAX, MENUITEM_INT|MENUITEM_ARG_ADDR_INC, &conf.batt_volts_max, (int)&voltage_step }, |
|---|
| 462 | {0x67,LANG_MENU_BATT_VOLT_MIN, MENUITEM_INT|MENUITEM_ARG_ADDR_INC, &conf.batt_volts_min, (int)&voltage_step }, |
|---|
| 463 | {0x68,LANG_MENU_BATT_STEP_25, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_step_25, (int)cb_step_25 }, |
|---|
| 464 | {0x0,(int)"", MENUITEM_SEPARATOR }, |
|---|
| 465 | {0x73,LANG_MENU_BATT_SHOW_PERCENT, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_perc_show, (int)cb_perc }, |
|---|
| 466 | {0x73,LANG_MENU_BATT_SHOW_VOLTS, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.batt_volts_show, (int)cb_volts }, |
|---|
| 467 | {0x32,LANG_MENU_BATT_SHOW_ICON, MENUITEM_BOOL, &conf.batt_icon_show }, |
|---|
| 468 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 469 | {0} |
|---|
| 470 | }; |
|---|
| 471 | static CMenu battery_submenu = {0x32,LANG_MENU_BATT_TITLE, cb_battery_menu_change, battery_submenu_items }; |
|---|
| 472 | |
|---|
| 473 | static CMenuItem space_submenu_items[] = { |
|---|
| 474 | {0x5c,LANG_MENU_SPACE_SHOW_ICON, MENUITEM_BOOL, &conf.space_icon_show }, |
|---|
| 475 | {0x69,LANG_MENU_SPACE_SHOW_BAR, MENUITEM_ENUM, (int*)gui_space_bar_enum }, |
|---|
| 476 | {0x6a,LANG_MENU_SPACE_BAR_SIZE, MENUITEM_ENUM, (int*)gui_space_bar_size_enum }, |
|---|
| 477 | {0x6b,LANG_MENU_SPACE_BAR_WIDTH, MENUITEM_ENUM, (int*)gui_space_bar_width_enum }, |
|---|
| 478 | {0x5c,LANG_MENU_SPACE_SHOW_PERCENT, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_perc_show, (int)cb_space_perc }, |
|---|
| 479 | {0x5c,LANG_MENU_SPACE_SHOW_MB, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_mb_show, (int)cb_space_mb }, |
|---|
| 480 | {0x5f,LANG_MENU_SPACE_WARN_TYPE, MENUITEM_ENUM, (int*)gui_space_warn_type_enum }, |
|---|
| 481 | {0x58,LANG_MENU_SPACE_WARN_PERCENT, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.space_perc_warn, MENU_MINMAX(1, 99) }, |
|---|
| 482 | {0x58,LANG_MENU_SPACE_WARN_MB, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.space_mb_warn, MENU_MINMAX(1, 4000) }, |
|---|
| 483 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 484 | {0} |
|---|
| 485 | }; |
|---|
| 486 | static CMenu space_submenu = {0x33,LANG_MENU_OSD_SPACE_PARAMS_TITLE, NULL, space_submenu_items}; |
|---|
| 487 | |
|---|
| 488 | static CMenuItem dof_submenu_items[] = { |
|---|
| 489 | {0x5f,LANG_MENU_OSD_SHOW_DOF_CALC, MENUITEM_ENUM, (int*)gui_dof_show_value_enum }, |
|---|
| 490 | {0x5c,LANG_MENU_DOF_SUBJ_DIST_AS_NEAR_LIMIT, MENUITEM_BOOL, &conf.dof_subj_dist_as_near_limit}, |
|---|
| 491 | {0x5c,LANG_MENU_DOF_USE_EXIF_SUBJ_DIST, MENUITEM_BOOL, &conf.dof_use_exif_subj_dist}, |
|---|
| 492 | {0x5c,LANG_MENU_DOF_SUBJ_DIST_IN_MISC, MENUITEM_BOOL, &conf.dof_subj_dist_in_misc}, |
|---|
| 493 | {0x5c,LANG_MENU_DOF_NEAR_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_near_limit_in_misc}, |
|---|
| 494 | {0x5c,LANG_MENU_DOF_FAR_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_far_limit_in_misc}, |
|---|
| 495 | {0x5c,LANG_MENU_DOF_HYPERFOCAL_IN_MISC, MENUITEM_BOOL, &conf.dof_hyperfocal_in_misc}, |
|---|
| 496 | {0x5c,LANG_MENU_DOF_DEPTH_LIMIT_IN_MISC, MENUITEM_BOOL, &conf.dof_depth_in_misc}, |
|---|
| 497 | #if !CAM_DRYOS |
|---|
| 498 | {0x5c,LANG_MENU_DOF_DIST_FROM_LENS, MENUITEM_BOOL, &conf.dof_dist_from_lens}, |
|---|
| 499 | #endif |
|---|
| 500 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 501 | {0} |
|---|
| 502 | }; |
|---|
| 503 | static CMenu dof_submenu = {0x31,LANG_MENU_DOF_TITLE, /*cb_dof_menu_change*/ NULL, dof_submenu_items }; |
|---|
| 504 | |
|---|
| 505 | static CMenuItem values_submenu_items[] = { |
|---|
| 506 | {0x5f,LANG_MENU_OSD_SHOW_MISC_VALUES, MENUITEM_ENUM, (int*)gui_show_values_enum }, |
|---|
| 507 | // {0x43,LANG_MENU_VALUES_SHOW_IN_REVIEW, MENUITEM_BOOL, &conf.values_show_in_review}, |
|---|
| 508 | {0x5c,LANG_MENU_SHOW_VALUES_IN_VIDEO, MENUITEM_BOOL, &conf.show_values_in_video}, |
|---|
| 509 | {0x5c,LANG_MENU_VALUES_SHOW_ZOOM, MENUITEM_BOOL, &conf.values_show_zoom}, |
|---|
| 510 | {0x5f,LANG_MENU_OSD_ZOOM_VALUE, MENUITEM_ENUM, (int*)gui_zoom_value_enum }, |
|---|
| 511 | {0x60,LANG_MENU_OSD_ZOOM_SCALE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zoom_scale, MENU_MINMAX(0, 1000)}, |
|---|
| 512 | {0x62,LANG_MENU_VALUES_SHOW_REAL_APERTURE, MENUITEM_BOOL, &conf.values_show_real_aperture}, |
|---|
| 513 | {0x74,LANG_MENU_VALUES_SHOW_REAL_ISO, MENUITEM_BOOL, &conf.values_show_real_iso}, |
|---|
| 514 | {0x74,LANG_MENU_VALUES_SHOW_MARKET_ISO, MENUITEM_BOOL, &conf.values_show_market_iso}, |
|---|
| 515 | {0x2d,LANG_MENU_SHOW_ISO_ONLY_IN_AUTOISO_MODE, MENUITEM_BOOL, &conf.values_show_iso_only_in_autoiso_mode}, |
|---|
| 516 | {0x5c,LANG_MENU_VALUES_SHOW_EV_SETED, MENUITEM_BOOL, &conf.values_show_ev_seted}, |
|---|
| 517 | {0x5c,LANG_MENU_VALUES_SHOW_EV_MEASURED, MENUITEM_BOOL, &conf.values_show_ev_measured}, |
|---|
| 518 | {0x5c,LANG_MENU_VALUES_SHOW_BV_SETED, MENUITEM_BOOL, &conf.values_show_bv_seted}, |
|---|
| 519 | {0x5c,LANG_MENU_VALUES_SHOW_BV_MEASURED, MENUITEM_BOOL, &conf.values_show_bv_measured}, |
|---|
| 520 | {0x5c,LANG_MENU_VALUES_SHOW_OVEREXPOSURE, MENUITEM_BOOL, &conf.values_show_overexposure}, |
|---|
| 521 | {0x5c,LANG_MENU_SHOW_CANON_OVEREXPOSURE, MENUITEM_BOOL, &conf.values_show_canon_overexposure}, |
|---|
| 522 | {0x5c,LANG_MENU_VALUES_SHOW_LUMINANCE, MENUITEM_BOOL, &conf.values_show_luminance}, |
|---|
| 523 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 524 | {0} |
|---|
| 525 | }; |
|---|
| 526 | static CMenu values_submenu = {0x28,LANG_MENU_OSD_VALUES_TITLE, /*cb_values_menu_change*/ NULL, values_submenu_items }; |
|---|
| 527 | |
|---|
| 528 | static CMenuItem clock_submenu_items[] = { |
|---|
| 529 | {0x5f,LANG_MENU_OSD_SHOW_CLOCK, MENUITEM_ENUM, (int*)gui_show_clock_enum }, |
|---|
| 530 | {0x6d,LANG_MENU_OSD_CLOCK_FORMAT, MENUITEM_ENUM, (int*)gui_clock_format_enum }, |
|---|
| 531 | {0x6c,LANG_MENU_OSD_CLOCK_INDICATOR, MENUITEM_ENUM, (int*)gui_clock_indicator_enum }, |
|---|
| 532 | {0x6e,LANG_MENU_OSD_CLOCK_HALFPRESS, MENUITEM_ENUM, (int*)gui_clock_halfpress_enum }, |
|---|
| 533 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 534 | {0} |
|---|
| 535 | }; |
|---|
| 536 | static CMenu clock_submenu = {0x34,LANG_MENU_OSD_CLOCK_PARAMS_TITLE, NULL, clock_submenu_items }; |
|---|
| 537 | |
|---|
| 538 | |
|---|
| 539 | static CMenuItem video_submenu_items[] = { |
|---|
| 540 | #if CAM_CHDK_HAS_EXT_VIDEO_MENU |
|---|
| 541 | {0x23,LANG_MENU_VIDEO_MODE, MENUITEM_ENUM, (int*)gui_video_mode_enum}, |
|---|
| 542 | #if !CAM_VIDEO_QUALITY_ONLY |
|---|
| 543 | {0x5e,LANG_MENU_VIDEO_BITRATE, MENUITEM_ENUM, (int*)gui_video_bitrate_enum}, |
|---|
| 544 | #endif |
|---|
| 545 | {0x60,LANG_MENU_VIDEO_QUALITY, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.video_quality, MENU_MINMAX(1, 99)}, |
|---|
| 546 | {0x5c,LANG_MENU_CLEAR_VIDEO_VALUES, MENUITEM_BOOL, (int*)&conf.clear_video}, |
|---|
| 547 | #endif |
|---|
| 548 | #if CAM_VIDEO_CONTROL |
|---|
| 549 | {0x5c,LANG_MENU_FAST_SWITCH_VIDEO, MENUITEM_BOOL, &conf.fast_movie_control}, |
|---|
| 550 | #endif |
|---|
| 551 | #if CAM_CHDK_HAS_EXT_VIDEO_MENU |
|---|
| 552 | {0x5c,LANG_MENU_FAST_SWITCH_QUALITY_VIDEO, MENUITEM_BOOL, &conf.fast_movie_quality_control}, |
|---|
| 553 | #endif |
|---|
| 554 | #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO |
|---|
| 555 | {0x5c,LANG_MENU_OPTICAL_ZOOM_IN_VIDEO, MENUITEM_BOOL, &conf.unlock_optical_zoom_for_video}, |
|---|
| 556 | #endif |
|---|
| 557 | #if CAM_CAN_MUTE_MICROPHONE |
|---|
| 558 | {0x83,LANG_MENU_MUTE_ON_ZOOM, MENUITEM_BOOL, &conf.mute_on_zoom}, |
|---|
| 559 | #endif |
|---|
| 560 | #if CAM_AF_SCAN_DURING_VIDEO_RECORD |
|---|
| 561 | {0x82,LANG_MENU_VIDEO_AF_KEY, MENUITEM_ENUM, (int*)gui_video_af_key_enum}, |
|---|
| 562 | #endif |
|---|
| 563 | {0x5c,LANG_MENU_OSD_SHOW_VIDEO_TIME, MENUITEM_ENUM, (int*)gui_show_movie_time }, |
|---|
| 564 | {0x60,LANG_MENU_OSD_SHOW_VIDEO_REFRESH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.show_movie_refresh, MENU_MINMAX(1, 20)}, |
|---|
| 565 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 566 | {0} |
|---|
| 567 | }; |
|---|
| 568 | static CMenu video_submenu = {0x23,LANG_MENU_VIDEO_PARAM_TITLE, NULL, video_submenu_items }; |
|---|
| 569 | |
|---|
| 570 | static CMenuItem bracketing_in_continuous_submenu_items[] = { |
|---|
| 571 | {0x63,LANG_MENU_TV_BRACKET_VALUE, MENUITEM_ENUM, (int*)gui_tv_bracket_values_enum }, |
|---|
| 572 | #if CAM_HAS_IRIS_DIAPHRAGM |
|---|
| 573 | {0x62,LANG_MENU_AV_BRACKET_VALUE, MENUITEM_ENUM, (int*)gui_av_bracket_values_enum }, |
|---|
| 574 | #endif |
|---|
| 575 | #if CAM_CAN_SD_OVERRIDE |
|---|
| 576 | {0x5e,LANG_MENU_SUBJ_DIST_BRACKET_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.subj_dist_bracket_value, MENU_MINMAX(0, 100)}, |
|---|
| 577 | {0x5f,LANG_MENU_SUBJ_DIST_BRACKET_KOEF, MENUITEM_ENUM, (int*)gui_subj_dist_bracket_koef_enum}, |
|---|
| 578 | #endif |
|---|
| 579 | {0x74,LANG_MENU_ISO_BRACKET_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.iso_bracket_value, MENU_MINMAX(0, 100)}, |
|---|
| 580 | {0x5f,LANG_MENU_ISO_BRACKET_KOEF, MENUITEM_ENUM, (int*)gui_iso_bracket_koef_enum}, |
|---|
| 581 | {0x60,LANG_MENU_BRACKET_TYPE, MENUITEM_ENUM, (int*)gui_bracket_type_enum }, |
|---|
| 582 | {0x5b,LANG_MENU_CLEAR_BRACKET_VALUES, MENUITEM_BOOL, (int*)&conf.clear_bracket}, |
|---|
| 583 | {0x5c,LANG_MENU_BRACKETING_ADD_RAW_SUFFIX, MENUITEM_BOOL, &conf.bracketing_add_raw_suffix }, |
|---|
| 584 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 585 | {0} |
|---|
| 586 | }; |
|---|
| 587 | static CMenu bracketing_in_continuous_submenu = {0x2c,LANG_MENU_BRACKET_IN_CONTINUOUS_TITLE, NULL, bracketing_in_continuous_submenu_items }; |
|---|
| 588 | |
|---|
| 589 | |
|---|
| 590 | /* |
|---|
| 591 | static CMenuItem exposure_submenu_items[] = { |
|---|
| 592 | {0x59,LANG_MENU_RECALC_EXPOSURE, MENUITEM_BOOL, &conf.recalc_exposure}, |
|---|
| 593 | {0x63,LANG_MENU_TV_EXPOSURE_ORDER, MENUITEM_ENUM, (int*)gui_tv_exposure_order_enum}, |
|---|
| 594 | {0x62,LANG_MENU_AV_EXPOSURE_ORDER, MENUITEM_ENUM, (int*)gui_av_exposure_order_enum}, |
|---|
| 595 | {0x74,LANG_MENU_ISO_EXPOSURE_ORDER, MENUITEM_ENUM, (int*)gui_iso_exposure_order_enum}, |
|---|
| 596 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 597 | {0} |
|---|
| 598 | }; |
|---|
| 599 | static CMenu exposure_submenu = {0x2a,LANG_MENU_EXPOSURE_TITLE, NULL, exposure_submenu_items }; |
|---|
| 600 | */ |
|---|
| 601 | |
|---|
| 602 | static CMenuItem operation_submenu_items[] = { |
|---|
| 603 | {0x5c,LANG_MENU_OVERRIDE_DISABLE, MENUITEM_ENUM, (int*)gui_override_disable_enum},//&conf.override_disable }, |
|---|
| 604 | {0x5c,LANG_MENU_OVERRIDE_DISABLE_ALL, MENUITEM_BOOL, &conf.override_disable_all }, |
|---|
| 605 | {0x61,LANG_MENU_OVERRIDE_TV_VALUE, MENUITEM_ENUM, (int*)gui_tv_override_value_enum}, |
|---|
| 606 | {0x5f,LANG_MENU_OVERRIDE_TV_KOEF, MENUITEM_ENUM, (int*)gui_tv_override_koef_enum}, |
|---|
| 607 | {0x59,LANG_MENU_TV_ENUM_TYPE, MENUITEM_ENUM, (int*)gui_tv_enum_type_enum}, |
|---|
| 608 | #if CAM_HAS_IRIS_DIAPHRAGM |
|---|
| 609 | {0x62,LANG_MENU_OVERRIDE_AV_VALUE, MENUITEM_ENUM, (int*)gui_av_override_enum }, |
|---|
| 610 | #endif |
|---|
| 611 | #if CAM_HAS_ND_FILTER |
|---|
| 612 | {0x62,LANG_MENU_OVERRIDE_ND_FILTER, MENUITEM_ENUM, (int*)gui_nd_filter_state_enum }, |
|---|
| 613 | #endif |
|---|
| 614 | #if CAM_CAN_SD_OVERRIDE |
|---|
| 615 | {0x5e,LANG_MENU_OVERRIDE_SUBJ_DIST_VALUE, MENUITEM_ENUM, (int*)gui_subj_dist_override_value_enum}, |
|---|
| 616 | {0x5f,LANG_MENU_OVERRIDE_SUBJ_DIST_KOEF, MENUITEM_ENUM, (int*)gui_subj_dist_override_koef_enum}, |
|---|
| 617 | #endif |
|---|
| 618 | {0x74,LANG_MENU_OVERRIDE_ISO_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.iso_override_value, MENU_MINMAX(0, 800)}, |
|---|
| 619 | {0x5f,LANG_MENU_OVERRIDE_ISO_KOEF, MENUITEM_ENUM, (int*)gui_iso_override_koef_enum}, |
|---|
| 620 | #if ZOOM_OVERRIDE |
|---|
| 621 | {0x5c,LANG_MENU_OVERRIDE_ZOOM, MENUITEM_BOOL, &conf.zoom_override}, |
|---|
| 622 | {0x5f,LANG_MENU_OVERRIDE_ZOOM_VALUE, MENUITEM_ENUM, (int*)gui_zoom_override_enum }, |
|---|
| 623 | |
|---|
| 624 | {0x5c,LANG_MENU_CLEAR_ZOOM_OVERRIDE_VALUES, MENUITEM_BOOL, (int*)&conf.clear_zoom_override}, |
|---|
| 625 | #endif |
|---|
| 626 | {0x2c,LANG_MENU_BRACKET_IN_CONTINUOUS, MENUITEM_SUBMENU, (int*)&bracketing_in_continuous_submenu }, |
|---|
| 627 | {0x2d,LANG_MENU_AUTOISO, MENUITEM_SUBMENU, (int*)&autoiso_submenu }, |
|---|
| 628 | //{LANG_MENU_EXPOSURE, MENUITEM_SUBMENU, (int*)&exposure_submenu }, |
|---|
| 629 | {0x5b,LANG_MENU_CLEAR_OVERRIDE_VALUES, MENUITEM_BOOL, (int*)&conf.clear_override}, |
|---|
| 630 | |
|---|
| 631 | {0x5c,LANG_MENU_MISC_FAST_EV, MENUITEM_BOOL, &conf.fast_ev }, |
|---|
| 632 | {0x5f,LANG_MENU_MISC_FAST_EV_STEP, MENUITEM_ENUM, (int*)gui_fast_ev_step }, |
|---|
| 633 | #if CAM_REAR_CURTAIN |
|---|
| 634 | {0x5c, LANG_MENU_REAR_CURTAIN, MENUITEM_BOOL, &conf.flash_sync_curtain }, |
|---|
| 635 | #endif |
|---|
| 636 | {0x5c, LANG_MENU_FLASH_MANUAL_OVERRIDE, MENUITEM_BOOL, &conf.flash_manual_override}, |
|---|
| 637 | {0x5f, LANG_MENU_FLASH_VIDEO_OVERRIDE_POWER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.flash_video_override_power, MENU_MINMAX(0, 2)}, |
|---|
| 638 | #if CAM_HAS_VIDEO_BUTTON |
|---|
| 639 | {0x5c, LANG_MENU_FLASH_VIDEO_OVERRIDE, MENUITEM_BOOL, &conf.flash_video_override}, |
|---|
| 640 | #endif |
|---|
| 641 | #if CAM_QUALITY_OVERRIDE |
|---|
| 642 | {0x5c,LANG_MENU_MISC_IMAGE_QUALITY, MENUITEM_ENUM, (int*)gui_fast_image_quality }, |
|---|
| 643 | #endif |
|---|
| 644 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 645 | {0} |
|---|
| 646 | }; |
|---|
| 647 | static CMenu operation_submenu = {0x21,LANG_MENU_OPERATION_PARAM_TITLE, NULL, operation_submenu_items }; |
|---|
| 648 | |
|---|
| 649 | #ifdef OPT_EDGEOVERLAY |
|---|
| 650 | static CMenuItem edge_overlay_submenu_items[] = { |
|---|
| 651 | {0x5c,LANG_MENU_EDGE_OVERLAY_ENABLE, MENUITEM_BOOL, &conf.edge_overlay_enable }, |
|---|
| 652 | {0x5c,LANG_MENU_EDGE_FILTER, MENUITEM_BOOL, &conf.edge_overlay_filter }, |
|---|
| 653 | {0x5f,LANG_MENU_EDGE_PANO, MENUITEM_ENUM, (int*)gui_edge_pano_enum }, |
|---|
| 654 | {0x5e,LANG_MENU_EDGE_PANO_OVERLAP, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.edge_overlay_pano_overlap, MENU_MINMAX(0, 100)}, |
|---|
| 655 | {0x5c,LANG_MENU_EDGE_SHOW, MENUITEM_BOOL, &conf.edge_overlay_show }, |
|---|
| 656 | {0x5e,LANG_MENU_EDGE_OVERLAY_TRESH, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.edge_overlay_thresh, MENU_MINMAX(0, 255)}, |
|---|
| 657 | {0x65,LANG_MENU_EDGE_OVERLAY_COLOR, MENUITEM_COLOR_FG, (int*)&conf.edge_overlay_color }, |
|---|
| 658 | {0x5c,LANG_MENU_EDGE_PLAY, MENUITEM_BOOL, &conf.edge_overlay_play }, //does not work on cams like s-series, which dont have a real "hardware" play/rec switch, need a workaround, probably another button |
|---|
| 659 | {0x33,LANG_MENU_EDGE_SAVE, MENUITEM_PROC, (int*)gui_menuproc_edge_save }, |
|---|
| 660 | {0x5c,LANG_MENU_EDGE_ZOOM, MENUITEM_BOOL, &conf.edge_overlay_zoom }, |
|---|
| 661 | {0x33,LANG_MENU_EDGE_LOAD, MENUITEM_PROC, (int*)gui_menuproc_edge_load }, |
|---|
| 662 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 663 | {0} |
|---|
| 664 | }; |
|---|
| 665 | static CMenu edge_overlay_submenu = {0x7f,LANG_MENU_EDGE_OVERLAY_TITLE, NULL, edge_overlay_submenu_items }; |
|---|
| 666 | #endif |
|---|
| 667 | |
|---|
| 668 | static CMenuItem grid_submenu_items[] = { |
|---|
| 669 | {0x2f,LANG_MENU_SHOW_GRID, MENUITEM_BOOL, &conf.show_grid_lines }, |
|---|
| 670 | {0x35,LANG_MENU_GRID_LOAD, MENUITEM_PROC, (int*)gui_grid_lines_load }, |
|---|
| 671 | {0x0,LANG_MENU_GRID_CURRENT, MENUITEM_SEPARATOR }, |
|---|
| 672 | {0x0,(int)grid_title, MENUITEM_TEXT }, |
|---|
| 673 | {0x0,(int)"", MENUITEM_SEPARATOR }, |
|---|
| 674 | {0x5c,LANG_MENU_GRID_FORCE_COLOR, MENUITEM_BOOL, &conf.grid_force_color }, |
|---|
| 675 | {0x65,LANG_MENU_GRID_COLOR_LINE, MENUITEM_COLOR_FG, (int*)&conf.grid_color }, |
|---|
| 676 | {0x65,LANG_MENU_GRID_COLOR_FILL, MENUITEM_COLOR_BG, (int*)&conf.grid_color }, |
|---|
| 677 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 678 | {0} |
|---|
| 679 | }; |
|---|
| 680 | static CMenu grid_submenu = {0x2f,LANG_MENU_GRID_TITLE, NULL, grid_submenu_items }; |
|---|
| 681 | |
|---|
| 682 | static CMenuItem visual_submenu_items[] = { |
|---|
| 683 | {0x35,LANG_MENU_VIS_LANG, MENUITEM_PROC, (int*)gui_draw_load_lang }, |
|---|
| 684 | {0x5f,LANG_MENU_VIS_OSD_FONT, MENUITEM_ENUM, (int*)gui_font_enum }, |
|---|
| 685 | {0x35,LANG_MENU_VIS_MENU_FONT, MENUITEM_PROC, (int*)gui_draw_load_menu_rbf }, |
|---|
| 686 | {0x35,LANG_MENU_VIS_MENU_SYMBOL_FONT, MENUITEM_PROC, (int*)gui_draw_load_symbol_rbf }, |
|---|
| 687 | {0x80,LANG_MENU_RESET_FILES , MENUITEM_PROC, (int*)gui_menuproc_reset_files }, |
|---|
| 688 | {0x0,LANG_MENU_VIS_COLORS, MENUITEM_SEPARATOR }, |
|---|
| 689 | {0x65,LANG_MENU_VIS_OSD_TEXT, MENUITEM_COLOR_FG, (int*)&conf.osd_color }, |
|---|
| 690 | {0x65,LANG_MENU_VIS_OSD_BKG, MENUITEM_COLOR_BG, (int*)&conf.osd_color }, |
|---|
| 691 | {0x65,LANG_MENU_VIS_OSD_WARNING, MENUITEM_COLOR_FG, (int*)&conf.osd_color_warn }, |
|---|
| 692 | {0x65,LANG_MENU_VIS_OSD_WARNING_BKG, MENUITEM_COLOR_BG, (int*)&conf.osd_color_warn }, |
|---|
| 693 | {0x65,LANG_MENU_VIS_HISTO, MENUITEM_COLOR_FG, (int*)&conf.histo_color }, |
|---|
| 694 | {0x65,LANG_MENU_VIS_HISTO_BKG, MENUITEM_COLOR_BG, (int*)&conf.histo_color }, |
|---|
| 695 | {0x65,LANG_MENU_VIS_HISTO_BORDER, MENUITEM_COLOR_FG, (int*)&conf.histo_color2 }, |
|---|
| 696 | {0x65,LANG_MENU_VIS_HISTO_MARKERS, MENUITEM_COLOR_BG, (int*)&conf.histo_color2 }, |
|---|
| 697 | {0x65,LANG_MENU_VIS_ZEBRA_UNDER, MENUITEM_COLOR_BG, (int*)&conf.zebra_color }, |
|---|
| 698 | {0x65,LANG_MENU_VIS_ZEBRA_OVER, MENUITEM_COLOR_FG, (int*)&conf.zebra_color }, |
|---|
| 699 | {0x65,LANG_MENU_VIS_BATT_ICON, MENUITEM_COLOR_FG, (int*)&conf.batt_icon_color }, |
|---|
| 700 | {0x65,LANG_MENU_VIS_SPACE_ICON, MENUITEM_COLOR_FG, (int*)&conf.space_color }, |
|---|
| 701 | {0x65,LANG_MENU_VIS_SPACE_ICON_BKG, MENUITEM_COLOR_BG, (int*)&conf.space_color }, |
|---|
| 702 | {0x65,LANG_MENU_VIS_MENU_TEXT, MENUITEM_COLOR_FG, (int*)&conf.menu_color }, |
|---|
| 703 | {0x65,LANG_MENU_VIS_MENU_BKG, MENUITEM_COLOR_BG, (int*)&conf.menu_color }, |
|---|
| 704 | {0x65,LANG_MENU_VIS_MENU_TITLE_TEXT, MENUITEM_COLOR_FG, (int*)&conf.menu_title_color }, |
|---|
| 705 | {0x65,LANG_MENU_VIS_MENU_TITLE_BKG, MENUITEM_COLOR_BG, (int*)&conf.menu_title_color }, |
|---|
| 706 | {0x65,LANG_MENU_VIS_MENU_CURSOR_TEXT, MENUITEM_COLOR_FG, (int*)&conf.menu_cursor_color }, |
|---|
| 707 | {0x65,LANG_MENU_VIS_MENU_CURSOR_BKG, MENUITEM_COLOR_BG, (int*)&conf.menu_cursor_color }, |
|---|
| 708 | {0x65,LANG_MENU_VIS_MENU_SYMBOL_TEXT, MENUITEM_COLOR_FG, (int*)&conf.menu_symbol_color }, |
|---|
| 709 | {0x65,LANG_MENU_VIS_MENU_SYMBOL_BKG, MENUITEM_COLOR_BG, (int*)&conf.menu_symbol_color }, |
|---|
| 710 | {0x65,LANG_MENU_VIS_READER_TEXT, MENUITEM_COLOR_FG, (int*)&conf.reader_color }, |
|---|
| 711 | {0x65,LANG_MENU_VIS_READER_BKG, MENUITEM_COLOR_BG, (int*)&conf.reader_color }, |
|---|
| 712 | {0x65,LANG_MENU_VIS_OSD_OVERRIDE, MENUITEM_COLOR_FG, (int*)&conf.osd_color_override }, |
|---|
| 713 | {0x65,LANG_MENU_VIS_OSD_OVERRIDE_BKG, MENUITEM_COLOR_BG, (int*)&conf.osd_color_override }, |
|---|
| 714 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 715 | {0} |
|---|
| 716 | }; |
|---|
| 717 | static CMenu visual_submenu = {0x28,LANG_MENU_VIS_TITLE, NULL, visual_submenu_items }; |
|---|
| 718 | |
|---|
| 719 | /* |
|---|
| 720 | * 1 extra entry for the "Main menu" and 1 for null when the menu is full with user selections |
|---|
| 721 | * Compiler will zero init remaining portion of array so no there is no hidden relationship between |
|---|
| 722 | * this structure and the value of USER_MENU_ITEMS. The value of USER_MENU_ITEMS can be anything you |
|---|
| 723 | * wish and everything automagically works. |
|---|
| 724 | */ |
|---|
| 725 | |
|---|
| 726 | static CMenuItem user_submenu_items[USER_MENU_ITEMS + 2] = { |
|---|
| 727 | {0x20,LANG_MENU_MAIN_TITLE, MENUITEM_PROC, (int*)rinit} |
|---|
| 728 | }; |
|---|
| 729 | |
|---|
| 730 | static CMenu user_submenu = {0x2e,LANG_MENU_USER_MENU, NULL, user_submenu_items }; |
|---|
| 731 | |
|---|
| 732 | static CMenuItem raw_state_submenu_items[] = { |
|---|
| 733 | {0x5c,LANG_MENU_OSD_SHOW_RAW_STATE, MENUITEM_BOOL, &conf.show_raw_state }, |
|---|
| 734 | {0x5c,LANG_MENU_OSD_SHOW_REMAINING_RAW, MENUITEM_BOOL, &conf.show_remaining_raw }, |
|---|
| 735 | {0x60,LANG_MENU_OSD_RAW_TRESHOLD, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.remaining_raw_treshold, MENU_MINMAX(0, 200)}, |
|---|
| 736 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 737 | {0} |
|---|
| 738 | }; |
|---|
| 739 | |
|---|
| 740 | static CMenu raw_state_submenu = {0x24,LANG_MENU_OSD_RAW_STATE_PARAMS_TITLE, NULL, raw_state_submenu_items }; |
|---|
| 741 | |
|---|
| 742 | |
|---|
| 743 | static CMenuItem osd_submenu_items[] = { |
|---|
| 744 | {0x5c,LANG_MENU_OSD_SHOW, MENUITEM_BOOL, &conf.show_osd }, |
|---|
| 745 | {0x5c,LANG_MENU_OSD_HIDE_PLAYBACK, MENUITEM_ENUM, (int*)gui_hide_osd_enum }, |
|---|
| 746 | {0x81,LANG_MENU_VIS_MENU_CENTER, MENUITEM_BOOL, &conf.menu_center }, |
|---|
| 747 | {0x81,LANG_MENU_SELECT_FIRST_ENTRY, MENUITEM_BOOL, &conf.menu_select_first_entry }, |
|---|
| 748 | {0x64,LANG_MENU_VIS_SYMBOL, MENUITEM_BOOL, &conf.menu_symbol_enable }, |
|---|
| 749 | {0x2e,LANG_MENU_USER_MENU, MENUITEM_SUBMENU, (int*)&user_submenu}, |
|---|
| 750 | {0x5f,LANG_MENU_USER_MENU_ENABLE, MENUITEM_ENUM, (int*)gui_user_menu_show_enum }, |
|---|
| 751 | {0x5c,LANG_MENU_USER_MENU_AS_ROOT, MENUITEM_BOOL, &conf.user_menu_as_root }, |
|---|
| 752 | {0x5f,LANG_MENU_OSD_SHOW_STATES, MENUITEM_BOOL, &conf.show_state }, |
|---|
| 753 | {0x5f,LANG_MENU_OSD_SHOW_TEMP, MENUITEM_ENUM, (int*)gui_temp_mode_enum }, |
|---|
| 754 | {0x59,LANG_MENU_OSD_TEMP_FAHRENHEIT, MENUITEM_BOOL, &conf.temperature_unit}, |
|---|
| 755 | {0x72,LANG_MENU_OSD_LAYOUT_EDITOR, MENUITEM_PROC, (int*)gui_draw_osd_le }, |
|---|
| 756 | {0x2f,LANG_MENU_OSD_GRID_PARAMS, MENUITEM_SUBMENU, (int*)&grid_submenu }, |
|---|
| 757 | {0x22,LANG_MENU_OSD_VALUES, MENUITEM_SUBMENU, (int*)&values_submenu }, |
|---|
| 758 | {0x31,LANG_MENU_OSD_DOF_CALC, MENUITEM_SUBMENU, (int*)&dof_submenu }, |
|---|
| 759 | {0x24,LANG_MENU_OSD_RAW_STATE_PARAMS, MENUITEM_SUBMENU, (int*)&raw_state_submenu }, |
|---|
| 760 | {0x32,LANG_MENU_OSD_BATT_PARAMS, MENUITEM_SUBMENU, (int*)&battery_submenu }, |
|---|
| 761 | {0x33,LANG_MENU_OSD_SPACE_PARAMS, MENUITEM_SUBMENU, (int*)&space_submenu }, |
|---|
| 762 | {0x34,LANG_MENU_OSD_CLOCK_PARAMS, MENUITEM_SUBMENU, (int*)&clock_submenu }, |
|---|
| 763 | {0x59,LANG_MENU_OSD_SHOW_IN_REVIEW, MENUITEM_BOOL, &conf.show_osd_in_review}, |
|---|
| 764 | #ifndef OPTIONS_AUTOSAVE |
|---|
| 765 | {0x5c,LANG_MENU_MAIN_SAVE_OPTIONS, MENUITEM_PROC, (int*)gui_menuproc_save }, |
|---|
| 766 | #endif |
|---|
| 767 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 768 | {0} |
|---|
| 769 | }; |
|---|
| 770 | |
|---|
| 771 | static CMenu osd_submenu = {0x22,LANG_MENU_OSD_TITLE, NULL, osd_submenu_items }; |
|---|
| 772 | |
|---|
| 773 | static CMenuItem histo_submenu_items[] = { |
|---|
| 774 | {0x5f,LANG_MENU_HISTO_SHOW, MENUITEM_ENUM, (int*)gui_histo_show_enum }, |
|---|
| 775 | {0x6f,LANG_MENU_HISTO_LAYOUT, MENUITEM_ENUM, (int*)gui_histo_layout_enum }, |
|---|
| 776 | {0x5f,LANG_MENU_HISTO_MODE, MENUITEM_ENUM, (int*)gui_histo_mode_enum }, |
|---|
| 777 | {0x5c,LANG_MENU_HISTO_EXP, MENUITEM_BOOL, &conf.show_overexp }, |
|---|
| 778 | {0x70,LANG_MENU_HISTO_IGNORE_PEAKS, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.histo_ignore_boundary, MENU_MINMAX(0, 32)}, |
|---|
| 779 | {0x5c,LANG_MENU_HISTO_MAGNIFY, MENUITEM_BOOL, &conf.histo_auto_ajust }, |
|---|
| 780 | {0x5c,LANG_MENU_HISTO_SHOW_EV_GRID, MENUITEM_BOOL, &conf.histo_show_ev_grid }, |
|---|
| 781 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 782 | {0} |
|---|
| 783 | }; |
|---|
| 784 | static CMenu histo_submenu = {0x25,LANG_MENU_HISTO_TITLE, NULL, histo_submenu_items }; |
|---|
| 785 | |
|---|
| 786 | static CMenuItem raw_exceptions_submenu_items[] = { |
|---|
| 787 | #if defined CAM_HAS_VIDEO_BUTTON |
|---|
| 788 | {0x5c,LANG_MENU_RAW_SAVE_IN_VIDEO, MENUITEM_BOOL, &conf.save_raw_in_video }, |
|---|
| 789 | #endif |
|---|
| 790 | #if defined(CAMERA_s3is) |
|---|
| 791 | {0x5c,LANG_MENU_RAW_SAVE_IN_SPORTS, MENUITEM_BOOL, &conf.save_raw_in_sports }, |
|---|
| 792 | #endif |
|---|
| 793 | {0x5c,LANG_MENU_RAW_SAVE_IN_BURST, MENUITEM_BOOL, &conf.save_raw_in_burst }, |
|---|
| 794 | {0x5c,LANG_MENU_RAW_SAVE_IN_TIMER, MENUITEM_BOOL, &conf.save_raw_in_timer }, |
|---|
| 795 | {0x5c,LANG_MENU_RAW_SAVE_IN_EDGEOVERLAY, MENUITEM_BOOL, &conf.save_raw_in_edgeoverlay }, |
|---|
| 796 | {0x5c,LANG_MENU_RAW_SAVE_IN_AUTO, MENUITEM_BOOL, &conf.save_raw_in_auto }, |
|---|
| 797 | #if CAM_BRACKETING |
|---|
| 798 | {0x5c,LANG_MENU_RAW_SAVE_IN_EV_BRACKETING, MENUITEM_BOOL, &conf.save_raw_in_ev_bracketing }, |
|---|
| 799 | #endif |
|---|
| 800 | {0x5c,LANG_MENU_RAW_WARN, MENUITEM_BOOL, &conf.raw_exceptions_warn }, |
|---|
| 801 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 802 | {0} |
|---|
| 803 | }; |
|---|
| 804 | static CMenu raw_exceptions_submenu = {0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS_TITLE, NULL, raw_exceptions_submenu_items }; |
|---|
| 805 | |
|---|
| 806 | |
|---|
| 807 | static CMenuItem raw_submenu_items[] = { |
|---|
| 808 | {0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL, &conf.save_raw }, |
|---|
| 809 | {0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS, MENUITEM_SUBMENU, (int*)&raw_exceptions_submenu }, |
|---|
| 810 | {0x5f,LANG_MENU_RAW_NOISE_REDUCTION, MENUITEM_ENUM, (int*)gui_raw_nr_enum }, |
|---|
| 811 | {0x5c,LANG_MENU_RAW_FIRST_ONLY, MENUITEM_BOOL, &conf.raw_save_first_only }, |
|---|
| 812 | {0x5c,LANG_MENU_RAW_SAVE_IN_DIR, MENUITEM_BOOL, &conf.raw_in_dir }, |
|---|
| 813 | {0x5f,LANG_MENU_RAW_PREFIX, MENUITEM_ENUM, (int*)gui_raw_prefix_enum }, |
|---|
| 814 | {0x5f,LANG_MENU_RAW_EXTENSION, MENUITEM_ENUM, (int*)gui_raw_ext_enum }, |
|---|
| 815 | {0x5f,LANG_MENU_SUB_PREFIX, MENUITEM_ENUM, (int*)gui_sub_batch_prefix_enum }, |
|---|
| 816 | {0x5f,LANG_MENU_SUB_EXTENSION, MENUITEM_ENUM, (int*)gui_sub_batch_ext_enum }, |
|---|
| 817 | // {0x60,LANG_MENU_SUB_IN_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_in_dark_value, MENU_MINMAX(0, 1023)}, |
|---|
| 818 | // {0x60,LANG_MENU_SUB_OUT_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_out_dark_value, MENU_MINMAX(0, 1023)}, |
|---|
| 819 | {0x2a,LANG_MENU_RAW_DEVELOP, MENUITEM_PROC, (int*)gui_raw_develop }, |
|---|
| 820 | {0x5c,LANG_MENU_BAD_PIXEL_REMOVAL, MENUITEM_ENUM, (int*)gui_bad_pixel_enum }, |
|---|
| 821 | #if DNG_SUPPORT |
|---|
| 822 | {0x5c,LANG_MENU_DNG_FORMAT, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_raw , (int)cb_change_dng }, |
|---|
| 823 | {0x5c,LANG_MENU_RAW_DNG_EXT, MENUITEM_BOOL, &conf.raw_dng_ext}, |
|---|
| 824 | #endif |
|---|
| 825 | {0x5c,LANG_MENU_RAW_CACHED, MENUITEM_BOOL, &conf.raw_cache }, |
|---|
| 826 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 827 | {0} |
|---|
| 828 | }; |
|---|
| 829 | static CMenu raw_submenu = {0x24,LANG_MENU_RAW_TITLE, NULL, raw_submenu_items }; |
|---|
| 830 | |
|---|
| 831 | |
|---|
| 832 | static CMenuItem zebra_submenu_items[] = { |
|---|
| 833 | {0x5c,LANG_MENU_ZEBRA_DRAW, MENUITEM_BOOL, &conf.zebra_draw }, |
|---|
| 834 | {0x5f,LANG_MENU_ZEBRA_MODE, MENUITEM_ENUM, (int*)gui_zebra_mode_enum }, |
|---|
| 835 | {0x58,LANG_MENU_ZEBRA_UNDER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zebra_under, MENU_MINMAX(0, 32)}, |
|---|
| 836 | {0x57,LANG_MENU_ZEBRA_OVER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.zebra_over, MENU_MINMAX(0, 32)}, |
|---|
| 837 | {0x28,LANG_MENU_ZEBRA_RESTORE_SCREEN, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.zebra_restore_screen, (int)cb_zebra_restore_screen }, |
|---|
| 838 | {0x5c,LANG_MENU_ZEBRA_RESTORE_OSD, MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.zebra_restore_osd, (int)cb_zebra_restore_osd }, |
|---|
| 839 | {0x5f,LANG_MENU_ZEBRA_DRAW_OVER, MENUITEM_ENUM, (int*)gui_zebra_draw_osd_enum }, |
|---|
| 840 | {0x5c,LANG_MENU_ZEBRA_MULTICHANNEL, MENUITEM_BOOL, &conf.zebra_multichannel}, |
|---|
| 841 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 842 | {0} |
|---|
| 843 | }; |
|---|
| 844 | static CMenu zebra_submenu = {0x26,LANG_MENU_ZEBRA_TITLE, NULL, zebra_submenu_items }; |
|---|
| 845 | |
|---|
| 846 | #ifdef OPT_CURVES |
|---|
| 847 | static CMenuItem curve_submenu_items[] = { |
|---|
| 848 | {0x5f,LANG_MENU_CURVE_ENABLE, MENUITEM_ENUM, (int*)gui_conf_curve_enum }, |
|---|
| 849 | {0x35,LANG_MENU_CURVE_LOAD, MENUITEM_PROC, (int*)gui_load_curve }, |
|---|
| 850 | {0x51,LANG_MENU_BACK, MENUITEM_UP }, |
|---|
| 851 | {0} |
|---|
| 852 | }; |
|---|
| 853 | static CMenu curve_submenu = {0x85,LANG_MENU_CURVE_PARAM_TITLE, NULL, curve_submenu_items }; |
|---|
| 854 | #endif |
|---|
| 855 | |
|---|
| 856 | static CMenuItem root_menu_items[] = { |
|---|
| 857 | {0x21,LANG_MENU_OPERATION_PARAM, MENUITEM_SUBMENU, (int*)&operation_submenu }, |
|---|
| 858 | {0x23,LANG_MENU_VIDEO_PARAM, MENUITEM_SUBMENU, (int*)&video_submenu }, |
|---|
| 859 | {0x24,LANG_MENU_MAIN_RAW_PARAM, MENUITEM_SUBMENU, (int*)&raw_submenu }, |
|---|
| 860 | #ifdef OPT_EDGEOVERLAY |
|---|
| 861 | {0x7f,LANG_MENU_EDGE_OVERLAY, MENUITEM_SUBMENU, (int*)&edge_overlay_submenu }, |
|---|
| 862 | #endif |
|---|
| 863 | #ifdef OPT_CURVES |
|---|
| 864 | {0x85,LANG_MENU_CURVE_PARAM, MENUITEM_SUBMENU, (int*)&curve_submenu }, |
|---|
| 865 | #endif |
|---|
| 866 | {0x25,LANG_MENU_MAIN_HISTO_PARAM, MENUITEM_SUBMENU, (int*)&histo_submenu }, |
|---|
| 867 | {0x26,LANG_MENU_MAIN_ZEBRA_PARAM, MENUITEM_SUBMENU, (int*)&zebra_submenu }, |
|---|
| 868 | {0x22,LANG_MENU_MAIN_OSD_PARAM, MENUITEM_SUBMENU, (int*)&osd_submenu }, |
|---|
| 869 | {0x28,LANG_MENU_MAIN_VISUAL_PARAM, MENUITEM_SUBMENU, (int*)&visual_submenu }, |
|---|
| 870 | #ifdef OPT_SCRIPTING |
|---|
| 871 | {0x27,LANG_MENU_MAIN_SCRIPT_PARAM, MENUITEM_SUBMENU, (int*)&script_submenu }, |
|---|
| 872 | #endif |
|---|
| 873 | {0x29,LANG_MENU_MAIN_MISC, MENUITEM_SUBMENU, (int*)&misc_submenu }, |
|---|
| 874 | #ifndef OPTIONS_AUTOSAVE |
|---|
| 875 | {0x33,LANG_MENU_MAIN_SAVE_OPTIONS, MENUITEM_PROC, (int*)gui_menuproc_save }, |
|---|
| 876 | #endif |
|---|
| 877 | {0} |
|---|
| 878 | }; |
|---|
| 879 | |
|---|
| 880 | static CMenu root_menu = {0x20,LANG_MENU_MAIN_TITLE, NULL, root_menu_items }; |
|---|
| 881 | |
|---|
| 882 | static int gui_user_menu_flag; |
|---|
| 883 | |
|---|
| 884 | void rinit(){ |
|---|
| 885 | gui_menu_init(&root_menu); |
|---|
| 886 | } |
|---|
| 887 | |
|---|
| 888 | //------------------------------------------------------------------- |
|---|
| 889 | void |
|---|
| 890 | mod_user_menu(CMenuItem curr_menu_item, int* cur_memnu_item_indx, int mod) { |
|---|
| 891 | int i; |
|---|
| 892 | CMenuItem tmp_menu_item; |
|---|
| 893 | switch(mod) { |
|---|
| 894 | |
|---|
| 895 | case 0: |
|---|
| 896 | /* |
|---|
| 897 | * Delete user menu entry by sliding all the lower valid/existing entries up. |
|---|
| 898 | */ |
|---|
| 899 | |
|---|
| 900 | if (*cur_memnu_item_indx == 0) /* don't allow deleting "user menu" */ |
|---|
| 901 | break; |
|---|
| 902 | for(i = *cur_memnu_item_indx; user_submenu_items[i].text; i++) { |
|---|
| 903 | user_submenu_items[i] = user_submenu_items[i+1]; |
|---|
| 904 | } |
|---|
| 905 | |
|---|
| 906 | /* |
|---|
| 907 | * there were no valid entries below this one, so |
|---|
| 908 | * the index pointer must be decremented. |
|---|
| 909 | */ |
|---|
| 910 | if(!user_submenu_items[*cur_memnu_item_indx].text) |
|---|
| 911 | *cur_memnu_item_indx -= 1; |
|---|
| 912 | |
|---|
| 913 | break; |
|---|
| 914 | |
|---|
| 915 | case 1: |
|---|
| 916 | /* |
|---|
| 917 | * Insert new Item at end of existing entries |
|---|
| 918 | */ |
|---|
| 919 | for(i = 1; i < USER_MENU_ITEMS + 1; i++) { |
|---|
| 920 | if(!user_submenu_items[i].text) { |
|---|
| 921 | user_submenu_items[i] = curr_menu_item; |
|---|
| 922 | break; |
|---|
| 923 | } |
|---|
| 924 | } |
|---|
| 925 | break; |
|---|
| 926 | |
|---|
| 927 | case 2: |
|---|
| 928 | /* |
|---|
| 929 | * Move entry up |
|---|
| 930 | */ |
|---|
| 931 | |
|---|
| 932 | if((*cur_memnu_item_indx > 1)) { |
|---|
| 933 | tmp_menu_item = user_submenu_items[*cur_memnu_item_indx -1]; |
|---|
| 934 | user_submenu_items[*cur_memnu_item_indx -1] = user_submenu_items[*cur_memnu_item_indx]; |
|---|
| 935 | user_submenu_items[*cur_memnu_item_indx] = tmp_menu_item; |
|---|
| 936 | *cur_memnu_item_indx -=1; |
|---|
| 937 | } |
|---|
| 938 | break; |
|---|
| 939 | |
|---|
| 940 | case 3: |
|---|
| 941 | /* |
|---|
| 942 | * Move entry down below next entry if next entry is not empty |
|---|
| 943 | */ |
|---|
| 944 | if (*cur_memnu_item_indx == 0) /* don't allow moving "user menu" */ |
|---|
| 945 | break; |
|---|
| 946 | if((*cur_memnu_item_indx < (USER_MENU_ITEMS)) && (user_submenu_items[*cur_memnu_item_indx +1].text)) { |
|---|
| 947 | tmp_menu_item = user_submenu_items[*cur_memnu_item_indx +1]; |
|---|
| 948 | user_submenu_items[*cur_memnu_item_indx + 1] = user_submenu_items[*cur_memnu_item_indx]; |
|---|
| 949 | user_submenu_items[*cur_memnu_item_indx] = tmp_menu_item; |
|---|
| 950 | *cur_memnu_item_indx +=1; |
|---|
| 951 | } |
|---|
| 952 | break; |
|---|
| 953 | |
|---|
| 954 | } |
|---|
| 955 | } |
|---|
| 956 | |
|---|
| 957 | //------------------------------------------------------------------- |
|---|
| 958 | void cb_step_25() { |
|---|
| 959 | voltage_step = (conf.batt_step_25)?25:1; |
|---|
| 960 | } |
|---|
| 961 | |
|---|
| 962 | void cb_perc() { |
|---|
| 963 | conf.batt_volts_show=0; |
|---|
| 964 | } |
|---|
| 965 | |
|---|
| 966 | void cb_volts() { |
|---|
| 967 | conf.batt_perc_show=0; |
|---|
| 968 | } |
|---|
| 969 | |
|---|
| 970 | void cb_space_perc() { |
|---|
| 971 | conf.space_mb_show=0; |
|---|
| 972 | } |
|---|
| 973 | |
|---|
| 974 | void cb_space_mb() { |
|---|
| 975 | conf.space_perc_show=0; |
|---|
| 976 | } |
|---|
| 977 | |
|---|
| 978 | void cb_battery_menu_change(unsigned int item) { |
|---|
| 979 | switch (item) { |
|---|
| 980 | case 0: //Voltage MAX |
|---|
| 981 | if (conf.batt_volts_max<conf.batt_volts_min+25) { |
|---|
| 982 | conf.batt_volts_min = conf.batt_volts_max-25; |
|---|
| 983 | } |
|---|
| 984 | break; |
|---|
| 985 | case 1: //Voltage MIN |
|---|
| 986 | if (conf.batt_volts_min>conf.batt_volts_max-25) { |
|---|
| 987 | conf.batt_volts_max = conf.batt_volts_min+25; |
|---|
| 988 | } |
|---|
| 989 | break; |
|---|
| 990 | default: |
|---|
| 991 | break; |
|---|
| 992 | } |
|---|
| 993 | } |
|---|
| 994 | |
|---|
| 995 | void cb_zebra_restore_screen() { |
|---|
| 996 | if (!conf.zebra_restore_screen) |
|---|
| 997 | conf.zebra_restore_osd = 0; |
|---|
| 998 | } |
|---|
| 999 | |
|---|
| 1000 | void cb_zebra_restore_osd() { |
|---|
| 1001 | if (conf.zebra_restore_osd) |
|---|
| 1002 | conf.zebra_restore_screen = 1; |
|---|
| 1003 | } |
|---|
| 1004 | |
|---|
| 1005 | #if DNG_SUPPORT |
|---|
| 1006 | void cb_change_dng(){ |
|---|
| 1007 | int old=conf.dng_raw; |
|---|
| 1008 | conf_change_dng(); |
|---|
| 1009 | if ((old==1) && (conf.dng_raw==0)) gui_mbox_init(LANG_ERROR, LANG_CANNOT_OPEN_BADPIXEL_FILE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
|---|
| 1010 | } |
|---|
| 1011 | #endif |
|---|
| 1012 | |
|---|
| 1013 | #if defined (DNG_EXT_FROM) |
|---|
| 1014 | void cb_change_dng_usb_ext(){ |
|---|
| 1015 | if (conf.dng_usb_ext) change_ext_to_dng(); else change_ext_to_default(); |
|---|
| 1016 | } |
|---|
| 1017 | #endif |
|---|
| 1018 | |
|---|
| 1019 | /* |
|---|
| 1020 | common code for "enum" menu items that just take a list of string values and don't require any special setters |
|---|
| 1021 | would be better to have another menu item type that does this by default |
|---|
| 1022 | save memory by eliminating dupe code |
|---|
| 1023 | */ |
|---|
| 1024 | static void gui_enum_value_change(int *value, int change, unsigned num_items) { |
|---|
| 1025 | *value+=change; |
|---|
| 1026 | if (*value<0) |
|---|
| 1027 | *value = num_items-1; |
|---|
| 1028 | else if (*value>=num_items) |
|---|
| 1029 | *value = 0; |
|---|
| 1030 | } |
|---|
| 1031 | static const char* gui_change_simple_enum(int* value, int change, const char** items, unsigned num_items) { |
|---|
| 1032 | gui_enum_value_change(value, change, num_items); |
|---|
| 1033 | return items[*value]; |
|---|
| 1034 | } |
|---|
| 1035 | |
|---|
| 1036 | //------------------------------------------------------------------- |
|---|
| 1037 | #ifdef OPT_CURVES |
|---|
| 1038 | const char* gui_conf_curve_enum(int change, int arg) { |
|---|
| 1039 | static const char* modes[]={ "None", "Custom", "+1EV", "+2EV", "Auto DR" }; |
|---|
| 1040 | |
|---|
| 1041 | gui_enum_value_change(&conf.curve_enable,change,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1042 | |
|---|
| 1043 | if(change) |
|---|
| 1044 | curve_init_mode(); |
|---|
| 1045 | return modes[conf.curve_enable]; |
|---|
| 1046 | } |
|---|
| 1047 | #endif |
|---|
| 1048 | |
|---|
| 1049 | #ifdef OPT_SCRIPTING |
|---|
| 1050 | //------------------------------------------------------------------- |
|---|
| 1051 | const char* gui_script_autostart_enum(int change, int arg) { |
|---|
| 1052 | static const char* modes[]={ "Off", "On", "Once"}; |
|---|
| 1053 | return gui_change_simple_enum(&conf.script_startup,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1054 | } |
|---|
| 1055 | |
|---|
| 1056 | //------------------------------------------------------------------- |
|---|
| 1057 | const char* gui_script_param_set_enum(int change, int arg) { |
|---|
| 1058 | static const char* modes[]={ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; |
|---|
| 1059 | |
|---|
| 1060 | if (change != 0) { |
|---|
| 1061 | if (conf.script_param_save) { |
|---|
| 1062 | save_params_values(0); |
|---|
| 1063 | } |
|---|
| 1064 | gui_enum_value_change(&conf.script_param_set,change,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1065 | |
|---|
| 1066 | if (!load_params_values(conf.script_file, 1, 0)) |
|---|
| 1067 | script_load(conf.script_file, 0); |
|---|
| 1068 | gui_update_script_submenu(); |
|---|
| 1069 | } |
|---|
| 1070 | |
|---|
| 1071 | return modes[conf.script_param_set]; |
|---|
| 1072 | } |
|---|
| 1073 | |
|---|
| 1074 | //------------------------------------------------------------------- |
|---|
| 1075 | void gui_update_script_submenu() { |
|---|
| 1076 | register int p=0, i; |
|---|
| 1077 | |
|---|
| 1078 | for (i=0; i<sizeof(script_submenu_items_top)/sizeof(script_submenu_items_top[0]); ++p, ++i) { |
|---|
| 1079 | script_submenu_items[p]=script_submenu_items_top[i]; |
|---|
| 1080 | } |
|---|
| 1081 | for (i=0; i<SCRIPT_NUM_PARAMS; ++i) { |
|---|
| 1082 | if (script_param_order[i]) { |
|---|
| 1083 | script_submenu_items[p].symbol=0x0; |
|---|
| 1084 | script_submenu_items[p].text=(int)script_params[script_param_order[i]-1]; |
|---|
| 1085 | script_submenu_items[p].type=MENUITEM_INT; |
|---|
| 1086 | script_submenu_items[p].value=&conf.ubasic_vars[script_param_order[i]-1]; |
|---|
| 1087 | ++p; |
|---|
| 1088 | } |
|---|
| 1089 | } |
|---|
| 1090 | for (i=0; i<sizeof(script_submenu_items_bottom)/sizeof(script_submenu_items_bottom[0]); ++p, ++i) { |
|---|
| 1091 | script_submenu_items[p]=script_submenu_items_bottom[i]; |
|---|
| 1092 | } |
|---|
| 1093 | } |
|---|
| 1094 | |
|---|
| 1095 | //------------------------------------------------------------------- |
|---|
| 1096 | static void gui_load_script_selected(const char *fn) { |
|---|
| 1097 | if (fn) |
|---|
| 1098 | script_load(fn, 1); |
|---|
| 1099 | } |
|---|
| 1100 | |
|---|
| 1101 | void gui_load_script(int arg) { |
|---|
| 1102 | DIR *d; |
|---|
| 1103 | char *path="A/CHDK/SCRIPTS"; |
|---|
| 1104 | |
|---|
| 1105 | // if exists "A/CHDK/SCRIPTS" go into |
|---|
| 1106 | d=opendir(path); |
|---|
| 1107 | if (d) { |
|---|
| 1108 | closedir(d); |
|---|
| 1109 | } else { |
|---|
| 1110 | path="A"; |
|---|
| 1111 | } |
|---|
| 1112 | |
|---|
| 1113 | gui_fselect_init(LANG_STR_SELECT_SCRIPT_FILE, path, gui_load_script_selected); |
|---|
| 1114 | } |
|---|
| 1115 | |
|---|
| 1116 | void gui_load_script_default(int arg) { |
|---|
| 1117 | script_load(conf.script_file, 0); |
|---|
| 1118 | if (conf.script_param_save) { |
|---|
| 1119 | save_params_values(1); |
|---|
| 1120 | } |
|---|
| 1121 | } |
|---|
| 1122 | #endif |
|---|
| 1123 | |
|---|
| 1124 | //------------------------------------------------------------------- |
|---|
| 1125 | const char* gui_override_disable_enum(int change, int arg) { |
|---|
| 1126 | static const char* modes[]={ "Off", "On", "Disabled"}; |
|---|
| 1127 | return gui_change_simple_enum(&conf.override_disable,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1128 | } |
|---|
| 1129 | |
|---|
| 1130 | //------------------------------------------------------------------- |
|---|
| 1131 | const char* gui_histo_mode_enum(int change, int arg) { |
|---|
| 1132 | static const char* modes[]={ "Linear", "Log" }; |
|---|
| 1133 | |
|---|
| 1134 | gui_enum_value_change(&conf.histo_mode,change,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1135 | |
|---|
| 1136 | histogram_set_mode(conf.histo_mode); |
|---|
| 1137 | |
|---|
| 1138 | return modes[conf.histo_mode]; |
|---|
| 1139 | } |
|---|
| 1140 | |
|---|
| 1141 | //------------------------------------------------------------------- |
|---|
| 1142 | const char* gui_temp_mode_enum(int change, int arg) { |
|---|
| 1143 | static const char* modes[]={ "Off", "Optical","CCD","Battery","all" }; |
|---|
| 1144 | return gui_change_simple_enum(&conf.show_temp,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1145 | } |
|---|
| 1146 | |
|---|
| 1147 | //------------------------------------------------------------------- |
|---|
| 1148 | const char* gui_histo_layout_enum(int change, int arg) { |
|---|
| 1149 | static const char* modes[]={ "RGB", "Y", "RGB Y", "R G B", "RGB all", "Y all", "Blend", "Blend Y"}; |
|---|
| 1150 | |
|---|
| 1151 | gui_enum_value_change(&conf.histo_layout,change,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1152 | |
|---|
| 1153 | if (conf.histo_layout==OSD_HISTO_LAYOUT_Y || conf.histo_layout==OSD_HISTO_LAYOUT_Y_argb) { |
|---|
| 1154 | histogram_set_main(HISTO_Y); |
|---|
| 1155 | } else { |
|---|
| 1156 | histogram_set_main(HISTO_RGB); |
|---|
| 1157 | } |
|---|
| 1158 | |
|---|
| 1159 | return modes[conf.histo_layout]; |
|---|
| 1160 | } |
|---|
| 1161 | |
|---|
| 1162 | //------------------------------------------------------------------- |
|---|
| 1163 | const char* gui_font_enum(int change, int arg) { |
|---|
| 1164 | static const char* fonts[]={ "Win1250", "Win1251", "Win1252", "Win1253", "Win1254", "Win1257"}; |
|---|
| 1165 | |
|---|
| 1166 | gui_enum_value_change(&conf.font_cp,change,sizeof(fonts)/sizeof(fonts[0])); |
|---|
| 1167 | |
|---|
| 1168 | if (change != 0) { |
|---|
| 1169 | font_set(conf.font_cp); |
|---|
| 1170 | if (!rbf_load(conf.menu_rbf_file)) |
|---|
| 1171 | rbf_load_from_8x16(current_font); |
|---|
| 1172 | rbf_set_codepage(FONT_CP_WIN); |
|---|
| 1173 | gui_menu_init(NULL); |
|---|
| 1174 | } |
|---|
| 1175 | |
|---|
| 1176 | return fonts[conf.font_cp]; |
|---|
| 1177 | } |
|---|
| 1178 | |
|---|
| 1179 | //------------------------------------------------------------------- |
|---|
| 1180 | const char* gui_raw_prefix_enum(int change, int arg) { |
|---|
| 1181 | return gui_change_simple_enum(&conf.raw_prefix,change,img_prefixes,NUM_IMG_PREFIXES); |
|---|
| 1182 | } |
|---|
| 1183 | |
|---|
| 1184 | //------------------------------------------------------------------- |
|---|
| 1185 | const char* gui_raw_ext_enum(int change, int arg) { |
|---|
| 1186 | return gui_change_simple_enum(&conf.raw_ext,change,img_exts,NUM_IMG_EXTS); |
|---|
| 1187 | } |
|---|
| 1188 | |
|---|
| 1189 | //------------------------------------------------------------------- |
|---|
| 1190 | const char* gui_sub_batch_prefix_enum(int change, int arg) { |
|---|
| 1191 | return gui_change_simple_enum(&conf.sub_batch_prefix,change,img_prefixes,NUM_IMG_PREFIXES); |
|---|
| 1192 | } |
|---|
| 1193 | |
|---|
| 1194 | //------------------------------------------------------------------- |
|---|
| 1195 | const char* gui_sub_batch_ext_enum(int change, int arg) { |
|---|
| 1196 | return gui_change_simple_enum(&conf.sub_batch_ext,change,img_exts,NUM_IMG_EXTS); |
|---|
| 1197 | } |
|---|
| 1198 | |
|---|
| 1199 | //------------------------------------------------------------------- |
|---|
| 1200 | const char* gui_raw_nr_enum(int change, int arg) { |
|---|
| 1201 | static const char* modes[]={ "Auto", "Off", "On"}; |
|---|
| 1202 | return gui_change_simple_enum(&conf.raw_nr,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1203 | } |
|---|
| 1204 | |
|---|
| 1205 | //------------------------------------------------------------------- |
|---|
| 1206 | #ifdef OPT_TEXTREADER |
|---|
| 1207 | const char* gui_reader_codepage_enum(int change, int arg) { |
|---|
| 1208 | static const char* cps[]={ "Win1251", "DOS"}; |
|---|
| 1209 | return gui_change_simple_enum(&conf.reader_codepage,change,cps,sizeof(cps)/sizeof(cps[0])); |
|---|
| 1210 | } |
|---|
| 1211 | #endif |
|---|
| 1212 | //------------------------------------------------------------------- |
|---|
| 1213 | const char* gui_autoiso_shutter_enum(int change, int arg) { |
|---|
| 1214 | static const char* shutter[]={ "Auto", "1/8s", "1/15s", "1/30s", "1/60s", "1/125s", "1/250s", "1/500s", "1/1000s"}; |
|---|
| 1215 | return gui_change_simple_enum(&conf.autoiso_shutter,change,shutter,sizeof(shutter)/sizeof(shutter[0])); |
|---|
| 1216 | } |
|---|
| 1217 | |
|---|
| 1218 | //------------------------------------------------------------------- |
|---|
| 1219 | const char* gui_zebra_mode_enum(int change, int arg) { |
|---|
| 1220 | static const char* modes[]={ "Blink 1", "Blink 2", "Blink 3", "Solid", "Zebra 1", "Zebra 2" }; |
|---|
| 1221 | return gui_change_simple_enum(&conf.zebra_mode,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1222 | } |
|---|
| 1223 | |
|---|
| 1224 | //------------------------------------------------------------------- |
|---|
| 1225 | const char* gui_zebra_draw_osd_enum(int change, int arg) { |
|---|
| 1226 | static const char* modes[]={ "Nothing", "Histo", "OSD" }; |
|---|
| 1227 | return gui_change_simple_enum(&conf.zebra_draw_osd,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1228 | } |
|---|
| 1229 | |
|---|
| 1230 | //------------------------------------------------------------------- |
|---|
| 1231 | const char* gui_zoom_value_enum(int change, int arg) { |
|---|
| 1232 | static const char* modes[]={ "X", "FL", "EFL" }; |
|---|
| 1233 | return gui_change_simple_enum(&conf.zoom_value,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1234 | } |
|---|
| 1235 | |
|---|
| 1236 | const char* gui_show_values_enum(int change, int arg) { |
|---|
| 1237 | static const char* modes[]={ "Don't", "Always", "Shoot" }; |
|---|
| 1238 | return gui_change_simple_enum(&conf.show_values,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1239 | } |
|---|
| 1240 | |
|---|
| 1241 | const char* gui_nd_filter_state_enum(int change, int arg) { |
|---|
| 1242 | static const char* modes[]={ "Off", "In", "Out" }; |
|---|
| 1243 | return gui_change_simple_enum(&conf.nd_filter_state,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1244 | } |
|---|
| 1245 | |
|---|
| 1246 | const char* gui_dof_show_value_enum(int change, int arg) { |
|---|
| 1247 | static const char* modes[]={ "Don't", "Separate", "In Misc" }; |
|---|
| 1248 | return gui_change_simple_enum(&conf.show_dof,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1249 | } |
|---|
| 1250 | |
|---|
| 1251 | const char* gui_histo_show_enum(int change, int arg) { |
|---|
| 1252 | static const char* modes[]={ "Don't", "Always", "Shoot" }; |
|---|
| 1253 | return gui_change_simple_enum(&conf.show_histo,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1254 | } |
|---|
| 1255 | |
|---|
| 1256 | const char* gui_show_clock_enum(int change, int arg) { |
|---|
| 1257 | static const char* modes[]={ "Don't", "Normal", "Seconds"}; |
|---|
| 1258 | return gui_change_simple_enum(&conf.show_clock,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1259 | } |
|---|
| 1260 | |
|---|
| 1261 | const char* gui_hide_osd_enum(int change, int arg) { |
|---|
| 1262 | static const char* modes[]={ "Don't", "In Playback", "On Disp Press", "both"}; |
|---|
| 1263 | return gui_change_simple_enum(&conf.hide_osd,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1264 | } |
|---|
| 1265 | |
|---|
| 1266 | const char* gui_clock_format_enum(int change, int arg) { |
|---|
| 1267 | static const char* modes[]={ "24h", "12h"}; |
|---|
| 1268 | return gui_change_simple_enum(&conf.clock_format,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1269 | } |
|---|
| 1270 | |
|---|
| 1271 | const char* gui_clock_indicator_enum(int change, int arg) { |
|---|
| 1272 | static const char* modes[]={ "PM", "P","."}; |
|---|
| 1273 | return gui_change_simple_enum(&conf.clock_indicator,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1274 | } |
|---|
| 1275 | |
|---|
| 1276 | const char* gui_clock_halfpress_enum(int change, int arg) { |
|---|
| 1277 | static const char* modes[]={ "Full", "Seconds","Don't"}; |
|---|
| 1278 | return gui_change_simple_enum(&conf.clock_halfpress,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1279 | } |
|---|
| 1280 | |
|---|
| 1281 | const char* gui_space_bar_enum(int change, int arg) { |
|---|
| 1282 | static const char* modes[]={ "Don't", "Horizontal", "Vertical"}; |
|---|
| 1283 | return gui_change_simple_enum(&conf.space_bar_show,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1284 | } |
|---|
| 1285 | |
|---|
| 1286 | const char* gui_space_bar_size_enum(int change, int arg) { |
|---|
| 1287 | static const char* modes[]={ "1/4", "1/2", "1"}; |
|---|
| 1288 | return gui_change_simple_enum(&conf.space_bar_size,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1289 | } |
|---|
| 1290 | |
|---|
| 1291 | const char* gui_space_bar_width_enum(int change, int arg) { |
|---|
| 1292 | static const char* modes[]={ "1", "2", "3","4","5","6","7","8","9","10"}; |
|---|
| 1293 | return gui_change_simple_enum(&conf.space_bar_width,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1294 | } |
|---|
| 1295 | |
|---|
| 1296 | const char* gui_space_warn_type_enum(int change, int arg) { |
|---|
| 1297 | static const char* modes[]={ "Percent", "MB", "Don't"}; |
|---|
| 1298 | return gui_change_simple_enum(&conf.space_warn_type,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1299 | } |
|---|
| 1300 | |
|---|
| 1301 | const char* gui_show_movie_time(int change, int arg) { |
|---|
| 1302 | static const char* modes[]={ "Don't", "hh:mm:ss", "KB/s","both"}; |
|---|
| 1303 | return gui_change_simple_enum(&conf.show_movie_time,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1304 | } |
|---|
| 1305 | |
|---|
| 1306 | //------------------------------------------------------------------- |
|---|
| 1307 | #if CAM_ADJUSTABLE_ALT_BUTTON |
|---|
| 1308 | const char* gui_alt_mode_button_enum(int change, int arg) { |
|---|
| 1309 | #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_s5is) |
|---|
| 1310 | static const char* names[]={ "Shrtcut", "Flash", "Timer", "ISO", "Video" }; |
|---|
| 1311 | static const int keys[]={ KEY_PRINT, KEY_FLASH, KEY_TIMER, KEY_ISO, KEY_VIDEO }; |
|---|
| 1312 | #elif defined(CAMERA_g7) |
|---|
| 1313 | static const char* names[]={ "Print", "FE"}; |
|---|
| 1314 | static const int keys[]={ KEY_PRINT, KEY_MICROPHONE }; |
|---|
| 1315 | #elif defined(CAMERA_g9) |
|---|
| 1316 | static const char* names[]={ "Print", "FE"}; |
|---|
| 1317 | static const int keys[]={ KEY_PRINT, KEY_MICROPHONE }; |
|---|
| 1318 | #elif defined(CAMERA_a650) |
|---|
| 1319 | static const char* names[]={ "Print", "ISO"}; |
|---|
| 1320 | static const int keys[]={ KEY_PRINT, KEY_ISO }; |
|---|
| 1321 | #elif defined(CAMERA_sx100is) || defined(CAMERA_sx110is) |
|---|
| 1322 | static const char* names[]={ "Print", "Face"}; |
|---|
| 1323 | static const int keys[]={ KEY_PRINT, KEY_FACE }; |
|---|
| 1324 | #elif defined(CAMERA_sx10) || defined(CAMERA_sx1) || defined(CAMERA_sx20) || defined(CAMERA_sx30) |
|---|
| 1325 | static const char* names[]={ "Shrtcut", "Flash", "Video"}; |
|---|
| 1326 | static const int keys[]={ KEY_PRINT, KEY_FLASH, KEY_VIDEO }; |
|---|
| 1327 | #elif defined(CAMERA_a570) || defined(CAMERA_a590) || defined(CAMERA_a720) |
|---|
| 1328 | static const char* names[]={ "Print", "Display"}; |
|---|
| 1329 | static const int keys[] = {KEY_PRINT, KEY_DISPLAY}; |
|---|
| 1330 | #else |
|---|
| 1331 | #error camera alt-buttons not defined |
|---|
| 1332 | #endif |
|---|
| 1333 | int i; |
|---|
| 1334 | |
|---|
| 1335 | for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { |
|---|
| 1336 | if (conf.alt_mode_button==keys[i]) { |
|---|
| 1337 | break; |
|---|
| 1338 | } |
|---|
| 1339 | } |
|---|
| 1340 | |
|---|
| 1341 | i+=change; |
|---|
| 1342 | if (i<0) |
|---|
| 1343 | i=(sizeof(names)/sizeof(names[0]))-1; |
|---|
| 1344 | else if (i>=(sizeof(names)/sizeof(names[0]))) |
|---|
| 1345 | i=0; |
|---|
| 1346 | |
|---|
| 1347 | conf.alt_mode_button = keys[i]; |
|---|
| 1348 | kbd_set_alt_mode_key_mask(conf.alt_mode_button); |
|---|
| 1349 | return names[i]; |
|---|
| 1350 | } |
|---|
| 1351 | #endif |
|---|
| 1352 | |
|---|
| 1353 | //------------------------------------------------------------------- |
|---|
| 1354 | const char* gui_alt_power_enum(int change, int arg) { |
|---|
| 1355 | // Script option is retained even if scripting is disabled, otherwise conf values will change |
|---|
| 1356 | // Equivalent to ALT |
|---|
| 1357 | static const char* modes[]={ "Never", "Alt", "Script", "Always" }; |
|---|
| 1358 | gui_enum_value_change(&conf.alt_prevent_shutdown,change,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1359 | |
|---|
| 1360 | conf_update_prevent_shutdown(); |
|---|
| 1361 | |
|---|
| 1362 | return modes[conf.alt_prevent_shutdown]; |
|---|
| 1363 | } |
|---|
| 1364 | const char* gui_fast_ev_step(int change, int arg) { |
|---|
| 1365 | static const char* 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"}; |
|---|
| 1366 | return gui_change_simple_enum(&conf.fast_ev_step,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1367 | } |
|---|
| 1368 | #if CAM_QUALITY_OVERRIDE |
|---|
| 1369 | const char* gui_fast_image_quality(int change, int arg) { |
|---|
| 1370 | static const char* modes[]={"sup.fine","fine","normal","off"}; |
|---|
| 1371 | return gui_change_simple_enum(&conf.fast_image_quality,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1372 | } |
|---|
| 1373 | #endif |
|---|
| 1374 | |
|---|
| 1375 | const char* gui_video_mode_enum(int change, int arg) { |
|---|
| 1376 | #if !CAM_VIDEO_QUALITY_ONLY |
|---|
| 1377 | static const char* modes[]={ "Bitrate", "Quality"}; |
|---|
| 1378 | #else |
|---|
| 1379 | static const char* modes[]={ "Default", "Quality"}; |
|---|
| 1380 | #endif |
|---|
| 1381 | return gui_change_simple_enum(&conf.video_mode,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1382 | } |
|---|
| 1383 | |
|---|
| 1384 | //------------------------------------------------------------------- |
|---|
| 1385 | const char* gui_video_bitrate_enum(int change, int arg) { |
|---|
| 1386 | gui_enum_value_change(&conf.video_bitrate,change,VIDEO_BITRATE_STEPS); |
|---|
| 1387 | |
|---|
| 1388 | shooting_video_bitrate_change(conf.video_bitrate); |
|---|
| 1389 | |
|---|
| 1390 | return video_bitrate_strings[conf.video_bitrate]; |
|---|
| 1391 | } |
|---|
| 1392 | |
|---|
| 1393 | |
|---|
| 1394 | //------------------------------------------------------------------- |
|---|
| 1395 | const char* gui_tv_bracket_values_enum(int change, int arg) { |
|---|
| 1396 | 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"}; |
|---|
| 1397 | return gui_change_simple_enum(&conf.tv_bracket_value,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1398 | } |
|---|
| 1399 | |
|---|
| 1400 | const char* gui_av_bracket_values_enum(int change, int arg) { |
|---|
| 1401 | 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"}; |
|---|
| 1402 | return gui_change_simple_enum(&conf.av_bracket_value,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1403 | } |
|---|
| 1404 | |
|---|
| 1405 | const char* gui_subj_dist_bracket_koef_enum(int change, int arg) { |
|---|
| 1406 | static const char* modes[]={"Off", "1", "10","100","1000"}; |
|---|
| 1407 | return gui_change_simple_enum(&conf.subj_dist_bracket_koef,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1408 | } |
|---|
| 1409 | |
|---|
| 1410 | const char* gui_iso_bracket_koef_enum(int change, int arg) { |
|---|
| 1411 | static const char* modes[]={ "Off","1", "10","100"}; |
|---|
| 1412 | return gui_change_simple_enum(&conf.iso_bracket_koef,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1413 | } |
|---|
| 1414 | |
|---|
| 1415 | const char* gui_bracket_type_enum(int change, int arg) { |
|---|
| 1416 | static const char* modes[]={ "+/-", "-","+"}; |
|---|
| 1417 | return gui_change_simple_enum(&conf.bracket_type,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1418 | } |
|---|
| 1419 | |
|---|
| 1420 | const char* gui_tv_override_koef_enum(int change, int arg) { |
|---|
| 1421 | static const char* modes[]={"Off", "1/100K", "1/10000", "1/1000","1/100","1/10", "1","10","100"}; |
|---|
| 1422 | |
|---|
| 1423 | conf.tv_override_koef+=change; |
|---|
| 1424 | if (conf.tv_enum_type) { |
|---|
| 1425 | if (conf.tv_override_koef<0) conf.tv_override_koef=6; |
|---|
| 1426 | else if (conf.tv_override_koef>6) conf.tv_override_koef=0; |
|---|
| 1427 | else if (conf.tv_override_koef==1) conf.tv_override_koef=6; |
|---|
| 1428 | else if (conf.tv_override_koef==5) conf.tv_override_koef=0; |
|---|
| 1429 | else if (conf.tv_override_koef!=0 && conf.tv_override_koef!=6) conf.tv_override_koef=6; |
|---|
| 1430 | } |
|---|
| 1431 | else { |
|---|
| 1432 | if (conf.tv_override_koef<0) |
|---|
| 1433 | conf.tv_override_koef=sizeof(modes)/sizeof(modes[0])-1; |
|---|
| 1434 | else if (conf.tv_override_koef>=(sizeof(modes)/sizeof(modes[0]))) |
|---|
| 1435 | conf.tv_override_koef=0; |
|---|
| 1436 | } |
|---|
| 1437 | |
|---|
| 1438 | return modes[conf.tv_override_koef]; |
|---|
| 1439 | } |
|---|
| 1440 | |
|---|
| 1441 | const char* gui_tv_override_value_enum(int change, int arg) { |
|---|
| 1442 | /* |
|---|
| 1443 | static const char* modes[]={ |
|---|
| 1444 | // add very long time exposures as approximately powers of 2, adding 15 exposures |
|---|
| 1445 | "2048","1625","1290","1024","812","645","512","406","322","256","203","161","128","101","80", |
|---|
| 1446 | "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"}; |
|---|
| 1447 | */ |
|---|
| 1448 | static char *buf; |
|---|
| 1449 | |
|---|
| 1450 | // XXX This array above is redundant with platform/generic/shooting.c, this should be avoided! |
|---|
| 1451 | conf.tv_override_value+=change; |
|---|
| 1452 | if (conf.tv_enum_type) { |
|---|
| 1453 | if (conf.tv_override_value<0) { |
|---|
| 1454 | conf.tv_override_value=tv_override_amount-1; |
|---|
| 1455 | } |
|---|
| 1456 | else if ((unsigned)conf.tv_override_value>=(tv_override_amount)) |
|---|
| 1457 | conf.tv_override_value=0; |
|---|
| 1458 | return tv_override[conf.tv_override_value]; |
|---|
| 1459 | } |
|---|
| 1460 | else |
|---|
| 1461 | { |
|---|
| 1462 | if (conf.tv_override_value<0) { |
|---|
| 1463 | conf.tv_override_value=100; |
|---|
| 1464 | } |
|---|
| 1465 | else if (conf.tv_override_value>100) conf.tv_override_value=0; |
|---|
| 1466 | if(!buf) buf=malloc(4); |
|---|
| 1467 | if(!buf) return ""; |
|---|
| 1468 | sprintf(buf, "%d", conf.tv_override_value); |
|---|
| 1469 | return buf; |
|---|
| 1470 | } |
|---|
| 1471 | } |
|---|
| 1472 | |
|---|
| 1473 | const char* gui_tv_enum_type_enum(int change, int arg) { |
|---|
| 1474 | static const char* modes[]={"Factor", "Ev Step"}; |
|---|
| 1475 | |
|---|
| 1476 | gui_enum_value_change(&conf.tv_enum_type,change,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1477 | if (change) { |
|---|
| 1478 | conf.tv_override_koef=6; |
|---|
| 1479 | if (conf.tv_enum_type) |
|---|
| 1480 | conf.tv_override_value=tv_override_zero_shift; |
|---|
| 1481 | else conf.tv_override_value=1; |
|---|
| 1482 | } |
|---|
| 1483 | return modes[conf.tv_enum_type]; |
|---|
| 1484 | } |
|---|
| 1485 | |
|---|
| 1486 | |
|---|
| 1487 | const char* gui_iso_override_koef_enum(int change, int arg) { |
|---|
| 1488 | static const char* modes[]={ "Off","1", "10","100"}; |
|---|
| 1489 | return gui_change_simple_enum(&conf.iso_override_koef,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1490 | } |
|---|
| 1491 | |
|---|
| 1492 | const char* gui_subj_dist_override_value_enum(int change, int arg) { |
|---|
| 1493 | static const int koef[] = {0, 1,10,100,1000}; |
|---|
| 1494 | static char buf[8]; |
|---|
| 1495 | conf.subj_dist_override_value+=(change*koef[conf.subj_dist_override_koef]); |
|---|
| 1496 | if (conf.subj_dist_override_value<0) |
|---|
| 1497 | conf.subj_dist_override_value=MAX_DIST; |
|---|
| 1498 | else if (conf.subj_dist_override_value>MAX_DIST) |
|---|
| 1499 | conf.subj_dist_override_value=0; |
|---|
| 1500 | sprintf(buf, "%d", (int)conf.subj_dist_override_value); |
|---|
| 1501 | return buf; |
|---|
| 1502 | } |
|---|
| 1503 | |
|---|
| 1504 | |
|---|
| 1505 | const char* gui_subj_dist_override_koef_enum(int change, int arg) { |
|---|
| 1506 | static const char* modes[]={ "Off","1", "10","100","1000"}; |
|---|
| 1507 | return gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1508 | } |
|---|
| 1509 | |
|---|
| 1510 | /* |
|---|
| 1511 | const char* gui_tv_exposure_order_enum(int change, int arg) { |
|---|
| 1512 | static const char* modes[]={ "Off", "1","2", "3"}; |
|---|
| 1513 | |
|---|
| 1514 | conf.tv_exposure_order+=change; |
|---|
| 1515 | if (conf.tv_exposure_order<0) |
|---|
| 1516 | conf.tv_exposure_order=0; |
|---|
| 1517 | else if (conf.tv_exposure_order>=(sizeof(modes)/sizeof(modes[0]))) |
|---|
| 1518 | conf.tv_exposure_order=sizeof(modes)/sizeof(modes[0])-1; |
|---|
| 1519 | if((conf.tv_exposure_order>0) && (conf.av_exposure_order==conf.tv_exposure_order)) |
|---|
| 1520 | { |
|---|
| 1521 | conf.av_exposure_order=0; |
|---|
| 1522 | } |
|---|
| 1523 | if((conf.tv_exposure_order>0) && (conf.iso_exposure_order==conf.tv_exposure_order)) |
|---|
| 1524 | { |
|---|
| 1525 | conf.iso_exposure_order=0; |
|---|
| 1526 | } |
|---|
| 1527 | |
|---|
| 1528 | return modes[conf.tv_exposure_order]; |
|---|
| 1529 | } |
|---|
| 1530 | |
|---|
| 1531 | const char* gui_av_exposure_order_enum(int change, int arg) { |
|---|
| 1532 | static const char* modes[]={ "Off", "1","2", "3"}; |
|---|
| 1533 | |
|---|
| 1534 | conf.av_exposure_order+=change; |
|---|
| 1535 | if (conf.av_exposure_order<0) |
|---|
| 1536 | conf.av_exposure_order=0; |
|---|
| 1537 | else if (conf.av_exposure_order>=(sizeof(modes)/sizeof(modes[0]))) |
|---|
| 1538 | conf.av_exposure_order=sizeof(modes)/sizeof(modes[0])-1; |
|---|
| 1539 | if((conf.av_exposure_order>0) && (conf.tv_exposure_order==conf.av_exposure_order)) |
|---|
| 1540 | { |
|---|
| 1541 | conf.tv_exposure_order=0; |
|---|
| 1542 | } |
|---|
| 1543 | if((conf.av_exposure_order>0) && (conf.iso_exposure_order==conf.av_exposure_order)) |
|---|
| 1544 | { |
|---|
| 1545 | conf.iso_exposure_order=0; |
|---|
| 1546 | } |
|---|
| 1547 | return modes[conf.av_exposure_order]; |
|---|
| 1548 | } |
|---|
| 1549 | |
|---|
| 1550 | const char* gui_iso_exposure_order_enum(int change, int arg) { |
|---|
| 1551 | static const char* modes[]={ "Off", "1","2", "3"}; |
|---|
| 1552 | |
|---|
| 1553 | conf.iso_exposure_order+=change; |
|---|
| 1554 | if (conf.iso_exposure_order<0) |
|---|
| 1555 | conf.iso_exposure_order=0; |
|---|
| 1556 | else if (conf.iso_exposure_order>=(sizeof(modes)/sizeof(modes[0]))) |
|---|
| 1557 | conf.iso_exposure_order=sizeof(modes)/sizeof(modes[0])-1; |
|---|
| 1558 | if((conf.iso_exposure_order>0) && (conf.tv_exposure_order==conf.iso_exposure_order)) |
|---|
| 1559 | { |
|---|
| 1560 | conf.tv_exposure_order=0; |
|---|
| 1561 | } |
|---|
| 1562 | if((conf.iso_exposure_order>0) && (conf.av_exposure_order==conf.iso_exposure_order)) |
|---|
| 1563 | { |
|---|
| 1564 | conf.av_exposure_order=0; |
|---|
| 1565 | } |
|---|
| 1566 | |
|---|
| 1567 | return modes[conf.iso_exposure_order]; |
|---|
| 1568 | } |
|---|
| 1569 | */ |
|---|
| 1570 | const char* gui_av_override_enum(int change, int arg) { |
|---|
| 1571 | static char buf[8]; |
|---|
| 1572 | short prop_id; |
|---|
| 1573 | conf.av_override_value+=change; |
|---|
| 1574 | if (conf.av_override_value<0) conf.av_override_value=shooting_get_aperture_sizes_table_size()+6; |
|---|
| 1575 | else if (conf.av_override_value>shooting_get_aperture_sizes_table_size()+6) conf.av_override_value=0; |
|---|
| 1576 | if (conf.av_override_value == 0) return "Off"; |
|---|
| 1577 | else { |
|---|
| 1578 | short prop_id=shooting_get_aperture_from_av96(shooting_get_av96_override_value()); |
|---|
| 1579 | sprintf(buf, "%d.%02d", (int)prop_id/100, (int)prop_id%100 ); |
|---|
| 1580 | return buf; |
|---|
| 1581 | } |
|---|
| 1582 | } |
|---|
| 1583 | |
|---|
| 1584 | #if ZOOM_OVERRIDE |
|---|
| 1585 | const char* gui_zoom_override_enum(int change, int arg) { |
|---|
| 1586 | static char buf[3]; |
|---|
| 1587 | conf.zoom_override_value+=change; |
|---|
| 1588 | if (conf.zoom_override_value<0) conf.zoom_override_value=zoom_points-1; |
|---|
| 1589 | else if (conf.zoom_override_value>zoom_points-1) conf.zoom_override_value=0; |
|---|
| 1590 | sprintf(buf,"%i",conf.zoom_override_value); |
|---|
| 1591 | return buf; |
|---|
| 1592 | } |
|---|
| 1593 | #endif |
|---|
| 1594 | |
|---|
| 1595 | const char* gui_user_menu_show_enum(int change, int arg) { |
|---|
| 1596 | static const char* modes[]={ "Off", "On","On Direct", "Edit" }; |
|---|
| 1597 | |
|---|
| 1598 | if (conf.user_menu_enable == 3) user_menu_save(); |
|---|
| 1599 | return gui_change_simple_enum(&conf.user_menu_enable,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1600 | } |
|---|
| 1601 | |
|---|
| 1602 | const char* gui_video_af_key_enum(int change, int arg){ |
|---|
| 1603 | #if CAMERA_g12 |
|---|
| 1604 | static const char* names[]={ "", "Shutter", "Set", "AE Lock"}; |
|---|
| 1605 | static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET, KEY_AE_LOCK }; |
|---|
| 1606 | #else |
|---|
| 1607 | static const char* names[]={ "", "Shutter", "Set"}; |
|---|
| 1608 | static const int keys[]={0, KEY_SHOOT_HALF, KEY_SET }; |
|---|
| 1609 | #endif |
|---|
| 1610 | int i; |
|---|
| 1611 | |
|---|
| 1612 | for (i=0; i<sizeof(names)/sizeof(names[0]); ++i) { |
|---|
| 1613 | if (conf.video_af_key==keys[i]) { |
|---|
| 1614 | break; |
|---|
| 1615 | } |
|---|
| 1616 | } |
|---|
| 1617 | |
|---|
| 1618 | i+=change; |
|---|
| 1619 | if (i<0) |
|---|
| 1620 | i=(sizeof(names)/sizeof(names[0]))-1; |
|---|
| 1621 | else if (i>=(sizeof(names)/sizeof(names[0]))) |
|---|
| 1622 | i=0; |
|---|
| 1623 | |
|---|
| 1624 | conf.video_af_key = keys[i]; |
|---|
| 1625 | return names[i]; |
|---|
| 1626 | } |
|---|
| 1627 | |
|---|
| 1628 | const char* gui_bad_pixel_enum(int change, int arg) { |
|---|
| 1629 | int modes[]={LANG_MENU_BAD_PIXEL_OFF, LANG_MENU_BAD_PIXEL_INTERPOLATION, LANG_MENU_BAD_PIXEL_RAW_CONVERTER}; |
|---|
| 1630 | return lang_str((int)gui_change_simple_enum(&conf.bad_pixel_removal,change,(const char **)modes,sizeof(modes)/sizeof(modes[0]))); |
|---|
| 1631 | } |
|---|
| 1632 | |
|---|
| 1633 | //------------------------------------------------------------------- |
|---|
| 1634 | |
|---|
| 1635 | void raw_fselect_cb(const char * filename){ |
|---|
| 1636 | struct stat st; |
|---|
| 1637 | if (!filename) return; |
|---|
| 1638 | stat((char*)filename,&st); |
|---|
| 1639 | if (st.st_size!=hook_raw_size()) return; |
|---|
| 1640 | gui_mbox_init((int)"", LANG_RAW_DEVELOP_MESSAGE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
|---|
| 1641 | raw_prepare_develop((char*)filename); |
|---|
| 1642 | } |
|---|
| 1643 | |
|---|
| 1644 | //------------------------------------------------------------------- |
|---|
| 1645 | void gui_raw_develop(int arg){ |
|---|
| 1646 | int m=mode_get(); |
|---|
| 1647 | gui_fselect_init(LANG_RAW_DEVELOP_SELECT_FILE, "A/DCIM", raw_fselect_cb); |
|---|
| 1648 | } |
|---|
| 1649 | |
|---|
| 1650 | //------------------------------------------------------------------- |
|---|
| 1651 | |
|---|
| 1652 | static void gui_menuproc_reset_files(int arg){ |
|---|
| 1653 | conf.lang_file[0] = 0; |
|---|
| 1654 | conf.menu_symbol_rbf_file[0] = 0; |
|---|
| 1655 | conf.menu_rbf_file[0] = 0; |
|---|
| 1656 | conf_save(); |
|---|
| 1657 | gui_mbox_init(LANG_INFORMATION, LANG_MENU_RESTART_CAMERA, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
|---|
| 1658 | |
|---|
| 1659 | } |
|---|
| 1660 | |
|---|
| 1661 | //------------------------------------------------------------------- |
|---|
| 1662 | #ifdef OPT_DEBUGGING |
|---|
| 1663 | #define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen |
|---|
| 1664 | #define TASKLIST_NUM_TASKS 64 // should be enough ? |
|---|
| 1665 | static void gui_debug_draw_tasklist(void) { |
|---|
| 1666 | #ifndef CAM_DRYOS |
|---|
| 1667 | int tasklist[TASKLIST_NUM_TASKS]; // max number of tasks we will look at |
|---|
| 1668 | char buf[40]; // a single line of the list |
|---|
| 1669 | int n_tasks,n_show_tasks,show_start; |
|---|
| 1670 | const char *name; |
|---|
| 1671 | int i; |
|---|
| 1672 | n_tasks = task_id_list_get(tasklist,sizeof(tasklist)/sizeof(tasklist[0])); |
|---|
| 1673 | show_start = debug_tasklist_start; |
|---|
| 1674 | n_show_tasks = n_tasks - show_start; |
|---|
| 1675 | // auto adjust to show the last N tasks |
|---|
| 1676 | if(n_show_tasks < TASKLIST_MAX_LINES) { |
|---|
| 1677 | show_start = n_tasks - TASKLIST_MAX_LINES; |
|---|
| 1678 | if(show_start<0) |
|---|
| 1679 | show_start = 0; |
|---|
| 1680 | n_show_tasks = n_tasks - show_start; |
|---|
| 1681 | } |
|---|
| 1682 | else if( n_show_tasks > TASKLIST_MAX_LINES ) { |
|---|
| 1683 | n_show_tasks = TASKLIST_MAX_LINES; |
|---|
| 1684 | } |
|---|
| 1685 | sprintf(buf,"%d-%d of %d tasks %c",show_start,show_start+n_show_tasks,n_tasks,debug_display_direction > 0?'+':'-'); |
|---|
| 1686 | draw_string(64,0,buf, conf.osd_color); |
|---|
| 1687 | for( i = 0; i < n_show_tasks; i++ ) { |
|---|
| 1688 | // TODO get full task info |
|---|
| 1689 | name = task_name(tasklist[show_start+i]); |
|---|
| 1690 | if ( !name || !*name ) { |
|---|
| 1691 | name = "(unknown)"; |
|---|
| 1692 | } |
|---|
| 1693 | sprintf(buf,"%10s %8X",name,tasklist[show_start+i]); |
|---|
| 1694 | draw_string(64,16+16*i,buf, conf.osd_color); |
|---|
| 1695 | } |
|---|
| 1696 | #endif //CAM_DRYOS |
|---|
| 1697 | } |
|---|
| 1698 | |
|---|
| 1699 | #define DEBUG_DISPLAY_NONE 0 |
|---|
| 1700 | #define DEBUG_DISPLAY_PROPS 1 |
|---|
| 1701 | #define DEBUG_DISPLAY_PARAMS 2 |
|---|
| 1702 | #define DEBUG_DISPLAY_TASKS 3 |
|---|
| 1703 | static const char * gui_debug_shortcut_enum(int change, int arg) { |
|---|
| 1704 | static const char* modes[]={ "None", "DmpRAM", "Page", "CmpProps"}; |
|---|
| 1705 | return gui_change_simple_enum(&conf.debug_shortcut_action,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1706 | } |
|---|
| 1707 | |
|---|
| 1708 | static const char * gui_debug_display_enum(int change, int arg) { |
|---|
| 1709 | static const char* modes[]={ "None", "Props", "Params", "Tasks"}; |
|---|
| 1710 | return gui_change_simple_enum(&conf.debug_display,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 1711 | } |
|---|
| 1712 | |
|---|
| 1713 | static void gui_debug_shortcut(void) { |
|---|
| 1714 | static int lastcall = -1; |
|---|
| 1715 | int t=get_tick_count(); |
|---|
| 1716 | if ( lastcall != -1) { |
|---|
| 1717 | if (t-lastcall <= 400) |
|---|
| 1718 | debug_display_direction = -debug_display_direction; |
|---|
| 1719 | } |
|---|
| 1720 | lastcall=t; |
|---|
| 1721 | switch(conf.debug_shortcut_action) { |
|---|
| 1722 | case 1: |
|---|
| 1723 | dump_memory(); |
|---|
| 1724 | break; |
|---|
| 1725 | case 2: |
|---|
| 1726 | if(conf.debug_display == DEBUG_DISPLAY_TASKS) { |
|---|
| 1727 | debug_tasklist_start += debug_display_direction*(TASKLIST_MAX_LINES-2); // a little intentional overlap |
|---|
| 1728 | if(debug_tasklist_start >= TASKLIST_NUM_TASKS || debug_tasklist_start < 0) |
|---|
| 1729 | debug_tasklist_start = 0; |
|---|
| 1730 | } |
|---|
| 1731 | else if (conf.debug_display == DEBUG_DISPLAY_PROPS || conf.debug_display == DEBUG_DISPLAY_PARAMS) { |
|---|
| 1732 | conf.debug_propcase_page += debug_display_direction*1; |
|---|
| 1733 | if(conf.debug_propcase_page > 128 || conf.debug_propcase_page < 0) |
|---|
| 1734 | conf.debug_propcase_page = 0; |
|---|
| 1735 | } |
|---|
| 1736 | break; |
|---|
| 1737 | case 3: |
|---|
| 1738 | gui_compare_props(1); |
|---|
| 1739 | break; |
|---|
| 1740 | } |
|---|
| 1741 | } |
|---|
| 1742 | |
|---|
| 1743 | //------------------------------------------------------------------- |
|---|
| 1744 | #endif |
|---|
| 1745 | |
|---|
| 1746 | #if CAM_MULTIPART |
|---|
| 1747 | void card_break_proc(unsigned int btn){ |
|---|
| 1748 | if (btn==MBOX_BTN_YES) create_partitions(); |
|---|
| 1749 | } |
|---|
| 1750 | |
|---|
| 1751 | |
|---|
| 1752 | #ifdef OPT_DEBUGGING |
|---|
| 1753 | static void gui_menuproc_break_card(int arg){ |
|---|
| 1754 | gui_mbox_init(LANG_WARNING, LANG_PARTITIONS_CREATE_WARNING, MBOX_BTN_YES_NO|MBOX_DEF_BTN2|MBOX_TEXT_CENTER, card_break_proc); |
|---|
| 1755 | } |
|---|
| 1756 | #endif |
|---|
| 1757 | |
|---|
| 1758 | static void gui_menuproc_swap_patitons(int arg){ |
|---|
| 1759 | if (get_part_count()<2) gui_mbox_init(LANG_ERROR, LANG_ONLY_ONE_PARTITION, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
|---|
| 1760 | else |
|---|
| 1761 | { |
|---|
| 1762 | swap_partitions(); |
|---|
| 1763 | gui_mbox_init(LANG_INFORMATION, LANG_SOKOBAN_MSG_FINISH_TITLE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); |
|---|
| 1764 | } |
|---|
| 1765 | } |
|---|
| 1766 | #endif |
|---|
| 1767 | |
|---|
| 1768 | //------------------------------------------------------------------- |
|---|
| 1769 | static volatile enum Gui_Mode gui_mode; |
|---|
| 1770 | static volatile int gui_restore; |
|---|
| 1771 | static volatile int gui_in_redraw; |
|---|
| 1772 | static int gui_splash, gui_splash_mode; |
|---|
| 1773 | static char osd_buf[32]; |
|---|
| 1774 | #ifdef OPTIONS_AUTOSAVE |
|---|
| 1775 | static Conf old_conf; |
|---|
| 1776 | #endif |
|---|
| 1777 | |
|---|
| 1778 | //------------------------------------------------------------------- |
|---|
| 1779 | void gui_init() |
|---|
| 1780 | { |
|---|
| 1781 | |
|---|
| 1782 | gui_mode = GUI_MODE_NONE; |
|---|
| 1783 | gui_restore = 0; |
|---|
| 1784 | gui_in_redraw = 0; |
|---|
| 1785 | if (conf.start_sound>0) |
|---|
| 1786 | { |
|---|
| 1787 | play_sound(4); |
|---|
| 1788 | } |
|---|
| 1789 | gui_splash = (conf.splash_show)?SPLASH_TIME:0; |
|---|
| 1790 | user_menu_restore(); |
|---|
| 1791 | gui_lang_init(); |
|---|
| 1792 | draw_init(); |
|---|
| 1793 | |
|---|
| 1794 | exposition_thresh = screen_size/500; |
|---|
| 1795 | voltage_step = (conf.batt_step_25)?25:1; |
|---|
| 1796 | load_bad_pixels_list("A/CHDK/badpixel"); |
|---|
| 1797 | load_bad_pixels_list("A/CHDK/badpixel.txt"); |
|---|
| 1798 | #ifdef OPT_CURVES |
|---|
| 1799 | // initialize curves, loading files if required by current mode |
|---|
| 1800 | curve_init_mode(); |
|---|
| 1801 | #endif |
|---|
| 1802 | #if ZOOM_OVERRIDE |
|---|
| 1803 | // reyalp - need to do this in capt_seq |
|---|
| 1804 | // if (conf.zoom_override) shooting_set_zoom(conf.zoom_override_value); |
|---|
| 1805 | #endif |
|---|
| 1806 | } |
|---|
| 1807 | |
|---|
| 1808 | //------------------------------------------------------------------- |
|---|
| 1809 | #ifdef OPT_CURVES |
|---|
| 1810 | static void gui_load_curve_selected(const char *fn) { |
|---|
| 1811 | if (fn) { |
|---|
| 1812 | // TODO we could sanity check here, but curve_set_type should fail gracefullish |
|---|
| 1813 | strcpy(conf.curve_file,fn); |
|---|
| 1814 | if(conf.curve_enable == 1) |
|---|
| 1815 | curve_init_mode(); |
|---|
| 1816 | } |
|---|
| 1817 | } |
|---|
| 1818 | |
|---|
| 1819 | //------------------------------------------------------------------- |
|---|
| 1820 | void gui_load_curve(int arg) { |
|---|
| 1821 | DIR *d; |
|---|
| 1822 | char *path = CURVE_DIR; |
|---|
| 1823 | |
|---|
| 1824 | // if exists CURVE_DIR go into |
|---|
| 1825 | d=opendir(path); |
|---|
| 1826 | if (d) { |
|---|
| 1827 | closedir(d); |
|---|
| 1828 | } else { |
|---|
| 1829 | path="A"; |
|---|
| 1830 | } |
|---|
| 1831 | |
|---|
| 1832 | gui_fselect_init(LANG_STR_SELECT_CURVE_FILE, path, gui_load_curve_selected); |
|---|
| 1833 | } |
|---|
| 1834 | |
|---|
| 1835 | #endif |
|---|
| 1836 | //------------------------------------------------------------------- |
|---|
| 1837 | enum Gui_Mode gui_get_mode() { |
|---|
| 1838 | return gui_mode; |
|---|
| 1839 | } |
|---|
| 1840 | |
|---|
| 1841 | //------------------------------------------------------------------- |
|---|
| 1842 | void gui_set_mode(enum Gui_Mode mode) { |
|---|
| 1843 | gui_mode = mode; |
|---|
| 1844 | } |
|---|
| 1845 | |
|---|
| 1846 | //------------------------------------------------------------------- |
|---|
| 1847 | void gui_force_restore() { |
|---|
| 1848 | gui_restore = gui_in_redraw; |
|---|
| 1849 | } |
|---|
| 1850 | |
|---|
| 1851 | static void gui_handle_splash(void) { |
|---|
| 1852 | static char *logo = NULL; |
|---|
| 1853 | static int logo_size; |
|---|
| 1854 | if (gui_splash) { |
|---|
| 1855 | static int need_logo=1; // don't use logo ptr, since we don't want to keep re-trying |
|---|
| 1856 | if(need_logo) { |
|---|
| 1857 | const char *logo_name="A/CHDK/DATA/logo.dat"; |
|---|
| 1858 | FILE *fd; |
|---|
| 1859 | struct stat st; |
|---|
| 1860 | need_logo=0; |
|---|
| 1861 | if (stat(logo_name,&st) == 0) { |
|---|
| 1862 | logo_size=st.st_size; |
|---|
| 1863 | logo=malloc(logo_size); |
|---|
| 1864 | if(logo) { |
|---|
| 1865 | fd = fopen(logo_name, "rb"); |
|---|
| 1866 | if(fd){ |
|---|
| 1867 | fread(logo,1,logo_size,fd); |
|---|
| 1868 | fclose(fd); |
|---|
| 1869 | } |
|---|
| 1870 | else { |
|---|
| 1871 | free(logo); |
|---|
| 1872 | logo=NULL; |
|---|
| 1873 | } |
|---|
| 1874 | } |
|---|
| 1875 | } |
|---|
| 1876 | } |
|---|
| 1877 | if (gui_splash>(SPLASH_TIME-4)) { |
|---|
| 1878 | gui_draw_splash(logo,logo_size); |
|---|
| 1879 | // conf.show_osd = 0; |
|---|
| 1880 | } else if (gui_splash==1 && (mode_get()&MODE_MASK) == gui_splash_mode && (gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT)) { |
|---|
| 1881 | draw_restore(); |
|---|
| 1882 | // conf.show_osd = 1; //had to uncomment in order to fix a bug with disappearing osd... |
|---|
| 1883 | } |
|---|
| 1884 | --gui_splash; |
|---|
| 1885 | if(!gui_splash) { |
|---|
| 1886 | free(logo); |
|---|
| 1887 | } |
|---|
| 1888 | } |
|---|
| 1889 | } |
|---|
| 1890 | |
|---|
| 1891 | //------------------------------------------------------------------- |
|---|
| 1892 | void gui_redraw() |
|---|
| 1893 | { |
|---|
| 1894 | enum Gui_Mode gui_mode_old; |
|---|
| 1895 | static int show_md_grid=0; |
|---|
| 1896 | |
|---|
| 1897 | gui_handle_splash(); |
|---|
| 1898 | |
|---|
| 1899 | gui_in_redraw = 1; |
|---|
| 1900 | gui_mode_old = gui_mode; |
|---|
| 1901 | |
|---|
| 1902 | #if CAM_USES_ASPECT_CORRECTION //nandoide sept-2009 |
|---|
| 1903 | //the different modes arises because games are designed on a 360x240 basis and are difficult to downscale to 320x240 |
|---|
| 1904 | if (gui_mode == GUI_MODE_REVERSI || gui_mode == GUI_MODE_SOKOBAN || gui_mode == GUI_MODE_4WINS || gui_mode == GUI_MODE_MASTERMIND) { |
|---|
| 1905 | draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); |
|---|
| 1906 | } else { //default |
|---|
| 1907 | // draw_set_environment(NULL, NULL, SCREENX, SCREENY); |
|---|
| 1908 | draw_set_environment(NULL, NULL, vid_get_bitmap_screen_width(), vid_get_bitmap_screen_height()); |
|---|
| 1909 | } |
|---|
| 1910 | #endif |
|---|
| 1911 | switch (gui_mode) { |
|---|
| 1912 | case GUI_MODE_MENU: |
|---|
| 1913 | gui_menu_draw(); |
|---|
| 1914 | // draw_txt_string(20, 14, "<CNF>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
|---|
| 1915 | break; |
|---|
| 1916 | case GUI_MODE_ALT: |
|---|
| 1917 | gui_draw_osd(); |
|---|
| 1918 | draw_txt_string(20, 14, "<ALT>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
|---|
| 1919 | #ifdef OPT_SCRIPTING |
|---|
| 1920 | if ((mode_get()&MODE_MASK) == MODE_REC) { |
|---|
| 1921 | draw_txt_string(0, 14, script_title, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
|---|
| 1922 | if (state_kbd_script_run) show_md_grid=5; |
|---|
| 1923 | if (show_md_grid) { |
|---|
| 1924 | --show_md_grid; |
|---|
| 1925 | md_draw_grid(); |
|---|
| 1926 | } |
|---|
| 1927 | } |
|---|
| 1928 | #endif |
|---|
| 1929 | console_draw(); |
|---|
| 1930 | break; |
|---|
| 1931 | case GUI_MODE_NONE: |
|---|
| 1932 | gui_draw_osd(); |
|---|
| 1933 | break; |
|---|
| 1934 | case GUI_MODE_PALETTE: |
|---|
| 1935 | gui_palette_draw(); |
|---|
| 1936 | break; |
|---|
| 1937 | case GUI_MODE_MBOX: |
|---|
| 1938 | gui_mbox_draw(); |
|---|
| 1939 | break; |
|---|
| 1940 | #ifdef OPT_GAME_REVERSI |
|---|
| 1941 | case GUI_MODE_REVERSI: |
|---|
| 1942 | gui_reversi_draw(); |
|---|
| 1943 | break; |
|---|
| 1944 | #endif |
|---|
| 1945 | #ifdef OPT_GAME_SOKOBAN |
|---|
| 1946 | case GUI_MODE_SOKOBAN: |
|---|
| 1947 | gui_sokoban_draw(); |
|---|
| 1948 | break; |
|---|
| 1949 | #endif |
|---|
| 1950 | #ifdef OPT_GAME_CONNECT4 |
|---|
| 1951 | case GUI_MODE_4WINS: |
|---|
| 1952 | gui_4wins_draw(); |
|---|
| 1953 | break; |
|---|
| 1954 | #endif |
|---|
| 1955 | #ifdef OPT_GAME_MASTERMIND |
|---|
| 1956 | case GUI_MODE_MASTERMIND: |
|---|
| 1957 | gui_mastermind_draw(); |
|---|
| 1958 | break; |
|---|
| 1959 | #endif |
|---|
| 1960 | #ifdef OPT_DEBUGGING |
|---|
| 1961 | case GUI_MODE_DEBUG: |
|---|
| 1962 | gui_debug_draw(); |
|---|
| 1963 | break; |
|---|
| 1964 | #endif |
|---|
| 1965 | case GUI_MODE_FSELECT: |
|---|
| 1966 | gui_fselect_draw(); |
|---|
| 1967 | break; |
|---|
| 1968 | #ifdef OPT_TEXTREADER |
|---|
| 1969 | case GUI_MODE_READ: |
|---|
| 1970 | gui_read_draw(); |
|---|
| 1971 | break; |
|---|
| 1972 | #endif |
|---|
| 1973 | case GUI_MODE_OSD: |
|---|
| 1974 | gui_osd_draw(); |
|---|
| 1975 | // draw_txt_string(20, 14, "<OSD>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); |
|---|
| 1976 | break; |
|---|
| 1977 | #ifdef OPT_CALENDAR |
|---|
| 1978 | case GUI_MODE_CALENDAR: |
|---|
| 1979 | gui_calendar_draw(); |
|---|
| 1980 | break; |
|---|
| 1981 | #endif |
|---|
| 1982 | #ifdef OPT_DEBUGGING |
|---|
| 1983 | case GUI_MODE_BENCH: |
|---|
| 1984 | gui_bench_draw(); |
|---|
| 1985 | break; |
|---|
| 1986 | #endif |
|---|
| 1987 | case GUI_MODE_MPOPUP: |
|---|
| 1988 | gui_mpopup_draw(); |
|---|
| 1989 | break; |
|---|
| 1990 | default: |
|---|
| 1991 | break; |
|---|
| 1992 | } |
|---|
| 1993 | |
|---|
| 1994 | gui_in_redraw = 0; |
|---|
| 1995 | if ((gui_mode_old != gui_mode && (gui_mode_old != GUI_MODE_NONE && gui_mode_old != GUI_MODE_ALT) && (gui_mode != GUI_MODE_MBOX && gui_mode != GUI_MODE_MPOPUP)) || gui_restore) { |
|---|
| 1996 | gui_restore = 0; |
|---|
| 1997 | if (gui_mode != GUI_MODE_REVERSI && gui_mode != GUI_MODE_SOKOBAN && gui_mode != GUI_MODE_4WINS && gui_mode != GUI_MODE_MASTERMIND) |
|---|
| 1998 | draw_restore(); |
|---|
| 1999 | } |
|---|
| 2000 | } |
|---|
| 2001 | |
|---|
| 2002 | #ifdef OPTIONS_AUTOSAVE |
|---|
| 2003 | //------------------------------------------------------------------- |
|---|
| 2004 | static inline void conf_store_old_settings() { |
|---|
| 2005 | old_conf=conf; |
|---|
| 2006 | } |
|---|
| 2007 | |
|---|
| 2008 | //------------------------------------------------------------------- |
|---|
| 2009 | static inline int conf_save_new_settings_if_changed() { |
|---|
| 2010 | if (memcmp(&old_conf, &conf, sizeof(Conf)) != 0) { |
|---|
| 2011 | user_menu_save(); |
|---|
| 2012 | conf_save(); |
|---|
| 2013 | conf_store_old_settings(); |
|---|
| 2014 | return 1; |
|---|
| 2015 | } |
|---|
| 2016 | return 0; |
|---|
| 2017 | } |
|---|
| 2018 | #endif |
|---|
| 2019 | |
|---|
| 2020 | |
|---|
| 2021 | //------------------------------------------------------------------- |
|---|
| 2022 | void gui_kbd_process() |
|---|
| 2023 | { |
|---|
| 2024 | int clicked_key; |
|---|
| 2025 | |
|---|
| 2026 | if (kbd_is_key_clicked(KEY_MENU)){ |
|---|
| 2027 | switch (gui_mode) { |
|---|
| 2028 | case GUI_MODE_ALT: |
|---|
| 2029 | if (conf.user_menu_as_root && (conf.user_menu_enable != 0)) { |
|---|
| 2030 | if (kbd_is_key_pressed(KEY_SHOOT_HALF)) |
|---|
| 2031 | gui_menu_init(&root_menu); |
|---|
| 2032 | else |
|---|
| 2033 | gui_menu_init(&user_submenu); |
|---|
| 2034 | } |
|---|
| 2035 | else { |
|---|
| 2036 | if ((conf.user_menu_enable != 0) && kbd_is_key_pressed(KEY_SHOOT_HALF)) |
|---|
| 2037 | gui_menu_init(&user_submenu); |
|---|
| 2038 | else |
|---|
| 2039 | gui_menu_init(&root_menu); |
|---|
| 2040 | } |
|---|
| 2041 | gui_mode = GUI_MODE_MENU; |
|---|
| 2042 | draw_restore(); |
|---|
| 2043 | break; |
|---|
| 2044 | case GUI_MODE_MENU: |
|---|
| 2045 | #ifdef OPTIONS_AUTOSAVE |
|---|
| 2046 | conf_save_new_settings_if_changed(); |
|---|
| 2047 | #endif |
|---|
| 2048 | if (gui_user_menu_flag) { |
|---|
| 2049 | gui_mode = GUI_MODE_MENU; |
|---|
| 2050 | gui_user_menu_flag = 0; |
|---|
| 2051 | gui_menu_init(&root_menu); |
|---|
| 2052 | } |
|---|
| 2053 | else |
|---|
| 2054 | gui_mode = GUI_MODE_ALT; |
|---|
| 2055 | draw_restore(); |
|---|
| 2056 | break; |
|---|
| 2057 | case GUI_MODE_PALETTE: |
|---|
| 2058 | case GUI_MODE_REVERSI: |
|---|
| 2059 | case GUI_MODE_SOKOBAN: |
|---|
| 2060 | case GUI_MODE_4WINS: |
|---|
| 2061 | case GUI_MODE_MASTERMIND: |
|---|
| 2062 | #ifdef OPT_DEBUGGING |
|---|
| 2063 | case GUI_MODE_DEBUG: |
|---|
| 2064 | #endif |
|---|
| 2065 | case GUI_MODE_OSD: |
|---|
| 2066 | #ifdef OPT_CALENDAR |
|---|
| 2067 | case GUI_MODE_CALENDAR: |
|---|
| 2068 | #endif |
|---|
| 2069 | case GUI_MODE_BENCH: |
|---|
| 2070 | draw_restore(); |
|---|
| 2071 | gui_mode = GUI_MODE_MENU; |
|---|
| 2072 | break; |
|---|
| 2073 | case GUI_MODE_FSELECT: |
|---|
| 2074 | gui_fselect_kbd_process(); |
|---|
| 2075 | break; |
|---|
| 2076 | #ifdef OPT_TEXTREADER |
|---|
| 2077 | case GUI_MODE_READ: |
|---|
| 2078 | gui_read_kbd_process(); |
|---|
| 2079 | draw_restore(); |
|---|
| 2080 | gui_mode = GUI_MODE_MENU; |
|---|
| 2081 | break; |
|---|
| 2082 | #endif |
|---|
| 2083 | default: |
|---|
| 2084 | break; |
|---|
| 2085 | } |
|---|
| 2086 | return; |
|---|
| 2087 | } |
|---|
| 2088 | |
|---|
| 2089 | switch (gui_mode) { |
|---|
| 2090 | case GUI_MODE_ALT: |
|---|
| 2091 | if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) { |
|---|
| 2092 | if (conf.debug_shortcut_action > 0) { |
|---|
| 2093 | #ifdef OPT_DEBUGGING |
|---|
| 2094 | gui_debug_shortcut(); |
|---|
| 2095 | #endif |
|---|
| 2096 | } |
|---|
| 2097 | #if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE |
|---|
| 2098 | if (!shooting_get_common_focus_mode()) |
|---|
| 2099 | #else |
|---|
| 2100 | else |
|---|
| 2101 | #endif |
|---|
| 2102 | {conf.save_raw = !conf.save_raw; |
|---|
| 2103 | draw_restore(); |
|---|
| 2104 | } |
|---|
| 2105 | #if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE |
|---|
| 2106 | else { |
|---|
| 2107 | #if CAM_HAS_ZOOM_LEVER |
|---|
| 2108 | conf.subj_dist_override_value=MAX_DIST; |
|---|
| 2109 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
|---|
| 2110 | #else |
|---|
| 2111 | if (conf.subj_dist_override_koef==4) |
|---|
| 2112 | gui_subj_dist_override_koef_enum(-3,0); |
|---|
| 2113 | else |
|---|
| 2114 | gui_subj_dist_override_koef_enum(1,0); |
|---|
| 2115 | #endif |
|---|
| 2116 | } |
|---|
| 2117 | #endif |
|---|
| 2118 | #ifdef OPT_SCRIPTING |
|---|
| 2119 | } else if (kbd_is_key_clicked(KEY_SET)) { |
|---|
| 2120 | gui_menu_init(&script_submenu); |
|---|
| 2121 | gui_mode = GUI_MODE_MENU; |
|---|
| 2122 | draw_restore(); |
|---|
| 2123 | #endif |
|---|
| 2124 | } else { |
|---|
| 2125 | #if !CAM_HAS_MANUAL_FOCUS && CAM_CAN_SD_OVERRIDE |
|---|
| 2126 | if (kbd_is_key_clicked(SHORTCUT_MF_TOGGLE)) { |
|---|
| 2127 | if (conf.subj_dist_override_koef>0) |
|---|
| 2128 | conf.subj_dist_override_koef=0; |
|---|
| 2129 | else conf.subj_dist_override_koef=1; |
|---|
| 2130 | draw_restore(); |
|---|
| 2131 | } |
|---|
| 2132 | else if (shooting_get_common_focus_mode()) |
|---|
| 2133 | #elif CAM_CAN_SD_OVERRIDE |
|---|
| 2134 | if (shooting_get_common_focus_mode()) |
|---|
| 2135 | #endif |
|---|
| 2136 | |
|---|
| 2137 | #if CAM_CAN_SD_OVERRIDE |
|---|
| 2138 | { |
|---|
| 2139 | #if CAM_HAS_ZOOM_LEVER |
|---|
| 2140 | if (kbd_is_key_clicked(KEY_RIGHT)) { |
|---|
| 2141 | gui_subj_dist_override_koef_enum(1,0); |
|---|
| 2142 | #if !CAM_HAS_MANUAL_FOCUS |
|---|
| 2143 | if (conf.subj_dist_override_koef==0) conf.subj_dist_override_koef=1; |
|---|
| 2144 | #endif |
|---|
| 2145 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
|---|
| 2146 | } |
|---|
| 2147 | else if (kbd_is_key_clicked(KEY_LEFT)) |
|---|
| 2148 | { |
|---|
| 2149 | gui_subj_dist_override_koef_enum(-1,0); |
|---|
| 2150 | #if !CAM_HAS_MANUAL_FOCUS |
|---|
| 2151 | if (conf.subj_dist_override_koef==0) conf.subj_dist_override_koef=1; |
|---|
| 2152 | #endif |
|---|
| 2153 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
|---|
| 2154 | } |
|---|
| 2155 | else if (kbd_is_key_clicked(SHORTCUT_SET_INFINITY)) |
|---|
| 2156 | { |
|---|
| 2157 | conf.subj_dist_override_value=MAX_DIST; |
|---|
| 2158 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
|---|
| 2159 | } |
|---|
| 2160 | else |
|---|
| 2161 | #endif |
|---|
| 2162 | if (kbd_is_key_clicked(SHORTCUT_SET_HYPERFOCAL)) |
|---|
| 2163 | { |
|---|
| 2164 | int m=mode_get()&MODE_SHOOTING_MASK; |
|---|
| 2165 | if ((m==MODE_M) || (m==MODE_AV)) |
|---|
| 2166 | conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance_f(shooting_get_aperture_from_av96(shooting_get_user_av96()),get_focal_length(lens_get_zoom_point())); |
|---|
| 2167 | else conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance(); |
|---|
| 2168 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
|---|
| 2169 | } |
|---|
| 2170 | else |
|---|
| 2171 | switch (kbd_get_autoclicked_key()) { |
|---|
| 2172 | #if CAM_HAS_ZOOM_LEVER |
|---|
| 2173 | case KEY_ZOOM_IN: |
|---|
| 2174 | #else |
|---|
| 2175 | case KEY_RIGHT: |
|---|
| 2176 | #endif |
|---|
| 2177 | gui_subj_dist_override_value_enum(1,0); |
|---|
| 2178 | shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); |
|---|
| 2179 | break; |
|---|
| 2180 | #if CAM_HAS_ZOOM_LEVER |
|---|
| 2181 | case KEY_ZOOM_OUT: |
|---|
| 2182 | #else |
|---|
| 2183 | case KEY_LEFT: |
|---|
| 2184 | #endif |
|---|
| 2185 | gui_subj_dist_override_value_enum(-1,0); |
|---|
| 2186 | shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); |
|---|
| 2187 | break; |
|---|
| 2188 | } |
|---|
| 2189 | } |
|---|
| 2190 | #endif |
|---|
| 2191 | } |
|---|
| 2192 | break; |
|---|
| 2193 | case GUI_MODE_MENU: |
|---|
| 2194 | gui_menu_kbd_process(); |
|---|
| 2195 | break; |
|---|
| 2196 | case GUI_MODE_PALETTE: |
|---|
| 2197 | gui_palette_kbd_process(); |
|---|
| 2198 | break; |
|---|
| 2199 | case GUI_MODE_MBOX: |
|---|
| 2200 | gui_mbox_kbd_process(); |
|---|
| 2201 | break; |
|---|
| 2202 | #ifdef OPT_GAME_REVERSI |
|---|
| 2203 | case GUI_MODE_REVERSI: |
|---|
| 2204 | gui_reversi_kbd_process(); |
|---|
| 2205 | break; |
|---|
| 2206 | #endif |
|---|
| 2207 | #ifdef OPT_GAME_SOKOBAN |
|---|
| 2208 | case GUI_MODE_SOKOBAN: |
|---|
| 2209 | gui_sokoban_kbd_process(); |
|---|
| 2210 | break; |
|---|
| 2211 | #endif |
|---|
| 2212 | #ifdef OPT_GAME_CONNECT4 |
|---|
| 2213 | case GUI_MODE_4WINS: |
|---|
| 2214 | gui_4wins_kbd_process(); |
|---|
| 2215 | break; |
|---|
| 2216 | #endif |
|---|
| 2217 | #ifdef OPT_GAME_MASTERMIND |
|---|
| 2218 | case GUI_MODE_MASTERMIND: |
|---|
| 2219 | gui_mastermind_kbd_process(); |
|---|
| 2220 | break; |
|---|
| 2221 | #endif |
|---|
| 2222 | #ifdef OPT_DEBUGGING |
|---|
| 2223 | case GUI_MODE_DEBUG: |
|---|
| 2224 | gui_debug_kbd_process(); |
|---|
| 2225 | break; |
|---|
| 2226 | #endif |
|---|
| 2227 | case GUI_MODE_FSELECT: |
|---|
| 2228 | gui_fselect_kbd_process(); |
|---|
| 2229 | break; |
|---|
| 2230 | #ifdef OPT_TEXTREADER |
|---|
| 2231 | case GUI_MODE_READ: |
|---|
| 2232 | gui_read_kbd_process(); |
|---|
| 2233 | break; |
|---|
| 2234 | #endif |
|---|
| 2235 | case GUI_MODE_OSD: |
|---|
| 2236 | gui_osd_kbd_process(); |
|---|
| 2237 | break; |
|---|
| 2238 | #ifdef OPT_CALENDAR |
|---|
| 2239 | case GUI_MODE_CALENDAR: |
|---|
| 2240 | gui_calendar_kbd_process(); |
|---|
| 2241 | break; |
|---|
| 2242 | #endif |
|---|
| 2243 | #ifdef OPT_DEBUGGING |
|---|
| 2244 | case GUI_MODE_BENCH: |
|---|
| 2245 | gui_bench_kbd_process(); |
|---|
| 2246 | break; |
|---|
| 2247 | #endif |
|---|
| 2248 | case GUI_MODE_MPOPUP: |
|---|
| 2249 | gui_mpopup_kbd_process(); |
|---|
| 2250 | break; |
|---|
| 2251 | default: |
|---|
| 2252 | break; |
|---|
| 2253 | } |
|---|
| 2254 | } |
|---|
| 2255 | |
|---|
| 2256 | //------------------------------------------------------------------- |
|---|
| 2257 | void gui_kbd_enter() |
|---|
| 2258 | { |
|---|
| 2259 | // XXX set custom palette |
|---|
| 2260 | #ifdef OPTIONS_AUTOSAVE |
|---|
| 2261 | conf_store_old_settings(); |
|---|
| 2262 | #endif |
|---|
| 2263 | gui_mode = GUI_MODE_ALT; |
|---|
| 2264 | |
|---|
| 2265 | conf_update_prevent_shutdown(); |
|---|
| 2266 | |
|---|
| 2267 | vid_turn_off_updates(); |
|---|
| 2268 | |
|---|
| 2269 | gui_user_menu_flag = 0; |
|---|
| 2270 | if (conf.user_menu_enable == 2) { |
|---|
| 2271 | gui_menu_init(&user_submenu); |
|---|
| 2272 | gui_mode = GUI_MODE_MENU; |
|---|
| 2273 | draw_restore(); |
|---|
| 2274 | gui_user_menu_flag = 1; |
|---|
| 2275 | } |
|---|
| 2276 | |
|---|
| 2277 | } |
|---|
| 2278 | |
|---|
| 2279 | //------------------------------------------------------------------- |
|---|
| 2280 | void gui_kbd_leave() |
|---|
| 2281 | { |
|---|
| 2282 | // XXX restore palette |
|---|
| 2283 | #ifdef OPTIONS_AUTOSAVE |
|---|
| 2284 | conf_save_new_settings_if_changed(); |
|---|
| 2285 | #endif |
|---|
| 2286 | #ifdef OPT_UBASIC |
|---|
| 2287 | ubasic_error = UBASIC_E_NONE; |
|---|
| 2288 | #endif |
|---|
| 2289 | draw_restore(); |
|---|
| 2290 | if (gui_mode == GUI_MODE_READ && !rbf_load(conf.menu_rbf_file)) |
|---|
| 2291 | rbf_load_from_8x16(current_font); |
|---|
| 2292 | rbf_set_codepage(FONT_CP_WIN); |
|---|
| 2293 | vid_turn_on_updates(); |
|---|
| 2294 | gui_mode = GUI_MODE_NONE; |
|---|
| 2295 | |
|---|
| 2296 | conf_update_prevent_shutdown(); |
|---|
| 2297 | } |
|---|
| 2298 | //------------------------------------------------------------------- |
|---|
| 2299 | |
|---|
| 2300 | void other_kbd_process(){ |
|---|
| 2301 | int key; |
|---|
| 2302 | #if CAM_AF_SCAN_DURING_VIDEO_RECORD |
|---|
| 2303 | |
|---|
| 2304 | if (movie_status==VIDEO_RECORD_IN_PROGRESS) { |
|---|
| 2305 | if (kbd_is_key_clicked(conf.video_af_key)) MakeAFScan(); |
|---|
| 2306 | } |
|---|
| 2307 | |
|---|
| 2308 | #endif |
|---|
| 2309 | |
|---|
| 2310 | #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO |
|---|
| 2311 | // return from digital to optical zoom in video |
|---|
| 2312 | #if CAM_HAS_ZOOM_LEVER |
|---|
| 2313 | key=KEY_ZOOM_OUT; |
|---|
| 2314 | #else |
|---|
| 2315 | key=KEY_DOWN; |
|---|
| 2316 | #endif |
|---|
| 2317 | if (conf.unlock_optical_zoom_for_video && (movie_status==VIDEO_RECORD_IN_PROGRESS) && kbd_is_key_clicked(key)){ |
|---|
| 2318 | short x; |
|---|
| 2319 | get_property_case(PROPCASE_DIGITAL_ZOOM_STATE, &x, sizeof(x)); |
|---|
| 2320 | if (x) { |
|---|
| 2321 | get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION, &x, sizeof(x)); |
|---|
| 2322 | #if defined (CAMERA_s90) |
|---|
| 2323 | if (x==0) zoom_status=ZOOM_OPTICAL_MAX; //ERR99: No zoom back from digital to optical zoom possible if set to medium |
|---|
| 2324 | #elif defined (CAMERA_sx30) || defined (CAMERA_g12) // can't find, crashes camera ******* |
|---|
| 2325 | #else |
|---|
| 2326 | if (x==0) zoom_status=ZOOM_OPTICAL_MEDIUM; |
|---|
| 2327 | #endif |
|---|
| 2328 | |
|---|
| 2329 | } |
|---|
| 2330 | } |
|---|
| 2331 | #endif |
|---|
| 2332 | |
|---|
| 2333 | #if CAM_EV_IN_VIDEO |
|---|
| 2334 | if ((movie_status==VIDEO_RECORD_IN_PROGRESS) && !kbd_is_key_pressed(KEY_SHOOT_HALF)){ |
|---|
| 2335 | #if CAM_HAS_ERASE_BUTTON |
|---|
| 2336 | if (kbd_is_key_clicked(KEY_ERASE)){ |
|---|
| 2337 | #else |
|---|
| 2338 | #if !defined (CAMERA_a480) |
|---|
| 2339 | if (kbd_is_key_clicked(KEY_DISPLAY)){ |
|---|
| 2340 | #else |
|---|
| 2341 | if (kbd_is_key_clicked(KEY_MENU)){ |
|---|
| 2342 | #endif |
|---|
| 2343 | #endif |
|---|
| 2344 | set_ev_video_avail(!get_ev_video_avail()); |
|---|
| 2345 | } |
|---|
| 2346 | if (get_ev_video_avail()) { |
|---|
| 2347 | if (kbd_is_key_clicked(KEY_LEFT)) { |
|---|
| 2348 | set_ev_video(get_ev_video()-1); |
|---|
| 2349 | } |
|---|
| 2350 | if (kbd_is_key_clicked(KEY_RIGHT)){ |
|---|
| 2351 | set_ev_video(get_ev_video()+1); |
|---|
| 2352 | } |
|---|
| 2353 | } |
|---|
| 2354 | } |
|---|
| 2355 | #endif |
|---|
| 2356 | } |
|---|
| 2357 | |
|---|
| 2358 | void gui_draw_debug_vals_osd() { |
|---|
| 2359 | #ifdef OPT_DEBUGGING |
|---|
| 2360 | if (conf.debug_misc_vals_show) { |
|---|
| 2361 | // long v=get_file_counter(); |
|---|
| 2362 | // sprintf(osd_buf, "1:%03d-%04d ", (v>>18)&0x3FF, (v>>4)&0x3FFF); |
|---|
| 2363 | // sprintf(osd_buf, "1:%d, %08X ", xxxx, eeee); |
|---|
| 2364 | /* |
|---|
| 2365 | extern long physw_status[3]; |
|---|
| 2366 | sprintf(osd_buf, "1:%8x ", physw_status[0]); |
|---|
| 2367 | draw_txt_string(28, 10, osd_buf, conf.osd_color); |
|---|
| 2368 | |
|---|
| 2369 | sprintf(osd_buf, "2:%8x ", physw_status[1]); |
|---|
| 2370 | draw_txt_string(28, 11, osd_buf, conf.osd_color); |
|---|
| 2371 | |
|---|
| 2372 | sprintf(osd_buf, "3:%8x ", physw_status[2]); |
|---|
| 2373 | draw_txt_string(28, 12, osd_buf, conf.osd_color); |
|---|
| 2374 | |
|---|
| 2375 | // sprintf(osd_buf, "4:%8x ", vid_get_viewport_fb_d()); |
|---|
| 2376 | */ |
|---|
| 2377 | sprintf(osd_buf, "u:%8x ", get_usb_power(1)); |
|---|
| 2378 | draw_txt_string(28, 9, osd_buf, conf.osd_color); |
|---|
| 2379 | |
|---|
| 2380 | sprintf(osd_buf, "1:%8x ", (void*) (*(int*)conf.mem_view_addr_init)); |
|---|
| 2381 | draw_txt_string(28, 10, osd_buf, conf.osd_color); |
|---|
| 2382 | |
|---|
| 2383 | extern volatile long focus_busy; |
|---|
| 2384 | sprintf(osd_buf, "f:%8x ", focus_busy); |
|---|
| 2385 | draw_txt_string(28, 11, osd_buf, conf.osd_color); |
|---|
| 2386 | |
|---|
| 2387 | extern volatile long zoom_busy; |
|---|
| 2388 | sprintf(osd_buf, "z:%8x ", zoom_busy); |
|---|
| 2389 | draw_txt_string(28, 12, osd_buf, conf.osd_color); |
|---|
| 2390 | |
|---|
| 2391 | // some cameras missing zoom_status |
|---|
| 2392 | #if 0 |
|---|
| 2393 | sprintf(osd_buf, "t:%8x ", zoom_status); |
|---|
| 2394 | draw_txt_string(28, 13, osd_buf, conf.osd_color); |
|---|
| 2395 | #endif |
|---|
| 2396 | |
|---|
| 2397 | } |
|---|
| 2398 | { |
|---|
| 2399 | static char sbuf[100]; |
|---|
| 2400 | int r,i, p, len; |
|---|
| 2401 | if (conf.debug_display == DEBUG_DISPLAY_PROPS){ |
|---|
| 2402 | |
|---|
| 2403 | for (i=0;i<10;i++){ |
|---|
| 2404 | r = 0; |
|---|
| 2405 | p = conf.debug_propcase_page*10+i; |
|---|
| 2406 | get_property_case(p, &r, 4); |
|---|
| 2407 | sprintf(sbuf, "%3d: %d ", p, r); |
|---|
| 2408 | sbuf[20]=0; |
|---|
| 2409 | draw_string(64,16+16*i,sbuf, conf.osd_color); |
|---|
| 2410 | } |
|---|
| 2411 | } |
|---|
| 2412 | |
|---|
| 2413 | if (conf.debug_display == DEBUG_DISPLAY_PARAMS){ |
|---|
| 2414 | extern long* FlashParamsTable[]; |
|---|
| 2415 | char s[30]; |
|---|
| 2416 | int count; |
|---|
| 2417 | |
|---|
| 2418 | for (i=0;i<10;i++){ |
|---|
| 2419 | r = 0; |
|---|
| 2420 | p = conf.debug_propcase_page*10+i; |
|---|
| 2421 | if (p>=get_flash_params_count()) { |
|---|
| 2422 | sprintf(sbuf, "%3d: This parameter does not exists", p); |
|---|
| 2423 | } else { |
|---|
| 2424 | len=FlashParamsTable[p][1]>>16; |
|---|
| 2425 | if ((len==1)||(len==2)||(len==4)){ |
|---|
| 2426 | get_parameter_data(p, &r, len); |
|---|
| 2427 | sprintf(sbuf, "%3d: %30d :%2d ", p, r,len); |
|---|
| 2428 | } |
|---|
| 2429 | else { |
|---|
| 2430 | if (len>=sizeof(s)) count=sizeof(s)-1; else count=len; |
|---|
| 2431 | get_parameter_data(p, &s, count); |
|---|
| 2432 | s[count]=0; |
|---|
| 2433 | sprintf(sbuf, "%3d: %30s :%2d ", p, s,len); |
|---|
| 2434 | } |
|---|
| 2435 | } |
|---|
| 2436 | draw_string(16,16+16*i,sbuf, conf.osd_color); |
|---|
| 2437 | } |
|---|
| 2438 | } |
|---|
| 2439 | } |
|---|
| 2440 | |
|---|
| 2441 | if(conf.debug_display == DEBUG_DISPLAY_TASKS) { |
|---|
| 2442 | gui_debug_draw_tasklist(); |
|---|
| 2443 | } |
|---|
| 2444 | #endif |
|---|
| 2445 | } |
|---|
| 2446 | //------------------------------------------------------------------- |
|---|
| 2447 | //extern int xxxx, eeee; |
|---|
| 2448 | //------------------------------------------------------------------- |
|---|
| 2449 | void gui_draw_osd() { |
|---|
| 2450 | unsigned int m, /*n = 0,*/ mode_photo, mode_video; |
|---|
| 2451 | coord x; |
|---|
| 2452 | #if CAM_SWIVEL_SCREEN |
|---|
| 2453 | static int flashlight = 0; |
|---|
| 2454 | #endif |
|---|
| 2455 | static int pressed = 0; |
|---|
| 2456 | static int half_disp_press_old=0; |
|---|
| 2457 | int half_disp_press; |
|---|
| 2458 | int need_restore = 0; |
|---|
| 2459 | m = mode_get(); |
|---|
| 2460 | |
|---|
| 2461 | // uncomment if you want debug values always on top |
|---|
| 2462 | // gui_draw_debug_vals_osd(); |
|---|
| 2463 | |
|---|
| 2464 | #if CAM_SWIVEL_SCREEN |
|---|
| 2465 | if (conf.flashlight && (m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED) && (gui_mode==GUI_MODE_NONE /* || gui_mode==GUI_MODE_ALT */)) { |
|---|
| 2466 | draw_filled_rect(0, 0, screen_width-1, screen_height-1, MAKE_COLOR(COLOR_WHITE, COLOR_WHITE)); |
|---|
| 2467 | flashlight = 1; |
|---|
| 2468 | } |
|---|
| 2469 | if (flashlight) { |
|---|
| 2470 | if ((!((m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED))) || (gui_mode!=GUI_MODE_NONE /* && gui_mode!=GUI_MODE_ALT */)) { |
|---|
| 2471 | flashlight = 0; |
|---|
| 2472 | need_restore = 1; |
|---|
| 2473 | } else { |
|---|
| 2474 | return; |
|---|
| 2475 | } |
|---|
| 2476 | } |
|---|
| 2477 | #endif |
|---|
| 2478 | |
|---|
| 2479 | if (kbd_is_key_pressed(KEY_SHOOT_HALF)) { |
|---|
| 2480 | if (kbd_is_key_pressed(SHORTCUT_TOGGLE_ZEBRA)) { |
|---|
| 2481 | if (!pressed) { |
|---|
| 2482 | conf.zebra_draw = !conf.zebra_draw; |
|---|
| 2483 | if (!conf.zebra_draw) { |
|---|
| 2484 | need_restore = 1; |
|---|
| 2485 | } |
|---|
| 2486 | pressed = 1; |
|---|
| 2487 | } |
|---|
| 2488 | } else if (kbd_is_key_pressed(SHORTCUT_TOGGLE_HISTO)) { |
|---|
| 2489 | if (!pressed) { |
|---|
| 2490 | if (++conf.show_histo>SHOW_HALF) conf.show_histo=0; |
|---|
| 2491 | if (!conf.show_histo) { |
|---|
| 2492 | need_restore = 1; |
|---|
| 2493 | } |
|---|
| 2494 | pressed = 1; |
|---|
| 2495 | } |
|---|
| 2496 | } else if (kbd_is_key_pressed(SHORTCUT_TOGGLE_OSD)) { |
|---|
| 2497 | if (!pressed) { |
|---|
| 2498 | conf.show_osd = !conf.show_osd; |
|---|
| 2499 | if (!conf.show_osd) { |
|---|
| 2500 | need_restore = 1; |
|---|
| 2501 | } |
|---|
| 2502 | pressed = 1; |
|---|
| 2503 | } |
|---|
| 2504 | } else if (kbd_is_key_pressed(SHORTCUT_DISABLE_OVERRIDES)) { |
|---|
| 2505 | if (!pressed) { |
|---|
| 2506 | if (conf.override_disable < 2) conf.override_disable = !conf.override_disable; |
|---|
| 2507 | if (!conf.show_osd) { |
|---|
| 2508 | need_restore = 1; |
|---|
| 2509 | } |
|---|
| 2510 | pressed = 1; |
|---|
| 2511 | } |
|---|
| 2512 | } else { |
|---|
| 2513 | pressed = 0; |
|---|
| 2514 | } |
|---|
| 2515 | } else { |
|---|
| 2516 | pressed = 0; |
|---|
| 2517 | } |
|---|
| 2518 | |
|---|
| 2519 | // TODO some of the ifs below should probably use this |
|---|
| 2520 | mode_video = MODE_IS_VIDEO(m); |
|---|
| 2521 | |
|---|
| 2522 | mode_photo = (m&MODE_MASK) == MODE_PLAY || |
|---|
| 2523 | !( mode_video || |
|---|
| 2524 | (m&MODE_SHOOTING_MASK)==MODE_STITCH); |
|---|
| 2525 | |
|---|
| 2526 | half_disp_press=mode_photo && kbd_is_key_pressed(KEY_SHOOT_HALF) && kbd_is_key_pressed(KEY_DISPLAY); |
|---|
| 2527 | if (half_disp_press && ! half_disp_press_old) |
|---|
| 2528 | need_restore = 1; |
|---|
| 2529 | half_disp_press_old=half_disp_press; |
|---|
| 2530 | |
|---|
| 2531 | if (need_restore) |
|---|
| 2532 | draw_restore(); |
|---|
| 2533 | |
|---|
| 2534 | if (half_disp_press) |
|---|
| 2535 | return; |
|---|
| 2536 | |
|---|
| 2537 | if (gui_osd_draw_zebra(conf.zebra_draw && gui_mode==GUI_MODE_NONE && |
|---|
| 2538 | kbd_is_key_pressed(KEY_SHOOT_HALF) && mode_photo && |
|---|
| 2539 | !state_kbd_script_run)) {// no zebra when script running, to save mem |
|---|
| 2540 | return; // if zebra drawn, we're done |
|---|
| 2541 | } |
|---|
| 2542 | #if !CAM_SHOW_OSD_IN_SHOOT_MENU |
|---|
| 2543 | if (!(conf.show_osd && (canon_menu_active==(int)&canon_menu_active-4) && (canon_shoot_menu_active==0))) return; |
|---|
| 2544 | #else |
|---|
| 2545 | if (!(conf.show_osd && (canon_menu_active==(int)&canon_menu_active-4) /*&& (canon_shoot_menu_active==0)*/ )) return; |
|---|
| 2546 | #endif |
|---|
| 2547 | |
|---|
| 2548 | |
|---|
| 2549 | if ((gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT) && ( |
|---|
| 2550 | (kbd_is_key_pressed(KEY_SHOOT_HALF) && ((conf.show_histo==SHOW_HALF)/* || (m&MODE_MASK) == MODE_PLAY*/)) || |
|---|
| 2551 | ((conf.show_histo==SHOW_ALWAYS) && !((m&MODE_MASK) == MODE_PLAY) && (recreview_hold==0)) |
|---|
| 2552 | ) && |
|---|
| 2553 | (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH)) { |
|---|
| 2554 | gui_osd_draw_histo(); |
|---|
| 2555 | } |
|---|
| 2556 | |
|---|
| 2557 | if ((m&MODE_MASK) == MODE_REC && (recreview_hold==0 || conf.show_osd_in_review) ) { |
|---|
| 2558 | if (conf.show_grid_lines) { |
|---|
| 2559 | gui_grid_draw_osd(1); |
|---|
| 2560 | } |
|---|
| 2561 | if ((gui_mode==GUI_MODE_NONE || gui_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 || movie_status > 1) && conf.show_values_in_video) )) { |
|---|
| 2562 | |
|---|
| 2563 | if (conf.show_dof!=DOF_DONT_SHOW) gui_osd_calc_dof(); |
|---|
| 2564 | |
|---|
| 2565 | if (conf.show_dof==DOF_SHOW_IN_DOF) gui_osd_draw_dof(); |
|---|
| 2566 | |
|---|
| 2567 | 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(); |
|---|
| 2568 | } |
|---|
| 2569 | if (conf.show_state) gui_osd_draw_state(); |
|---|
| 2570 | if (conf.save_raw && conf.show_raw_state && !mode_video && (!kbd_is_key_pressed(KEY_SHOOT_HALF))) gui_osd_draw_raw_info(); |
|---|
| 2571 | |
|---|
| 2572 | if ((conf.show_values==SHOW_ALWAYS && mode_photo) || ((mode_video || movie_status > 1)&& conf.show_values_in_video) || ((kbd_is_key_pressed(KEY_SHOOT_HALF) || (recreview_hold==1)) && (conf.show_values==SHOW_HALF))) |
|---|
| 2573 | gui_osd_draw_values(1); |
|---|
| 2574 | else if (shooting_get_common_focus_mode() && mode_photo && conf.show_values && !(conf.show_dof==DOF_SHOW_IN_DOF) ) |
|---|
| 2575 | gui_osd_draw_values(2); |
|---|
| 2576 | else if (conf.show_values==SHOW_HALF) |
|---|
| 2577 | gui_osd_draw_values(0); |
|---|
| 2578 | } |
|---|
| 2579 | |
|---|
| 2580 | |
|---|
| 2581 | if ((recreview_hold==0) && (!kbd_is_key_pressed(KEY_SHOOT_HALF) && ( ((m&MODE_MASK) == MODE_REC) || (!((m&MODE_MASK) == MODE_REC) && !((conf.hide_osd == 1) || (conf.hide_osd == 3)) )) && !(((conf.hide_osd == 2) || (conf.hide_osd == 3))&& (shooting_get_prop(PROPCASE_DISPLAY_MODE) == 1)))) { |
|---|
| 2582 | gui_batt_draw_osd(); |
|---|
| 2583 | gui_space_draw_osd(); |
|---|
| 2584 | if (conf.fast_ev && !mode_video && (m&MODE_MASK) == MODE_REC ) gui_osd_draw_ev(); |
|---|
| 2585 | } |
|---|
| 2586 | |
|---|
| 2587 | if ((conf.show_clock) && (recreview_hold==0) && ((!kbd_is_key_pressed(KEY_SHOOT_HALF) && ( ((m&MODE_MASK) == MODE_REC) || (!((m&MODE_MASK) == MODE_REC) && !((conf.hide_osd == 1) || (conf.hide_osd == 3)) )) && !(((conf.hide_osd == 2) || (conf.hide_osd == 3))&& (shooting_get_prop(PROPCASE_DISPLAY_MODE) == 1)))|| (conf.clock_halfpress==0) )) { |
|---|
| 2588 | gui_osd_draw_clock(0,0,0); |
|---|
| 2589 | } |
|---|
| 2590 | else if ((conf.show_clock) && (recreview_hold==0) && kbd_is_key_pressed(KEY_SHOOT_HALF) && conf.clock_halfpress==1) { |
|---|
| 2591 | gui_osd_draw_seconds(); |
|---|
| 2592 | } |
|---|
| 2593 | |
|---|
| 2594 | if ((conf.show_temp>0) && (recreview_hold==0) && ((!kbd_is_key_pressed(KEY_SHOOT_HALF) && ( ((m&MODE_MASK) == MODE_REC) || (!((m&MODE_MASK) == MODE_REC) && !((conf.hide_osd == 1) || (conf.hide_osd == 3)) )) && !(((conf.hide_osd == 2) || (conf.hide_osd == 3))&& (shooting_get_prop(PROPCASE_DISPLAY_MODE) == 1)) )|| (conf.clock_halfpress==0) )) { |
|---|
| 2595 | gui_osd_draw_temp(); |
|---|
| 2596 | } |
|---|
| 2597 | if (conf.show_movie_time > 0 && (mode_video || movie_status > 1)) { |
|---|
| 2598 | gui_osd_draw_movie_time_left(); |
|---|
| 2599 | } |
|---|
| 2600 | |
|---|
| 2601 | #if CAM_DRAW_EXPOSITION |
|---|
| 2602 | if (gui_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) { |
|---|
| 2603 | strcpy(osd_buf,shooting_get_tv_str()); |
|---|
| 2604 | strcat(osd_buf,"\" F"); |
|---|
| 2605 | strcat(osd_buf,shooting_get_av_str()); |
|---|
| 2606 | draw_txt_string(22-strlen(osd_buf)/2, 14, osd_buf, conf.osd_color); |
|---|
| 2607 | } |
|---|
| 2608 | #endif |
|---|
| 2609 | |
|---|
| 2610 | #if CAM_EV_IN_VIDEO |
|---|
| 2611 | if (movie_status==VIDEO_RECORD_IN_PROGRESS) gui_osd_draw_ev_video(get_ev_video_avail()); |
|---|
| 2612 | #endif |
|---|
| 2613 | |
|---|
| 2614 | gui_draw_debug_vals_osd(); |
|---|
| 2615 | |
|---|
| 2616 | #ifdef OPT_UBASIC |
|---|
| 2617 | if (ubasic_error){ |
|---|
| 2618 | const char *msg; |
|---|
| 2619 | if (ubasic_error >= UBASIC_E_ENDMARK) { |
|---|
| 2620 | msg = ubasic_errstrings[UBASIC_E_UNKNOWN_ERROR]; |
|---|
| 2621 | } else { |
|---|
| 2622 | msg = ubasic_errstrings[ubasic_error]; |
|---|
| 2623 | } |
|---|
| 2624 | sprintf(osd_buf, "uBASIC:%d %s ", ubasic_linenumber(), msg); |
|---|
| 2625 | draw_txt_string(0, 0, osd_buf, MAKE_COLOR(COLOR_RED, COLOR_YELLOW)); |
|---|
| 2626 | } |
|---|
| 2627 | #endif |
|---|
| 2628 | } |
|---|
| 2629 | |
|---|
| 2630 | #ifndef OPTIONS_AUTOSAVE |
|---|
| 2631 | //------------------------------------------------------------------- |
|---|
| 2632 | void gui_menuproc_save(int arg) |
|---|
| 2633 | { |
|---|
| 2634 | conf_save(); |
|---|
| 2635 | } |
|---|
| 2636 | #endif |
|---|
| 2637 | |
|---|
| 2638 | //------------------------------------------------------------------- |
|---|
| 2639 | static void gui_menuproc_reset_selected(unsigned int btn) { |
|---|
| 2640 | if (btn==MBOX_BTN_YES) |
|---|
| 2641 | conf_load_defaults(); |
|---|
| 2642 | } |
|---|
| 2643 | |
|---|
| 2644 | void gui_menuproc_reset(int arg) |
|---|
| 2645 | { |
|---|
| 2646 | gui_mbox_init(LANG_MSG_RESET_OPTIONS_TITLE, |
|---|
| 2647 | LANG_MSG_RESET_OPTIONS_TEXT, |
|---|
| 2648 | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER|MBOX_BTN_YES_NO|MBOX_DEF_BTN2, gui_menuproc_reset_selected); |
|---|
| 2649 | } |
|---|
| 2650 | |
|---|
| 2651 | //------------------------------------------------------------------- |
|---|
| 2652 | void gui_draw_palette(int arg) { |
|---|
| 2653 | draw_restore(); |
|---|
| 2654 | gui_palette_init(PALETTE_MODE_DEFAULT, 0x00, NULL); |
|---|
| 2655 | gui_mode = GUI_MODE_PALETTE; |
|---|
| 2656 | } |
|---|
| 2657 | |
|---|
| 2658 | //------------------------------------------------------------------- |
|---|
| 2659 | void gui_show_build_info(int arg) { |
|---|
| 2660 | static char buf[192]; |
|---|
| 2661 | static char comp[64]; |
|---|
| 2662 | |
|---|
| 2663 | #ifdef __GNUC__ |
|---|
| 2664 | # ifndef __GNUC_PATCHLEVEL__ |
|---|
| 2665 | # define __GNUC_PATCHLEVEL 0 |
|---|
| 2666 | # endif |
|---|
| 2667 | sprintf(comp, "GCC %d.%d.%d", __GNUC__ ,__GNUC_MINOR__,__GNUC_PATCHLEVEL__ ); |
|---|
| 2668 | #else |
|---|
| 2669 | sprintf(comp, "UNKNOWN" ); |
|---|
| 2670 | #endif |
|---|
| 2671 | sprintf(buf, lang_str(LANG_MSG_BUILD_INFO_TEXT), HDK_VERSION, BUILD_NUMBER, __DATE__, __TIME__, PLATFORM, PLATFORMSUB, comp); |
|---|
| 2672 | gui_mbox_init(LANG_MSG_BUILD_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_LEFT, NULL); |
|---|
| 2673 | } |
|---|
| 2674 | |
|---|
| 2675 | //------------------------------------------------------------------- |
|---|
| 2676 | void gui_show_memory_info(int arg) { |
|---|
| 2677 | static char buf[64]; |
|---|
| 2678 | |
|---|
| 2679 | sprintf(buf, lang_str(LANG_MSG_MEMORY_INFO_TEXT), core_get_free_memory(), MEMISOSIZE, &_start, &_end); |
|---|
| 2680 | gui_mbox_init(LANG_MSG_MEMORY_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
|---|
| 2681 | } |
|---|
| 2682 | |
|---|
| 2683 | //------------------------------------------------------------------- |
|---|
| 2684 | #ifdef OPT_GAME_REVERSI |
|---|
| 2685 | void gui_draw_reversi(int arg) { |
|---|
| 2686 | if ((mode_get()&MODE_MASK) != MODE_PLAY) { |
|---|
| 2687 | gui_mbox_init(LANG_MSG_INFO_TITLE, LANG_MSG_SWITCH_TO_PLAY_MODE, |
|---|
| 2688 | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
|---|
| 2689 | return; |
|---|
| 2690 | } |
|---|
| 2691 | |
|---|
| 2692 | #if CAM_USES_ASPECT_CORRECTION //nandoide sept-2009 |
|---|
| 2693 | draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); |
|---|
| 2694 | #endif |
|---|
| 2695 | gui_mode = GUI_MODE_REVERSI; |
|---|
| 2696 | gui_reversi_init(); |
|---|
| 2697 | } |
|---|
| 2698 | #endif |
|---|
| 2699 | |
|---|
| 2700 | //------------------------------------------------------------------- |
|---|
| 2701 | #ifdef OPT_GAME_SOKOBAN |
|---|
| 2702 | void gui_draw_sokoban(int arg) { |
|---|
| 2703 | if ((mode_get()&MODE_MASK) != MODE_PLAY) { |
|---|
| 2704 | gui_mbox_init(LANG_MSG_INFO_TITLE, LANG_MSG_SWITCH_TO_PLAY_MODE, |
|---|
| 2705 | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
|---|
| 2706 | return; |
|---|
| 2707 | } |
|---|
| 2708 | #if CAM_USES_ASPECT_CORRECTION //nandoide sept-2009 |
|---|
| 2709 | draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); |
|---|
| 2710 | #endif |
|---|
| 2711 | if ( gui_sokoban_init() ) |
|---|
| 2712 | gui_mode = GUI_MODE_SOKOBAN; |
|---|
| 2713 | } |
|---|
| 2714 | #endif |
|---|
| 2715 | //------------------------------------------------------------------- |
|---|
| 2716 | #ifdef OPT_GAME_CONNECT4 |
|---|
| 2717 | void gui_draw_4wins(int arg) { |
|---|
| 2718 | if ((mode_get()&MODE_MASK) != MODE_PLAY) { |
|---|
| 2719 | gui_mbox_init(LANG_MSG_INFO_TITLE, LANG_MSG_SWITCH_TO_PLAY_MODE, |
|---|
| 2720 | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
|---|
| 2721 | return; |
|---|
| 2722 | } |
|---|
| 2723 | #if CAM_USES_ASPECT_CORRECTION //nandoide sept-2009 |
|---|
| 2724 | draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); |
|---|
| 2725 | #endif |
|---|
| 2726 | if ( gui_4wins_init() ) |
|---|
| 2727 | gui_mode = GUI_MODE_4WINS; |
|---|
| 2728 | } |
|---|
| 2729 | #endif |
|---|
| 2730 | //------------------------------------------------------------------- |
|---|
| 2731 | #ifdef OPT_GAME_MASTERMIND |
|---|
| 2732 | void gui_draw_mastermind(int arg) { |
|---|
| 2733 | if ((mode_get()&MODE_MASK) != MODE_PLAY) { |
|---|
| 2734 | gui_mbox_init(LANG_MSG_INFO_TITLE, LANG_MSG_SWITCH_TO_PLAY_MODE, |
|---|
| 2735 | MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); |
|---|
| 2736 | return; |
|---|
| 2737 | } |
|---|
| 2738 | #if CAM_USES_ASPECT_CORRECTION //nandoide sept-2009 |
|---|
| 2739 | draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); |
|---|
| 2740 | #endif |
|---|
| 2741 | if ( gui_mastermind_init() ) |
|---|
| 2742 | gui_mode = GUI_MODE_MASTERMIND; |
|---|
| 2743 | } |
|---|
| 2744 | #endif |
|---|
| 2745 | //------------------------------------------------------------------- |
|---|
| 2746 | #ifdef OPT_DEBUGGING |
|---|
| 2747 | void gui_draw_debug(int arg) { |
|---|
| 2748 | // gui_debug_init(0x2510); |
|---|
| 2749 | // gui_debug_init(0x127E0); |
|---|
| 2750 | // gui_debug_init(0x7F5B8); |
|---|
| 2751 | // gui_debug_init(malloc(16)); |
|---|
| 2752 | gui_debug_init((void*)conf.mem_view_addr_init); |
|---|
| 2753 | } |
|---|
| 2754 | #endif |
|---|
| 2755 | //------------------------------------------------------------------- |
|---|
| 2756 | #ifdef OPT_DEBUGGING |
|---|
| 2757 | void gui_draw_bench(int arg) { |
|---|
| 2758 | gui_mode = GUI_MODE_BENCH; |
|---|
| 2759 | gui_bench_init(); |
|---|
| 2760 | } |
|---|
| 2761 | #endif |
|---|
| 2762 | //------------------------------------------------------------------- |
|---|
| 2763 | |
|---|
| 2764 | void gui_draw_splash(char* logo, int logo_size) { |
|---|
| 2765 | coord w, h, x, y; |
|---|
| 2766 | static const char *text[] = { |
|---|
| 2767 | "CHDK Firmware '" HDK_VERSION " " BUILD_NUMBER "'" , |
|---|
| 2768 | "Build: " __DATE__ " " __TIME__ , |
|---|
| 2769 | "Camera: " PLATFORM " - " PLATFORMSUB }; |
|---|
| 2770 | int i, l; |
|---|
| 2771 | color cl = MAKE_COLOR(COLOR_RED, COLOR_WHITE); |
|---|
| 2772 | |
|---|
| 2773 | gui_splash_mode = (mode_get()&MODE_MASK); |
|---|
| 2774 | |
|---|
| 2775 | h=sizeof(text)/sizeof(text[0])*FONT_HEIGHT+8; |
|---|
| 2776 | w=0; |
|---|
| 2777 | for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { |
|---|
| 2778 | l=strlen(text[i]); |
|---|
| 2779 | if (l>w) w=l; |
|---|
| 2780 | } |
|---|
| 2781 | w=w*FONT_WIDTH+10; |
|---|
| 2782 | |
|---|
| 2783 | x = (screen_width-w)>>1; y = ((screen_height-h)>>1) + 20; |
|---|
| 2784 | draw_filled_round_rect(x, y, x+w, y+h, MAKE_COLOR(COLOR_RED, COLOR_RED)); |
|---|
| 2785 | for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { |
|---|
| 2786 | draw_string(x+((w-strlen(text[i])*FONT_WIDTH)>>1), y+i*FONT_HEIGHT+4, text[i], cl); |
|---|
| 2787 | } |
|---|
| 2788 | if(logo){ |
|---|
| 2789 | int pos; |
|---|
| 2790 | int mx=0; |
|---|
| 2791 | int my=0; |
|---|
| 2792 | int offset_x = (screen_width-150)>>1; |
|---|
| 2793 | int offset_y = ((screen_height-84)>>1) - 42; |
|---|
| 2794 | const color color_lookup[8] = {COLOR_BLACK, |
|---|
| 2795 | COLOR_SPLASH_RED/*0x2E redish*/, |
|---|
| 2796 | COLOR_RED, |
|---|
| 2797 | COLOR_GREY /*0x3D*/, |
|---|
| 2798 | COLOR_SPLASH_GREY /*0x1F*/, |
|---|
| 2799 | COLOR_SPLASH_PINK /*0x21 pinkish*/, |
|---|
| 2800 | COLOR_TRANSPARENT /*0x00*/, |
|---|
| 2801 | COLOR_WHITE /*0x11*/}; |
|---|
| 2802 | for(pos=0; pos<logo_size; pos++){ |
|---|
| 2803 | char data = logo[pos]; |
|---|
| 2804 | color c = color_lookup[(data>>5) & 0x07]; |
|---|
| 2805 | for(i=0; i<(data&0x1F)+1; i++){ |
|---|
| 2806 | if (c!=0x00){ |
|---|
| 2807 | draw_pixel(offset_x+mx,offset_y+my,c); |
|---|
| 2808 | } |
|---|
| 2809 | if (mx==149){ |
|---|
| 2810 | mx=0; |
|---|
| 2811 | my++; |
|---|
| 2812 | }else{ |
|---|
| 2813 | mx++; |
|---|
| 2814 | } |
|---|
| 2815 | } |
|---|
| 2816 | } |
|---|
| 2817 | } |
|---|
| 2818 | } |
|---|
| 2819 | |
|---|
| 2820 | //------------------------------------------------------------------- |
|---|
| 2821 | void gui_draw_fselect(int arg) { |
|---|
| 2822 | gui_fselect_init(LANG_STR_FILE_BROWSER, "A", NULL); |
|---|
| 2823 | } |
|---|
| 2824 | |
|---|
| 2825 | //------------------------------------------------------------------- |
|---|
| 2826 | static void gui_grid_lines_load_selected(const char *fn) { |
|---|
| 2827 | if (fn) |
|---|
| 2828 | grid_lines_load(fn); |
|---|
| 2829 | } |
|---|
| 2830 | void gui_grid_lines_load(int arg) { |
|---|
| 2831 | DIR *d; |
|---|
| 2832 | char *path="A/CHDK/GRIDS"; |
|---|
| 2833 | |
|---|
| 2834 | // if exists "A/CHDK/GRIDS" go into |
|---|
| 2835 | d=opendir(path); |
|---|
| 2836 | if (d) { |
|---|
| 2837 | closedir(d); |
|---|
| 2838 | } else { |
|---|
| 2839 | path="A"; |
|---|
| 2840 | } |
|---|
| 2841 | |
|---|
| 2842 | gui_fselect_init(LANG_STR_SELECT_GRID_FILE, path, gui_grid_lines_load_selected); |
|---|
| 2843 | } |
|---|
| 2844 | |
|---|
| 2845 | //------------------------------------------------------------------- |
|---|
| 2846 | void gui_draw_osd_le(int arg) { |
|---|
| 2847 | gui_mode = GUI_MODE_OSD; |
|---|
| 2848 | gui_osd_init(); |
|---|
| 2849 | } |
|---|
| 2850 | |
|---|
| 2851 | //------------------------------------------------------------------- |
|---|
| 2852 | #ifdef OPT_TEXTREADER |
|---|
| 2853 | static void gui_draw_read_selected(const char *fn) { |
|---|
| 2854 | if (fn) { |
|---|
| 2855 | if (!rbf_load(conf.reader_rbf_file)) |
|---|
| 2856 | rbf_load_from_8x16(current_font); |
|---|
| 2857 | rbf_set_codepage(conf.reader_codepage); |
|---|
| 2858 | gui_mode = GUI_MODE_READ; |
|---|
| 2859 | gui_read_init(fn); |
|---|
| 2860 | } |
|---|
| 2861 | } |
|---|
| 2862 | void gui_draw_read(int arg) { |
|---|
| 2863 | DIR *d; |
|---|
| 2864 | char *path="A/CHDK/BOOKS"; |
|---|
| 2865 | |
|---|
| 2866 | // if exists "A/CHDK/BOOKS" go into |
|---|
| 2867 | d=opendir(path); |
|---|
| 2868 | if (d) { |
|---|
| 2869 | closedir(d); |
|---|
| 2870 | } else { |
|---|
| 2871 | path="A"; |
|---|
| 2872 | } |
|---|
| 2873 | gui_fselect_init(LANG_STR_SELECT_TEXT_FILE, path, gui_draw_read_selected); |
|---|
| 2874 | } |
|---|
| 2875 | |
|---|
| 2876 | //------------------------------------------------------------------- |
|---|
| 2877 | void gui_draw_read_last(int arg) { |
|---|
| 2878 | int fd; |
|---|
| 2879 | |
|---|
| 2880 | fd = open(conf.reader_file, O_RDONLY, 0777); |
|---|
| 2881 | if (fd >= 0) { |
|---|
| 2882 | close(fd); |
|---|
| 2883 | gui_draw_read_selected(conf.reader_file); |
|---|
| 2884 | } else { |
|---|
| 2885 | gui_draw_read(arg); |
|---|
| 2886 | } |
|---|
| 2887 | } |
|---|
| 2888 | #endif |
|---|
| 2889 | |
|---|
| 2890 | //------------------------------------------------------------------- |
|---|
| 2891 | void gui_menuproc_mkbootdisk(int arg) { |
|---|
| 2892 | mark_filesystem_bootable(); |
|---|
| 2893 | } |
|---|
| 2894 | |
|---|
| 2895 | #ifdef OPT_EDGEOVERLAY |
|---|
| 2896 | static void gui_load_edge_selected( const char* fn ) { |
|---|
| 2897 | if( fn ) |
|---|
| 2898 | load_edge_overlay(fn); |
|---|
| 2899 | } |
|---|
| 2900 | |
|---|
| 2901 | void gui_menuproc_edge_save(int arg) { |
|---|
| 2902 | save_edge_overlay(); |
|---|
| 2903 | } |
|---|
| 2904 | |
|---|
| 2905 | void gui_menuproc_edge_load(int arg) { |
|---|
| 2906 | DIR *d; |
|---|
| 2907 | char *path = EDGE_SAVE_DIR; |
|---|
| 2908 | const char* fn; |
|---|
| 2909 | |
|---|
| 2910 | // if exists, go into |
|---|
| 2911 | d=opendir(path); |
|---|
| 2912 | if (d) { |
|---|
| 2913 | closedir(d); |
|---|
| 2914 | } else { |
|---|
| 2915 | path="A"; |
|---|
| 2916 | } |
|---|
| 2917 | |
|---|
| 2918 | gui_fselect_init(LANG_MENU_EDGE_LOAD, path, gui_load_edge_selected); |
|---|
| 2919 | } |
|---|
| 2920 | #endif |
|---|
| 2921 | |
|---|
| 2922 | //------------------------------------------------------------------- |
|---|
| 2923 | #ifdef OPT_CALENDAR |
|---|
| 2924 | void gui_draw_calendar(int arg) { |
|---|
| 2925 | gui_mode = GUI_MODE_CALENDAR; |
|---|
| 2926 | gui_calendar_init(); |
|---|
| 2927 | } |
|---|
| 2928 | #endif |
|---|
| 2929 | //------------------------------------------------------------------- |
|---|
| 2930 | static void gui_draw_rbf_selected(const char *fn) { |
|---|
| 2931 | if (fn) { |
|---|
| 2932 | strcpy(conf.reader_rbf_file, fn); |
|---|
| 2933 | } |
|---|
| 2934 | } |
|---|
| 2935 | #ifdef OPT_TEXTREADER |
|---|
| 2936 | void gui_draw_load_rbf(int arg) { |
|---|
| 2937 | DIR *d; |
|---|
| 2938 | char *path="A/CHDK/FONTS"; |
|---|
| 2939 | |
|---|
| 2940 | // if exists "A/CHDK/FONTS" go into |
|---|
| 2941 | d=opendir(path); |
|---|
| 2942 | if (d) { |
|---|
| 2943 | closedir(d); |
|---|
| 2944 | } else { |
|---|
| 2945 | path="A"; |
|---|
| 2946 | } |
|---|
| 2947 | |
|---|
| 2948 | gui_fselect_init(LANG_STR_SELECT_FONT_FILE, path, gui_draw_rbf_selected); |
|---|
| 2949 | } |
|---|
| 2950 | #endif |
|---|
| 2951 | //------------------------------------------------------------------- |
|---|
| 2952 | static void gui_draw_menu_rbf_selected(const char *fn) { |
|---|
| 2953 | if (fn) { |
|---|
| 2954 | strcpy(conf.menu_rbf_file, fn); |
|---|
| 2955 | if (!rbf_load(conf.menu_rbf_file)) |
|---|
| 2956 | rbf_load_from_8x16(current_font); |
|---|
| 2957 | rbf_set_codepage(FONT_CP_WIN); |
|---|
| 2958 | gui_menu_init(NULL); |
|---|
| 2959 | } |
|---|
| 2960 | } |
|---|
| 2961 | void gui_draw_load_menu_rbf(int arg) { |
|---|
| 2962 | DIR *d; |
|---|
| 2963 | char *path="A/CHDK/FONTS"; |
|---|
| 2964 | |
|---|
| 2965 | // if exists "A/CHDK/FONTS" go into |
|---|
| 2966 | d=opendir(path); |
|---|
| 2967 | if (d) { |
|---|
| 2968 | closedir(d); |
|---|
| 2969 | } else { |
|---|
| 2970 | path="A"; |
|---|
| 2971 | } |
|---|
| 2972 | |
|---|
| 2973 | gui_fselect_init(LANG_STR_SELECT_FONT_FILE, path, gui_draw_menu_rbf_selected); |
|---|
| 2974 | } |
|---|
| 2975 | |
|---|
| 2976 | //------------------------------------------------------------------- |
|---|
| 2977 | static void gui_draw_symbol_rbf_selected(const char *fn) { |
|---|
| 2978 | if (fn) { |
|---|
| 2979 | strcpy(conf.menu_symbol_rbf_file, fn); |
|---|
| 2980 | if(!rbf_load_symbol(conf.menu_symbol_rbf_file)) conf.menu_symbol_enable=0; //AKA |
|---|
| 2981 | gui_menu_init(NULL); |
|---|
| 2982 | } |
|---|
| 2983 | } |
|---|
| 2984 | void gui_draw_load_symbol_rbf(int arg) { |
|---|
| 2985 | DIR *d; |
|---|
| 2986 | char *path="A/CHDK/SYMBOLS"; |
|---|
| 2987 | |
|---|
| 2988 | // if exists "A/CHDK/FONTS" go into |
|---|
| 2989 | d=opendir(path); |
|---|
| 2990 | if (d) { |
|---|
| 2991 | closedir(d); |
|---|
| 2992 | } else { |
|---|
| 2993 | path="A"; |
|---|
| 2994 | } |
|---|
| 2995 | |
|---|
| 2996 | gui_fselect_init(LANG_STR_SELECT_SYMBOL_FILE, path, gui_draw_symbol_rbf_selected); |
|---|
| 2997 | } |
|---|
| 2998 | |
|---|
| 2999 | //------------------------------------------------------------------- |
|---|
| 3000 | static void gui_draw_lang_selected(const char *fn) { |
|---|
| 3001 | if (fn) { |
|---|
| 3002 | strcpy(conf.lang_file, fn); |
|---|
| 3003 | lang_load_from_file(conf.lang_file); |
|---|
| 3004 | gui_menu_init(NULL); |
|---|
| 3005 | } |
|---|
| 3006 | } |
|---|
| 3007 | void gui_draw_load_lang(int arg) { |
|---|
| 3008 | DIR *d; |
|---|
| 3009 | char *path="A/CHDK/LANG"; |
|---|
| 3010 | |
|---|
| 3011 | // if exists "A/CHDK/LANG" go into |
|---|
| 3012 | d=opendir(path); |
|---|
| 3013 | if (d) { |
|---|
| 3014 | closedir(d); |
|---|
| 3015 | } else { |
|---|
| 3016 | path="A"; |
|---|
| 3017 | } |
|---|
| 3018 | |
|---|
| 3019 | gui_fselect_init(LANG_STR_SELECT_LANG_FILE, path, gui_draw_lang_selected); |
|---|
| 3020 | } |
|---|
| 3021 | |
|---|
| 3022 | int find_mnu(CMenu *curr_menu, int mnu, int count) |
|---|
| 3023 | { |
|---|
| 3024 | int gui_menu_curr_item; |
|---|
| 3025 | |
|---|
| 3026 | gui_menu_curr_item = 0; |
|---|
| 3027 | while(curr_menu->menu[gui_menu_curr_item].text) { |
|---|
| 3028 | if (curr_menu->menu[gui_menu_curr_item].text == mnu){ |
|---|
| 3029 | user_submenu_items[count] = curr_menu->menu[gui_menu_curr_item]; |
|---|
| 3030 | return 1; |
|---|
| 3031 | } |
|---|
| 3032 | if ((curr_menu->menu[gui_menu_curr_item].type & MENUITEM_MASK) == MENUITEM_SUBMENU) |
|---|
| 3033 | if (curr_menu->menu[gui_menu_curr_item].text != LANG_MENU_USER_MENU) |
|---|
| 3034 | if (find_mnu((CMenu*)(curr_menu->menu[gui_menu_curr_item].value), mnu, count)) return 1; |
|---|
| 3035 | gui_menu_curr_item++; |
|---|
| 3036 | } |
|---|
| 3037 | return 0; |
|---|
| 3038 | } |
|---|
| 3039 | |
|---|
| 3040 | void user_menu_save() { |
|---|
| 3041 | int x; |
|---|
| 3042 | for (x=0; x<USER_MENU_ITEMS; x++) { |
|---|
| 3043 | /* |
|---|
| 3044 | * First entry in user_submenu_items is reserved for the "Main Menu" |
|---|
| 3045 | * conf.user_menu_vars only traks/saves the real user entries. |
|---|
| 3046 | */ |
|---|
| 3047 | conf.user_menu_vars[x] = user_submenu_items[x+1].text; |
|---|
| 3048 | } |
|---|
| 3049 | } |
|---|
| 3050 | |
|---|
| 3051 | void user_menu_restore() { |
|---|
| 3052 | int x; |
|---|
| 3053 | for (x=0; x<USER_MENU_ITEMS; x++) { |
|---|
| 3054 | /* |
|---|
| 3055 | * First entry in user_submenu_items is reserved for the "Main Menu" |
|---|
| 3056 | * conf.user_menu_vars only traks/saves the real user entries. |
|---|
| 3057 | */ |
|---|
| 3058 | find_mnu(&root_menu, conf.user_menu_vars[x], x+1); |
|---|
| 3059 | } |
|---|
| 3060 | } |
|---|
| 3061 | |
|---|
| 3062 | #ifdef OPT_EDGEOVERLAY |
|---|
| 3063 | static const char* gui_edge_pano_enum(int change, int arg) |
|---|
| 3064 | { |
|---|
| 3065 | static const char* modes[]={ "Off", "Right", "Down", "Left", "Up", "Free"}; |
|---|
| 3066 | return gui_change_simple_enum(&conf.edge_overlay_pano,change,modes,sizeof(modes)/sizeof(modes[0])); |
|---|
| 3067 | } |
|---|
| 3068 | #endif |
|---|
| 3069 | |
|---|
| 3070 | #ifdef OPT_DEBUGGING |
|---|
| 3071 | |
|---|
| 3072 | void gui_compare_props(int arg) |
|---|
| 3073 | { |
|---|
| 3074 | #define NUM_PROPS 512 |
|---|
| 3075 | // never freed, but not allocated unless prop compare is used once |
|---|
| 3076 | static int *props = NULL; |
|---|
| 3077 | char buf[64]; |
|---|
| 3078 | int i; |
|---|
| 3079 | int p; |
|---|
| 3080 | int c; |
|---|
| 3081 | |
|---|
| 3082 | if( props ) |
|---|
| 3083 | { // we have previous data set! do a comparison |
|---|
| 3084 | c = 0; |
|---|
| 3085 | for( i = 0; i < NUM_PROPS; ++i ) |
|---|
| 3086 | { |
|---|
| 3087 | p = shooting_get_prop(i); |
|---|
| 3088 | if( props[i] != p ) |
|---|
| 3089 | { |
|---|
| 3090 | ++c; |
|---|
| 3091 | sprintf(buf,"%4d is %8d was %8d",i,p,props[i]); |
|---|
| 3092 | draw_string(16,16*c,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW)); |
|---|
| 3093 | } |
|---|
| 3094 | props[i] = p; |
|---|
| 3095 | if( c == 12 ) |
|---|
| 3096 | { |
|---|
| 3097 | ++c; |
|---|
| 3098 | sprintf(buf,"%s","Waiting 15 Seconds"); |
|---|
| 3099 | draw_string(16,16*c,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW)); |
|---|
| 3100 | msleep(15000); |
|---|
| 3101 | c = 0; |
|---|
| 3102 | } |
|---|
| 3103 | } |
|---|
| 3104 | ++c; |
|---|
| 3105 | sprintf(buf,"%s","Press <ALT> to leave"); |
|---|
| 3106 | draw_string(16,16*c,buf,MAKE_COLOR(COLOR_BLACK,COLOR_YELLOW)); |
|---|
| 3107 | } |
|---|
| 3108 | else |
|---|
| 3109 | { |
|---|
| 3110 | // no previous data was set so we save the data initially |
|---|
| 3111 | props = (int *)malloc(NUM_PROPS*sizeof(int)); |
|---|
| 3112 | if(props) { |
|---|
| 3113 | for( i = 0; i < NUM_PROPS; ++i ) |
|---|
| 3114 | { |
|---|
| 3115 | props[i] = shooting_get_prop(i); |
|---|
| 3116 | } |
|---|
| 3117 | } |
|---|
| 3118 | } |
|---|
| 3119 | } |
|---|
| 3120 | |
|---|
| 3121 | #endif |
|---|