mirror of
https://github.com/marqs85/ossc.git
synced 2025-01-20 18:29:41 +00:00
remote hotkey and display improvements
* fix direct sampling phase adjustment while in sampling menu * wrap around sampling phase value in menu * always display full samplerate value in menu * enable direct loading of profile 10 and higher
This commit is contained in:
parent
5e0277fb48
commit
b24e6c6366
@ -43,9 +43,10 @@ extern avconfig_t tc;
|
||||
extern avinput_t target_input;
|
||||
extern alt_u8 menu_active;
|
||||
extern alt_u16 sys_ctrl;
|
||||
extern alt_u16 tc_sampler_phase;
|
||||
extern alt_u8 profile_sel, profile_sel_menu;
|
||||
extern alt_u8 lcd_bl_timeout;
|
||||
extern alt_u8 update_cur_vm;
|
||||
extern alt_u8 update_cur_vm, vm_edit;
|
||||
extern volatile sc_regs *sc;
|
||||
|
||||
alt_u32 remote_code;
|
||||
@ -108,8 +109,8 @@ void setup_rc()
|
||||
|
||||
int parse_control()
|
||||
{
|
||||
int i, ret=0;
|
||||
alt_u32 btn_vec;
|
||||
int i, prof_x10=0, ret=0, retval;
|
||||
alt_u32 btn_vec, btn_vec_prev=1;
|
||||
alt_u8 pt_only = 0;
|
||||
avinput_t man_target_input = AV_LAST;
|
||||
|
||||
@ -216,28 +217,49 @@ int parse_control()
|
||||
lcd_write_status();
|
||||
menu_active = 0;
|
||||
break;
|
||||
case RC_PHASE_PLUS: video_modes[cm.id].sampler_phase = (video_modes[cm.id].sampler_phase < SAMPLER_PHASE_MAX) ? (video_modes[cm.id].sampler_phase + 1) : 0; update_cur_vm = 1; break;
|
||||
case RC_PHASE_MINUS: video_modes[cm.id].sampler_phase = video_modes[cm.id].sampler_phase ? (video_modes[cm.id].sampler_phase - 1) : SAMPLER_PHASE_MAX; update_cur_vm = 1; break;
|
||||
case RC_PHASE_PLUS:
|
||||
video_modes[cm.id].sampler_phase = (video_modes[cm.id].sampler_phase < SAMPLER_PHASE_MAX) ? (video_modes[cm.id].sampler_phase + 1) : 0;
|
||||
update_cur_vm = 1;
|
||||
if (cm.id == vm_edit)
|
||||
tc_sampler_phase = video_modes[vm_edit].sampler_phase;
|
||||
break;
|
||||
case RC_PHASE_MINUS: video_modes[cm.id].sampler_phase = video_modes[cm.id].sampler_phase ? (video_modes[cm.id].sampler_phase - 1) : SAMPLER_PHASE_MAX;
|
||||
update_cur_vm = 1;
|
||||
if (cm.id == vm_edit)
|
||||
tc_sampler_phase = video_modes[vm_edit].sampler_phase;
|
||||
break;
|
||||
case RC_PROF_HOTKEY:
|
||||
Prof_Hotkey_Prompt:
|
||||
strncpy(menu_row1, "Profile load:", LCD_ROW_LEN+1);
|
||||
strncpy(menu_row2, "press 0-9", LCD_ROW_LEN+1);
|
||||
sniprintf(menu_row2, LCD_ROW_LEN+1, "press %u-%u", prof_x10*10, ((prof_x10*10+9) > MAX_PROFILE) ? MAX_PROFILE : (prof_x10*10+9));
|
||||
lcd_write_menu();
|
||||
|
||||
while (1) {
|
||||
btn_vec = IORD_ALTERA_AVALON_PIO_DATA(PIO_1_BASE) & RC_MASK;
|
||||
for (i = RC_BTN1; i < REMOTE_MAX_KEYS; i++) {
|
||||
if (btn_vec == rc_keymap[i])
|
||||
|
||||
if ((btn_vec_prev == 0) && (btn_vec != 0)) {
|
||||
for (i = RC_BTN1; i < REMOTE_MAX_KEYS; i++) {
|
||||
if (btn_vec == rc_keymap[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if ((i == RC_BTN0) || (i < (RC_BTN1 + (prof_x10 == (MAX_PROFILE/10)) ? (MAX_PROFILE%10) : 9))) {
|
||||
profile_sel_menu = prof_x10*10 + ((i+1)%10);
|
||||
retval = load_profile();
|
||||
sniprintf(menu_row2, LCD_ROW_LEN+1, "%s", (retval==0) ? "Done" : "Failed");
|
||||
lcd_write_menu();
|
||||
usleep(500000);
|
||||
break;
|
||||
} else if (i == RC_PROF_HOTKEY) {
|
||||
prof_x10 = (prof_x10+1) % ((MAX_PROFILE/10)+1);
|
||||
btn_vec_prev = btn_vec;
|
||||
goto Prof_Hotkey_Prompt;
|
||||
} else if (i == RC_BACK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i <= RC_BTN0) {
|
||||
profile_sel_menu = (i+1)%10;
|
||||
load_profile();
|
||||
break;
|
||||
} else if (i == RC_BACK) {
|
||||
break;
|
||||
}
|
||||
|
||||
btn_vec_prev = btn_vec;
|
||||
usleep(WAITLOOP_SLEEP_US);
|
||||
}
|
||||
lcd_write_status();
|
||||
|
@ -246,7 +246,7 @@ void display_menu(alt_u8 forcedisp)
|
||||
menucode_id code = NO_ACTION;
|
||||
menuitem_type type;
|
||||
alt_u8 *val, val_wrap, val_min, val_max;
|
||||
alt_u16 *val_u16;
|
||||
alt_u16 *val_u16, val_u16_min, val_u16_max;
|
||||
int i, func_called = 0, retval = 0;
|
||||
|
||||
for (i=RC_OK; i < RC_INFO; i++) {
|
||||
@ -315,10 +315,13 @@ void display_menu(alt_u8 forcedisp)
|
||||
break;
|
||||
case OPT_AVCONFIG_NUMVAL_U16:
|
||||
val_u16 = navi[navlvl].m->items[navi[navlvl].mp].num_u16.data;
|
||||
val_u16_min = navi[navlvl].m->items[navi[navlvl].mp].num_u16.min;
|
||||
val_u16_max = navi[navlvl].m->items[navi[navlvl].mp].num_u16.max;
|
||||
val_wrap = (val_u16_min == 0);
|
||||
if (code == VAL_MINUS)
|
||||
*val_u16 = (*val_u16 > navi[navlvl].m->items[navi[navlvl].mp].num_u16.min) ? (*val_u16-1) : *val_u16;
|
||||
*val_u16 = (*val_u16 > val_u16_min) ? (*val_u16-1) : (val_wrap ? val_u16_max : val_u16_min);
|
||||
else
|
||||
*val_u16 = (*val_u16 < navi[navlvl].m->items[navi[navlvl].mp].num_u16.max) ? (*val_u16+1) : *val_u16;
|
||||
*val_u16 = (*val_u16 < val_u16_max) ? (*val_u16+1) : (val_wrap ? val_u16_min : val_u16_max);
|
||||
break;
|
||||
case OPT_SUBMENU:
|
||||
val = navi[navlvl].m->items[navi[navlvl].mp].sub.arg_info->data;
|
||||
@ -422,8 +425,8 @@ static void vm_tweak(alt_u16 *v) {
|
||||
|
||||
if (v == &tc_sampler_phase)
|
||||
sniprintf(menu_row2, LCD_ROW_LEN+1, LNG("%d deg","%d ド"), ((*v)*1125)/100);
|
||||
else if (v == &tc_h_samplerate_adj)
|
||||
sniprintf(menu_row2, LCD_ROW_LEN+1, "%u.%.2u", video_modes[vm_edit].h_total, (*v)*5);
|
||||
else if ((v == &tc_h_samplerate) || (v == &tc_h_samplerate_adj))
|
||||
sniprintf(menu_row2, LCD_ROW_LEN+1, "%u.%.2u", video_modes[vm_edit].h_total, video_modes[vm_edit].h_total_adj*5);
|
||||
else
|
||||
sniprintf(menu_row2, LCD_ROW_LEN+1, "%u", *v);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user