mirror of
https://github.com/marqs85/ossc.git
synced 2025-04-06 06:37:23 +00:00
Merge branch 'megari-profile_handling_simplified' into release
This commit is contained in:
commit
e6e970227a
@ -549,8 +549,17 @@ int load_profile() {
|
||||
|
||||
input_profiles[profile_link ? cm.avinput : AV_TESTPAT] = profile_sel;
|
||||
retval = read_userdata(profile_sel);
|
||||
if (retval == 0)
|
||||
if (retval == 0) {
|
||||
// Change the input if the new profile demands a different one.
|
||||
// Also prevent the change of input from inducing a profile load.
|
||||
if (tc.link_av != AV_LAST && tc.link_av != cm.avinput) {
|
||||
target_input = tc.link_av;
|
||||
input_profiles[profile_link ? target_input : AV_TESTPAT]
|
||||
= profile_sel;
|
||||
}
|
||||
|
||||
write_userdata(INIT_CONFIG_SLOT);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -808,69 +817,39 @@ int main()
|
||||
|
||||
if (target_input != cm.avinput) {
|
||||
|
||||
target_tvp = TVP_INPUT1;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
|
||||
if (target_input <= AV1_YPBPR) {
|
||||
target_ths = THS_INPUT_B;
|
||||
target_pcm = PCM_INPUT4;
|
||||
} else if (target_input <= AV2_RGsB) {
|
||||
target_ths = THS_INPUT_A;
|
||||
target_pcm = PCM_INPUT3;
|
||||
} else { // if (target_input <= AV3_YPBPR) {
|
||||
target_tvp = TVP_INPUT3;
|
||||
target_ths = THS_STANDBY;
|
||||
target_pcm = PCM_INPUT2;
|
||||
}
|
||||
|
||||
switch (target_input) {
|
||||
case AV1_RGBs:
|
||||
target_tvp = TVP_INPUT1;
|
||||
case AV3_RGBs:
|
||||
target_format = FORMAT_RGBS;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_INPUT_B;
|
||||
target_pcm = PCM_INPUT4;
|
||||
break;
|
||||
case AV1_RGsB:
|
||||
target_tvp = TVP_INPUT1;
|
||||
case AV2_RGsB:
|
||||
case AV3_RGsB:
|
||||
target_format = FORMAT_RGsB;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_INPUT_B;
|
||||
target_pcm = PCM_INPUT4;
|
||||
break;
|
||||
case AV1_YPBPR:
|
||||
target_tvp = TVP_INPUT1;
|
||||
target_format = FORMAT_YPbPr;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_INPUT_B;
|
||||
target_pcm = PCM_INPUT4;
|
||||
break;
|
||||
case AV2_YPBPR:
|
||||
target_tvp = TVP_INPUT1;
|
||||
case AV3_YPBPR:
|
||||
target_format = FORMAT_YPbPr;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_INPUT_A;
|
||||
target_pcm = PCM_INPUT3;
|
||||
break;
|
||||
case AV2_RGsB:
|
||||
target_tvp = TVP_INPUT1;
|
||||
target_format = FORMAT_RGsB;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_INPUT_A;
|
||||
target_pcm = PCM_INPUT3;
|
||||
break;
|
||||
case AV3_RGBHV:
|
||||
target_tvp = TVP_INPUT3;
|
||||
target_format = FORMAT_RGBHV;
|
||||
target_typemask = VIDEO_PC;
|
||||
target_ths = THS_STANDBY;
|
||||
target_pcm = PCM_INPUT2;
|
||||
break;
|
||||
case AV3_RGBs:
|
||||
target_tvp = TVP_INPUT3;
|
||||
target_format = FORMAT_RGBS;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_STANDBY;
|
||||
target_pcm = PCM_INPUT2;
|
||||
break;
|
||||
case AV3_RGsB:
|
||||
target_tvp = TVP_INPUT3;
|
||||
target_format = FORMAT_RGsB;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_STANDBY;
|
||||
target_pcm = PCM_INPUT2;
|
||||
break;
|
||||
case AV3_YPBPR:
|
||||
target_tvp = TVP_INPUT3;
|
||||
target_format = FORMAT_YPbPr;
|
||||
target_typemask = VIDEO_LDTV|VIDEO_SDTV|VIDEO_EDTV|VIDEO_HDTV;
|
||||
target_ths = THS_STANDBY;
|
||||
target_pcm = PCM_INPUT2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -878,7 +857,8 @@ int main()
|
||||
|
||||
printf("### SWITCH MODE TO %s ###\n", avinput_str[target_input]);
|
||||
|
||||
// The input changed, so load the appropriate profile
|
||||
// The input changed, so load the appropriate profile if
|
||||
// input->profile link is enabled
|
||||
if (profile_link && (profile_sel != input_profiles[target_input])) {
|
||||
profile_sel = input_profiles[target_input];
|
||||
read_userdata(profile_sel);
|
||||
|
@ -59,22 +59,6 @@
|
||||
#define FPGA_SCANLINEMODE_V 2
|
||||
#define FPGA_SCANLINEMODE_ALT 3
|
||||
|
||||
static const char *avinput_str[] = { "Test pattern", "AV1: RGBS", "AV1: RGsB", "AV1: YPbPr", "AV2: YPbPr", "AV2: RGsB", "AV3: RGBHV", "AV3: RGBS", "AV3: RGsB", "AV3: YPbPr", "Last used" };
|
||||
|
||||
typedef enum {
|
||||
AV_TESTPAT = 0,
|
||||
AV1_RGBs = 1,
|
||||
AV1_RGsB = 2,
|
||||
AV1_YPBPR = 3,
|
||||
AV2_YPBPR = 4,
|
||||
AV2_RGsB = 5,
|
||||
AV3_RGBHV = 6,
|
||||
AV3_RGBs = 7,
|
||||
AV3_RGsB = 8,
|
||||
AV3_YPBPR = 9,
|
||||
AV_LAST = 10
|
||||
} avinput_t;
|
||||
|
||||
// In reverse order of importance
|
||||
typedef enum {
|
||||
NO_CHANGE = 0,
|
||||
|
@ -67,6 +67,7 @@ const avconfig_t tc_default = {
|
||||
.g_f_off = DEFAULT_FINE_OFFSET,
|
||||
.b_f_off = DEFAULT_FINE_OFFSET,
|
||||
},
|
||||
.link_av = AV_LAST,
|
||||
};
|
||||
|
||||
int set_default_avconfig()
|
||||
|
@ -48,6 +48,22 @@
|
||||
#define L5FMT_1600x1200 1
|
||||
#define L5FMT_1920x1200 2
|
||||
|
||||
static const char *avinput_str[] = { "Test pattern", "AV1: RGBS", "AV1: RGsB", "AV1: YPbPr", "AV2: YPbPr", "AV2: RGsB", "AV3: RGBHV", "AV3: RGBS", "AV3: RGsB", "AV3: YPbPr", "Last used" };
|
||||
|
||||
typedef enum {
|
||||
AV_TESTPAT = 0,
|
||||
AV1_RGBs = 1,
|
||||
AV1_RGsB = 2,
|
||||
AV1_YPBPR = 3,
|
||||
AV2_YPBPR = 4,
|
||||
AV2_RGsB = 5,
|
||||
AV3_RGBHV = 6,
|
||||
AV3_RGBs = 7,
|
||||
AV3_RGsB = 8,
|
||||
AV3_YPBPR = 9,
|
||||
AV_LAST = 10
|
||||
} avinput_t;
|
||||
|
||||
typedef struct {
|
||||
alt_u8 sl_mode;
|
||||
alt_u8 sl_type;
|
||||
@ -93,6 +109,7 @@ typedef struct {
|
||||
alt_u8 audio_gain;
|
||||
#endif
|
||||
color_setup_t col;
|
||||
avinput_t link_av;
|
||||
} __attribute__((packed)) avconfig_t;
|
||||
|
||||
int set_default_avconfig();
|
||||
|
@ -78,6 +78,7 @@ static void value_disp(alt_u8 v) { sniprintf(menu_row2, LCD_ROW_LEN+1, " %u",
|
||||
static void lt_disp(alt_u8 v) { strncpy(menu_row2, lt_desc[v], LCD_ROW_LEN+1); }
|
||||
static void aud_db_disp(alt_u8 v) { sniprintf(menu_row2, LCD_ROW_LEN+1, "%d dB", ((alt_8)v-AUDIO_GAIN_0DB)); }
|
||||
static void vm_display_name (alt_u8 v) { strncpy(menu_row2, video_modes[v].name, LCD_ROW_LEN+1); }
|
||||
static void link_av_desc (avinput_t v) { strncpy(menu_row2, v == AV_LAST ? "No link" : avinput_str[v], LCD_ROW_LEN+1); }
|
||||
|
||||
static const arg_info_t vm_arg_info = {&vm_sel, VIDEO_MODES_CNT-1, vm_display_name};
|
||||
static const arg_info_t profile_arg_info = {&profile_sel, MAX_PROFILE, value_disp};
|
||||
@ -170,12 +171,13 @@ MENU(menu_audio, P99_PROTECT({ \
|
||||
#endif
|
||||
|
||||
MENU(menu_settings, P99_PROTECT({ \
|
||||
{ LNG("<Load profile >","<プロファイルロード >"), OPT_FUNC_CALL, { .fun = { load_profile, &profile_arg_info } } },
|
||||
{ LNG("<Save profile >","<プロファイルセーブ >"), OPT_FUNC_CALL, { .fun = { save_profile, &profile_arg_info } } },
|
||||
{ LNG("<Load profile >","<プロファイルロード >"), OPT_FUNC_CALL, { .fun = { load_profile, &profile_arg_info } } },
|
||||
{ LNG("<Save profile >","<プロファイルセーブ >"), OPT_FUNC_CALL, { .fun = { save_profile, &profile_arg_info } } },
|
||||
{ LNG("<Reset settings>","<セッテイオショキカ >"), OPT_FUNC_CALL, { .fun = { set_default_avconfig, NULL } } },
|
||||
{ LNG("Link prof->input","Link prof->input"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.link_av, OPT_WRAP, AV1_RGBs, AV_LAST, link_av_desc } } },
|
||||
{ LNG("Link input->prof","Link input->prof"), OPT_AVCONFIG_SELECTION, { .sel = { &profile_link, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
|
||||
{ LNG("Initial input","ショキニュウリョク"), OPT_AVCONFIG_SELECTION, { .sel = { &def_input, OPT_WRAP, SETTING_ITEM(avinput_str) } } },
|
||||
{ "Link input/prof", OPT_AVCONFIG_SELECTION, { .sel = { &profile_link, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
|
||||
{ LNG("<Fw. update >","<ファームウェアアップデート>"), OPT_FUNC_CALL, { .fun = { fw_update, NULL } } },
|
||||
{ LNG("<Fw. update >","<ファームウェアアップデート>"), OPT_FUNC_CALL, { .fun = { fw_update, NULL } } },
|
||||
}))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user