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