K1Guitar/UI/UI_ExpertMode.c

158 lines
6.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "includes.h"
void UI_ExpertMode_Init(void)
{
mGuiData[GUI_TAB_INDEX].Current = 1;
mGuiData[GUI_TAB_LAST_INDEX].Current = mGuiData[GUI_TAB_INDEX].Current;
//mGuiData[GUI_AUTOBAND_SW].Current = 1;
UI_ReloadTonePreset(); /* 必须在 TAB=专业 之后换库,否则仍是万能 3.bin */
/* 未连 App 弹唱:专业把位灯一直全绿。App 引导中不改灯。 */
if (!AppNeckLed_IsGuide())
app_tm1629_all_on(LED_COLOR_G);
if (CurrUIProcress == UI_SongMode_Process)
Show_home_UI_Diff();
else
Show_home_UI();
pCurrentTouch_Area = Touch_Areas;
}
void UI_ExpertMode_Process(DisplayTaskMessage_Type msg)
{
NvmParam_Type * nvm = drv_nvm_param_ptr();
switch(msg.MessageType)
{
case MSG_ID_TOUCH:
for(uint8_t k=0; k<TOUCH_AREA_NUM; k++)
{
if( msg.HiByte >= pCurrentTouch_Area[k].x_min && msg.HiByte <= pCurrentTouch_Area[k].x_max &&
msg.LoByte >= pCurrentTouch_Area[k].y_min && msg.LoByte <= pCurrentTouch_Area[k].y_max )
{
Touch_Action(pCurrentTouch_Area[k].Flag,pCurrentTouch_Area[k].ID,k,pCurrentTouch_Area[k].Value);
ResetAutoPowerCount();
break;
}
}
break;
case MSG_ID_BATTERY_VALUE:
Draw_Status_Battery_Icon(percentage);
break;
case MSG_ID_CHARG:
Show_Battery_Icon(msg.ID);
break;
case MSG_ID_TAP_SPEED:
// uint8_t last_value = mGuiData[GUI_SPEED].Current;
// mGuiData[GUI_SPEED].Current = msg.DataU16[1];
// Refresh_Transpose(last_value, &UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
//
// uint8_t Speed[6] = {0xF0, 0x51, 0x03, 0x00, 0x00, 0xF7};
// Speed[3] = mGuiData[GUI_SPEED].Current / 128;
// Speed[4] = mGuiData[GUI_SPEED].Current % 128;
// USART4_SendData(Speed,sizeof(Speed));
// AutoBandTop1_ChangeBPM(mGuiData[GUI_SPEED].Current);
//
// ResetAutoPowerCount();
break;
case MSG_ID_EC_VOL:
Draw_Volume_Bar(UI0902_VOL_X, UI0902_VOL_Y, msg.HiByte, 1, WHITE, GRAY);
ResetAutoPowerCount();
break;
case MSG_ID_TOUCH_LONG_REPEAT:
// {
// for(uint8_t k=0; k<TOUCH_AREA_NUM; k++)
// {
// if( msg.DataU16[2] >= pCurrentTouch_Area[k].x_min && msg.DataU16[2] <= pCurrentTouch_Area[k].x_max &&
// msg.DataU16[3] >= pCurrentTouch_Area[k].y_min && msg.DataU16[3] <= pCurrentTouch_Area[k].y_max )
// {
// if(pCurrentTouch_Area[k].ID == GUI_SPEED)
// {
// int flag = pCurrentTouch_Area[k].Flag;
// uint8_t last = mGuiData[GUI_SPEED].Current;
//
// if(flag == 1)
// {
// if(mGuiData[GUI_SPEED].Current < 260)
// {
// mGuiData[GUI_SPEED].Current += 10;
// if(mGuiData[GUI_SPEED].Current > 260)
// mGuiData[GUI_SPEED].Current = 260;
// }
// else
// {
// break;
// }
// }
// else if(flag == -1)
// {
// if(mGuiData[GUI_SPEED].Current > 40)
// {
// mGuiData[GUI_SPEED].Current -= 10;
// if(mGuiData[GUI_SPEED].Current < 40)
// mGuiData[GUI_SPEED].Current = 40;
// }else
// {
// break;
// }
// }
//
// // 只有数值真正改变,才执行全套刷新、串口、伴奏更新
// if(last != mGuiData[GUI_SPEED].Current)
// {
// Refresh_Transpose(last, &UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
//
// if(nvm->param.BPM != mGuiData[GUI_SPEED].Current)
// {
// nvm->param.BPM = mGuiData[GUI_SPEED].Current;
// }
// uint8_t Speed[6] = {0xF0, 0x51, 0x03, 0x00, 0x00, 0xF7};
// Speed[3] = mGuiData[GUI_SPEED].Current / 128;
// Speed[4] = mGuiData[GUI_SPEED].Current % 128;
// USART4_SendData(Speed,sizeof(Speed));
// AutoBandTop1_ChangeBPM(mGuiData[GUI_SPEED].Current);
// }
//
// ResetAutoPowerCount();
// }
// break;
// }
// }
// }
break;
case MSG_ID_BP_TRANSPOSE:
// uint8_t lastvalue = mGuiData[GUI_TRANSPOSE].Current;
// if(mGuiData[GUI_TRANSPOSE].Current != msg.DataU16[1])
// {
// mGuiData[GUI_TRANSPOSE].Current = msg.DataU16[1];
// Refresh_Transpose(lastvalue, &UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
// }
// if(nvm->param.Transpose != mGuiData[GUI_TRANSPOSE].Current)
// {
// nvm->param.Transpose = mGuiData[GUI_TRANSPOSE].Current;
// }
// int8_t new_trans = mGuiData[GUI_TRANSPOSE].Current;
// delta = new_trans - lastvalue; /* 使用正确<E6ADA3>??? 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(/*KEY_ID_1629 != 0 && */StartFlag && KEY_ID_1629 != 22 && KEY_ID_1629 != 23)
// {
// uint8_t midi_note_buff[4] = {0,};
// AutoBandTop1_SetPiecePlayMode(1,0,480);
// AutoBandTop1_StartWithNotes(midi_note_buff,GetChordNotesByType(KEY_ID_1629,chord_type_index_map[KEY_ID_1629].type,midi_note_buff));
// AutoBandTop1_SetLoopMode(0,1);
//// AutoBandTop1_StartWithNotes(midi_note_buff,GetChordNotesByType(KEY_ID_1629,chord_type_index_map[KEY_ID_1629].type,midi_note_buff));
// }
// ResetAutoPowerCount();
break;
}
//drv_nvm_save_to_flash();
}