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