U8 CreateDistortionScreen(void* pPara) { int x,y; x=GUI_GetScreenSizeX(); y=GUI_GetScreenSizeY(); disIndex = 0; hDistortion = WM_CreateWindow(0, 0, x, y, /*WM_CF_SHOW | */WM_CF_MEMDEV, DistortionProc, 0); return 0; }
U8 CreateSynthScreen(void* pPara) { int x,y; x=GUI_GetScreenSizeX(); y=GUI_GetScreenSizeY(); hSynth = WM_CreateWindow(0, 0, x, y, /*WM_CF_SHOW | */WM_CF_MEMDEV, SynthProc, 0); CreateMIDIControlScreen(0); CreateControlAssignmentsScreen(0); CreateVoiceScreen(0); return 0; }
int WM_PollSimMsg(void) { int xSize, ySize, r = 0; WM_LOCK(); xSize = GUI_GetScreenSizeX(); ySize = GUI_GetScreenSizeY(); if ((xSize != _OldSizeX) || (ySize != _OldSizeY)) { WM_MESSAGE Msg; Msg.MsgId = WM_SCREENSIZE_CHANGED; WM_BroadcastMessage(&Msg); _OldSizeX = xSize; _OldSizeY = ySize; r = 1; } WM_UNLOCK(); return r; }
void MainTask_2D_text_bmp(void) { int i; horPos = ICONS_HOR_POS; verPos = ICONS_VER_POS; iconTouched = 0xFF; SetemWinRunning(1); GUI_SelectLayer(1); // select foregroung layer GUI_SetBkColor(GUI_TRANSPARENT); // select background as transparent color GUI_Clear(); // fill with the background color // get the number of icons iconNumber = GUI_COUNTOF(iconDrawFunctions); // compute padding to fit to whole display iconPadding = ((GUI_GetScreenSizeY() - (iconNumber * ICON_SIZE) - 2*ICONS_VER_POS) / iconNumber); // start time measurement timeMeasureStart(); // draw a background bitmap to the bottom LCD layer GUI_SelectLayer(0); // select the background layer // !! TO BE MODIFIED !! GUI_DrawBitmap(&bmbackground, 0, 0); GUI_SelectLayer(1); // set back the foregroung layer // now draw our icons one by one for (i = 0; i < iconNumber; i++) { iconDrawFunctions[i](horPos, verPos, ICON_SIZE); verPos += ICON_SIZE + iconPadding; } // add a title text GUI_SetTextMode(GUI_TM_TRANS); GUI_SetFont(&GUI_FontTimesNewRoman31); LCD_AA_SetAndMask(0xFFFFFFFF); GUI_DispStringInRect("STM32 Player", &rect, GUI_TA_CENTER); LCD_AA_SetAndMask(0x00FFFFFF); // end measurement time = timeMeasureEnd(); GUI_SetFont(&GUI_Font8_1); sprintf (timeString, "time to render: %d,%dms", time/10, time%10); GUI_DispStringAt(timeString, 10, 320 - 10); // optionally we can use cursor GUI_CURSOR_Show(); // the GUI is now rendered // in never ending loop just check if an incon is touched while(!tamperPushed) { GUI_TOUCH_GetState(&TouchState); // Get the touch position in pixel if (TouchState.Pressed) { if (iconTouched == 0xFF) // no icon was touched previously { GUI_CURSOR_SetPosition(TouchState.x, TouchState.y); // move the cursor to current touch position // check if the touch is in icons area if (TouchState.x > ICONS_HOR_POS && TouchState.x < ICONS_HOR_POS + ICON_SIZE) { if(TouchState.y > ICONS_VER_POS && TouchState.y < ICONS_VER_POS + iconNumber*(ICON_SIZE + iconPadding)) { // get he number of touched icon iconTouched = (TouchState.y - ICONS_VER_POS) / (ICON_SIZE + iconPadding); ReDrawIcon(GUI_RED, iconTouched); // draw again with hihghlight color } } } } else { ReDrawIcon(GUI_WHITE, iconTouched); iconTouched = 0xFF; } } SetemWinRunning(0); GUI_CURSOR_Hide(); }