static int complex_row_cb(int absrow, int relrow, int y, void *data) { const char *label = NULL; void *tgl = NULL; void *value = NULL; data = NULL; int x = 0; int w = LEFT_VIEW_WIDTH; if (absrow + COMMON_LAST == COMPLEX_TRIM) { GUI_CreateButtonPlateText(&gui->value[relrow].but, x, y, w, ITEM_HEIGHT, &labelDesc, show_trim_cb, 0x0000, toggle_trim_cb, NULL); if (! MIXER_SourceHasTrim(MIXER_SRC(mp->mixer[0].src))) GUI_SetHidden((guiObject_t *)&gui->label[relrow], 1); return 1; } switch(absrow + COMMON_LAST) { case COMPLEX_MIXER: label = _tr_noop("Mixers"); value = set_nummixers_cb; break; case COMPLEX_PAGE: label = _tr_noop("Page"); tgl = reorder_cb; value = set_mixernum_cb; break; case COMPLEX_SWITCH: label = _tr_noop("Switch"); tgl = sourceselect_cb; value = set_drsource_cb; data = &mp->cur_mixer->sw; break; case COMPLEX_MUX: label = _tr_noop("Mux"); value = set_mux_cb; break; case COMPLEX_SRC: label = _tr_noop("Src"); tgl = sourceselect_cb; value = set_source_cb; data = &mp->cur_mixer->src; break; case COMPLEX_CURVE: label = _tr_noop("Curve"); tgl = curveselect_cb; value = set_curvename_cb; data = mp->cur_mixer; break; case COMPLEX_SCALE: label = _tr_noop("Scale"); value = set_number100_cb; data = &mp->cur_mixer->scalar; break; case COMPLEX_OFFSET: label = _tr_noop("Offset"); value = set_number100_cb; data = &mp->cur_mixer->offset; break; } labelDesc.style = LABEL_LEFTCENTER; GUI_CreateLabelBox(&gui->label[relrow], x, y, w, ITEM_HEIGHT, &labelDesc, NULL, NULL, _tr(label)); labelDesc.style = LABEL_CENTER; GUI_CreateTextSelectPlate(&gui->value[relrow].ts, x, y + ITEM_HEIGHT + 1, w, ITEM_HEIGHT, &labelDesc, tgl, value, data); if (absrow + COMMON_LAST == COMPLEX_SRC) set_src_enable(CURVE_TYPE(&mp->cur_mixer->curve)); return 1; }
void toggle_link_cb(guiObject_t *obj, const void *data) { (void)obj; if(data) { mp->link_curves ^= 0x02; if (mp->link_curves & 0x02) { //Redraw graphs when re-linking sync_mixers(); set_src_enable(CURVE_TYPE(&mp->mixer[0].curve)); MIXPAGE_RedrawGraphs(); } } else { mp->link_curves ^= 0x01; if (mp->link_curves & 0x01) { //Redraw graphs when re-linking sync_mixers(); set_src_enable(CURVE_TYPE(&mp->mixer[0].curve)); MIXPAGE_RedrawGraphs(); } } _update_rate_widgets(data ? 1 : 0); }
const char *set_mixernum_cb(guiObject_t *obj, int dir, void *data) { (void)obj; (void)data; u8 cur = (mp->cur_mixer - mp->mixer) + 1; u8 changed; cur = GUI_TextSelectHelper(cur, 1, mp->num_mixers, dir, 1, 1, &changed); if (changed) { mp->cur_mixer = mp->mixer + (cur - 1); _show_complex(1); set_src_enable(CURVE_TYPE(&mp->cur_mixer->curve)); } sprintf(mp->tmpstr, "%d", cur); return mp->tmpstr; }
static const char *set_curvename_cb(guiObject_t *obj, int dir, void *data) { if (!GUI_IsTextSelectEnabled(obj)) { strcpy(mp->tmpstr, _tr("Linked")); return mp->tmpstr; } u8 changed; struct Mixer *mix = (struct Mixer *)data; u8 type = CURVE_TYPE(&mix->curve); type = GUI_TextSelectHelper(type, 0, CURVE_MAX, dir, 1, 1, &changed); if (changed) { CURVE_SET_TYPE(&mix->curve, type); sync_mixers(); set_src_enable(type); MIXPAGE_RedrawGraphs(); } GUI_TextSelectEnablePress((guiTextSelect_t *)obj, type > CURVE_FIXED); return CURVE_GetName(mp->tmpstr, &mix->curve); }
void MIXPAGE_ChangeTemplate(int show_header) { if (mp->cur_template != MIXERTEMPLATE_COMPLEX || mp->cur_mixer < mp->mixer || mp->cur_mixer > mp->mixer + mp->num_mixers) { mp->cur_mixer = mp->mixer; } if (Model.type == MODELTYPE_PLANE && mp->cur_template > MIXERTEMPLATE_MAX_PLANE) { mp->cur_template = MIXERTEMPLATE_NONE; } sync_mixers(); if (show_header) { PAGE_RemoveAllObjects(); _show_titlerow(); } else { GUI_RemoveHierObjects(mp->firstObj); } mp->firstObj = NULL; switch(mp->cur_template) { case MIXERTEMPLATE_NONE: case MIXERTEMPLATE_CYC1: case MIXERTEMPLATE_CYC2: case MIXERTEMPLATE_CYC3: show_none(); return; case MIXERTEMPLATE_SIMPLE: _show_simple(); break; case MIXERTEMPLATE_EXPO_DR: _show_expo_dr(); break; case MIXERTEMPLATE_COMPLEX: _show_complex(0); break; } set_src_enable(CURVE_TYPE(&mp->mixer[0].curve)); }