static void okcancel_cb(guiObject_t *obj, const void *data) { (void)obj; if (data) { //Save mixer here MIXER_SetLimit(mp->channel, &mp->limit); MIXER_SetTemplate(mp->channel, mp->cur_template); MIXER_SetMixers(mp->mixer, mp->num_mixers); } PAGE_RemoveAllObjects(); PAGE_MixerInit(mp->top_channel); }
static unsigned action_cb(u32 button, unsigned flags, void *data) { (void)data; if ((flags & BUTTON_PRESS) || (flags & BUTTON_LONGPRESS)) { if (CHAN_ButtonIsPressed(button, BUT_EXIT)) { PAGE_RemoveAllObjects(); // Discard unsaved items and exit to upper page PAGE_MixerInit(mp->top_channel); } else { // only one callback can handle a button press, so we don't handle BUT_ENTER here, let it handled by press cb return 0; } } return 1; }