Align UI focus colors with 0819 spec and fix J-Link flash script usage.
Only the focused control uses the blue gradient; unfocused widgets use the dark normal background. Drop invalid Commander commands from IAR jlink_script_file to stop V5.10m parse popups. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1d5fe8073d
commit
27cf30cbe4
|
|
@ -58,15 +58,15 @@
|
||||||
#define BLACK 0x0000
|
#define BLACK 0x0000
|
||||||
#define BLUE 0x001F
|
#define BLUE 0x001F
|
||||||
#define COLOR_PRIMARY 0x1B9F // #1D73FF MiSans UI 主色
|
#define COLOR_PRIMARY 0x1B9F // #1D73FF MiSans UI 主色
|
||||||
#define COLOR_GRAD_START 0x039D // #003AEE
|
#define COLOR_GRAD_START 0x01D5 // #003AAE 规范渐变起始(深蓝)
|
||||||
#define COLOR_GRAD_MID 0x2A5A // #354FD6
|
#define COLOR_GRAD_MID 0x029A // #034FD6 规范渐变中间
|
||||||
#define COLOR_GRAD_END 0x4B1F // #5561F8
|
#define COLOR_GRAD_END 0x431E // #4161F8 规范渐变结束(中蓝)
|
||||||
#define COLOR_BG_START 0x0849 // #0E1537
|
#define COLOR_BG_START 0x10A6 // #0E1535 屏幕背景渐变顶
|
||||||
#define COLOR_BG_END 0x3189 // #2F3647
|
#define COLOR_BG_END 0x31A9 // #2F3647 屏幕背景渐变底
|
||||||
#define COLOR_MIXER_RED 0xFB2D // #F85E4B
|
#define COLOR_MIXER_RED 0xF2E9 // #F85E4B 弦音色槽位红
|
||||||
#define COLOR_MIXER_ORANGE 0xFD26 // #F59C2C
|
#define COLOR_MIXER_ORANGE 0xF4C5 // #F59C2C 伴奏槽位橙
|
||||||
#define COLOR_MIXER_YELLOW 0xFF6E // #F3D939
|
#define COLOR_MIXER_YELLOW 0xF6C7 // #F3D939 导奏槽位黄
|
||||||
#define COLOR_MIXER_GREEN 0x071F // #13E17F
|
#define COLOR_MIXER_GREEN 0x170F // #13E17F 鼓音槽位绿
|
||||||
#define BRED 0XF81F
|
#define BRED 0XF81F
|
||||||
#define GRED 0XFFE0
|
#define GRED 0XFFE0
|
||||||
#define GBLUE 0X07FF
|
#define GBLUE 0X07FF
|
||||||
|
|
@ -87,7 +87,8 @@
|
||||||
#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)
|
#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)
|
||||||
|
|
||||||
|
|
||||||
#define DARKLGRAY 0x5AEB/*0x2988*//*0x1926*//*0x252E*//*0X2B12*/
|
#define DARKLGRAY 0x2968 // #292C42 控件未选中(暗蓝灰,对应规范非焦点背景)
|
||||||
|
#define COLOR_NORMAL_BG DARKLGRAY /* 控件普通状态背景 */
|
||||||
#define BUTTON_COLOR /*0x5AEB*/BLACK
|
#define BUTTON_COLOR /*0x5AEB*/BLACK
|
||||||
|
|
||||||
#define START_COLOR COLOR_GRAD_START
|
#define START_COLOR COLOR_GRAD_START
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ GUI_SWITCH ParamGuiData[] =
|
||||||
|
|
||||||
|
|
||||||
const LEBEL_UI UI_Label[] = {
|
const LEBEL_UI UI_Label[] = {
|
||||||
{5, 115, 30, 60, (const uint8_t*)"\xD2\xC6\xB5\xF7", LCD_ALIGN_CENTER, WHITE,BLACK,11, LCD_ALIGN_CENTER,WHITE,BLACK,11, GUI_TRANSPOSE},
|
{5, 115, 30, 60, (const uint8_t*)"\xD2\xC6\xB5\xF7", LCD_ALIGN_CENTER, WHITE,BLACK,11, LCD_ALIGN_CENTER,WHITE,BLACK,16, GUI_TRANSPOSE},
|
||||||
{125,110, 30, 60, (const uint8_t*)"\xCB\xD9\xB6\xC8", LCD_ALIGN_CENTER, WHITE,BLACK,11, LCD_ALIGN_CENTER,WHITE,BLACK,11, GUI_SPEED},
|
{125,110, 30, 60, (const uint8_t*)"\xCB\xD9\xB6\xC8", LCD_ALIGN_CENTER, WHITE,BLACK,11, LCD_ALIGN_CENTER,WHITE,BLACK,16, GUI_SPEED},
|
||||||
{5, 230, 95, 55, (const uint8_t*)"\xB8\xE8\xC7\xFA\xD1\xA1\xD2\xE9", LCD_ALIGN_LEFT,WHITE,BLACK,11,LCD_ALIGN_CENTER,WHITE,BLACK,13,GUI_MODE_PARAM},
|
{5, 230, 95, 55, (const uint8_t*)"\xB8\xE8\xC7\xFA\xD1\xA1\xD2\xE9", LCD_ALIGN_LEFT,WHITE,BLACK,11,LCD_ALIGN_CENTER,WHITE,BLACK,13,GUI_MODE_PARAM},
|
||||||
{5, 230, 155,55, (const uint8_t*)"\xCF\xD2\xD2\xF4\xC9\xAB\xD1\xA1\xD2\xE9",LCD_ALIGN_LEFT,WHITE,BLACK,11,LCD_ALIGN_CENTER,WHITE,BLACK,13,GUI_TIMBRE_SELECT},
|
{5, 230, 155,55, (const uint8_t*)"\xCF\xD2\xD2\xF4\xC9\xAB\xD1\xA1\xD2\xE9",LCD_ALIGN_LEFT,WHITE,BLACK,11,LCD_ALIGN_CENTER,WHITE,BLACK,13,GUI_TIMBRE_SELECT},
|
||||||
{5, 230, 210,55, (const uint8_t*)"\xD1\xDD\xD7\xE0\xB6\xCE\xC2\xE4",LCD_ALIGN_LEFT,WHITE,BLACK,11,LCD_ALIGN_CENTER,WHITE,BLACK,13,GUI_PLAY_SECTION},
|
{5, 230, 210,55, (const uint8_t*)"\xD1\xDD\xD7\xE0\xB6\xCE\xC2\xE4",LCD_ALIGN_LEFT,WHITE,BLACK,11,LCD_ALIGN_CENTER,WHITE,BLACK,13,GUI_PLAY_SECTION},
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@ void UI_FreeMode_Process(DisplayTaskMessage_Type msg)
|
||||||
{
|
{
|
||||||
//uint8_t last_value = mGuiData[GUI_SPEED].Current;
|
//uint8_t last_value = mGuiData[GUI_SPEED].Current;
|
||||||
mGuiData[GUI_SPEED].Current = msg.ID;
|
mGuiData[GUI_SPEED].Current = msg.ID;
|
||||||
Refresh_Transpose(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
if (!UI_SetFocus(GUI_SPEED))
|
||||||
|
Refresh_Transpose(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
||||||
uint8_t Speed[6] = {0xF0, 0x51, 0x03, 0x00, 0x00, 0xF7};
|
uint8_t Speed[6] = {0xF0, 0x51, 0x03, 0x00, 0x00, 0xF7};
|
||||||
Speed[3] = mGuiData[GUI_SPEED].Current / 128;
|
Speed[3] = mGuiData[GUI_SPEED].Current / 128;
|
||||||
Speed[4] = mGuiData[GUI_SPEED].Current % 128;
|
Speed[4] = mGuiData[GUI_SPEED].Current % 128;
|
||||||
|
|
@ -136,7 +137,8 @@ void UI_FreeMode_Process(DisplayTaskMessage_Type msg)
|
||||||
if(mGuiData[GUI_TRANSPOSE].Current != msg.ID)
|
if(mGuiData[GUI_TRANSPOSE].Current != msg.ID)
|
||||||
{
|
{
|
||||||
mGuiData[GUI_TRANSPOSE].Current = msg.ID;
|
mGuiData[GUI_TRANSPOSE].Current = msg.ID;
|
||||||
Refresh_Transpose(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
if (!UI_SetFocus(GUI_TRANSPOSE))
|
||||||
|
Refresh_Transpose(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
||||||
}
|
}
|
||||||
if(nvm->param.Transpose != mGuiData[GUI_TRANSPOSE].Current)
|
if(nvm->param.Transpose != mGuiData[GUI_TRANSPOSE].Current)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
104
UI/UI_Idle.c
104
UI/UI_Idle.c
|
|
@ -24,76 +24,63 @@ void RGB_Y_TO_G()
|
||||||
#define UI_MODE_TEXT_COLOR 0xFFFF
|
#define UI_MODE_TEXT_COLOR 0xFFFF
|
||||||
#define UI_MODE_FONT_SIZE 16
|
#define UI_MODE_FONT_SIZE 16
|
||||||
|
|
||||||
void UI_DrawModeSelectScreen(void)
|
/* 模式选择页焦点:0=万能 1=普通 2=专业,默认选中万能(与规范一致) */
|
||||||
|
static uint8_t s_mode_select_focus = 0;
|
||||||
|
|
||||||
|
static void UI_DrawModeSelectButton(uint16_t y, const uint8_t *text,
|
||||||
|
const uint8_t *icon, uint8_t focused)
|
||||||
{
|
{
|
||||||
|
|
||||||
// 1. <20><><EFBFBD>䱳<EFBFBD><E4B1B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҡ<EFBFBD><D2A1><EFBFBD>ɫ?????
|
|
||||||
// LCD_FillGradient(0, 0, 240, 320, 0x5AEB, 0x0000);
|
|
||||||
LCD_FillByColor(0, 0, 240, 320, BLACK);
|
|
||||||
|
|
||||||
label_top();
|
|
||||||
|
|
||||||
// 2. <20><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>???=220 ???????=87 Բ???=10 <20><><EFBFBD>ɫ<EFBFBD><C9AB>???????
|
|
||||||
const uint16_t btn_w = 220;
|
const uint16_t btn_w = 220;
|
||||||
const uint16_t btn_h = 87;
|
const uint16_t btn_h = 87;
|
||||||
const uint16_t btn_r = 10;
|
const uint16_t btn_r = 10;
|
||||||
const uint16_t btn_x = (240 - btn_w) / 2; // 10
|
const uint16_t btn_x = (240 - btn_w) / 2;
|
||||||
//const uint16_t btn_color = /*DARKLGRAY*//*0x2988*/BLACK; // <20><><EFBFBD>???????
|
uint16_t text_y = y + (btn_h - UI_MODE_FONT_SIZE) / 2;
|
||||||
|
uint16_t text_x;
|
||||||
|
|
||||||
// 3. <20><><EFBFBD><EFBFBD> 3 ???????<3F><>ť<EFBFBD><C5A5>Y=40<34><30><EFBFBD><EFBFBD>??????? 5<><35><EFBFBD><EFBFBD><EFBFBD>һ???????<3F><>ť<EFBFBD>ײ<EFBFBD><D7B2><EFBFBD><EFBFBD> 9px
|
if (focused)
|
||||||
// <20><>ť Y: 40, 132, 224
|
{
|
||||||
|
LCD_FillRoundRectGradient(btn_x, y, btn_w, btn_h, btn_r,
|
||||||
|
START_COLOR, END_COLOR);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LCD_FillRoundRect(btn_x, y, btn_w, btn_h, btn_r, COLOR_NORMAL_BG);
|
||||||
|
}
|
||||||
|
|
||||||
//LCD_DrawLine(0, 30, 240, 30, btn_color);
|
/* 叠加绘制文字,避免在渐变底上打出实心色块 */
|
||||||
|
text_x = LCD_ShowChinese_AutoAlign(
|
||||||
|
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>Y=40???????
|
|
||||||
//LCD_FillRoundRect(btn_x, 40, btn_w, btn_h, btn_r, btn_color);
|
|
||||||
// LCD_FillRoundRectGradient(btn_x, 40, btn_w, btn_h, btn_r, 0XC618,0x5AEB);
|
|
||||||
LCD_FillRoundRectGradient(btn_x, 40, btn_w, btn_h, btn_r, START_COLOR, END_COLOR);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint16_t x1 = LCD_ShowChinese_AutoAlign_Gradient(
|
|
||||||
btn_x, btn_x + btn_w,
|
btn_x, btn_x + btn_w,
|
||||||
40 + (btn_h - UI_MODE_FONT_SIZE) / 2,
|
text_y,
|
||||||
(uint8_t*)"\xCD\xF2\xC4\xDC\xC4\xA3\xCA\xBD", //<2F><><EFBFBD><EFBFBD>ģʽ
|
text,
|
||||||
LCD_ALIGN_CENTER,
|
LCD_ALIGN_CENTER,
|
||||||
UI_MODE_TEXT_COLOR,
|
UI_MODE_TEXT_COLOR,
|
||||||
START_COLOR, END_COLOR,
|
BLACK,
|
||||||
UI_MODE_FONT_SIZE
|
1,
|
||||||
);
|
UI_MODE_FONT_SIZE
|
||||||
LCD_WR_PIC(x1-45, 40 + (btn_h - UI_MODE_FONT_SIZE) / 2-5,40,30,gImage_FreeMode_Icon_40_30);
|
|
||||||
|
|
||||||
// ר???ģʽ<C4A3><CABD>Y=132???????
|
|
||||||
// LCD_FillRoundRect(btn_x, 132, btn_w, btn_h, btn_r, btn_color);
|
|
||||||
LCD_FillRoundRectGradient(btn_x, 132, btn_w, btn_h, btn_r, START_COLOR, END_COLOR);
|
|
||||||
uint16_t x2 = LCD_ShowChinese_AutoAlign_Gradient(
|
|
||||||
btn_x, btn_x + btn_w,
|
|
||||||
132 + (btn_h - UI_MODE_FONT_SIZE) / 2,
|
|
||||||
(uint8_t *)"\xC6\xD5\xCD\xA8\xC4\xA3\xCA\xBD", // <20><>ͨģʽ
|
|
||||||
LCD_ALIGN_CENTER,
|
|
||||||
UI_MODE_TEXT_COLOR,
|
|
||||||
START_COLOR, END_COLOR,
|
|
||||||
UI_MODE_FONT_SIZE
|
|
||||||
);
|
);
|
||||||
LCD_WR_PIC(x2-45, 132 + (btn_h - UI_MODE_FONT_SIZE) / 2-5,40,30,gImage_NormalMode_Icon_40_30);
|
LCD_WR_PIC_Trans(text_x - 45, text_y - 5, 40, 30, icon, BLACK);
|
||||||
|
}
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>Y=224???????
|
void UI_DrawModeSelectScreen(void)
|
||||||
// LCD_FillRoundRect(btn_x, 224, btn_w, btn_h, btn_r, btn_color);
|
{
|
||||||
LCD_FillRoundRectGradient(btn_x, 224, btn_w, btn_h, btn_r, START_COLOR, END_COLOR);
|
UI_ClearFocus();
|
||||||
uint16_t x3 = LCD_ShowChinese_AutoAlign_Gradient(
|
s_mode_select_focus = 0;
|
||||||
btn_x, btn_x + btn_w,
|
|
||||||
224 + (btn_h - UI_MODE_FONT_SIZE) / 2,
|
|
||||||
(const uint8_t *)"\xD7\xA8\xD2\xB5\xC4\xA3\xCA\xBD", // רҵģʽ
|
|
||||||
LCD_ALIGN_CENTER,
|
|
||||||
UI_MODE_TEXT_COLOR,
|
|
||||||
START_COLOR, END_COLOR,
|
|
||||||
UI_MODE_FONT_SIZE
|
|
||||||
);
|
|
||||||
|
|
||||||
LCD_WR_PIC(x3-45, 224 + (btn_h - UI_MODE_FONT_SIZE) / 2-5,40,30,gImage_ExpressMode_Icon_40_30);
|
LCD_FillByColor(0, 0, 240, 320, BLACK);
|
||||||
|
label_top();
|
||||||
|
|
||||||
|
UI_DrawModeSelectButton(40,
|
||||||
|
(const uint8_t *)"\xCD\xF2\xC4\xDC\xC4\xA3\xCA\xBD",
|
||||||
|
gImage_FreeMode_Icon_40_30,
|
||||||
|
s_mode_select_focus == 0);
|
||||||
|
UI_DrawModeSelectButton(132,
|
||||||
|
(const uint8_t *)"\xC6\xD5\xCD\xA8\xC4\xA3\xCA\xBD",
|
||||||
|
gImage_NormalMode_Icon_40_30,
|
||||||
|
s_mode_select_focus == 1);
|
||||||
|
UI_DrawModeSelectButton(224,
|
||||||
|
(const uint8_t *)"\xD7\xA8\xD2\xB5\xC4\xA3\xCA\xBD",
|
||||||
|
gImage_ExpressMode_Icon_40_30,
|
||||||
|
s_mode_select_focus == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Touch_AreaTypeDef Touch_ModeSelect_Areas[] = {
|
const Touch_AreaTypeDef Touch_ModeSelect_Areas[] = {
|
||||||
|
|
@ -144,6 +131,7 @@ void LoadConfig()
|
||||||
void Touch_Mode_Select_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex)
|
void Touch_Mode_Select_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex)
|
||||||
{
|
{
|
||||||
StartTask();
|
StartTask();
|
||||||
|
s_mode_select_focus = (uint8_t)FLAG;
|
||||||
mGuiData[GUI_TAB_INDEX].Current = ID;
|
mGuiData[GUI_TAB_INDEX].Current = ID;
|
||||||
InModeFlag = true;
|
InModeFlag = true;
|
||||||
// <20>ٽ<EFBFBD><D9BD><EFBFBD><EFBFBD>ٽ<EFBFBD><D9BD><EFBFBD>
|
// <20>ٽ<EFBFBD><D9BD><EFBFBD><EFBFBD>ٽ<EFBFBD><D9BD><EFBFBD>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
extern const Touch_AreaTypeDef *pCurrentTouch_Area;
|
extern const Touch_AreaTypeDef *pCurrentTouch_Area;
|
||||||
|
static int8_t s_mixer_focus = -1;
|
||||||
// ==================== <20><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> ====================
|
// ==================== <20><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> ====================
|
||||||
#define BTN_Y 275 // <20><>ť<EFBFBD><C5A5>ʼY
|
#define BTN_Y 275 // <20><>ť<EFBFBD><C5A5>ʼY
|
||||||
#define BTN_H 40 // <20><>ť<EFBFBD>߶<EFBFBD>
|
#define BTN_H 40 // <20><>ť<EFBFBD>߶<EFBFBD>
|
||||||
|
|
@ -125,10 +126,11 @@ static void DrawFaderGrooveAt(Fader_t *f, uint16_t y_start, uint16_t y_end)
|
||||||
static void DrawFaderSlider(Fader_t *f, uint16_t slider_y)
|
static void DrawFaderSlider(Fader_t *f, uint16_t slider_y)
|
||||||
{
|
{
|
||||||
uint16_t x = f->x, w = f->w, slider_h = 20;
|
uint16_t x = f->x, w = f->w, slider_h = 20;
|
||||||
|
uint16_t bg = (s_mixer_focus == (int8_t)f->id) ? COLOR_PRIMARY : COLOR_NORMAL_BG;
|
||||||
char buf[8];
|
char buf[8];
|
||||||
LCD_FillRoundRect(x+5, slider_y, w-10, slider_h, 5, COLOR_PRIMARY);
|
LCD_FillRoundRect(x+5, slider_y, w-10, slider_h, 5, bg);
|
||||||
sprintf(buf, "%d", f->val);
|
sprintf(buf, "%d", f->val);
|
||||||
LCD_ShowString_AutoAlign(x, x + w, slider_y, (uint8_t*)buf, LCD_ALIGN_CENTER, FADER_TEXT, COLOR_PRIMARY, 0, 15);
|
LCD_ShowString_AutoAlign(x, x + w, slider_y, (uint8_t*)buf, LCD_ALIGN_CENTER, FADER_TEXT, bg, 0, 15);
|
||||||
}
|
}
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// 完整重绘滑块(槽背景 + 刻度线 + 滑块)
|
// 完整重绘滑块(槽背景 + 刻度线 + 滑块)
|
||||||
|
|
@ -157,6 +159,13 @@ void UpdateFaderByTouch(int idx, uint16_t y)
|
||||||
uint8_t STR_val;
|
uint8_t STR_val;
|
||||||
if (idx < 0 || idx > 3) return;
|
if (idx < 0 || idx > 3) return;
|
||||||
Fader_t *f = &faders[idx];
|
Fader_t *f = &faders[idx];
|
||||||
|
if (s_mixer_focus != (int8_t)idx)
|
||||||
|
{
|
||||||
|
int8_t prev = s_mixer_focus;
|
||||||
|
s_mixer_focus = (int8_t)idx;
|
||||||
|
if (prev >= 0 && prev <= 3)
|
||||||
|
DrawFaderSlider(&faders[prev], faders[prev].prev_slider_y);
|
||||||
|
}
|
||||||
uint16_t y_min = f->y;
|
uint16_t y_min = f->y;
|
||||||
uint16_t y_max = f->y + f->h;
|
uint16_t y_max = f->y + f->h;
|
||||||
if (y < y_min + 8) { // 闈犺繎椤堕儴 鈫?鐩存帴10
|
if (y < y_min + 8) { // 闈犺繎椤堕儴 鈫?鐩存帴10
|
||||||
|
|
@ -173,6 +182,7 @@ void UpdateFaderByTouch(int idx, uint16_t y)
|
||||||
f->val = val_raw;
|
f->val = val_raw;
|
||||||
}
|
}
|
||||||
UpdateFaderSlider(f);
|
UpdateFaderSlider(f);
|
||||||
|
DrawFaderSlider(f, f->prev_slider_y);
|
||||||
// 闊抽噺杈撳嚭
|
// 闊抽噺杈撳嚭
|
||||||
switch(idx) {
|
switch(idx) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -270,6 +280,8 @@ int CheckTouchFader(uint16_t x, uint16_t y)
|
||||||
// ==================== <20><>ʼ<EFBFBD><CABC> ====================
|
// ==================== <20><>ʼ<EFBFBD><CABC> ====================
|
||||||
void UI_Mixer_Init(void)
|
void UI_Mixer_Init(void)
|
||||||
{
|
{
|
||||||
|
s_mixer_focus = -1;
|
||||||
|
UI_ClearFocus();
|
||||||
// LCD_WR_REG(0x28); // Display OFF
|
// LCD_WR_REG(0x28); // Display OFF
|
||||||
UI_DrawTop_TiaoYinTai();
|
UI_DrawTop_TiaoYinTai();
|
||||||
DrawAllFaders();
|
DrawAllFaders();
|
||||||
|
|
|
||||||
|
|
@ -184,12 +184,14 @@ void Touch_SystemSettingAction(int8_t FLAG, uint8_t ID, uint8_t areaIndex, uint8
|
||||||
{
|
{
|
||||||
case GUI_BLUETOOTH_SW:
|
case GUI_BLUETOOTH_SW:
|
||||||
GUI_Item_AjustValue(&mGuiData_SystemSETTING[ID], FLAG);
|
GUI_Item_AjustValue(&mGuiData_SystemSETTING[ID], FLAG);
|
||||||
RefreshSystemSetting(last_value, &SystemSetting[ID], &mGuiData_SystemSETTING[ID]);
|
if (!UI_SetFocus(ID))
|
||||||
|
RefreshSystemSetting(last_value, &SystemSetting[ID], &mGuiData_SystemSETTING[ID]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUI_AUTOCLOSE:
|
case GUI_AUTOCLOSE:
|
||||||
GUI_Item_AjustLoopValue(&mGuiData_SystemSETTING[ID], FLAG);
|
GUI_Item_AjustLoopValue(&mGuiData_SystemSETTING[ID], FLAG);
|
||||||
RefreshSystemSetting(last_value, &SystemSetting[ID], &mGuiData_SystemSETTING[ID]);
|
if (!UI_SetFocus(ID))
|
||||||
|
RefreshSystemSetting(last_value, &SystemSetting[ID], &mGuiData_SystemSETTING[ID]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUI_RESTORE:
|
case GUI_RESTORE:
|
||||||
|
|
@ -202,6 +204,7 @@ void Touch_SystemSettingAction(int8_t FLAG, uint8_t ID, uint8_t areaIndex, uint8
|
||||||
|
|
||||||
void UI_Setting_Init(void)
|
void UI_Setting_Init(void)
|
||||||
{
|
{
|
||||||
|
UI_ClearFocus();
|
||||||
// LCD_WR_REG(0x28); // Display OFF
|
// LCD_WR_REG(0x28); // Display OFF
|
||||||
UI_DrawTop_SystemSetting();
|
UI_DrawTop_SystemSetting();
|
||||||
DrawSystemSetting();
|
DrawSystemSetting();
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
|
|
||||||
extern GUI_SWITCH mGuiData_SystemSETTING[];
|
extern GUI_SWITCH mGuiData_SystemSETTING[];
|
||||||
|
extern LEBEL_UI SystemSetting[];
|
||||||
|
|
||||||
|
|
||||||
void UI_DrawTop_TiaoYinTai(void);
|
void UI_DrawTop_TiaoYinTai(void);
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ void Draw_Tab_Mode_Menu(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
||||||
const uint16_t text_y = UI->y + 2; // 鏂囧<E98F82>????Y
|
const uint16_t text_y = UI->y + 2; // 鏂囧<E98F82>????Y
|
||||||
|
|
||||||
// ===================== 棰滆壊瀹氫<E780B9>???? =====================
|
// ===================== 棰滆壊瀹氫<E780B9>???? =====================
|
||||||
uint16_t color_sel_bg = COLOR_PRIMARY; // 选中背景
|
uint16_t color_sel_bg = UI_IsFocused(GUI_MODE_PARAM) ? COLOR_PRIMARY : COLOR_NORMAL_BG;
|
||||||
uint16_t color_unsel_bg = DARKLGRAY; // 鏈<E98F88>????変腑鑳屾<E991B3>????
|
uint16_t color_unsel_bg = COLOR_NORMAL_BG;
|
||||||
uint16_t color_text = UI->Text_fc; // 鏂囧瓧棰滆<E6A3B0>??
|
uint16_t color_text = UI->Text_fc; // 鏂囧瓧棰滆<E6A3B0>??
|
||||||
|
|
||||||
// 鏄剧ず锛氳嚜鍔ㄤ即濂忓紑 / <20>?????
|
// 鏄剧ず锛氳嚜鍔ㄤ即濂忓紑 / <20>?????
|
||||||
|
|
@ -104,9 +104,8 @@ void Draw_Tab_Mode_Menu(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
||||||
|
|
||||||
void Show_home_UI(void)
|
void Show_home_UI(void)
|
||||||
{
|
{
|
||||||
//LCD_BLK_Clr();
|
UI_ClearFocus();
|
||||||
//LCD_WR_REG(0x28); // Display OFF:关<EFBC9A>?<3F>?描,隐藏后续绘制过程
|
LCD_FillByColor(0,0,240,320,BLACK);
|
||||||
LCD_FillByColor(0,0,240,320,BLACK); // 刷背<E588B7>?
|
|
||||||
label_top();
|
label_top();
|
||||||
label_Tranzpose_ui(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
label_Tranzpose_ui(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
||||||
label_Speed_ui(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
label_Speed_ui(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
||||||
|
|
@ -133,7 +132,8 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
last_value = mGuiData[ID].Current;
|
last_value = mGuiData[ID].Current;
|
||||||
GUI_Item_AjustLoopValue(&mGuiData[ID], FLAG);
|
GUI_Item_AjustLoopValue(&mGuiData[ID], FLAG);
|
||||||
|
|
||||||
Refresh_Transpose(&UI_Label[ID], &mGuiData[ID]);
|
if (!UI_SetFocus(GUI_TRANSPOSE))
|
||||||
|
Refresh_Transpose(&UI_Label[ID], &mGuiData[ID]);
|
||||||
// label_Tranzpose_ui(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
// label_Tranzpose_ui(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
||||||
if(nvm->param.Transpose != mGuiData[ID].Current)
|
if(nvm->param.Transpose != mGuiData[ID].Current)
|
||||||
{
|
{
|
||||||
|
|
@ -188,7 +188,8 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
last_value = mGuiData[ID].Current;
|
last_value = mGuiData[ID].Current;
|
||||||
GUI_Item_AjustValue(&mGuiData[ID], FLAG);
|
GUI_Item_AjustValue(&mGuiData[ID], FLAG);
|
||||||
|
|
||||||
Refresh_Transpose(&UI_Label[ID], &mGuiData[ID]);
|
if (!UI_SetFocus(GUI_SPEED))
|
||||||
|
Refresh_Transpose(&UI_Label[ID], &mGuiData[ID]);
|
||||||
|
|
||||||
Speed[3] = mGuiData[ID].Current / 128;
|
Speed[3] = mGuiData[ID].Current / 128;
|
||||||
Speed[4] = mGuiData[ID].Current % 128;
|
Speed[4] = mGuiData[ID].Current % 128;
|
||||||
|
|
@ -222,6 +223,8 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
}
|
}
|
||||||
last_value = pCurData->Current;
|
last_value = pCurData->Current;
|
||||||
GUI_Item_AjustLoopValue(pCurData, FLAG);
|
GUI_Item_AjustLoopValue(pCurData, FLAG);
|
||||||
|
if (!UI_SetFocus(GUI_MODE_PARAM))
|
||||||
|
show_Param(&UI_Label[GUI_MODE_PARAM], pCurData);
|
||||||
switch(mGuiData[GUI_TAB_INDEX].Current)
|
switch(mGuiData[GUI_TAB_INDEX].Current)
|
||||||
{
|
{
|
||||||
case 0: case 1:
|
case 0: case 1:
|
||||||
|
|
@ -245,13 +248,12 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
break; // 涓撳<E6B693>????
|
break; // 涓撳<E6B693>????
|
||||||
case 2: nvm->param.Param3 = ParamGuiData[ALL_MODE_PARAM].Current; break; // 涓囪<E6B693>????
|
case 2: nvm->param.Param3 = ParamGuiData[ALL_MODE_PARAM].Current; break; // 涓囪<E6B693>????
|
||||||
}
|
}
|
||||||
show_Param(&UI_Label[GUI_MODE_PARAM], pCurData);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GUI_TIMBRE_SELECT:
|
case GUI_TIMBRE_SELECT:
|
||||||
last_value = mGuiData[ID].Current;
|
last_value = mGuiData[ID].Current;
|
||||||
GUI_Item_AjustLoopValue(&mGuiData[ID], FLAG);
|
GUI_Item_AjustLoopValue(&mGuiData[ID], FLAG);
|
||||||
|
UI_SetFocus(GUI_TIMBRE_SELECT);
|
||||||
Refresh_StringTimbre(last_value, &UI_Label[ID], &mGuiData[ID]);
|
Refresh_StringTimbre(last_value, &UI_Label[ID], &mGuiData[ID]);
|
||||||
|
|
||||||
uint8_t ReturnTimbre[8] = {0xF0,0x60,0x03,0x05,0x00,0x00,0x00,0xF7};
|
uint8_t ReturnTimbre[8] = {0xF0,0x60,0x03,0x05,0x00,0x00,0x00,0xF7};
|
||||||
|
|
@ -277,7 +279,8 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
{
|
{
|
||||||
ADDRESS = 0x00000000;
|
ADDRESS = 0x00000000;
|
||||||
}
|
}
|
||||||
label_ModeSelece_ui(&UI_Label[GUI_MODE_PARAM],&mGuiData[GUI_MODE_PARAM]);
|
if (!UI_SetFocus(GUI_MODE_PARAM))
|
||||||
|
label_ModeSelece_ui(&UI_Label[GUI_MODE_PARAM],&mGuiData[GUI_MODE_PARAM]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(ID==GUI_PLAY_SECTION)
|
else if(ID==GUI_PLAY_SECTION)
|
||||||
|
|
@ -291,7 +294,8 @@ void Touch_Action(int8_t FLAG, uint8_t ID, uint8_t areaIndex,uint8_t value)
|
||||||
AutoBandTop1_FillinWithIndex(value);
|
AutoBandTop1_FillinWithIndex(value);
|
||||||
AutoBandTop1_Start();
|
AutoBandTop1_Start();
|
||||||
}
|
}
|
||||||
Refresh_SectionSelect(last_value, &UI_Label[ID], &mGuiData[ID]);
|
if (!UI_SetFocus(GUI_PLAY_SECTION))
|
||||||
|
Refresh_SectionSelect(last_value, &UI_Label[ID], &mGuiData[ID]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(ID==GUI_TAB_INDEX)
|
else if(ID==GUI_TAB_INDEX)
|
||||||
|
|
@ -397,7 +401,8 @@ void UI_SongMode_Process(DisplayTaskMessage_Type msg)
|
||||||
case MSG_ID_TAP_SPEED:
|
case MSG_ID_TAP_SPEED:
|
||||||
//last_value = mGuiData[GUI_SPEED].Current;
|
//last_value = mGuiData[GUI_SPEED].Current;
|
||||||
mGuiData[GUI_SPEED].Current = msg.ID;
|
mGuiData[GUI_SPEED].Current = msg.ID;
|
||||||
Refresh_Transpose(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
if (!UI_SetFocus(GUI_SPEED))
|
||||||
|
Refresh_Transpose(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
||||||
AutoBandTop1_ChangeBPM(mGuiData[GUI_SPEED].Current);
|
AutoBandTop1_ChangeBPM(mGuiData[GUI_SPEED].Current);
|
||||||
if(nvm->param.BPM != mGuiData[GUI_SPEED].Current)
|
if(nvm->param.BPM != mGuiData[GUI_SPEED].Current)
|
||||||
{
|
{
|
||||||
|
|
@ -476,7 +481,8 @@ void UI_SongMode_Process(DisplayTaskMessage_Type msg)
|
||||||
if(mGuiData[GUI_TRANSPOSE].Current != msg.ID)
|
if(mGuiData[GUI_TRANSPOSE].Current != msg.ID)
|
||||||
{
|
{
|
||||||
mGuiData[GUI_TRANSPOSE].Current = msg.ID;
|
mGuiData[GUI_TRANSPOSE].Current = msg.ID;
|
||||||
Refresh_Transpose(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
if (!UI_SetFocus(GUI_TRANSPOSE))
|
||||||
|
Refresh_Transpose(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nvm->param.Transpose != mGuiData[GUI_TRANSPOSE].Current)
|
if(nvm->param.Transpose != mGuiData[GUI_TRANSPOSE].Current)
|
||||||
|
|
|
||||||
|
|
@ -200,55 +200,47 @@ void UI_DrawSysModeSelectScreen(void)
|
||||||
const uint16_t btn_h = 87;
|
const uint16_t btn_h = 87;
|
||||||
const uint16_t btn_r = 10;
|
const uint16_t btn_r = 10;
|
||||||
const uint16_t btn_x = (240 - btn_w) / 2; // 10
|
const uint16_t btn_x = (240 - btn_w) / 2; // 10
|
||||||
const uint16_t btn_color = /*DARKLGRAY*//*0x2988*/BLACK; // 深灰<E6B7B1>?????
|
const uint16_t btn_color = COLOR_NORMAL_BG;
|
||||||
|
|
||||||
// 3. 排列 3 <20>?????按钮:Y=40,间<EFBC8C>????? 5,最后一<E5908E>?????按钮底部距底 9px
|
|
||||||
// 按钮 Y: 40, 132, 224
|
|
||||||
|
|
||||||
LCD_DrawLine(0, 30, 240, 30, btn_color);
|
LCD_DrawLine(0, 30, 240, 30, btn_color);
|
||||||
|
|
||||||
|
LCD_FillRoundRect(btn_x, 40+20, btn_w, btn_h, btn_r, btn_color);
|
||||||
|
|
||||||
// 调音台(Y=40+20
|
|
||||||
// LCD_FillRoundRect(btn_x, 40+20, btn_w, btn_h, btn_r, btn_color);
|
|
||||||
LCD_FillRoundRectGradient(btn_x, 40+20, btn_w, btn_h, btn_r, START_COLOR, END_COLOR);
|
|
||||||
|
|
||||||
LCD_DrawChevron_Right(200, 105, 15, 3, WHITE);
|
LCD_DrawChevron_Right(200, 105, 15, 3, WHITE);
|
||||||
|
|
||||||
uint16_t x1 = LCD_ShowChinese_AutoAlign_Gradient(
|
uint16_t x1 = LCD_ShowChinese_AutoAlign(
|
||||||
btn_x, btn_x + btn_w,
|
btn_x, btn_x + btn_w,
|
||||||
40 + (btn_h - 24) / 2+20,
|
40 + (btn_h - 24) / 2+20,
|
||||||
(uint8_t*)"\xB5\xF7\xD2\xF4\xCC\xA8",
|
(uint8_t*)"\xB5\xF7\xD2\xF4\xCC\xA8",
|
||||||
LCD_ALIGN_CENTER,
|
LCD_ALIGN_CENTER,
|
||||||
UI_SET_MODE_TEXT_COLOR,
|
UI_SET_MODE_TEXT_COLOR,
|
||||||
START_COLOR, END_COLOR,
|
btn_color,
|
||||||
|
0,
|
||||||
24
|
24
|
||||||
);
|
);
|
||||||
LCD_WR_PIC(x1-45, 40 + (btn_h - 24) / 2+10,40,40,gImage_mixer);
|
LCD_WR_PIC_Trans(x1-45, 40 + (btn_h - 24) / 2+10,40,40,gImage_mixer, BLACK);
|
||||||
|
|
||||||
// 系统设置(Y=132+20
|
LCD_FillRoundRect(btn_x, 132+20, btn_w, btn_h, btn_r, btn_color);
|
||||||
// LCD_FillRoundRect(btn_x, 132+20, btn_w, btn_h, btn_r, btn_color);
|
|
||||||
LCD_FillRoundRectGradient(btn_x, 132+20, btn_w, btn_h, btn_r, START_COLOR, END_COLOR);
|
|
||||||
|
|
||||||
|
|
||||||
LCD_DrawChevron_Right(200, 195, 15, 3, WHITE);
|
LCD_DrawChevron_Right(200, 195, 15, 3, WHITE);
|
||||||
uint8_t x2 = LCD_ShowChinese_AutoAlign_Gradient(
|
uint8_t x2 = LCD_ShowChinese_AutoAlign(
|
||||||
btn_x, btn_x + btn_w,
|
btn_x, btn_x + btn_w,
|
||||||
132 + (btn_h - 24) / 2+20,
|
132 + (btn_h - 24) / 2+20,
|
||||||
(uint8_t*)"\xCF\xB5\xCD\xB3\xC9\xE8\xD6\xC3",
|
(uint8_t*)"\xCF\xB5\xCD\xB3\xC9\xE8\xD6\xC3",
|
||||||
LCD_ALIGN_CENTER,
|
LCD_ALIGN_CENTER,
|
||||||
UI_SET_MODE_TEXT_COLOR,
|
UI_SET_MODE_TEXT_COLOR,
|
||||||
START_COLOR, END_COLOR,
|
btn_color,
|
||||||
|
0,
|
||||||
24
|
24
|
||||||
);
|
);
|
||||||
|
|
||||||
LCD_WR_PIC(x2-45, 132 + (btn_h - 24) / 2+10,40,40,gImage_SystemSetting);
|
LCD_WR_PIC_Trans(x2-45, 132 + (btn_h - 24) / 2+10,40,40,gImage_SystemSetting, BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_SystemSet_Init(void)
|
void UI_SystemSet_Init(void)
|
||||||
{
|
{
|
||||||
|
UI_ClearFocus();
|
||||||
// LCD_WR_REG(0x28); // Display OFF
|
// LCD_WR_REG(0x28); // Display OFF
|
||||||
pCurrentTouch_Area = Touch_SetingSelect_Areas;
|
pCurrentTouch_Area = Touch_SetingSelect_Areas;
|
||||||
UI_DrawSysModeSelectScreen();
|
UI_DrawSysModeSelectScreen();
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ typedef enum {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void UI_DrawSysModeSelectScreen(void);
|
||||||
void UI_SystemSet_Init(void);
|
void UI_SystemSet_Init(void);
|
||||||
void UI_SystemSet_Process(DisplayTaskMessage_Type msg);
|
void UI_SystemSet_Process(DisplayTaskMessage_Type msg);
|
||||||
|
|
||||||
|
|
|
||||||
423
UI/UI_global.c
423
UI/UI_global.c
|
|
@ -72,7 +72,85 @@ void CallUI_RestoreSelect(void) {
|
||||||
UI_Restore_Select_Init();
|
UI_Restore_Select_Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint8_t s_ui_focus_id = UI_FOCUS_NONE;
|
||||||
|
|
||||||
|
static uint8_t UI_NormalizeFocusId(uint8_t widget_id)
|
||||||
|
{
|
||||||
|
if (widget_id == GUI_AUTOBAND_SW)
|
||||||
|
return GUI_MODE_PARAM;
|
||||||
|
return widget_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void UI_RedrawWidget(uint8_t id)
|
||||||
|
{
|
||||||
|
if (CurrUIProcress == UI_SongMode_Process)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case GUI_TRANSPOSE:
|
||||||
|
label_Tranzpose_ui(&UI_Label[GUI_TRANSPOSE], &mGuiData[GUI_TRANSPOSE]);
|
||||||
|
break;
|
||||||
|
case GUI_SPEED:
|
||||||
|
label_Speed_ui(&UI_Label[GUI_SPEED], &mGuiData[GUI_SPEED]);
|
||||||
|
break;
|
||||||
|
case GUI_MODE_PARAM:
|
||||||
|
label_ModeSelece_ui(&UI_Label[GUI_MODE_PARAM], &mGuiData[GUI_MODE_PARAM]);
|
||||||
|
break;
|
||||||
|
case GUI_TIMBRE_SELECT:
|
||||||
|
label_TimbreSelece_ui(&UI_Label[GUI_TIMBRE_SELECT], &mGuiData[GUI_TIMBRE_SELECT]);
|
||||||
|
break;
|
||||||
|
case GUI_PLAY_SECTION:
|
||||||
|
label_PlaySection_ui(&UI_Label[GUI_PLAY_SECTION], &mGuiData[GUI_PLAY_SECTION]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (CurrUIProcress == UI_Setting_Process)
|
||||||
|
{
|
||||||
|
if (id <= GUI_RESTORE)
|
||||||
|
Draw_System_Item_List(&SystemSetting[id], &mGuiData_SystemSETTING[id]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UI_ClearFocus(void)
|
||||||
|
{
|
||||||
|
s_ui_focus_id = UI_FOCUS_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t UI_IsFocused(uint8_t widget_id)
|
||||||
|
{
|
||||||
|
return (s_ui_focus_id == UI_NormalizeFocusId(widget_id)) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UI_GetFocusGrad(uint8_t widget_id, uint16_t *c_top, uint16_t *c_bot)
|
||||||
|
{
|
||||||
|
if (UI_IsFocused(widget_id))
|
||||||
|
{
|
||||||
|
*c_top = START_COLOR;
|
||||||
|
*c_bot = END_COLOR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*c_top = COLOR_NORMAL_BG;
|
||||||
|
*c_bot = COLOR_NORMAL_BG;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t UI_SetFocus(uint8_t widget_id)
|
||||||
|
{
|
||||||
|
uint8_t prev = s_ui_focus_id;
|
||||||
|
widget_id = UI_NormalizeFocusId(widget_id);
|
||||||
|
if (prev == widget_id)
|
||||||
|
return 0;
|
||||||
|
s_ui_focus_id = widget_id;
|
||||||
|
if (prev != UI_FOCUS_NONE)
|
||||||
|
UI_RedrawWidget(prev);
|
||||||
|
if (widget_id != UI_FOCUS_NONE)
|
||||||
|
UI_RedrawWidget(widget_id);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void label_top()
|
void label_top()
|
||||||
{
|
{
|
||||||
const uint16_t btn_color = /*DARKLGRAY*/0x2988; // 深灰<E6B7B1>?????
|
const uint16_t btn_color = /*DARKLGRAY*/0x2988; // 深灰<E6B7B1>?????
|
||||||
|
|
@ -144,13 +222,16 @@ void show_Param(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
||||||
char NumBuf[8] = {0};
|
char NumBuf[8] = {0};
|
||||||
uint16_t text_y = UI->y + 25+5+5;
|
uint16_t text_y = UI->y + 25+5+5;
|
||||||
uint8_t idx = Group->Current + 1;
|
uint8_t idx = Group->Current + 1;
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
|
||||||
|
UI_GetFocusGrad(GUI_MODE_PARAM, &c_top, &c_bot);
|
||||||
|
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x+25, UI->y+20+5,
|
UI->x+25, UI->y+20+5,
|
||||||
UI->x + UI->w-40-(UI->x+25),
|
UI->x + UI->w-40-(UI->x+25),
|
||||||
UI->h-20,
|
UI->h-20,
|
||||||
0,
|
0,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
|
|
||||||
// 拼接序号 1. 2. 3.
|
// 拼接序号 1. 2. 3.
|
||||||
|
|
@ -195,26 +276,28 @@ void show_Param(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
||||||
|
|
||||||
void Refresh_Transpose(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
void Refresh_Transpose(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
||||||
{
|
{
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(UI->Id, &c_top, &c_bot);
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x+30,
|
UI->x+30,
|
||||||
UI->y + 20,
|
UI->y + 20,
|
||||||
25 + 10+10+5,
|
25 + 10+10+5,
|
||||||
20,
|
20,
|
||||||
0,
|
0,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
char Textstr1[20] = {0,};
|
char Textstr1[20] = {0,};
|
||||||
GET_Num_Str(Group->Current,0,Textstr1,Group->Id);
|
GET_Num_Str(Group->Current,0,Textstr1,Group->Id);
|
||||||
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
LCD_ShowString_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<EFBFBD>?
|
UI->x, // 坐标
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y + 17,
|
UI->y + 17,
|
||||||
(const uint8_t*)Textstr1,
|
(const uint8_t*)Textstr1,
|
||||||
UI->Text_Align,
|
UI->Text_Align,
|
||||||
UI->Text_fc,
|
UI->Text_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
UI->Text_size
|
UI->Text_size
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -222,13 +305,15 @@ void Refresh_Transpose(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
||||||
|
|
||||||
void Refresh_StringTimbre(uint8_t last_data,const LEBEL_UI *UI, GUI_SWITCH * Group)
|
void Refresh_StringTimbre(uint8_t last_data,const LEBEL_UI *UI, GUI_SWITCH * Group)
|
||||||
{
|
{
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(UI->Id, &c_top, &c_bot);
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x + 40,
|
UI->x + 40,
|
||||||
UI->y + 25,
|
UI->y + 25,
|
||||||
UI->x + UI->w - 40 - (UI->x + 40),
|
UI->x + UI->w - 40 - (UI->x + 40),
|
||||||
UI->y + 25 + UI->Text_size + 5 -(UI->y + 25),
|
UI->y + 25 + UI->Text_size + 5 -(UI->y + 25),
|
||||||
0,
|
0,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
char Textstr1[20] = {0,};
|
char Textstr1[20] = {0,};
|
||||||
char NumBuf[8] = {0};
|
char NumBuf[8] = {0};
|
||||||
|
|
@ -316,106 +401,103 @@ void Refresh_Mode1Select(uint8_t last_data, LEBEL_UI *UI, GUI_SWITCH *Group)
|
||||||
void label_Tranzpose_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
void label_Tranzpose_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
||||||
{
|
{
|
||||||
uint8_t Textstr[20] = {0};
|
uint8_t Textstr[20] = {0};
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(UI->Id, &c_top, &c_bot);
|
||||||
|
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x,
|
UI->x,
|
||||||
UI->y,
|
UI->y,
|
||||||
UI->w, // 小写 w
|
UI->w,
|
||||||
UI->h,
|
UI->h,
|
||||||
10,
|
10,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR
|
c_bot
|
||||||
);
|
);
|
||||||
// 显示<E698BE>?<3F>?
|
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(
|
LCD_ShowChinese_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<E59D90>?
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y+5,
|
UI->y+5,
|
||||||
UI->p,
|
UI->p,
|
||||||
UI->Tab_Align,
|
UI->Tab_Align,
|
||||||
UI->Tab_fc,
|
UI->Tab_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
// UI->Tab_size
|
UI->Tab_size
|
||||||
12
|
|
||||||
);
|
);
|
||||||
LCD_DrawArrow_Left(UI->x+10+5+5, UI->y+UI->h-20, 12, WHITE, BUTTON_COLOR);
|
LCD_DrawArrow_Left(UI->x+10+5+5, UI->y+UI->h-20, 12, WHITE, c_top);
|
||||||
LCD_DrawArrow_Right(UI->x+UI->w+10-25-5, UI->y+UI->h-20, 12, WHITE, BUTTON_COLOR);
|
LCD_DrawArrow_Right(UI->x+UI->w+10-25-5, UI->y+UI->h-20, 12, WHITE, c_top);
|
||||||
// 获取数字字<E5AD97>?<3F>串
|
|
||||||
GET_Num_Str(mGuiData[UI->Id].Current, 0, (char*)Textstr, UI->Id);
|
GET_Num_Str(mGuiData[UI->Id].Current, 0, (char*)Textstr, UI->Id);
|
||||||
// 显示文本
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
LCD_ShowString_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<E59D90>?
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y + 17,
|
UI->y + 17,
|
||||||
Textstr,
|
Textstr,
|
||||||
UI->Text_Align,
|
UI->Text_Align,
|
||||||
UI->Text_fc,
|
UI->Text_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
UI->Text_size
|
UI->Text_size
|
||||||
);
|
);
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
LCD_ShowString_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<E59D90>?
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y + 17+25,
|
UI->y + 17+25,
|
||||||
(const uint8_t*)"KEY",
|
(const uint8_t*)"KEY",
|
||||||
UI->Text_Align,
|
UI->Text_Align,
|
||||||
UI->Text_fc,
|
UI->Text_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
16
|
12
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
void label_Speed_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
void label_Speed_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
||||||
{
|
{
|
||||||
uint8_t Textstr[20] = {0};
|
uint8_t Textstr[20] = {0};
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(UI->Id, &c_top, &c_bot);
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x,
|
UI->x,
|
||||||
UI->y,
|
UI->y,
|
||||||
UI->w, // 小写 w
|
UI->w,
|
||||||
UI->h,
|
UI->h,
|
||||||
10,
|
10,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
// 显示<E698BE>?<3F>?
|
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(
|
LCD_ShowChinese_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<E59D90>?
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y+5,
|
UI->y+5,
|
||||||
UI->p,
|
UI->p,
|
||||||
UI->Tab_Align,
|
UI->Tab_Align,
|
||||||
UI->Tab_fc,
|
UI->Tab_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
UI->Tab_size
|
UI->Tab_size
|
||||||
);
|
);
|
||||||
LCD_DrawMinus_RoundBox(UI->x+10+5+5, UI->y+UI->h-20, 30,5, WHITE, BLACK);
|
LCD_DrawMinus_RoundBox(UI->x+10+5+5, UI->y+UI->h-20, 30,5, WHITE, c_top);
|
||||||
LCD_DrawPlus_RoundBox(UI->x+UI->w+10-25-5, UI->y+UI->h-20, 30,5, WHITE, BLACK);
|
LCD_DrawPlus_RoundBox(UI->x+UI->w+10-25-5, UI->y+UI->h-20, 30,5, WHITE, c_top);
|
||||||
// 获取数字字<E5AD97>?<3F>串
|
|
||||||
GET_Num_Str(mGuiData[UI->Id].Current, 0, (char*)Textstr, UI->Id);
|
GET_Num_Str(mGuiData[UI->Id].Current, 0, (char*)Textstr, UI->Id);
|
||||||
// 显示文本
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
LCD_ShowString_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<E59D90>?
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y + 17,
|
UI->y + 17,
|
||||||
Textstr,
|
Textstr,
|
||||||
UI->Text_Align,
|
UI->Text_Align,
|
||||||
UI->Text_fc,
|
UI->Text_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
UI->Text_size
|
UI->Text_size
|
||||||
);
|
);
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
LCD_ShowString_AutoAlign_Gradient(
|
||||||
UI->x, // 坐标<E59D90>?
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y + 17+25,
|
UI->y + 17+25,
|
||||||
(const uint8_t*)"BPM",
|
(const uint8_t*)"BPM",
|
||||||
UI->Text_Align,
|
UI->Text_Align,
|
||||||
UI->Text_fc,
|
UI->Text_fc,
|
||||||
START_COLOR,
|
c_top,
|
||||||
END_COLOR,
|
c_bot,
|
||||||
16
|
12
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// <20><EFBFBD><DEB8>棺ȥ<E6A3BA><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>autobandֵ<64><D6B5>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>ʾ
|
// <20><EFBFBD><DEB8>棺ȥ<E6A3BA><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>autobandֵ<64><D6B5>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>ʾ
|
||||||
|
|
@ -423,22 +505,24 @@ void label_ModeSelece_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
||||||
{
|
{
|
||||||
char *str;
|
char *str;
|
||||||
GUI_SWITCH *paramCurData = NULL;
|
GUI_SWITCH *paramCurData = NULL;
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(GUI_MODE_PARAM, &c_top, &c_bot);
|
||||||
switch(mGuiData[GUI_TAB_INDEX].Current)
|
switch(mGuiData[GUI_TAB_INDEX].Current)
|
||||||
{
|
{
|
||||||
case 0: paramCurData = &ParamGuiData[SONG_MODE_PARAM]; break;
|
case 0: paramCurData = &ParamGuiData[SONG_MODE_PARAM]; break;
|
||||||
case 1: paramCurData = &ParamGuiData[EXPRESS_MODE_PARAM]; break;
|
case 1: paramCurData = &ParamGuiData[EXPRESS_MODE_PARAM]; break;
|
||||||
case 2: paramCurData = &ParamGuiData[ALL_MODE_PARAM]; break;
|
case 2: paramCurData = &ParamGuiData[ALL_MODE_PARAM]; break;
|
||||||
}
|
}
|
||||||
LCD_FillRoundRectGradient(UI->x, UI->y+20+5, UI->w, UI->h-20, 10,START_COLOR, END_COLOR);
|
LCD_FillRoundRectGradient(UI->x, UI->y+20+5, UI->w, UI->h-20, 10, c_top, c_bot);
|
||||||
switch(mGuiData[GUI_TAB_INDEX].Current) {
|
switch(mGuiData[GUI_TAB_INDEX].Current) {
|
||||||
case 0:case 1:
|
case 0:case 1:
|
||||||
Draw_Tab_Mode_Menu(UI, &mGuiData[GUI_AUTOBAND_SW]);
|
Draw_Tab_Mode_Menu(UI, &mGuiData[GUI_AUTOBAND_SW]);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
str = (char*)"\xBA\xCD\xCF\xD2\xD7\xDF\xCF\xF2";
|
str = (char*)"\xBA\xCD\xCF\xD2\xD7\xDF\xCF\xF2";
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(
|
LCD_ShowChinese_AutoAlign(
|
||||||
UI->x, UI->x+UI->w, UI->y+5+5,
|
UI->x, UI->x+UI->w, UI->y+5+5,
|
||||||
(uint8_t *)str, UI->Tab_Align, UI->Tab_fc, UI->Tab_bc, 0, UI->Tab_size
|
(uint8_t *)str, UI->Tab_Align, UI->Tab_fc, BLACK, 0, UI->Tab_size
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -455,11 +539,9 @@ void label_ModeSelece_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
||||||
break;
|
break;
|
||||||
case 2: paramCurData = &ParamGuiData[ALL_MODE_PARAM]; break;
|
case 2: paramCurData = &ParamGuiData[ALL_MODE_PARAM]; break;
|
||||||
}
|
}
|
||||||
// <20><>ʾ<EFBFBD><CABE>ǰģʽ<C4A3><CABD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD>ᱻautobandֵ<64><D6B5><EFBFBD>ǣ<EFBFBD>
|
|
||||||
show_Param(&UI_Label[GUI_MODE_PARAM], paramCurData);
|
show_Param(&UI_Label[GUI_MODE_PARAM], paramCurData);
|
||||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
LCD_DrawArrow_Left(UI->x+10+5+5, UI->y+UI->h-15-2+5, 12, WHITE, c_top);
|
||||||
LCD_DrawArrow_Left(UI->x+10+5+5, UI->y+UI->h-15-2+5, 12, WHITE, BUTTON_COLOR);
|
LCD_DrawArrow_Right(UI->x+UI->w+10-25-5, UI->y+UI->h-15-2+5, 12, WHITE, c_top);
|
||||||
LCD_DrawArrow_Right(UI->x+UI->w+10-25-5, UI->y+UI->h-15-2+5, 12, WHITE, BUTTON_COLOR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void label_TimbreSelece_ui(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
void label_TimbreSelece_ui(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
||||||
|
|
@ -468,42 +550,40 @@ void label_TimbreSelece_ui(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
||||||
char NumBuf[8] = {0};
|
char NumBuf[8] = {0};
|
||||||
uint16_t text_y = UI->y + 25;
|
uint16_t text_y = UI->y + 25;
|
||||||
uint8_t idx = mGuiData[UI->Id].Current + 1;
|
uint8_t idx = mGuiData[UI->Id].Current + 1;
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(UI->Id, &c_top, &c_bot);
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x,
|
UI->x,
|
||||||
UI->y+20,
|
UI->y+20,
|
||||||
UI->w,
|
UI->w,
|
||||||
UI->h-20,
|
UI->h-20,
|
||||||
10,
|
10,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(
|
LCD_ShowChinese_AutoAlign(
|
||||||
UI->x,
|
UI->x,
|
||||||
UI->x+UI->w,
|
UI->x+UI->w,
|
||||||
UI->y+5,
|
UI->y+5,
|
||||||
UI->p,
|
UI->p,
|
||||||
UI->Tab_Align,
|
UI->Tab_Align,
|
||||||
UI->Tab_fc,
|
UI->Tab_fc,
|
||||||
START_COLOR,
|
BLACK,
|
||||||
END_COLOR,
|
0,
|
||||||
UI->Tab_size
|
UI->Tab_size
|
||||||
);
|
);
|
||||||
LCD_DrawArrow_Left(UI->x+10+5+5, UI->y+UI->h-20+3, 12, WHITE, BUTTON_COLOR);
|
LCD_DrawArrow_Left(UI->x+10+5+5, UI->y+UI->h-20+3, 12, WHITE, c_top);
|
||||||
LCD_DrawArrow_Right(UI->x+UI->w+10-25-5, UI->y+UI->h-20+3, 12, WHITE, BUTTON_COLOR);
|
LCD_DrawArrow_Right(UI->x+UI->w+10-25-5, UI->y+UI->h-20+3, 12, WHITE, c_top);
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x + 40,
|
UI->x + 40,
|
||||||
UI->y+20,
|
UI->y+20,
|
||||||
UI->x + UI->w - 40 - UI->x - 40 ,
|
UI->x + UI->w - 40 - UI->x - 40 ,
|
||||||
UI->h-20,
|
UI->h-20,
|
||||||
0,
|
0,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
// 拼接序号 1. 2. 3.
|
|
||||||
sprintf(NumBuf, "%d.", idx);
|
sprintf(NumBuf, "%d.", idx);
|
||||||
// 计算数字宽度
|
|
||||||
uint16_t num_w = (strlen(NumBuf)) * (UI->Text_size / 2);
|
uint16_t num_w = (strlen(NumBuf)) * (UI->Text_size / 2);
|
||||||
// 获取音色中文
|
|
||||||
GET_Num_Str(mGuiData[UI->Id].Current, 0, (char*)Textstr, UI->Id);
|
GET_Num_Str(mGuiData[UI->Id].Current, 0, (char*)Textstr, UI->Id);
|
||||||
// 先渲染中文,拿到中文起始X坐标
|
|
||||||
uint32_t chinese_start_x = LCD_ShowChinese_AutoAlign_Gradient(
|
uint32_t chinese_start_x = LCD_ShowChinese_AutoAlign_Gradient(
|
||||||
UI->x + num_w,
|
UI->x + num_w,
|
||||||
UI->x + UI->w,
|
UI->x + UI->w,
|
||||||
|
|
@ -511,15 +591,13 @@ void label_TimbreSelece_ui(const LEBEL_UI *UI, GUI_SWITCH * Group)
|
||||||
(const uint8_t*)Textstr,
|
(const uint8_t*)Textstr,
|
||||||
UI->Text_Align,
|
UI->Text_Align,
|
||||||
UI->Text_fc,
|
UI->Text_fc,
|
||||||
START_COLOR, END_COLOR,
|
c_top, c_bot,
|
||||||
UI->Text_size
|
UI->Text_size
|
||||||
);
|
);
|
||||||
// 序号X
|
|
||||||
uint16_t num_x = chinese_start_x - num_w - 5;
|
uint16_t num_x = chinese_start_x - num_w - 5;
|
||||||
// 绘制左侧数字序号
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(num_x, num_x + num_w, text_y+3,
|
LCD_ShowString_AutoAlign_Gradient(num_x, num_x + num_w, text_y+3,
|
||||||
(const uint8_t *)NumBuf, LCD_ALIGN_LEFT, UI->Text_fc,
|
(const uint8_t *)NumBuf, LCD_ALIGN_LEFT, UI->Text_fc,
|
||||||
START_COLOR, END_COLOR, UI->Text_size);
|
c_top, c_bot, UI->Text_size);
|
||||||
switch(Group->Id)
|
switch(Group->Id)
|
||||||
{
|
{
|
||||||
case GUI_TIMBRE_SELECT:
|
case GUI_TIMBRE_SELECT:
|
||||||
|
|
@ -615,182 +693,35 @@ void label_Tab_Select_ui(const LEBEL_UI *UI,GUI_SWITCH * Group)
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
// ===================== TAB 配置参数 =====================
|
const uint16_t tab_w = 50;
|
||||||
const uint16_t tab_w = 50; // TAB宽度
|
const uint16_t tab_h = 24 + 11;
|
||||||
const uint16_t tab_h = 24 + 11; // TAB高度
|
const uint8_t tab_r = 5;
|
||||||
const uint8_t tab_r = 5; // 圆<>??
|
const uint8_t space = 3;
|
||||||
const uint8_t space = 3; // 间距
|
const uint16_t start_x = UI->x + 10;
|
||||||
const uint16_t start_x = UI->x + 10; // 起<>?<3F>X
|
const uint16_t start_y = UI->y + 28 - 6;
|
||||||
const uint16_t start_y = UI->y + 28 - 6; // 起<>?<3F>Y
|
const uint16_t text_y = UI->y + 28 - 3;
|
||||||
const uint16_t text_y = UI->y + 28 - 3; // 文字Y
|
const char *nums[4] = {"1", "2", "3", "4"};
|
||||||
// ===================== 颜色定义 =====================
|
uint8_t focused = UI_IsFocused(GUI_PLAY_SECTION);
|
||||||
uint16_t color_sel_bg = COLOR_PRIMARY; // 选中背景
|
uint8_t i;
|
||||||
// uint16_t color_unsel_bg = BLACK; // <20>?选中背景
|
|
||||||
uint16_t color_text = UI->Text_fc; // 文字颜色
|
|
||||||
|
|
||||||
if(select_tab == TAB_A)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
LCD_FillRoundRect(start_x,
|
uint16_t x = start_x + i * (tab_w + space);
|
||||||
start_y,
|
uint16_t bg = (focused && (select_tab == i)) ? COLOR_PRIMARY : COLOR_NORMAL_BG;
|
||||||
tab_w,
|
LCD_FillRoundRect(x, start_y, tab_w, tab_h, tab_r, bg);
|
||||||
tab_h,
|
LCD_ShowString_AutoAlign(
|
||||||
tab_r,
|
x, x + tab_w, text_y,
|
||||||
color_sel_bg);
|
(const uint8_t*)nums[i],
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
UI->Text_Align,
|
||||||
start_x,
|
WHITE,
|
||||||
start_x + tab_w,
|
bg,
|
||||||
text_y,
|
0,
|
||||||
(const uint8_t*)"1",
|
24
|
||||||
UI->Text_Align,
|
);
|
||||||
color_text,
|
|
||||||
color_sel_bg, color_sel_bg,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
LCD_FillRoundRectGradient(
|
|
||||||
start_x,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
START_COLOR, END_COLOR
|
|
||||||
);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x,
|
|
||||||
start_x + tab_w,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"1",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
START_COLOR, END_COLOR,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(select_tab == TAB_B)
|
|
||||||
{
|
|
||||||
LCD_FillRoundRect(start_x + tab_w + space,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
color_sel_bg);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x + tab_w + space,
|
|
||||||
start_x + tab_w + space + tab_w,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"2",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
color_sel_bg, color_sel_bg,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
LCD_FillRoundRectGradient(
|
|
||||||
start_x + tab_w + space,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
START_COLOR, END_COLOR
|
|
||||||
);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x + tab_w + space,
|
|
||||||
start_x + tab_w + space + tab_w,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"2",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
START_COLOR, END_COLOR,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(select_tab == TAB_C)
|
|
||||||
{
|
|
||||||
LCD_FillRoundRect(start_x + tab_w + space + tab_w + space,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
color_sel_bg);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x + tab_w + space + tab_w + space,
|
|
||||||
start_x + tab_w + space + tab_w + space + tab_w,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"3",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
color_sel_bg, color_sel_bg,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
LCD_FillRoundRectGradient(
|
|
||||||
start_x + tab_w + space + tab_w + space,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
START_COLOR, END_COLOR
|
|
||||||
);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x + tab_w + space + tab_w + space,
|
|
||||||
start_x + tab_w + space + tab_w + space + tab_w,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"3",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
START_COLOR, END_COLOR,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if(select_tab == TAB_D)
|
|
||||||
{
|
|
||||||
LCD_FillRoundRect(start_x + tab_w + space + tab_w + space+ tab_w + space,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
color_sel_bg);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x + tab_w + space + tab_w + space+ tab_w + space,
|
|
||||||
start_x + tab_w + space + tab_w + space + tab_w+ tab_w + space,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"4",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
color_sel_bg, color_sel_bg,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
LCD_FillRoundRectGradient(
|
|
||||||
start_x + tab_w + space + tab_w + space+ tab_w + space,
|
|
||||||
start_y,
|
|
||||||
tab_w,
|
|
||||||
tab_h,
|
|
||||||
tab_r,
|
|
||||||
START_COLOR, END_COLOR
|
|
||||||
);
|
|
||||||
LCD_ShowString_AutoAlign_Gradient(
|
|
||||||
start_x + tab_w + space + tab_w + space+ tab_w + space,
|
|
||||||
start_x + tab_w + space + tab_w + space + tab_w+ tab_w + space,
|
|
||||||
text_y,
|
|
||||||
(const uint8_t*)"4",
|
|
||||||
UI->Text_Align,
|
|
||||||
color_text,
|
|
||||||
START_COLOR, END_COLOR,
|
|
||||||
24
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GET_ParamNum_Str(int16_t NUM, uint8_t ValidLen, char* Str, uint8_t hasSign)
|
void GET_ParamNum_Str(int16_t NUM, uint8_t ValidLen, char* Str, uint8_t hasSign)
|
||||||
{
|
{
|
||||||
// int16_t Value;
|
// int16_t Value;
|
||||||
|
|
@ -974,35 +905,37 @@ void Draw_System_Item_List(const LEBEL_UI *UI, GUI_SWITCH *Group)
|
||||||
{
|
{
|
||||||
NvmParam_Type * nvm = drv_nvm_param_ptr();
|
NvmParam_Type * nvm = drv_nvm_param_ptr();
|
||||||
char Info[40];
|
char Info[40];
|
||||||
|
uint16_t c_top, c_bot;
|
||||||
|
UI_GetFocusGrad(Group->Id, &c_top, &c_bot);
|
||||||
LCD_FillRoundRectGradient(
|
LCD_FillRoundRectGradient(
|
||||||
UI->x, UI->y, 220, UI->h, 5,
|
UI->x, UI->y, 220, UI->h, 5,
|
||||||
START_COLOR, END_COLOR
|
c_top, c_bot
|
||||||
);
|
);
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(UI->x+35,UI->x+UI->w,UI->y+UI->h/2-8,UI->p,UI->Tab_Align,UI->Tab_fc,START_COLOR, END_COLOR,UI->Tab_size);
|
LCD_ShowChinese_AutoAlign_Gradient(UI->x+35,UI->x+UI->w,UI->y+UI->h/2-8,UI->p,UI->Tab_Align,UI->Tab_fc,c_top, c_bot,UI->Tab_size);
|
||||||
switch(Group->Id)
|
switch(Group->Id)
|
||||||
{
|
{
|
||||||
case GUI_VERSION:
|
case GUI_VERSION:
|
||||||
LCD_WR_PIC(UI->x+10, UI->y+18,20,20,gImage_FimewareVection);
|
LCD_WR_PIC(UI->x+10, UI->y+18,20,20,gImage_FimewareVection);
|
||||||
sprintf (Info, "%d.%d.%d", Version[0], Version[1],Version[2]);
|
sprintf (Info, "%d.%d.%d", Version[0], Version[1],Version[2]);
|
||||||
LCD_ShowString_AutoAlign_Gradient(UI->x+100,UI->x+100+110, UI->y+UI->h/2-8-5,(const uint8_t*)Info,LCD_ALIGN_CENTER, UI->Text_fc,START_COLOR, END_COLOR,11);
|
LCD_ShowString_AutoAlign_Gradient(UI->x+100,UI->x+100+110, UI->y+UI->h/2-8-5,(const uint8_t*)Info,LCD_ALIGN_CENTER, UI->Text_fc,c_top, c_bot,11);
|
||||||
break;
|
break;
|
||||||
case GUI_BLUETOOTH_SW:
|
case GUI_BLUETOOTH_SW:
|
||||||
LCD_WR_PIC(UI->x+10, UI->y+18,20,20,gImage_BlueTooth);
|
LCD_WR_PIC(UI->x+10, UI->y+18,20,20,gImage_BlueTooth);
|
||||||
LCD_DrawArrow_Left(UI->x+100+10+5, UI->y+UI->h/2-8+12-5, 12, WHITE, GRAY);
|
LCD_DrawArrow_Left(UI->x+100+10+5, UI->y+UI->h/2-8+12-5, 12, WHITE, c_top);
|
||||||
LCD_DrawArrow_Right(UI->x+100+95, UI->y+UI->h/2-8+12-5, 12, WHITE, GRAY);
|
LCD_DrawArrow_Right(UI->x+100+95, UI->y+UI->h/2-8+12-5, 12, WHITE, c_top);
|
||||||
if(Group->Current)
|
if(Group->Current)
|
||||||
{
|
{
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(UI->x+100,UI->x+100+110, UI->y+UI->h/2-8-5,(const uint8_t*)"\xBF\xAA",LCD_ALIGN_CENTER, UI->Text_fc,START_COLOR, END_COLOR,11);
|
LCD_ShowChinese_AutoAlign_Gradient(UI->x+100,UI->x+100+110, UI->y+UI->h/2-8-5,(const uint8_t*)"\xBF\xAA",LCD_ALIGN_CENTER, UI->Text_fc,c_top, c_bot,11);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
LCD_ShowChinese_AutoAlign_Gradient(UI->x+100,UI->x+100+110, UI->y+UI->h/2-8-5,(const uint8_t*)"\xB9\xD8",LCD_ALIGN_CENTER, UI->Text_fc,START_COLOR, END_COLOR,11);
|
LCD_ShowChinese_AutoAlign_Gradient(UI->x+100,UI->x+100+110, UI->y+UI->h/2-8-5,(const uint8_t*)"\xB9\xD8",LCD_ALIGN_CENTER, UI->Text_fc,c_top, c_bot,11);
|
||||||
}
|
}
|
||||||
BSP_BlueToothPowerEnable (Group->Current);
|
BSP_BlueToothPowerEnable (Group->Current);
|
||||||
mGuiData[GUI_BL_SW].Current = Group->Current;
|
mGuiData[GUI_BL_SW].Current = Group->Current;
|
||||||
break;
|
break;
|
||||||
case GUI_AUTOCLOSE:
|
case GUI_AUTOCLOSE:
|
||||||
LCD_DrawArrow_Left(UI->x+100+10+5, UI->y+UI->h/2-8+12-5, 12, WHITE, GRAY);
|
LCD_DrawArrow_Left(UI->x+100+10+5, UI->y+UI->h/2-8+12-5, 12, WHITE, c_top);
|
||||||
LCD_DrawArrow_Right(UI->x+100+95, UI->y+UI->h/2-8+12-5, 12, WHITE, GRAY);
|
LCD_DrawArrow_Right(UI->x+100+95, UI->y+UI->h/2-8+12-5, 12, WHITE, c_top);
|
||||||
LCD_WR_PIC(UI->x+10, UI->y+18,20,20,gImage_AutoClose);
|
LCD_WR_PIC(UI->x+10, UI->y+18,20,20,gImage_AutoClose);
|
||||||
switch(Group->Current)
|
switch(Group->Current)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,12 @@ void CallUI_RestoreSelect(void);
|
||||||
#define UI_STATUS_BATTERY_X 180
|
#define UI_STATUS_BATTERY_X 180
|
||||||
#define UI_STATUS_BATTERY_H 11
|
#define UI_STATUS_BATTERY_H 11
|
||||||
#define UI_STATUS_BATTERY_Y ((UI_STATUS_BAR_H - UI_STATUS_BATTERY_H) / 2)
|
#define UI_STATUS_BATTERY_Y ((UI_STATUS_BAR_H - UI_STATUS_BATTERY_H) / 2)
|
||||||
|
#define UI_FOCUS_NONE 0xFF
|
||||||
|
|
||||||
|
void UI_ClearFocus(void);
|
||||||
|
uint8_t UI_IsFocused(uint8_t widget_id);
|
||||||
|
uint8_t UI_SetFocus(uint8_t widget_id);
|
||||||
|
void UI_GetFocusGrad(uint8_t widget_id, uint16_t *c_top, uint16_t *c_bot);
|
||||||
|
|
||||||
void Draw_Status_Battery_Icon(uint8_t battery_percent);
|
void Draw_Status_Battery_Icon(uint8_t battery_percent);
|
||||||
void Show_Battery_Icon(uint8_t flag);
|
void Show_Battery_Icon(uint8_t flag);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ typedef enum {
|
||||||
|
|
||||||
|
|
||||||
extern const Touch_AreaTypeDef Touch_ModeSelect_Areas[];
|
extern const Touch_AreaTypeDef Touch_ModeSelect_Areas[];
|
||||||
|
extern void UI_DrawModeSelectScreen(void);
|
||||||
|
|
||||||
|
|
||||||
extern void IdleProcess(DisplayTaskMessage_Type xEvent);
|
extern void IdleProcess(DisplayTaskMessage_Type xEvent);
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,30 @@ void LCD_WR_PIC(uint16_t x, uint16_t y, uint16_t length, uint16_t width, const u
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 跳过 key_color 像素,用于图标透明底(常见 key=BLACK) */
|
||||||
|
void LCD_WR_PIC_Trans(uint16_t x, uint16_t y, uint16_t length, uint16_t width,
|
||||||
|
const uint8_t data[], uint16_t key_color)
|
||||||
|
{
|
||||||
|
uint32_t total_pixels = (uint32_t)length * width;
|
||||||
|
uint8_t key_h = (uint8_t)(key_color >> 8);
|
||||||
|
uint8_t key_l = (uint8_t)(key_color & 0xFF);
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if (total_pixels == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < total_pixels; i++)
|
||||||
|
{
|
||||||
|
uint8_t hi = data[i * 2];
|
||||||
|
uint8_t lo = data[i * 2 + 1];
|
||||||
|
if (hi == key_h && lo == key_l)
|
||||||
|
continue;
|
||||||
|
LCD_DrawPoint((uint16_t)(x + (i % length)),
|
||||||
|
(uint16_t)(y + (i / length)),
|
||||||
|
(uint16_t)((hi << 8) | lo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
函数说明:从W25Q128外部Flash读取图片数据并显示
|
函数说明:从W25Q128外部Flash读取图片数据并显示
|
||||||
入口数据:x,y 显示起始坐标
|
入口数据:x,y 显示起始坐标
|
||||||
|
|
@ -1501,53 +1525,15 @@ uint16_t LCD_ShowString_AutoAlign_Gradient(uint16_t x1, uint16_t x2, uint16_t y,
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// =====================================================================
|
函数说明:圆角框 + 左箭头。bg_color 为框背景(普通态灰色 / 焦点蓝色)
|
||||||
// 旧版 LCD_DrawArrow_Left / LCD_DrawArrow_Right(保留以备回滚)
|
******************************************************************************/
|
||||||
// 仅画箭头,无背景框
|
|
||||||
// =====================================================================
|
|
||||||
//void LCD_DrawArrow_Left(uint16_t x, uint16_t y, uint8_t size, uint16_t color)
|
|
||||||
//{
|
|
||||||
// int16_t i;
|
|
||||||
// for(i = 0; i < size; i++)
|
|
||||||
// {
|
|
||||||
// LCD_DrawLine(
|
|
||||||
// x - i,
|
|
||||||
// y - size + i,
|
|
||||||
// x - i,
|
|
||||||
// y + size - i,
|
|
||||||
// color
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//void LCD_DrawArrow_Right(uint16_t x, uint16_t y, uint8_t size, uint16_t color)
|
|
||||||
//{
|
|
||||||
// int16_t i;
|
|
||||||
// for(i = 0; i < size; i++)
|
|
||||||
// {
|
|
||||||
// LCD_DrawLine(
|
|
||||||
// x + i,
|
|
||||||
// y - size + i,
|
|
||||||
// x + i,
|
|
||||||
// y + size - i,
|
|
||||||
// color
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
// =====================================================================
|
|
||||||
// 新版 LCD_DrawArrow_Left / LCD_DrawArrow_Right
|
|
||||||
// 新增 bg_color 参数:圆角正方形背景框的颜色
|
|
||||||
// 背景框为正方形,边长 = 2*size + 8,圆角半径 = 3
|
|
||||||
// 箭头居中显示在背景框内
|
|
||||||
// =====================================================================
|
|
||||||
void LCD_DrawArrow_Left(uint16_t x, uint16_t y, uint8_t size, uint16_t color, uint16_t bg_color)
|
void LCD_DrawArrow_Left(uint16_t x, uint16_t y, uint8_t size, uint16_t color, uint16_t bg_color)
|
||||||
{
|
{
|
||||||
// 圆角正方形背景框
|
int16_t box_side = size * 2 + 5;
|
||||||
int16_t box_side = size * 2 + 8;
|
|
||||||
int16_t box_x = x - box_side / 2;
|
int16_t box_x = x - box_side / 2;
|
||||||
int16_t box_y = y - box_side / 2;
|
int16_t box_y = y - box_side / 2;
|
||||||
LCD_FillRoundRect(box_x, box_y, box_side, box_side, 3, bg_color);
|
LCD_FillRoundRect(box_x, box_y, box_side, box_side, 3, bg_color);
|
||||||
|
|
||||||
// 箭头顶部(居中)
|
|
||||||
int16_t i;
|
int16_t i;
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -1563,65 +1549,11 @@ void LCD_DrawArrow_Left(uint16_t x, uint16_t y, uint8_t size, uint16_t color, ui
|
||||||
|
|
||||||
void LCD_DrawArrow_Right(uint16_t x, uint16_t y, uint8_t size, uint16_t color, uint16_t bg_color)
|
void LCD_DrawArrow_Right(uint16_t x, uint16_t y, uint8_t size, uint16_t color, uint16_t bg_color)
|
||||||
{
|
{
|
||||||
// 圆角正方形背景框
|
int16_t box_side = size * 2 + 5;
|
||||||
int16_t box_side = size * 2 + 8;
|
|
||||||
int16_t box_x = x - box_side / 2;
|
int16_t box_x = x - box_side / 2;
|
||||||
int16_t box_y = y - box_side / 2;
|
int16_t box_y = y - box_side / 2;
|
||||||
LCD_FillRoundRect(box_x, box_y, box_side, box_side, 3, bg_color);
|
LCD_FillRoundRect(box_x, box_y, box_side, box_side, 3, bg_color);
|
||||||
|
|
||||||
// 箭头顶部(居中)
|
|
||||||
int16_t i;
|
|
||||||
for(i = 0; i < size; i++)
|
|
||||||
{
|
|
||||||
LCD_DrawLine(
|
|
||||||
x + i,
|
|
||||||
y - size + i,
|
|
||||||
x + i,
|
|
||||||
y + size - i,
|
|
||||||
color
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// 新版 LCD_DrawArrow_Left / LCD_DrawArrow_Right
|
|
||||||
// 新增 bg_color 参数:圆角正方形背景框的颜色
|
|
||||||
// 背景框为正方形,边长 = 2*size + 8,圆角半径 = 3
|
|
||||||
// 箭头居中显示在背景框内
|
|
||||||
// =====================================================================
|
|
||||||
* */
|
|
||||||
void LCD_DrawArrow_Left(uint16_t x, uint16_t y, uint8_t size, uint16_t color, uint16_t bg_color)
|
|
||||||
{
|
|
||||||
// 圆角正方形背景框
|
|
||||||
int16_t box_side = size * 2+5;
|
|
||||||
int16_t box_x = x - box_side / 2;
|
|
||||||
int16_t box_y = y - box_side / 2;
|
|
||||||
// LCD_FillRoundRect(box_x, box_y, box_side, box_side, 3, bg_color);
|
|
||||||
LCD_FillRoundRectGradient(box_x, box_y, box_side, box_side, 3,START_COLOR,END_COLOR);
|
|
||||||
|
|
||||||
// 箭头顶部(居中)
|
|
||||||
int16_t i;
|
|
||||||
for(i = 0; i < size; i++)
|
|
||||||
{
|
|
||||||
LCD_DrawLine(
|
|
||||||
x - i,
|
|
||||||
y - size + i,
|
|
||||||
x - i,
|
|
||||||
y + size - i,
|
|
||||||
color
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LCD_DrawArrow_Right(uint16_t x, uint16_t y, uint8_t size, uint16_t color, uint16_t bg_color)
|
|
||||||
{
|
|
||||||
// 圆角正方形背景框
|
|
||||||
int16_t box_side = size * 2+5;
|
|
||||||
int16_t box_x = x - box_side / 2;
|
|
||||||
int16_t box_y = y - box_side / 2;
|
|
||||||
// LCD_FillRoundRect(box_x, box_y, box_side, box_side, 3, bg_color);
|
|
||||||
LCD_FillRoundRectGradient(box_x, box_y, box_side, box_side, 3,START_COLOR,END_COLOR);
|
|
||||||
// 箭头顶部(居中)
|
|
||||||
int16_t i;
|
int16_t i;
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -1671,17 +1603,7 @@ void LCD_DrawPlus_RoundBox(uint16_t x, uint16_t y, uint8_t size, uint8_t radius,
|
||||||
uint8_t box_h = size; // 框高度
|
uint8_t box_h = size; // 框高度
|
||||||
uint8_t line_w = 4; // 线条粗细
|
uint8_t line_w = 4; // 线条粗细
|
||||||
|
|
||||||
// 1. 画圆角填充背景框
|
LCD_FillRoundRect(x - box_w/2, y - box_h/2, box_w, box_h, radius, bg_color);
|
||||||
// LCD_FillRoundRect(
|
|
||||||
// x - box_w/2, // 左
|
|
||||||
// y - box_h/2, // 上
|
|
||||||
// box_w, // 宽
|
|
||||||
// box_h, // 高
|
|
||||||
// radius, // 圆角
|
|
||||||
// bg_color // 背景颜色(灰色)
|
|
||||||
// );
|
|
||||||
|
|
||||||
LCD_FillRoundRectGradient(x - box_w/2, y - box_h/2, box_w, box_h, radius,START_COLOR,END_COLOR);
|
|
||||||
|
|
||||||
// 2. 画水平居中横线
|
// 2. 画水平居中横线
|
||||||
for(i = 0; i < line_w; i++)
|
for(i = 0; i < line_w; i++)
|
||||||
|
|
@ -1719,17 +1641,7 @@ void LCD_DrawMinus_RoundBox(uint16_t x, uint16_t y, uint8_t size, uint8_t radius
|
||||||
uint8_t box_h = size;
|
uint8_t box_h = size;
|
||||||
uint8_t line_w = 2;
|
uint8_t line_w = 2;
|
||||||
|
|
||||||
// 1. 画圆角填充背景框
|
LCD_FillRoundRect(x - box_w/2, y - box_h/2, box_w, box_h, radius, bg_color);
|
||||||
// LCD_FillRoundRect(
|
|
||||||
// x - box_w/2,
|
|
||||||
// y - box_h/2,
|
|
||||||
// box_w,
|
|
||||||
// box_h,
|
|
||||||
// radius,
|
|
||||||
// bg_color
|
|
||||||
// );
|
|
||||||
|
|
||||||
LCD_FillRoundRectGradient(x - box_w/2, y - box_h/2, box_w, box_h, radius,START_COLOR,END_COLOR);
|
|
||||||
|
|
||||||
// 2. 画水平居中横线
|
// 2. 画水平居中横线
|
||||||
for(i = 0; i < line_w; i++)
|
for(i = 0; i < line_w; i++)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ extern void LCD_FillRoundRectGradient(uint16_t x, uint16_t y, uint16_t w, uint16
|
||||||
extern void LCD_FillGradient(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend,
|
extern void LCD_FillGradient(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend,
|
||||||
uint16_t color_top, uint16_t color_bottom);
|
uint16_t color_top, uint16_t color_bottom);
|
||||||
extern void LCD_WR_PIC(uint16_t x, uint16_t y, uint16_t length, uint16_t width, const uint8_t data[]);
|
extern void LCD_WR_PIC(uint16_t x, uint16_t y, uint16_t length, uint16_t width, const uint8_t data[]);
|
||||||
|
extern void LCD_WR_PIC_Trans(uint16_t x, uint16_t y, uint16_t length, uint16_t width,
|
||||||
|
const uint8_t data[], uint16_t key_color);
|
||||||
extern void LCD_WR_PIC_FROM_FLASH(uint16_t x, uint16_t y, uint16_t length, uint16_t width, uint32_t flash_addr);
|
extern void LCD_WR_PIC_FROM_FLASH(uint16_t x, uint16_t y, uint16_t length, uint16_t width, uint32_t flash_addr);
|
||||||
extern void LCD_DrawPoint(uint16_t x, uint16_t y, uint16_t color); //在指定位置画一个点
|
extern void LCD_DrawPoint(uint16_t x, uint16_t y, uint16_t color); //在指定位置画一个点
|
||||||
extern void LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color); //在指定位置画一条线
|
extern void LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color); //在指定位置画一条线
|
||||||
|
|
|
||||||
|
|
@ -58,15 +58,15 @@
|
||||||
#define BLACK 0x0000
|
#define BLACK 0x0000
|
||||||
#define BLUE 0x001F
|
#define BLUE 0x001F
|
||||||
#define COLOR_PRIMARY 0x1B9F // #1D73FF MiSans UI 主色
|
#define COLOR_PRIMARY 0x1B9F // #1D73FF MiSans UI 主色
|
||||||
#define COLOR_GRAD_START 0x039D // #003AEE
|
#define COLOR_GRAD_START 0x01D5 // #003AAE 规范渐变起始(深蓝)
|
||||||
#define COLOR_GRAD_MID 0x2A5A // #354FD6
|
#define COLOR_GRAD_MID 0x029A // #034FD6 规范渐变中间
|
||||||
#define COLOR_GRAD_END 0x4B1F // #5561F8
|
#define COLOR_GRAD_END 0x431E // #4161F8 规范渐变结束(中蓝)
|
||||||
#define COLOR_BG_START 0x0849 // #0E1537
|
#define COLOR_BG_START 0x10A6 // #0E1535 屏幕背景渐变顶
|
||||||
#define COLOR_BG_END 0x3189 // #2F3647
|
#define COLOR_BG_END 0x31A9 // #2F3647 屏幕背景渐变底
|
||||||
#define COLOR_MIXER_RED 0xFB2D // #F85E4B
|
#define COLOR_MIXER_RED 0xF2E9 // #F85E4B 弦音色槽位红
|
||||||
#define COLOR_MIXER_ORANGE 0xFD26 // #F59C2C
|
#define COLOR_MIXER_ORANGE 0xF4C5 // #F59C2C 伴奏槽位橙
|
||||||
#define COLOR_MIXER_YELLOW 0xFF6E // #F3D939
|
#define COLOR_MIXER_YELLOW 0xF6C7 // #F3D939 导奏槽位黄
|
||||||
#define COLOR_MIXER_GREEN 0x071F // #13E17F
|
#define COLOR_MIXER_GREEN 0x170F // #13E17F 鼓音槽位绿
|
||||||
#define BRED 0XF81F
|
#define BRED 0XF81F
|
||||||
#define GRED 0XFFE0
|
#define GRED 0XFFE0
|
||||||
#define GBLUE 0X07FF
|
#define GBLUE 0X07FF
|
||||||
|
|
@ -87,7 +87,8 @@
|
||||||
#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)
|
#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)
|
||||||
|
|
||||||
|
|
||||||
#define DARKLGRAY 0x5AEB/*0x2988*//*0x1926*//*0x252E*//*0X2B12*/
|
#define DARKLGRAY 0x2968 // #292C42 控件未选中(暗蓝灰,对应规范非焦点背景)
|
||||||
|
#define COLOR_NORMAL_BG DARKLGRAY /* 控件普通状态背景 */
|
||||||
#define BUTTON_COLOR /*0x5AEB*/BLACK
|
#define BUTTON_COLOR /*0x5AEB*/BLACK
|
||||||
|
|
||||||
#define START_COLOR COLOR_GRAD_START
|
#define START_COLOR COLOR_GRAD_START
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
[GENERAL]
|
[GENERAL]
|
||||||
HideDeviceSelection = 1
|
HideDeviceSelection = 1
|
||||||
|
|
||||||
[CPU]
|
[CPU]
|
||||||
Device="Cortex-M4"
|
Device = Cortex-M4
|
||||||
|
|
||||||
[FLASH]
|
|
||||||
Device="Cortex-M4"
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
@echo off
|
||||||
|
REM Flash YNGJ-GT1-M app via IAR cspybat (AT32 flash loader).
|
||||||
|
REM Do NOT pass Commander-style .jlink files to --jlink_script_file.
|
||||||
|
|
||||||
|
setlocal
|
||||||
|
set ROOT=%~dp0..
|
||||||
|
set OUT=%ROOT%\project\IAR_V7.4\YNGJ-GT1-M\Exe\YNGJ-GT1-M.out
|
||||||
|
set GEN=%ROOT%\project\IAR_V7.4\settings\YNGJ-GT1-M.YNGJ-GT1-M.general.xcl
|
||||||
|
set DRV=%ROOT%\project\IAR_V7.4\settings\YNGJ-GT1-M.YNGJ-GT1-M.driver.xcl
|
||||||
|
set CSPY="C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\common\bin\cspybat"
|
||||||
|
set STAGE=C:\Temp\k1flash
|
||||||
|
|
||||||
|
if not exist "%OUT%" (
|
||||||
|
echo ERROR: missing %OUT% - build first
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
mkdir "%STAGE%" 2>nul
|
||||||
|
copy /Y "%OUT%" "%STAGE%\YNGJ-GT1-M.out" >nul
|
||||||
|
|
||||||
|
%CSPY% -f "%GEN%" "--debug_file=%STAGE%\YNGJ-GT1-M.out" --download_only --backend -f "%DRV%"
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
|
||||||
|
"C:\Program Files\SEGGER\JLink_V818\JLink.exe" -CommandFile "%~dp0reset_run.jlink"
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
si SWD
|
||||||
|
speed 100
|
||||||
|
device STM32F407VG
|
||||||
|
r
|
||||||
|
connect
|
||||||
|
halt
|
||||||
|
exit
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
si SWD
|
||||||
|
speed 4000
|
||||||
|
device Cortex-M4
|
||||||
|
connect
|
||||||
|
halt
|
||||||
|
loadbin "c:\Users\qjyu\Documents\SoundWalker\一诺国际吉他\Code\YNGJ-GT1-M - AT32F403ARCT7\project\IAR_V7.4\YNGJ-GT1-M\Exe\YNGJ-GT1-M.bin", 0x08008000
|
||||||
|
r
|
||||||
|
g
|
||||||
|
exit
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
HideDeviceSelection 1
|
HideDeviceSelection = 1
|
||||||
Device Cortex-M4
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
/*********************************************************************
|
||||||
|
* J-Link script for IAR C-SPY / AT32F403A
|
||||||
|
* Hides unknown-device selection dialog (DEV_ID 0x241).
|
||||||
|
* NOTE: This must be JLinkScript syntax, NOT Commander commands.
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
int ConfigTargetSettings(void) {
|
||||||
|
JLINK_ExecCommand("HideDeviceSelection = 1");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
si SWD
|
||||||
|
speed 4000
|
||||||
|
device Cortex-M4
|
||||||
|
connect
|
||||||
|
r
|
||||||
|
g
|
||||||
|
exit
|
||||||
Loading…
Reference in New Issue