// This file was generated by SquareLine Studio // SquareLine Studio version: SquareLine Studio 1.6.1 // LVGL version: 9.2.2 // Project name: HeavenlyHeroStar #include "../ui.h" #include "board_config.h" lv_obj_t * ui_Screen3 = NULL; lv_obj_t * ui_BtnVolDown = NULL; lv_obj_t * ui_BtnVolUp = NULL; lv_obj_t * ui_BtnMute = NULL; lv_obj_t * ui_BtnPlayPause = NULL; lv_obj_t * ui_BtnPrev = NULL; lv_obj_t * ui_BtnNext = NULL; lv_obj_t * ui_LabelVolDown = NULL; lv_obj_t * ui_LabelVolUp = NULL; lv_obj_t * ui_LabelMute = NULL; lv_obj_t * ui_LabelPlayPause = NULL; lv_obj_t * ui_LabelPrev = NULL; lv_obj_t * ui_LabelNext = NULL; static void ui_screen3_create_button(lv_obj_t **btn, lv_obj_t **label, int32_t x, int32_t y, const char *text) { *btn = lv_button_create(ui_Screen3); lv_obj_set_width(*btn, 90); lv_obj_set_height(*btn, 45); lv_obj_set_x(*btn, x); lv_obj_set_y(*btn, y); lv_obj_set_align(*btn, LV_ALIGN_CENTER); lv_obj_add_flag(*btn, LV_OBJ_FLAG_SCROLL_ON_FOCUS); lv_obj_remove_flag(*btn, LV_OBJ_FLAG_SCROLLABLE); *label = lv_label_create(ui_Screen3); lv_obj_set_width(*label, LV_SIZE_CONTENT); lv_obj_set_height(*label, LV_SIZE_CONTENT); lv_obj_set_x(*label, x); lv_obj_set_y(*label, y); lv_obj_set_align(*label, LV_ALIGN_CENTER); lv_label_set_text(*label, text); } // event funtions void ui_event_BtnVolDown(lv_event_t * e) { lv_event_code_t event_code = lv_event_get_code(e); if(event_code == LV_EVENT_CLICKED) { click_consumer_vol_down(e); } } void ui_event_BtnVolUp(lv_event_t * e) { lv_event_code_t event_code = lv_event_get_code(e); if(event_code == LV_EVENT_CLICKED) { click_consumer_vol_up(e); } } void ui_event_BtnMute(lv_event_t * e) { lv_event_code_t event_code = lv_event_get_code(e); if(event_code == LV_EVENT_CLICKED) { click_consumer_mute(e); } } void ui_event_BtnPlayPause(lv_event_t * e) { lv_event_code_t event_code = lv_event_get_code(e); if(event_code == LV_EVENT_CLICKED) { click_consumer_play_pause(e); } } void ui_event_BtnPrev(lv_event_t * e) { lv_event_code_t event_code = lv_event_get_code(e); if(event_code == LV_EVENT_CLICKED) { click_consumer_prev(e); } } void ui_event_BtnNext(lv_event_t * e) { lv_event_code_t event_code = lv_event_get_code(e); if(event_code == LV_EVENT_CLICKED) { click_consumer_next(e); } } // build funtions void ui_Screen3_screen_init(void) { ui_Screen3 = lv_obj_create(NULL); lv_obj_set_size(ui_Screen3, BOARD_LCD_LOGIC_H_RES, BOARD_LCD_LOGIC_V_RES); lv_obj_remove_flag(ui_Screen3, LV_OBJ_FLAG_SCROLLABLE); ui_screen3_create_button(&ui_BtnVolDown, &ui_LabelVolDown, -50, -55, "Vol-"); ui_screen3_create_button(&ui_BtnVolUp, &ui_LabelVolUp, 50, -55, "Vol+"); ui_screen3_create_button(&ui_BtnMute, &ui_LabelMute, -50, 0, "Mute"); ui_screen3_create_button(&ui_BtnPlayPause, &ui_LabelPlayPause, 50, 0, "Play"); ui_screen3_create_button(&ui_BtnPrev, &ui_LabelPrev, -50, 55, "Prev"); ui_screen3_create_button(&ui_BtnNext, &ui_LabelNext, 50, 55, "Next"); lv_obj_add_event_cb(ui_BtnVolDown, ui_event_BtnVolDown, LV_EVENT_ALL, NULL); lv_obj_add_event_cb(ui_BtnVolUp, ui_event_BtnVolUp, LV_EVENT_ALL, NULL); lv_obj_add_event_cb(ui_BtnMute, ui_event_BtnMute, LV_EVENT_ALL, NULL); lv_obj_add_event_cb(ui_BtnPlayPause, ui_event_BtnPlayPause, LV_EVENT_ALL, NULL); lv_obj_add_event_cb(ui_BtnPrev, ui_event_BtnPrev, LV_EVENT_ALL, NULL); lv_obj_add_event_cb(ui_BtnNext, ui_event_BtnNext, LV_EVENT_ALL, NULL); } void ui_Screen3_screen_destroy(void) { if(ui_Screen3) lv_obj_del(ui_Screen3); ui_Screen3 = NULL; ui_BtnVolDown = NULL; ui_BtnVolUp = NULL; ui_BtnMute = NULL; ui_BtnPlayPause = NULL; ui_BtnPrev = NULL; ui_BtnNext = NULL; ui_LabelVolDown = NULL; ui_LabelVolUp = NULL; ui_LabelMute = NULL; ui_LabelPlayPause = NULL; ui_LabelPrev = NULL; ui_LabelNext = NULL; }