static U8 SynthCreateItems(WM_HWIN hParent) { int x,y; hCOMPcomm = CreateCommComponentEx(hParent,COMMON_ITEM_CLOSE); memset(hSynthItems,0,sizeof(hSynthItems)); // Panel 1 x = 4; y = bmEMPTYTITLEBAR.YSize; //y += SYNTH_YOFFSET; y += 1; hSynthItems[SYNTH_STRINGPANEL1] = MisaSynthString_Create(x,y,0,0,hParent,SYNTH_ID_STRINGPANEL1); y += STRING_PANEL_HEIGHT; y += 1; hSynthItems[SYNTH_STRINGPANEL2] = MisaSynthString_Create(x,y,0,0,hParent,SYNTH_ID_STRINGPANEL2); y += STRING_PANEL_HEIGHT; y += 1; hSynthItems[SYNTH_STRINGPANEL3] = MisaSynthString_Create(x,y,0,0,hParent,SYNTH_ID_STRINGPANEL3); y += STRING_PANEL_HEIGHT; y += 1; hSynthItems[SYNTH_STRINGPANEL4] = MisaSynthString_Create(x,y,0,0,hParent,SYNTH_ID_STRINGPANEL4); y += STRING_PANEL_HEIGHT; y += 1; hSynthItems[SYNTH_STRINGPANEL5] = MisaSynthString_Create(x,y,0,0,hParent,SYNTH_ID_STRINGPANEL5); y += STRING_PANEL_HEIGHT; y += 1; hSynthItems[SYNTH_STRINGPANEL6] = MisaSynthString_Create(x,y,0,0,hParent,SYNTH_ID_STRINGPANEL6); x = SYNTH_XOFFSET; y = 502; hSynthItems[SYNTH_MIDICTRL] = BUTTON_CreateAsChild(x,y,bmSM_MIDICTL_UN.XSize,bmSM_MIDICTL_UN.YSize,hParent,SYNTH_ID_MIDICTRL,WM_CF_SHOW|WM_CF_MEMDEV); BUTTON_SetFocussable(hSynthItems[SYNTH_MIDICTRL],0); BUTTON_SetBitmap(hSynthItems[SYNTH_MIDICTRL],BUTTON_CI_UNPRESSED,&bmSM_MIDICTL_UN); BUTTON_SetBitmap(hSynthItems[SYNTH_MIDICTRL],BUTTON_CI_PRESSED,&bmSM_MIDICTL_SE); return 0; }
static void _ShowButton(WM_HWIN hParent) { _ahButton[0] = BUTTON_CreateAsChild(60, 15, 13, 14, hParent, BUTTON_ID_LEFT, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[1] = BUTTON_CreateAsChild(260, 15, 13, 14, hParent, BUTTON_ID_RIGHT, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[2] = BUTTON_CreateAsChild(10, 10, 30, 25, hParent, BUTTON_ID_EXIT, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); BUTTON_SetBitmap(_ahButton[0], BUTTON_BI_UNPRESSED, &bmLeftarrows); BUTTON_SetBitmap(_ahButton[1], BUTTON_BI_UNPRESSED, &bmRightarrows); BUTTON_SetText(_ahButton[2], "EXIT"); }
static _ShowButton(WM_HWIN hWin) { _ahButton[0] = BUTTON_CreateAsChild(50, 50, 40, 40, hWin, BUTTON_ID_CALENDAR, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[1] = BUTTON_CreateAsChild(140, 50, 40, 40, hWin, BUTTON_ID_STOPWATCH, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[2] = BUTTON_CreateAsChild(230, 50, 40, 40, hWin, BUTTON_ID_CLOCK, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[3] = BUTTON_CreateAsChild(50, 130, 40, 40, hWin, BUTTON_ID_LED, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[4] = BUTTON_CreateAsChild(140, 130, 40, 40, hWin, BUTTON_ID_CALCULATOR, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); _ahButton[5] = BUTTON_CreateAsChild(230, 130, 40, 40, hWin, BUTTON_ID_FILESYSTEM, WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV); BUTTON_SetBitmap(_ahButton[0], BUTTON_BI_UNPRESSED, &bmcalendar); BUTTON_SetBitmap(_ahButton[1], BUTTON_BI_UNPRESSED, &bmSecWatch); BUTTON_SetBitmap(_ahButton[2], BUTTON_BI_UNPRESSED, &bmclock); BUTTON_SetBitmap(_ahButton[3], BUTTON_BI_UNPRESSED, &bmled); BUTTON_SetBitmap(_ahButton[4], BUTTON_BI_UNPRESSED, &bmcalculator); BUTTON_SetBitmap(_ahButton[5], BUTTON_BI_UNPRESSED, &bmfileSystem); }
/*---------------------------------------------------------------------------*/ static TBool IHandlePlayPause(WM_MESSAGE * pMsg, int aNCode, int aID) { WM_HWIN hItem; if (aNCode == WM_NOTIFICATION_RELEASED) { IHideButtonsAndText(pMsg); G_AutoPlayOn = !G_AutoPlayOn; WM_RestartTimer(G_PictureChangeTimer, 5000); if(G_AutoPlayOn) { hItem = WM_GetDialogItem(pMsg->hWin, ID_PLAY_PAUSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_UNPRESSED, &PAUSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_PRESSED, &PAUSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_DISABLED, &PAUSE_BUTTON); } else { hItem = WM_GetDialogItem(pMsg->hWin, ID_PLAY_PAUSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_UNPRESSED, &PLAY_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_PRESSED, &PLAY_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_DISABLED, &PLAY_BUTTON); } } return EFalse; }
/*---------------------------------------------------------------------------* * Routine: _PFMainDialog *---------------------------------------------------------------------------* * Description: * Callback function used by emWin to process events. * Inputs: * WM_MESSAGE *pMsg -- message structure for current dialog. *---------------------------------------------------------------------------*/ static void _PFMainDialog(WM_MESSAGE *pMsg) { int Id, NCode; WM_HWIN hItem; GUI_PID_STATE *p_touchState; T_ImageMessage message; switch (pMsg->MsgId){ case WM_INIT_DIALOG: Id = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; LAFSetup(pMsg->hWin, ID_WINDOW, PFMainLayout); hItem = WM_GetDialogItem(pMsg->hWin, ID_REVERSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_UNPRESSED, &REVERSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_PRESSED, &REVERSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_DISABLED, &REVERSE_BUTTON); hItem = WM_GetDialogItem(pMsg->hWin, ID_PLAY_PAUSE_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_UNPRESSED, &PLAY_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_PRESSED, &PLAY_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_DISABLED, &PLAY_BUTTON); hItem = WM_GetDialogItem(pMsg->hWin, ID_FORWARD_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_UNPRESSED, &FORWARD_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_PRESSED, &FORWARD_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_DISABLED, &FORWARD_BUTTON); hItem = WM_GetDialogItem(pMsg->hWin, ID_SETTINGS_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_UNPRESSED, &SETTINGS_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_PRESSED, &SETTINGS_BUTTON); BUTTON_SetBitmap(hItem, BUTTON_BI_DISABLED, &SETTINGS_BUTTON); G_OverlayTimer = WM_CreateTimer(pMsg->hWin, ID_OVERLAY_TIMER, OVERLAY_TIMEOUT_MS, 0); G_UpdateTimer = WM_CreateTimer(pMsg->hWin, ID_UPDATE_TIMER, UPDATE_TIME_MS, 0); G_PictureChangeTimer = WM_CreateTimer(pMsg->hWin, ID_PICTURECHANGE_TIMER, 0, 0); if (!G_Current) { G_Current = GUI_MEMDEV_Create(0, 0, UEZ_LCD_DISPLAY_WIDTH, UEZ_LCD_DISPLAY_HEIGHT); GUI_MEMDEV_Select(G_Current); GUI_BMP_Draw(G_CurrentImage, 0, 0); GUI_MEMDEV_Select(0); } WM_SetHasTrans(pMsg->hWin); message = IMAGE_INITILIZE; UEZQueueSend(G_ImageLoadQueue, (void*)&message, 50); break; case WM_NOTIFY_PARENT: Id = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; if( !LAFHandleEvent(PFMainLayout, pMsg, NCode, Id)){ //Handle special cases here } break; case WM_TIMER: NCode = pMsg->Data.v; if (G_Active) { if (NCode == G_OverlayTimer) { IHideButtonsAndText(pMsg); //Grab all the touches WM_SetCapture(pMsg->hWin, 0); } else if (NCode == G_PictureChangeTimer) { //put up new picture if(G_AutoPlayOn) { IHandleForward(pMsg, WM_NOTIFICATION_RELEASED, ID_FORWARD_BUTTON); WM_RestartTimer(G_PictureChangeTimer, 5000); } } else if (NCode == G_UpdateTimer) { IUpdateFields(pMsg); WM_RestartTimer(G_UpdateTimer, UPDATE_TIME_MS); } } break; case WM_TOUCH: p_touchState = (GUI_PID_STATE *)(pMsg->Data.p); if (!p_touchState->Pressed) { WM_RestartTimer(G_OverlayTimer, OVERLAY_TIMEOUT_MS); //Show all the hidden text on buttons hItem = WM_GetDialogItem(pMsg->hWin, ID_TITLE_TEXT); WM_ShowWindow(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_SETTINGS_BUTTON); WM_ShowWindow(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_REVERSE_BUTTON); WM_ShowWindow(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_PLAY_PAUSE_BUTTON); WM_ShowWindow(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_FORWARD_BUTTON); WM_ShowWindow(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_TIMEDATE_TEXT); WM_ShowWindow(hItem); WM_ReleaseCapture(); IUpdateFields(pMsg); } break; case WM_POST_PAINT: GUI_BMP_Draw(G_CurrentImage, 0, 0); break; case WM_APP_GAINED_FOCUS: G_Active = ETrue; WM_SetCapture(pMsg->hWin, 0); IHideButtonsAndText(pMsg); IUpdateFields(pMsg); break; case WM_APP_LOST_FOCUS: G_Active = EFalse; IHideButtonsAndText(pMsg); WM_ReleaseCapture(); G_AutoPlayOn = EFalse; break; default: WM_DefaultProc(pMsg); break; } }
void run_db(void) { /* printf("Database name : %s\n", db->name); printf("Database nb children : %i\n", (int)db->nb_motifs); for (uint32_t i = 0; i < db->nb_motifs; i++) { motif_t * m = db->motifs; printf(" motif %i:\n", (int)i); printf(" name : %s\n", m->name); printf(" desc : %s\n", m->desc); printf(" img : %s\n", m->image); } */ char error_404[] = "No Motifs Found in Database!"; if (db->motifs == NULL) { strcpy(current_motif_title, error_404); } else { current_motif_index = 1; //sprintf(current_motif_title, "%i/%i -- %s", (int)current_motif_index, (int)db->nb_motifs, db->motifs->name); //current_motif_desc = db->motifs->desc; update_motif(); } WM_HWIN db_nav_win = WINDOW_CreateEx( 0, 0, 800, 480, WM_HBKWIN, WM_CF_SHOW, 0, GUI_ID_USER+0, _cbrundb); WINDOW_SetBkColor(db_nav_win, GUI_WHITE); motif_name_widget = TEXT_CreateEx( 0, 0, 800, 100, db_nav_win, WM_CF_SHOW, TEXT_CF_HCENTER | TEXT_CF_VCENTER, GUI_ID_TEXT0, (const char *)current_motif_title); motif_desc_widget = MULTIEDIT_CreateEx( 100, 100, 600, 380, db_nav_win, WM_CF_SHOW, MULTIEDIT_CF_AUTOSCROLLBAR_V, GUI_ID_MULTIEDIT1, 5000, (const char *) current_motif_desc ); BUTTON_Handle bt_prev_widget = BUTTON_CreateEx( 0, 100, 100, 380, db_nav_win, WM_CF_SHOW, 0, GUI_ID_BUTTON0); BUTTON_Handle bt_next_widget = BUTTON_CreateEx( 700, 100, 100, 380, db_nav_win, WM_CF_SHOW, 0, GUI_ID_BUTTON1); TEXT_SetFont(motif_name_widget, GUI_FONT_24_1); BUTTON_SetFont(bt_prev_widget, GUI_FONT_24_1); BUTTON_SetFont(bt_next_widget, GUI_FONT_24_1); MULTIEDIT_SetFont(motif_desc_widget, GUI_FONT_24_1); MULTIEDIT_SetWrapWord(motif_desc_widget); BUTTON_SetBitmap(bt_prev_widget, BUTTON_BI_UNPRESSED, &bmarrowdefault); BUTTON_SetBitmap(bt_next_widget, BUTTON_BI_UNPRESSED, &bmarrowrdefault); BUTTON_SetBitmap(bt_prev_widget, BUTTON_BI_PRESSED , &bmarrowclicked); BUTTON_SetBitmap(bt_next_widget, BUTTON_BI_PRESSED , &bmarrowrclicked); }
static U8 DistortionCreateItems(WM_HWIN hParent) { int x,y; //MENU_ITEM_DATA menuItem; hCOMPcomm = CreateCommComponent(hParent); memset(hDistortionItems,0,sizeof(hDistortionItems)); x = 4; y = bmEMPTYTITLEBAR.YSize; hDistortionItems[DISTORTION_LEFTARROW] = BUTTON_CreateAsChild(x,y,bmLEFTARROW_UN.XSize,bmLEFTARROW_UN.YSize,hParent,DISTORTION_ID_LEFTARROW,WM_CF_SHOW|WM_CF_MEMDEV); BUTTON_SetFocussable(hDistortionItems[DISTORTION_LEFTARROW],0); BUTTON_SetBitmap(hDistortionItems[DISTORTION_LEFTARROW],BUTTON_CI_UNPRESSED,&bmLEFTARROW_UN); BUTTON_SetBitmap(hDistortionItems[DISTORTION_LEFTARROW],BUTTON_CI_PRESSED,&bmLEFTARROW_SE); x += bmLEFTARROW_UN.XSize+356; hDistortionItems[DISTORTION_RIGHTARROW] = BUTTON_CreateAsChild(x,y,bmRIGHTARROW_UN.XSize,bmRIGHTARROW_UN.YSize,hParent,DISTORTION_ID_RIGHTARROW,WM_CF_SHOW|WM_CF_MEMDEV); BUTTON_SetFocussable(hDistortionItems[DISTORTION_RIGHTARROW],0); BUTTON_SetBitmap(hDistortionItems[DISTORTION_RIGHTARROW],BUTTON_CI_UNPRESSED,&bmRIGHTARROW_UN); BUTTON_SetBitmap(hDistortionItems[DISTORTION_RIGHTARROW],BUTTON_CI_PRESSED,&bmRIGHTARROW_SE); y += bmDISTYPEAREA.YSize; y += DISTORTION_YOFFSET; int xbar = 50; hDistortionItems[DISTORTION_PROGDRIVE] = MisaProgressbar_Create(xbar,y,0,0,hParent,DISTORTION_ID_PROGDRIVE,"Drive",MISAPROG_FONT24); xbar += (bmSLIDER.XSize + 100); hDistortionItems[DISTORTION_PROGTONE] = MisaProgressbar_Create(xbar,y,0,0,hParent,DISTORTION_ID_PROGTONE,"Tone",MISAPROG_FONT24); xbar += (bmSLIDER.XSize + 100); hDistortionItems[DISTORTION_PROGLEVEL] = MisaProgressbar_Create(xbar,y,0,0,hParent,DISTORTION_ID_PROGLEVEL,"Level",MISAPROG_FONT24); //MZ - remove noise reduction control as it only works with line in // hDistortionItems[DISTORTION_PROGNOISEREDUCTION] = MisaProgressbar_CreateEx(500,y,0,0,hParent,DISTORTION_ID_PROGNOISEREDUCTION,"Noise","Reduct.",MISAPROG_FONT24,DistortionNoiseReductionCB); // MisaProgressbar_SetCheck(hDistortionItems[DISTORTION_PROGNOISEREDUCTION], 2); hDistortionItems[DISTORTION_PROGBOOSTER] = MisaProgressbar_CreateEx(650,y,0,0,hParent,DISTORTION_ID_PROGBOOSTER,"Booster",0,MISAPROG_FONT24,DistortionBoosterCB); MisaProgressbar_SetCheck(hDistortionItems[DISTORTION_PROGBOOSTER], 2); /*hDistortionItems[DISTORTION_POPMENU] = MENU_CreateEx(0,0,0,0,hParent,WM_CF_MEMDEV,MENU_CF_VERTICAL,DISTORTION_ID_POPMENU); menuItem.pText = "warm drive"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem); menuItem.pText = "overdrive"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem); menuItem.pText = "cry"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem); menuItem.pText = "distortion"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem); menuItem.pText = "metal"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem); menuItem.pText = "max saturation"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem); menuItem.pText = "fuzz"; menuItem.Id = DISTORTION_ID_POPMENU; menuItem.Flags = 0; menuItem.hSubmenu = 0; MENU_AddItem(hDistortionItems[DISTORTION_POPMENU],&menuItem);*/ return 0; }