fix(ui): keep playback and mode keys while the settings pages are open
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6166bb8346
commit
57e2789659
|
|
@ -1229,12 +1229,14 @@ void TM1617_Handle(uint8_t key)
|
||||||
/* 模式选择页:圆形段落键不得假触摸点选模式行,也不得改段落 */
|
/* 模式选择页:圆形段落键不得假触摸点选模式行,也不得改段落 */
|
||||||
if (!InModeFlag)
|
if (!InModeFlag)
|
||||||
return;
|
return;
|
||||||
/* 调音台:段落数字键不得注入假触摸(会打在推子底部,把数值打到 1) */
|
/* 设置入口及子页:加花键保持进入前模式的段落/尾奏,不得假触摸点进系统设置或恢复出厂 */
|
||||||
if (CurrUIProcress == UI_Mixer_Process)
|
if (UI_IsSettingsPage())
|
||||||
return;
|
{
|
||||||
/* 系统设置:1~4 加花键的假触摸落在「恢复出厂」行,按下应无效 */
|
ResetAutoPowerCount();
|
||||||
if (CurrUIProcress == UI_Setting_Process)
|
if (key <= 3u)
|
||||||
|
UI_PlaySectionKey(key);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
ResetAutoPowerCount();
|
ResetAutoPowerCount();
|
||||||
if(mGuiData[GUI_TAB_INDEX].Current == 3)
|
if(mGuiData[GUI_TAB_INDEX].Current == 3)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
void UI_ExpertMode_Init(void)
|
void UI_ExpertMode_Init(void)
|
||||||
{
|
{
|
||||||
|
uint8_t keep = (UI_IsSettingsPage() && mGuiData[GUI_TAB_INDEX].Current == 1) ? 1u : 0u;
|
||||||
|
|
||||||
mGuiData[GUI_TAB_INDEX].Current = 1;
|
mGuiData[GUI_TAB_INDEX].Current = 1;
|
||||||
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
|
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
|
||||||
//mGuiData[GUI_AUTOBAND_SW].Current = 1;
|
//mGuiData[GUI_AUTOBAND_SW].Current = 1;
|
||||||
|
if (!keep)
|
||||||
UI_ReloadTonePreset(); /* 必须在 TAB=专业 之后换库,否则仍是万能 3.bin */
|
UI_ReloadTonePreset(); /* 必须在 TAB=专业 之后换库,否则仍是万能 3.bin */
|
||||||
/* 未连 App 弹唱:专业把位灯一直全绿。App 引导中不改灯。 */
|
/* 未连 App 弹唱:专业把位灯一直全绿。从设置返回同一模式不改灯。 */
|
||||||
if (!AppNeckLed_IsGuide())
|
if (!keep && !AppNeckLed_IsGuide())
|
||||||
app_tm1629_all_on(LED_COLOR_G);
|
app_tm1629_all_on(LED_COLOR_G);
|
||||||
if (CurrUIProcress == UI_SongMode_Process)
|
if (CurrUIProcress == UI_SongMode_Process)
|
||||||
Show_home_UI_Diff();
|
Show_home_UI_Diff();
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,16 @@
|
||||||
|
|
||||||
void UI_FreeMode_Init(void)
|
void UI_FreeMode_Init(void)
|
||||||
{
|
{
|
||||||
|
uint8_t keep = (UI_IsSettingsPage() && mGuiData[GUI_TAB_INDEX].Current == 2) ? 1u : 0u;
|
||||||
|
|
||||||
// CurrentMode = 2;
|
// CurrentMode = 2;
|
||||||
mGuiData[GUI_TAB_INDEX].Current = 2;
|
mGuiData[GUI_TAB_INDEX].Current = 2;
|
||||||
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
|
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
|
||||||
//mGuiData[GUI_AUTOBAND_SW].Current = 1;
|
//mGuiData[GUI_AUTOBAND_SW].Current = 1;
|
||||||
|
if (!keep)
|
||||||
UI_ReloadTonePreset(); /* TAB=普通 后再加载 1.bin */
|
UI_ReloadTonePreset(); /* TAB=普通 后再加载 1.bin */
|
||||||
/* 未连 App:普通一直全绿。App 引导中不改灯。 */
|
/* 未连 App:普通一直全绿。从设置返回同一模式不改灯。 */
|
||||||
if (!AppNeckLed_IsGuide())
|
if (!keep && !AppNeckLed_IsGuide())
|
||||||
app_tm1629_all_on(LED_COLOR_G);
|
app_tm1629_all_on(LED_COLOR_G);
|
||||||
if (CurrUIProcress == UI_SongMode_Process)
|
if (CurrUIProcress == UI_SongMode_Process)
|
||||||
Show_home_UI_Diff();
|
Show_home_UI_Diff();
|
||||||
|
|
|
||||||
|
|
@ -345,10 +345,14 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
|
|
||||||
void UI_SongMode_Init(void)
|
void UI_SongMode_Init(void)
|
||||||
{
|
{
|
||||||
|
uint8_t keep = (UI_IsSettingsPage() && mGuiData[GUI_TAB_INDEX].Current == 0) ? 1u : 0u;
|
||||||
|
|
||||||
CurrentMode = 0;
|
CurrentMode = 0;
|
||||||
//mGuiData[GUI_AUTOBAND_SW].Current = 0;
|
//mGuiData[GUI_AUTOBAND_SW].Current = 0;
|
||||||
mGuiData[GUI_TAB_INDEX].Current = 0;
|
mGuiData[GUI_TAB_INDEX].Current = 0;
|
||||||
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
|
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
|
||||||
|
/* 从设置回到同一万能:不停、不换库 */
|
||||||
|
if (!keep)
|
||||||
UI_ReloadTonePreset(); /* TAB=万能 后再加载 3.bin */
|
UI_ReloadTonePreset(); /* TAB=万能 后再加载 3.bin */
|
||||||
/* 已在主页互切用差分;从 Idle/设置进入仍整页 */
|
/* 已在主页互切用差分;从 Idle/设置进入仍整页 */
|
||||||
if (CurrUIProcress == UI_SongMode_Process)
|
if (CurrUIProcress == UI_SongMode_Process)
|
||||||
|
|
@ -359,6 +363,70 @@ void UI_SongMode_Init(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UI_PlaySectionKey(uint8_t value)
|
||||||
|
{
|
||||||
|
if (value > 3u)
|
||||||
|
return;
|
||||||
|
/* 万能第4键是尾奏,不改 1/2/3 焦点 */
|
||||||
|
if (mGuiData[GUI_TAB_INDEX].Current == 0 && value == 3u)
|
||||||
|
{
|
||||||
|
AutoBand_StartOutro();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mGuiData[GUI_PLAY_SECTION].Current != value)
|
||||||
|
{
|
||||||
|
mGuiData[GUI_PLAY_SECTION].Current = value;
|
||||||
|
AutoBandTop1_SetRunVar(mGuiData[GUI_PLAY_SECTION].Current);
|
||||||
|
if (StartFlag)
|
||||||
|
Band_NotifyPlayActivity();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MasterVolume_Reapply();
|
||||||
|
AutoBandTop1_FillinWithIndex(value);
|
||||||
|
AutoBandTop1_Start();
|
||||||
|
if (StartFlag)
|
||||||
|
Band_NotifyPlayActivity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UI_ApplyModeKeysOnSettings(DisplayTaskMessage_Type msg)
|
||||||
|
{
|
||||||
|
NvmParam_Type *nvm = drv_nvm_param_ptr();
|
||||||
|
|
||||||
|
if (msg.MessageType == MSG_ID_TAP_SPEED)
|
||||||
|
{
|
||||||
|
mGuiData[GUI_SPEED].Current = msg.ID;
|
||||||
|
AutoBandTop1_ChangeBPM(mGuiData[GUI_SPEED].Current);
|
||||||
|
Speed[3] = mGuiData[GUI_SPEED].Current / 128;
|
||||||
|
Speed[4] = mGuiData[GUI_SPEED].Current % 128;
|
||||||
|
USART4_SendData(Speed, sizeof(Speed));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (msg.MessageType == MSG_ID_BP_TRANSPOSE)
|
||||||
|
{
|
||||||
|
uint8_t lastvalue = mGuiData[GUI_TRANSPOSE].Current;
|
||||||
|
int8_t new_trans;
|
||||||
|
|
||||||
|
if (mGuiData[GUI_TRANSPOSE].Current != msg.ID)
|
||||||
|
mGuiData[GUI_TRANSPOSE].Current = msg.ID;
|
||||||
|
if (nvm->param.Transpose != mGuiData[GUI_TRANSPOSE].Current)
|
||||||
|
nvm->param.Transpose = mGuiData[GUI_TRANSPOSE].Current;
|
||||||
|
transpose[3] = mGuiData[GUI_TRANSPOSE].Current;
|
||||||
|
USART4_SendData(transpose, 5);
|
||||||
|
new_trans = (int8_t)mGuiData[GUI_TRANSPOSE].Current;
|
||||||
|
delta = (int8_t)(new_trans - (int8_t)lastvalue);
|
||||||
|
USE_MIDI.Midi_1 += delta;
|
||||||
|
USE_MIDI.Midi_2 += delta;
|
||||||
|
USE_MIDI.Midi_3 += delta;
|
||||||
|
USE_MIDI.Midi_4 += delta;
|
||||||
|
USE_MIDI.Midi_5 += delta;
|
||||||
|
USE_MIDI.Midi_6 += delta;
|
||||||
|
if (StartFlag && KEY_ID_1629 != 22 && KEY_ID_1629 != 23)
|
||||||
|
Accomp_UpdatePlayingChord();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UI_SongMode_Process(DisplayTaskMessage_Type msg)
|
void UI_SongMode_Process(DisplayTaskMessage_Type msg)
|
||||||
{
|
{
|
||||||
NvmParam_Type * nvm = drv_nvm_param_ptr();
|
NvmParam_Type * nvm = drv_nvm_param_ptr();
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ void Draw_Tab_Mode_Menu(const LEBEL_UI *UI,GUI_SWITCH * Group);
|
||||||
|
|
||||||
void UI_SongMode_Init();
|
void UI_SongMode_Init();
|
||||||
void UI_SongMode_Process(DisplayTaskMessage_Type xEvent);
|
void UI_SongMode_Process(DisplayTaskMessage_Type xEvent);
|
||||||
|
/* 设置页上的 1~4 加花键:只改演奏段落,不画演奏页、不点设置 */
|
||||||
|
void UI_PlaySectionKey(uint8_t value);
|
||||||
|
/* 设置页上的拍速/快移调:改演奏状态,不刷新设置画面 */
|
||||||
|
void UI_ApplyModeKeysOnSettings(DisplayTaskMessage_Type msg);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1130,8 +1130,47 @@ void Draw_Bottom_Bar(uint8_t sel, uint8_t first_back)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t UI_IsSettingsPage(void)
|
||||||
|
{
|
||||||
|
return (CurrUIProcress == UI_SystemSet_Process ||
|
||||||
|
CurrUIProcress == UI_Setting_Process ||
|
||||||
|
CurrUIProcress == UI_Mixer_Process ||
|
||||||
|
CurrUIProcress == UI_Language_Process ||
|
||||||
|
CurrUIProcress == UI_Restore_Select_Process ||
|
||||||
|
CurrUIProcress == UI_UsbModeConfirm_Process) ? 1u : 0u;
|
||||||
|
}
|
||||||
|
|
||||||
void UI_NavBar_Action(uint8_t value)
|
void UI_NavBar_Action(uint8_t value)
|
||||||
{
|
{
|
||||||
|
uint8_t want = 0xFFu;
|
||||||
|
|
||||||
|
/* 进入设置:不停播、不改灯、不换库。底栏仍高亮「设置」。 */
|
||||||
|
if (value == UI0902_NAV_SETTING)
|
||||||
|
{
|
||||||
|
MenuPage_SystemSetting_Proc();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value == UI0902_NAV_UNIVERSAL)
|
||||||
|
want = 0;
|
||||||
|
else if (value == UI0902_NAV_EXPERT)
|
||||||
|
want = 1;
|
||||||
|
else if (value == UI0902_NAV_NORMAL)
|
||||||
|
want = 2;
|
||||||
|
|
||||||
|
/* 从设置回到进入前的同一模式:只重绘演奏页 */
|
||||||
|
if (UI_IsSettingsPage() && want == (uint8_t)mGuiData[GUI_TAB_INDEX].Current)
|
||||||
|
{
|
||||||
|
switch (want)
|
||||||
|
{
|
||||||
|
case 0: MenuPage_SongMode_Proc(); break;
|
||||||
|
case 1: MenuPage_ExpertMode_Proc(); break;
|
||||||
|
case 2: MenuPage_FreeMode_Proc(); break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* 离开万能后 LOOP_LIGHT 停更。未连 App 时普通/专业保持全绿;App 引导中不改灯。 */
|
/* 离开万能后 LOOP_LIGHT 停更。未连 App 时普通/专业保持全绿;App 引导中不改灯。 */
|
||||||
if (!AppNeckLed_IsGuide())
|
if (!AppNeckLed_IsGuide())
|
||||||
app_tm1629_all_on(LED_COLOR_G);
|
app_tm1629_all_on(LED_COLOR_G);
|
||||||
|
|
@ -1152,9 +1191,6 @@ void UI_NavBar_Action(uint8_t value)
|
||||||
case UI0902_NAV_EXPERT:
|
case UI0902_NAV_EXPERT:
|
||||||
MenuPage_ExpertMode_Proc();
|
MenuPage_ExpertMode_Proc();
|
||||||
break;
|
break;
|
||||||
case UI0902_NAV_SETTING:
|
|
||||||
MenuPage_SystemSetting_Proc(); /* 0902-11 设置入口:调音台/系统设置 */
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,8 @@ void Show_BL_Icon(uint8_t value);
|
||||||
void UI_StatusBar_ToggleBluetooth(void);
|
void UI_StatusBar_ToggleBluetooth(void);
|
||||||
void Draw_Tab_Section_Menu(const LEBEL_UI *UI, TAB_SECTION_INDEX select_tab);
|
void Draw_Tab_Section_Menu(const LEBEL_UI *UI, TAB_SECTION_INDEX select_tab);
|
||||||
void UI_NavBar_Action(uint8_t value);
|
void UI_NavBar_Action(uint8_t value);
|
||||||
|
/* 设置入口及其子页:播放与物理键仍按进入前的模式,不点设置项 */
|
||||||
|
uint8_t UI_IsSettingsPage(void);
|
||||||
void Draw_Bottom_Bar(uint8_t sel, uint8_t first_back);
|
void Draw_Bottom_Bar(uint8_t sel, uint8_t first_back);
|
||||||
void UI_GotoCurrentModePage(void);
|
void UI_GotoCurrentModePage(void);
|
||||||
void GET_Num_Str(int16_t NUM, uint8_t ValidLen, char* Str, uint8_t hasSign);
|
void GET_Num_Str(int16_t NUM, uint8_t ValidLen, char* Str, uint8_t hasSign);
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,13 @@ void TaskUIThread_entry(void* parameter)
|
||||||
}
|
}
|
||||||
if (System_LowBat_IsActive())
|
if (System_LowBat_IsActive())
|
||||||
continue;
|
continue;
|
||||||
|
if (UI_IsSettingsPage() &&
|
||||||
|
(xEvent.MessageType == MSG_ID_TAP_SPEED ||
|
||||||
|
xEvent.MessageType == MSG_ID_BP_TRANSPOSE))
|
||||||
|
{
|
||||||
|
UI_ApplyModeKeysOnSettings(xEvent);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
/* 任意页面的用户交互统一复位自动关机;避免各 Process 漏调/early-return 漏调 */
|
/* 任意页面的用户交互统一复位自动关机;避免各 Process 漏调/early-return 漏调 */
|
||||||
switch (xEvent.MessageType)
|
switch (xEvent.MessageType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue