2026-08-26 07:26:58 +08:00
|
|
|
|
#include "includes.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define UI_MODE_SCREEN_WIDTH 240 // <20><>Ļ<EFBFBD><C4BB>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LCD<43><EFBFBD>
|
|
|
|
|
|
#define UI_MODE_SCREEN_HEIGHT 250 // <20><>Ļ<EFBFBD>߶ȣ<DFB6><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LCD<43><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
#define UI_MODE_BG_COLOR 0x1925 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭͼ<D4AD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
|
#define UI_MODE_LINE_COLOR DARKBLUE // <20>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define UI_MODE_TEXT_COLOR 0xFFFF // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>ɫ
|
2026-08-28 11:24:06 +08:00
|
|
|
|
#define UI_MODE_FONT_SIZE 16 // 模式按钮字号(MiSans 16)
|
2026-08-26 07:26:58 +08:00
|
|
|
|
|
|
|
|
|
|
// ==============================
|
|
|
|
|
|
// <20><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
|
|
|
// ==============================
|
|
|
|
|
|
#define MODE_AREA_START_Y 25 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ Y
|
|
|
|
|
|
#define MODE_AREA_END_Y 250 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Y
|
|
|
|
|
|
#define MODE_AREA_HEIGHT (MODE_AREA_END_Y - MODE_AREA_START_Y)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Touch_AreaTypeDef Touch_SetingSelect_Areas[] = {
|
|
|
|
|
|
// Xmin, Xmax, Ymin, Ymax, flag, ID, action
|
|
|
|
|
|
{ 5, 235, 30, 140, 0, 0, GUI_SETING_SELECT1, NULL }, // <20><>һ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>̨
|
|
|
|
|
|
{ 5, 235, 140, 250, 1, 0, GUI_SETING_SELECT3, NULL }, // <20>ڶ<EFBFBD><DAB6>У<EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>
|
|
|
|
|
|
{ 10, 50, 275, 340, 0,2, 5, NULL },
|
|
|
|
|
|
{ 70, 130, 275, 340, 0,0, 5, NULL },
|
|
|
|
|
|
{ 130, 170, 275, 340, 0,1, 5, NULL },
|
|
|
|
|
|
{ 190, 230, 275, 340, 0,3, 5, NULL },
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_AREA_SETING_SELECT_NUM (sizeof(Touch_SetingSelect_Areas)/sizeof(Touch_AreaTypeDef))
|
|
|
|
|
|
|
|
|
|
|
|
void Touch_Seting_Select_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
|
|
|
|
|
{
|
|
|
|
|
|
uint8_t last_value;
|
|
|
|
|
|
switch(ID)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 0:
|
2026-08-31 21:59:12 +08:00
|
|
|
|
if (CurrUIProcress != UI_Mixer_Process)
|
|
|
|
|
|
MenuPage_Mixer_Proc();
|
2026-08-26 07:26:58 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
2026-08-31 21:59:12 +08:00
|
|
|
|
if (CurrUIProcress != UI_Setting_Process)
|
|
|
|
|
|
MenuPage_Setting_Proc();
|
2026-08-26 07:26:58 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 5:
|
2026-08-31 21:59:12 +08:00
|
|
|
|
last_value = mGuiData[GUI_TAB_INDEX].Current;
|
|
|
|
|
|
if (last_value == value)
|
|
|
|
|
|
break;
|
2026-08-26 07:26:58 +08:00
|
|
|
|
mGuiData[GUI_TAB_INDEX].Current = value;
|
2026-08-31 21:59:12 +08:00
|
|
|
|
switch(value)
|
2026-08-26 07:26:58 +08:00
|
|
|
|
{
|
2026-08-31 21:59:12 +08:00
|
|
|
|
case 0:
|
|
|
|
|
|
if(mGuiData[GUI_TAB_LAST_INDEX].Current == mGuiData[GUI_TAB_INDEX].Current)
|
|
|
|
|
|
break;
|
|
|
|
|
|
ADDRESS = 0x00000000;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
if(mGuiData[GUI_TAB_LAST_INDEX].Current == mGuiData[GUI_TAB_INDEX].Current)
|
|
|
|
|
|
break;
|
|
|
|
|
|
ADDRESS = 0x0000EB41;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
if(mGuiData[GUI_TAB_LAST_INDEX].Current == mGuiData[GUI_TAB_INDEX].Current)
|
|
|
|
|
|
break;
|
|
|
|
|
|
ADDRESS = 0x000170EF;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
2026-08-26 07:26:58 +08:00
|
|
|
|
}
|
2026-08-31 21:59:12 +08:00
|
|
|
|
Refresh_TabSelect_ui(&UI_Label[GUI_PLAY_SECTION], &mGuiData[GUI_TAB_INDEX]);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// 1 = 2<><32><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>0 = 3<><33><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
|
//#define USE_2_LINE_MODE 1
|
|
|
|
|
|
//
|
|
|
|
|
|
//void UI_DrawSysModeSelectScreen(void)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// uint16_t y1, y2;
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 1. <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
// LCD_FillByColor(0,0,240,320,BLACK);
|
|
|
|
|
|
// LCD_FillRoundRect(5,5,240-5,320-5,10,UI_MODE_BG_COLOR);
|
|
|
|
|
|
//
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> / <20><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// #if (USE_2_LINE_MODE == 1)
|
|
|
|
|
|
// // 2<>У<EFBFBD><D0A3><EFBFBD> 25~250 ֮<><D6AE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// y1 = MODE_AREA_START_Y + (MODE_AREA_HEIGHT / 2);
|
|
|
|
|
|
// LCD_DrawLine(5, y1, UI_MODE_SCREEN_WIDTH-5, y1, UI_MODE_LINE_COLOR);
|
|
|
|
|
|
// #else
|
|
|
|
|
|
// // 3<>У<EFBFBD><D0A3><EFBFBD><EFBFBD>ȷ<EFBFBD>
|
|
|
|
|
|
// y1 = MODE_AREA_START_Y + (MODE_AREA_HEIGHT / 3);
|
|
|
|
|
|
// y2 = MODE_AREA_START_Y + (MODE_AREA_HEIGHT * 2 / 3);
|
|
|
|
|
|
// LCD_DrawLine(5, y1, UI_MODE_SCREEN_WIDTH-5, y1, UI_MODE_LINE_COLOR);
|
|
|
|
|
|
// LCD_DrawLine(5, y2, UI_MODE_SCREEN_WIDTH-5, y2, UI_MODE_LINE_COLOR);
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
//
|
|
|
|
|
|
// uint16_t text_x_pos;
|
|
|
|
|
|
// uint16_t text_y_pos;
|
|
|
|
|
|
//
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// // <20><>һ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>3<EFBFBD><33> <20><><EFBFBD>У<EFBFBD>
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// text_x_pos = (UI_MODE_SCREEN_WIDTH - 3 * UI_MODE_FONT_SIZE) / 2;
|
|
|
|
|
|
//
|
|
|
|
|
|
// #if (USE_2_LINE_MODE == 1)
|
|
|
|
|
|
// text_y_pos = MODE_AREA_START_Y + (MODE_AREA_HEIGHT/2/2) - (UI_MODE_FONT_SIZE/2);
|
|
|
|
|
|
// #else
|
|
|
|
|
|
// text_y_pos = MODE_AREA_START_Y + (y1/2/2) - (UI_MODE_FONT_SIZE/2);
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
//
|
|
|
|
|
|
// LCD_ShowChineseString(
|
|
|
|
|
|
// text_x_pos, text_y_pos,
|
|
|
|
|
|
// (uint8_t*)"\xB5\xF7\xD2\xF4\xCC\xA8", // <20><><EFBFBD><EFBFBD>̨
|
|
|
|
|
|
// UI_MODE_TEXT_COLOR, UI_MODE_BG_COLOR, UI_MODE_FONT_SIZE, 0
|
|
|
|
|
|
// );
|
|
|
|
|
|
//
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// // <20>ڶ<EFBFBD><DAB6>У<EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>ã<EFBFBD>4<EFBFBD><34> <20><><EFBFBD>У<EFBFBD>
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// text_x_pos = (UI_MODE_SCREEN_WIDTH - 4 * UI_MODE_FONT_SIZE) / 2;
|
|
|
|
|
|
//
|
|
|
|
|
|
// #if (USE_2_LINE_MODE == 1)
|
|
|
|
|
|
// text_y_pos = MODE_AREA_START_Y + (MODE_AREA_HEIGHT/2) + (MODE_AREA_HEIGHT/2/2) - (UI_MODE_FONT_SIZE/2);
|
|
|
|
|
|
// #else
|
|
|
|
|
|
// text_y_pos = y1 + ((y2 - y1)/2) - (UI_MODE_FONT_SIZE/2);
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
//
|
|
|
|
|
|
// LCD_ShowChineseString(
|
|
|
|
|
|
// text_x_pos, text_y_pos,
|
|
|
|
|
|
// (uint8_t*)"\xCF\xB5\xCD\xB3\xC9\xE8\xD6\xC3", // ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>
|
|
|
|
|
|
// UI_MODE_TEXT_COLOR, UI_MODE_BG_COLOR, UI_MODE_FONT_SIZE, 0
|
|
|
|
|
|
// );
|
|
|
|
|
|
//
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// // <20><><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루<EFBFBD><EBA3A8><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>
|
|
|
|
|
|
// // ==============================
|
|
|
|
|
|
// #if (USE_2_LINE_MODE == 0)
|
|
|
|
|
|
// text_x_pos = (UI_MODE_SCREEN_WIDTH - 4 * UI_MODE_FONT_SIZE) / 2;
|
|
|
|
|
|
// text_y_pos = y2 + ((MODE_AREA_HEIGHT - y2)/2) - (UI_MODE_FONT_SIZE/2);
|
|
|
|
|
|
// LCD_ShowChineseString(
|
|
|
|
|
|
// text_x_pos, text_y_pos,
|
|
|
|
|
|
// (uint8_t*)"\xD7\xD4\xD3\xC9\xC4\xA3\xCA\xBD",
|
|
|
|
|
|
// UI_MODE_TEXT_COLOR, UI_MODE_BG_COLOR, UI_MODE_FONT_SIZE, 0
|
|
|
|
|
|
// );
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#define UI_MODE_SCREEN_WIDTH 240 // 屏幕宽度,根<EFBC8C>??????????你的LCD<43>??????????<3F>??????????
|
|
|
|
|
|
//#define UI_MODE_SCREEN_HEIGHT 320 // 屏幕高度,根<EFBC8C>??????????你的LCD<43>??????????<3F>??????????
|
|
|
|
|
|
|
|
|
|
|
|
//#define UI_MODE_BG_COLOR 0x1925 // 背景深色,近似原图的深蓝<E6B7B1>??????????
|
|
|
|
|
|
//#define UI_MODE_LINE_COLOR 0x0000/*DARKBLUE*/ // 分割线<E589B2>?<3F>色,比背景稍亮
|
|
|
|
|
|
#define UI_SET_MODE_TEXT_COLOR 0xFFFF // 文字颜色,白<EFBC8C>??????????
|
|
|
|
|
|
//#define UI_MODE_FONT_SIZE 24 // 字体大小,根<EFBC8C>??????????你的字库<E5AD97>??????????<3F>??????????
|
|
|
|
|
|
|
|
|
|
|
|
void UI_DrawSysModeSelectScreen(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
// 1. 渐变背景(深灰→黑色<E9BB91>???
|
|
|
|
|
|
// LCD_FillGradient(0, 0, 240, 320, 0x5AEB, 0x0000);
|
|
|
|
|
|
LCD_FillByColor(0, 0, 240, 320, BLACK);
|
|
|
|
|
|
|
|
|
|
|
|
label_top();
|
|
|
|
|
|
|
|
|
|
|
|
// 2. 按钮参数:<E695B0>??=220 <20>?????=87 圆<>??=10 深灰色背<E889B2>?????
|
|
|
|
|
|
const uint16_t btn_w = 220;
|
|
|
|
|
|
const uint16_t btn_h = 87;
|
|
|
|
|
|
const uint16_t btn_r = 10;
|
|
|
|
|
|
const uint16_t btn_x = (240 - btn_w) / 2; // 10
|
2026-08-31 06:10:13 +08:00
|
|
|
|
const uint16_t btn_color = COLOR_NORMAL_BG;
|
2026-08-26 07:26:58 +08:00
|
|
|
|
|
|
|
|
|
|
LCD_DrawLine(0, 30, 240, 30, btn_color);
|
|
|
|
|
|
|
2026-08-31 06:10:13 +08:00
|
|
|
|
LCD_FillRoundRect(btn_x, 40+20, btn_w, btn_h, btn_r, btn_color);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
|
|
|
|
|
|
LCD_DrawChevron_Right(200, 105, 15, 3, WHITE);
|
|
|
|
|
|
|
2026-08-31 06:10:13 +08:00
|
|
|
|
uint16_t x1 = LCD_ShowChinese_AutoAlign(
|
2026-08-26 07:26:58 +08:00
|
|
|
|
btn_x, btn_x + btn_w,
|
|
|
|
|
|
40 + (btn_h - 24) / 2+20,
|
|
|
|
|
|
(uint8_t*)"\xB5\xF7\xD2\xF4\xCC\xA8",
|
|
|
|
|
|
LCD_ALIGN_CENTER,
|
|
|
|
|
|
UI_SET_MODE_TEXT_COLOR,
|
2026-08-31 06:10:13 +08:00
|
|
|
|
btn_color,
|
|
|
|
|
|
0,
|
2026-08-26 07:26:58 +08:00
|
|
|
|
24
|
|
|
|
|
|
);
|
2026-08-31 06:10:13 +08:00
|
|
|
|
LCD_WR_PIC_Trans(x1-45, 40 + (btn_h - 24) / 2+10,40,40,gImage_mixer, BLACK);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
|
2026-08-31 06:10:13 +08:00
|
|
|
|
LCD_FillRoundRect(btn_x, 132+20, btn_w, btn_h, btn_r, btn_color);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LCD_DrawChevron_Right(200, 195, 15, 3, WHITE);
|
2026-08-31 06:10:13 +08:00
|
|
|
|
uint8_t x2 = LCD_ShowChinese_AutoAlign(
|
2026-08-26 07:26:58 +08:00
|
|
|
|
btn_x, btn_x + btn_w,
|
|
|
|
|
|
132 + (btn_h - 24) / 2+20,
|
|
|
|
|
|
(uint8_t*)"\xCF\xB5\xCD\xB3\xC9\xE8\xD6\xC3",
|
|
|
|
|
|
LCD_ALIGN_CENTER,
|
|
|
|
|
|
UI_SET_MODE_TEXT_COLOR,
|
2026-08-31 06:10:13 +08:00
|
|
|
|
btn_color,
|
|
|
|
|
|
0,
|
2026-08-26 07:26:58 +08:00
|
|
|
|
24
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2026-08-31 06:10:13 +08:00
|
|
|
|
LCD_WR_PIC_Trans(x2-45, 132 + (btn_h - 24) / 2+10,40,40,gImage_SystemSetting, BLACK);
|
2026-08-26 07:26:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UI_SystemSet_Init(void)
|
|
|
|
|
|
{
|
2026-08-31 06:10:13 +08:00
|
|
|
|
UI_ClearFocus();
|
2026-08-26 07:26:58 +08:00
|
|
|
|
pCurrentTouch_Area = Touch_SetingSelect_Areas;
|
|
|
|
|
|
UI_DrawSysModeSelectScreen();
|
|
|
|
|
|
label_Tab_Select_ui(&UI_Label[GUI_PLAY_SECTION], &mGuiData[GUI_TAB_INDEX]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UI_SystemSet_Process(DisplayTaskMessage_Type msg)
|
|
|
|
|
|
{
|
2026-08-31 21:59:12 +08:00
|
|
|
|
static uint32_t s_last_touch_ms;
|
|
|
|
|
|
|
2026-08-26 07:26:58 +08:00
|
|
|
|
switch(msg.MessageType)
|
|
|
|
|
|
{
|
|
|
|
|
|
case MSG_ID_TOUCH:
|
|
|
|
|
|
{
|
2026-08-31 21:59:12 +08:00
|
|
|
|
uint32_t now = rt_tick_get() * 1000U / RT_TICK_PER_SECOND;
|
|
|
|
|
|
if (now - s_last_touch_ms < 250U) {
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
s_last_touch_ms = now;
|
|
|
|
|
|
for(uint8_t k=0; k<TOUCH_AREA_SETING_SELECT_NUM; k++)
|
2026-08-26 07:26:58 +08:00
|
|
|
|
{
|
2026-08-31 21:59:12 +08:00
|
|
|
|
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_Seting_Select_Action(pCurrentTouch_Area[k].Flag,pCurrentTouch_Area[k].ID,k,pCurrentTouch_Area[k].Value);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
2026-08-26 07:26:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case MSG_ID_EC_VOL:
|
|
|
|
|
|
// //LCD_ShowString(200, 0, Num_To_String(msg.DataU16[1],buff,3), RED, WHITE, 16, 0);
|
|
|
|
|
|
// uint8_t vol = msg.DataU16[1];
|
|
|
|
|
|
//// uint8_t level;
|
|
|
|
|
|
// if (vol <= 5) level = 0;
|
|
|
|
|
|
// else if (vol <= 35) level = 1;
|
|
|
|
|
|
// else if (vol <= 65) level = 2;
|
|
|
|
|
|
// else if (vol <= 95) level = 3;
|
|
|
|
|
|
// else if (vol <= 115) level = 4;
|
|
|
|
|
|
// else level = 5;
|
|
|
|
|
|
// Draw_Volume_Bar(5, 5, level, 1, WHITE, GRAY);
|
|
|
|
|
|
// uint8_t mMasterSysExVolume[12] = { 0xF0, 0x41, 0x00, 0x42, 0x12, 0x40, 0x00, 0x04, 0x64, 0x00, 0x00,0xF7};
|
|
|
|
|
|
// memset(mMasterSysExVolume+8,msg.DataU16[1],1);
|
|
|
|
|
|
// SendMidiDataToDreamDSP(mMasterSysExVolume,12);
|
|
|
|
|
|
//
|
|
|
|
|
|
// ResetAutoPowerCount();
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|