Changeset 2035
- Timestamp:
- 08/02/12 11:36:45 (10 months ago)
- Location:
- branches/tsvstar-uitest
- Files:
-
- 8 edited
-
core/conf.c (modified) (2 diffs)
-
core/gui.c (modified) (7 diffs)
-
core/gui_menu.c (modified) (7 diffs)
-
core/gui_menu.h (modified) (1 diff)
-
core/gui_osd.c (modified) (1 diff)
-
core/raw.c (modified) (1 diff)
-
core/shooting.c (modified) (6 diffs)
-
include/gui.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/tsvstar-uitest/core/conf.c
r2025 r2035 97 97 if (conf.clear_override) 98 98 { 99 conf.av_override_value=0;100 conf.tv_override_koef=0;101 conf.subj_dist_override_koef=0;102 conf.iso_override_koef=0;99 value_turn_state( &conf.tv_override_value, -1 ); 100 value_turn_state( &conf.av_override_value, -1 ); 101 value_turn_state( &conf.subj_dist_override_value, -1 ); 102 value_turn_state( &conf.iso_override_value, -1 ); 103 103 conf.nd_filter_state=0; 104 104 } … … 106 106 if (conf.clear_zoom_override) 107 107 { 108 conf.zoom_override = 0;108 value_turn_state( &conf.conf.zoom_override, -1 ); 109 109 } 110 110 #endif 111 111 if (conf.clear_bracket) 112 112 { 113 conf.av_bracket_value=0;114 conf.tv_bracket_value=0;115 conf.iso_bracket_koef=0;116 conf.subj_dist_bracket_koef=0;113 value_turn_state( &conf.av_bracket_value, -1); 114 value_turn_state( &conf.tv_bracket_value, -1); 115 value_turn_state( &conf.iso_bracket_value, -1); 116 value_turn_state( &conf.subj_dist_bracket_value, -1); 117 117 } 118 118 if (conf.clear_video) -
branches/tsvstar-uitest/core/gui.c
r2026 r2035 101 101 //------------------------------------------------------------------- 102 102 103 static const char* gui_bracket_values_modes[] = { "Off", "1/3 Ev","2/3 Ev", "1 Ev", "1 1/3Ev", "1 2/3Ev", "2 Ev", "2 1/3Ev", "2 2/3Ev", "3 Ev", "3 1/3Ev", "3 2/3Ev", "4 Ev"};104 static const char* gui_override_koef_modes[] = { "Off", "1", "10", "100", "1000" };105 103 static const char* gui_bracket_type_modes[] = { "+/-", "-","+"}; 106 104 105 const char* gui_bracket_values_enum(int change, int arg) 106 { 107 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"}; 108 return gui_change_simple_qenum( (int*)arg, change, modes, sizeof(modes)/sizeof(modes[0]) ); 109 } 110 107 111 static CMenuItem bracketing_in_continuous_submenu_items[] = { 108 MENU_ ENUM2 (0x63,LANG_MENU_TV_BRACKET_VALUE, &conf.tv_bracket_value, gui_bracket_values_modes),112 MENU_ITEM (0x63,LANG_MENU_TV_BRACKET_VALUE, MENUITEM_ENUM|MENUITEM_QUICKDISABLE, gui_bracket_values_enum, &conf.tv_bracket_value ), 109 113 #if CAM_HAS_IRIS_DIAPHRAGM 110 MENU_ ENUM2 (0x62,LANG_MENU_AV_BRACKET_VALUE, &conf.av_bracket_value, gui_bracket_values_modes),114 MENU_ITEM (0x62,LANG_MENU_AV_BRACKET_VALUE, MENUITEM_ENUM|MENUITEM_QUICKDISABLE, gui_bracket_values_enum, &conf.av_bracket_value ), 111 115 #endif 112 116 #if CAM_CAN_SD_OVERRIDE … … 269 273 static const int shutter2_values[]={0, 4, 6, 8, 12, 15, 20, 25, 30, 40, 50, 60, 80, 100, 125, 160, 200, 250, 500, 1000 }; 270 274 271 static const char* gui_overexp_ev_modes[]={ "Off", "-1/3 Ev", "-2/3 Ev", "-1 Ev", "-1 1/3Ev", "-1 2/3Ev", "-2 Ev" }; 275 const char* gui_overexp_ev_enum(int change, int arg) 276 { 277 static const char* modes[]={ "Off", "-1/3 Ev", "-2/3 Ev", "-1 Ev", "-1 1/3Ev", "-1 2/3Ev", "-2 Ev" }; 278 return gui_change_simple_qenum( (int*)arg, change, modes, sizeof(modes)/sizeof(modes[0]) ); 279 } 280 272 281 273 282 void cb_autoiso_menu_change(unsigned int item); … … 293 302 #endif 294 303 295 MENU_ ENUM2 (0x5f,LANG_MENU_AUTOISO_OVEREXP_EV, &conf.overexp_ev_enum, gui_overexp_ev_modes),304 MENU_ITEM (0x5f,LANG_MENU_AUTOISO_OVEREXP_EV, MENUITEM_ENUM|MENUITEM_QUICKDISABLE, gui_overexp_ev_enum, &conf.overexp_ev_enum ), 296 305 MENU_ITEM (0x57,LANG_MENU_ZEBRA_OVER, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_over, MENU_MINMAX(0, 32) ), 297 306 MENU_ITEM (0x5f,LANG_MENU_AUTOISO_OVEREXP_THRES, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.overexp_threshold, MENU_MINMAX(1, 20) ), … … 309 318 menuitem_foreach2( &autoiso_submenu, LANG_MENU_AUTOISO_USER_FACTOR, 0, func ); 310 319 311 func = (conf.overexp_ev_enum );320 func = (conf.overexp_ev_enum>0); 312 321 menuitem_foreach2( &autoiso_submenu, LANG_MENU_ZEBRA_OVER, 0, func ); 313 322 menuitem_foreach2( &autoiso_submenu, LANG_MENU_AUTOISO_OVEREXP_THRES, 0, func ); … … 1132 1141 conf.tv_override_value+=change; 1133 1142 if (conf.tv_enum_type) { 1134 if (conf.tv_override_value<0 ) {1143 if (conf.tv_override_value<0 && change ) { 1135 1144 conf.tv_override_value=tv_override_amount-1; 1136 1145 } 1137 1146 else if ((unsigned)conf.tv_override_value>=(tv_override_amount)) 1138 1147 conf.tv_override_value=0; 1148 if ( conf.tv_override_value < 0 ) 1149 return "Off"; 1139 1150 return tv_override[conf.tv_override_value]; 1140 1151 } … … 1166 1177 const char* gui_av_override_enum(int change, int arg) 1167 1178 { 1168 conf.av_override_value+=change; 1169 if (conf.av_override_value<0) conf.av_override_value=shooting_get_aperture_sizes_table_size()+6; 1170 else if (conf.av_override_value>shooting_get_aperture_sizes_table_size()+6) conf.av_override_value=0; 1171 1172 if (conf.av_override_value == 0) 1179 gui_qenum_value_change( &conf.av_override_value, change, shooting_get_aperture_sizes_table_size()+7 ); 1180 1181 if (conf.av_override_value <= 0) 1173 1182 return "Off"; 1174 1183 else … … 1261 1270 1262 1271 static CMenuItem operation_submenu_items[] = { 1263 //MENU_ENUM2 (0x5f,LANG_MENU_OVERRIDE_DISABLE, &conf.override_disable, gui_override_disable_modes ),1264 1272 MENU_ITEM (0x5f,LANG_MENU_OVERRIDE_DISABLE, MENUITEM_ENUM, gui_override_disable, &conf.override_disable ), 1265 1273 MENU_ITEM (0x5c,LANG_MENU_OVERRIDE_DISABLE_ALL, MENUITEM_BOOL, &conf.override_disable_all, 0 ), -
branches/tsvstar-uitest/core/gui_menu.c
r1999 r2035 68 68 } 69 69 70 // specific processing of migrated to quickdisabled enum fields 71 void gui_qenum_value_change(int* value, int change, unsigned num_items ) { 72 *value+=change; 73 74 if (!change && !*value ) {*value=-2; } 75 if (*value<1 && change ) *value = num_items-1; 76 else if (*value>=num_items) *value=1; 77 } 78 79 const char* gui_change_simple_qenum(int* value, int change, const char** items, unsigned num_items) { 80 gui_qenum_value_change(value, change, num_items); 81 if (*value<=0) 82 return "Off"; 83 return items[*value]; 84 } 70 85 71 86 //------------------------------------------------------------------- … … 199 214 //------------------------------------------------------------------- 200 215 // Turn value on/off (quickdisable items) 201 // Argument: 1 turn on, -1 turn off 216 // Argument: 1 turn on, -1 turn off, 0 - toggle 202 217 // Return: 1 if changed, 0 otherwise 203 218 int value_turn_state( int* valueptr, int dir ) 204 219 { 205 220 // return if item already have same quickdisable status 221 if ( !dir ) 222 dir = ( *valueptr<0 )?1:-1; 223 206 224 if ( dir >0 ) { 207 225 if ( *valueptr >= 0 ) … … 220 238 //------------------------------------------------------------------- 221 239 // Turn current item on/off (quickdisable items) 222 // Argument: 1 turn on, -1 turn off 240 // Argument: 1 turn on, -1 turn off, 0 - toggle 223 241 // Return: 1 if ok, 0 otherwise 224 242 static int turn_current_item( int dir ) … … 742 760 case KEY_MENU: 743 761 // The only way to get this point - "edit" submode 744 if ( *(curr_menu->menu[gui_menu_curr_item].value) < 0 ) 745 turn_current_item_on(); 746 else 747 turn_current_item_off(); 762 turn_current_item(0); // toggle state 763 do_callback(); 748 764 break; 749 765 case KEY_SET: … … 848 864 #else 849 865 case KEY_DISPLAY: 850 if (conf.user_menu_enable == 3 && curr_menu->title == LANG_MENU_USER_MENU) { 866 if ( flag_editmode ) { 867 gui_menu_cancel_editmode(); 868 } else if (conf.user_menu_enable == 3 && curr_menu->title == LANG_MENU_USER_MENU) { 851 869 gui_menu_back(); 852 870 } … … 1130 1148 extern CMenu root_menu; 1131 1149 1132 gui_menu_unload_module_menus();1133 1134 1150 // In edit submode - MenuButton mean "Toggle feature" and processed by gui_menu_kbd_process 1135 1151 if ( gui_menu_get_editmode() ) { … … 1137 1153 return; 1138 1154 } 1155 1156 gui_menu_unload_module_menus(); 1139 1157 1140 1158 conf_save_new_settings_if_changed(); -
branches/tsvstar-uitest/core/gui_menu.h
r1976 r2035 80 80 extern const char* gui_change_simple_enum(int* value, int change, const char** items, unsigned num_items); 81 81 extern const char* gui_change_enum2(const CMenuItem *menu_item, int change); 82 extern void gui_qenum_value_change(int* value, int change, unsigned num_items ); 83 extern const char* gui_change_simple_qenum(int* value, int change, const char** items, unsigned num_items); 82 84 83 85 //------------------------------------------------------------------- -
branches/tsvstar-uitest/core/gui_osd.c
r2026 r2035 261 261 gui_print_osd_state_string_int("ISO:", shooting_get_iso_override_value()); 262 262 if ((gui_mode==GUI_MODE_OSD) || (shooting_get_drive_mode() && m!=MODE_STITCH && m!=MODE_SCN_BEST_IMAGE)) { 263 if ((conf.tv_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) || (conf.av_bracket_value&& !(conf.override_disable==1 && conf.override_disable_all)) || (conf.iso_bracket_value>0 && conf.iso_bracket_koef && !(conf.override_disable==1 && conf.override_disable_all)) || ((conf.subj_dist_bracket_value>0) && (conf.subj_dist_bracket_koef) && (shooting_can_focus() && !(conf.override_disable==1 && conf.override_disable_all))))263 if ((conf.tv_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) || (conf.av_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) || (conf.iso_bracket_value>0 && conf.iso_bracket_koef && !(conf.override_disable==1 && conf.override_disable_all)) || ((conf.subj_dist_bracket_value>0) && (conf.subj_dist_bracket_koef) && (shooting_can_focus() && !(conf.override_disable==1 && conf.override_disable_all)))) 264 264 gui_print_osd_state_string_chr("BRACKET:", shooting_get_bracket_type()); 265 if (conf.tv_bracket_value && !(conf.override_disable==1 && conf.override_disable_all))265 if (conf.tv_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) 266 266 gui_print_osd_state_string_chr("TV:", shooting_get_tv_bracket_value()); 267 else if (conf.av_bracket_value && !(conf.override_disable==1 && conf.override_disable_all))267 else if (conf.av_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) 268 268 gui_print_osd_state_string_chr("AV:", shooting_get_av_bracket_value()); 269 269 else if (conf.iso_bracket_value>0 && conf.iso_bracket_koef && !(conf.override_disable==1 && conf.override_disable_all)) -
branches/tsvstar-uitest/core/raw.c
r1996 r2035 92 92 shooting_bracketing(); 93 93 94 if(conf.tv_bracket_value || conf.av_bracket_value|| conf.iso_bracket_value>0 || conf.subj_dist_bracket_value>0 ) {94 if(conf.tv_bracket_value>0 || conf.av_bracket_value>0 || conf.iso_bracket_value>0 || conf.subj_dist_bracket_value>0 ) { 95 95 if(state_shooting_progress != SHOOTING_PROGRESS_PROCESSING) 96 96 br_counter = 1; -
branches/tsvstar-uitest/core/shooting.c
r1996 r2035 299 299 const char * shooting_get_tv_bracket_value() 300 300 { 301 if (conf.tv_bracket_value<0) 302 return expo_shift[0]; 301 303 return expo_shift[conf.tv_bracket_value]; 302 304 } … … 335 337 const char * shooting_get_av_bracket_value() 336 338 { 339 if ( conf.av_bracket_value<0) 340 return expo_shift[0]; 337 341 return expo_shift[conf.av_bracket_value]; 338 342 } … … 1197 1201 if (m==MODE_M || m==MODE_TV || m==MODE_STITCH) return; //Only operate outside of M and Tv 1198 1202 int ev_overexp = 0; 1199 if ( conf.overexp_ev_enum )1203 if ( conf.overexp_ev_enum>0 ) 1200 1204 { 1201 1205 // No shoot_histogram exist here because no future shot exist yet :) … … 1355 1359 else bracketing.tv96=shooting_get_user_tv96(); 1356 1360 } 1357 bracketing.tv96_step=32*conf.tv_bracket_value; 1361 bracketing.tv96_step=(conf.tv_bracket_value<=0)?0:(32*conf.tv_bracket_value); 1362 1358 1363 } 1359 1364 // other shoots … … 1384 1389 else 1385 1390 bracketing.av96 = shooting_get_user_av96(); 1386 bracketing.av96_step = 32*conf.av_bracket_value;1391 bracketing.av96_step = (conf.av_bracket_value<=0)?0:(32*conf.av_bracket_value); 1387 1392 } 1388 1393 // other shoots … … 1489 1494 void bracketing_step(int when) 1490 1495 { 1491 if (conf.tv_bracket_value && !(conf.override_disable==1 && conf.override_disable_all))1496 if (conf.tv_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) 1492 1497 shooting_tv_bracketing(when); 1493 else if (conf.av_bracket_value && !(conf.override_disable==1 && conf.override_disable_all))1498 else if (conf.av_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) 1494 1499 shooting_av_bracketing(when); 1495 else if ((conf.iso_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) && (conf.iso_bracket_koef))1500 else if ((conf.iso_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) && (conf.iso_bracket_koef)) 1496 1501 shooting_iso_bracketing(when); 1497 else if ((conf.subj_dist_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) && (conf.subj_dist_bracket_koef))1502 else if ((conf.subj_dist_bracket_value>0 && !(conf.override_disable==1 && conf.override_disable_all)) && (conf.subj_dist_bracket_koef)) 1498 1503 shooting_subject_distance_bracketing(when); 1499 else if ((conf.subj_dist_bracket_value ) && (conf.subj_dist_bracket_koef))1504 else if ((conf.subj_dist_bracket_value>0) && (conf.subj_dist_bracket_koef)) 1500 1505 shooting_subject_distance_bracketing(when); 1501 1506 } -
branches/tsvstar-uitest/include/gui.h
r2026 r2035 86 86 extern void gui_reset_alt_helper(); 87 87 88 extern void gui_enum_value_change(int *value, int change, unsigned num_items);89 88 extern const char* gui_subj_dist_override_value_enum(int change, int arg); 90 89 extern const char* gui_subj_dist_override_koef_enum(int change, int arg);
Note: See TracChangeset
for help on using the changeset viewer.