Example #1
0
static void _show_page()
{
    u8 h = 12;
    int i;
    PAGE_RemoveAllObjects();
    PAGE_ShowHeader(_tr("Mixer"));
    memset(gui, 0, sizeof(*gui));

    struct Mixer *mix = MIXER_GetAllMixers();
    u8 space = ITEM_HEIGHT + 1;
    u8 row = space;
    u8 w1 = 50;
    u8 w2 = LCD_WIDTH - w1 - ARROW_WIDTH - 4;
    for (i = 0; row < space * 5; i++) {
        u8 idx;
        labelDesc.style = LABEL_LEFT;
        u8 ch = mp->top_channel + i;
        if (ch >= Model.num_channels)
            ch += (NUM_OUT_CHANNELS - Model.num_channels);
        if (ch < NUM_OUT_CHANNELS) {
            GUI_CreateButtonPlateText(&gui->limit[i], 0, row, w1, h,&labelDesc, MIXPAGE_ChanNameProtoCB, 0,
                    limitselect_cb, (void *)((long)ch));
        } else if(! _is_virt_cyclic(ch)) {
            GUI_CreateButtonPlateText(&gui->limit[i], 0, row, w1, h,&labelDesc, MIXPAGE_ChanNameProtoCB, 0,
                    virtname_cb, (void *)((long)ch));
        } else {
            GUI_CreateLabelBox(&gui->name[i], 0, row, w1, h, &labelDesc,
                                   MIXPAGE_ChanNameProtoCB, NULL, (const void *)((long)ch));
        }

        labelDesc.style = LABEL_CENTER;
        GUI_CreateButtonPlateText(&gui->tmpl[i], w1 + 2, row, w2, h , &labelDesc, template_name_cb, 0,
                templateselect_cb, (void *)((long)ch));

        row += space; // bug fix: dynamically showing/hiding items won't work in devo10, it causes crash when changing template from none to simple/expo/complex
        for (idx = 0; idx < NUM_MIXERS; idx++)
            if (mix[idx].src && mix[idx].dest == ch)
                break;
        if (idx != NUM_MIXERS) {
            enum TemplateType template = MIXER_GetTemplate(ch);
            labelDesc.style = LABEL_LEFTCENTER;
            GUI_CreateLabelBox(&gui->src[i], 0, row, w1, h, &labelDesc, show_source, NULL, &mix[idx].src);
            if (template == MIXERTEMPLATE_EXPO_DR) {
Example #2
0
static void _show_page()
{
    // Note for future maintenance: DO NOT use logical view to draw all the channel items at a time for this page:  I just
    // gave it a try, it spent very long time to construct all the 30 items and could trigger watch-dog to reboot !!!
    static const int XOFFSET = ((LCD_WIDTH - 320) / 2);
    int init_y = LCD_HEIGHT == 240 ? 44 : 36;
    int i;
    if (mp->firstObj) {
        GUI_RemoveHierObjects(mp->firstObj);
        mp->firstObj = NULL;
    }
    struct Mixer *mix = MIXER_GetAllMixers();
    for (i = 0; i < ENTRIES_PER_PAGE; i++) {
        guiObject_t *obj;
        u8 idx;
        int row = init_y + 24 * i;
        u8 ch = mp->top_channel + i;
        if (ch >= Model.num_channels)
            ch += (NUM_OUT_CHANNELS - Model.num_channels);
        if (ch < NUM_OUT_CHANNELS) {
            obj = GUI_CreateButton(&gui->name[i].but, XOFFSET+4, row, BUTTON_64x16, MIXPAGE_ChanNameProtoCB,
                                   0x0000, limitselect_cb, (void *)((long)ch));
        } else if(! _is_virt_cyclic(ch)) {
            obj = GUI_CreateButton(&gui->name[i].but, XOFFSET+4, row, BUTTON_64x16, MIXPAGE_ChanNameProtoCB,
                                   0x0000, virtname_cb, (void *)(long)ch);
        } else {
            obj = GUI_CreateLabelBox(&gui->name[i].lbl, XOFFSET+4, row, 64, 16, &DEFAULT_FONT,
                                   MIXPAGE_ChanNameProtoCB, NULL, (void *)((long)ch));
        }
        if (! mp->firstObj)
            mp->firstObj = obj;
        GUI_CreateButton(&gui->tmpl[i], XOFFSET+132, row, BUTTON_64x16, template_name_cb, 0x0000,
                         templateselect_cb, (void *)((long)ch));
        for (idx = 0; idx < NUM_MIXERS; idx++)
            if (mix[idx].src && mix[idx].dest == ch)
                break;
        if (idx != NUM_MIXERS) {
            enum TemplateType template = MIXER_GetTemplate(ch);
            GUI_CreateLabelBox(&gui->src[i], XOFFSET+68, row, 60, 16, &NARROW_FONT, show_source, NULL, &mix[idx].src);
            if (template == MIXERTEMPLATE_EXPO_DR) {