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