Bsongis/gui refactoring for x7 d (#3701)
* [X7D] New board added * Cosmetics
This commit is contained in:
@@ -93,13 +93,13 @@ void onCustomFunctionsMenu(const char *result)
|
||||
storageDirty(eeFlags);
|
||||
}
|
||||
else if (result == STR_INSERT) {
|
||||
memmove(cfn+1, cfn, (NUM_CFN-menuVerticalPosition-1)*sizeof(CustomFunctionData));
|
||||
memmove(cfn+1, cfn, (MAX_SPECIAL_FUNCTIONS-menuVerticalPosition-1)*sizeof(CustomFunctionData));
|
||||
memset(cfn, 0, sizeof(CustomFunctionData));
|
||||
storageDirty(eeFlags);
|
||||
}
|
||||
else if (result == STR_DELETE) {
|
||||
memmove(cfn, cfn+1, (NUM_CFN-menuVerticalPosition-1)*sizeof(CustomFunctionData));
|
||||
memset(&g_model.customFn[NUM_CFN-1], 0, sizeof(CustomFunctionData));
|
||||
memmove(cfn, cfn+1, (MAX_SPECIAL_FUNCTIONS-menuVerticalPosition-1)*sizeof(CustomFunctionData));
|
||||
memset(&g_model.customFn[MAX_SPECIAL_FUNCTIONS-1], 0, sizeof(CustomFunctionData));
|
||||
storageDirty(eeFlags);
|
||||
}
|
||||
}
|
||||
@@ -154,11 +154,11 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY);
|
||||
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_FUNCTION)
|
||||
POPUP_MENU_ADD_ITEM(STR_PASTE);
|
||||
if (!CFN_EMPTY(cfn) && CFN_EMPTY(&functions[NUM_CFN-1]))
|
||||
if (!CFN_EMPTY(cfn) && CFN_EMPTY(&functions[MAX_SPECIAL_FUNCTIONS-1]))
|
||||
POPUP_MENU_ADD_ITEM(STR_INSERT);
|
||||
if (!CFN_EMPTY(cfn))
|
||||
POPUP_MENU_ADD_ITEM(STR_CLEAR);
|
||||
for (int i=menuVerticalPosition+1; i<NUM_CFN; i++) {
|
||||
for (int i=menuVerticalPosition+1; i<MAX_SPECIAL_FUNCTIONS; i++) {
|
||||
if (!CFN_EMPTY(&functions[i])) {
|
||||
POPUP_MENU_ADD_ITEM(STR_DELETE);
|
||||
break;
|
||||
@@ -183,7 +183,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
if (active || AUTOSWITCH_ENTER_LONG()) {
|
||||
CHECK_INCDEC_SWITCH(event, CFN_SWITCH(cfn), SWSRC_FIRST, SWSRC_LAST, eeFlags, isSwitchAvailableInCustomFunctions);
|
||||
}
|
||||
putsSwitches(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
break;
|
||||
|
||||
case ITEM_SPECIAL_FUNCTIONS_FUNCTION:
|
||||
@@ -204,7 +204,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
|
||||
case ITEM_SPECIAL_FUNCTIONS_PARAM:
|
||||
{
|
||||
int8_t maxParam = NUM_CHNOUT-1;
|
||||
int8_t maxParam = MAX_OUTPUT_CHANNELS-1;
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
if (func == FUNC_OVERRIDE_CHANNEL) {
|
||||
putsChn(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, CFN_CH_INDEX(cfn)+1, attr);
|
||||
@@ -213,7 +213,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
#endif
|
||||
if (func == FUNC_TRAINER) {
|
||||
maxParam = 4;
|
||||
putsMixerSource(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, CFN_CH_INDEX(cfn)==0 ? 0 : MIXSRC_Rud+CFN_CH_INDEX(cfn)-1, attr);
|
||||
drawSource(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, CFN_CH_INDEX(cfn)==0 ? 0 : MIXSRC_Rud+CFN_CH_INDEX(cfn)-1, attr);
|
||||
}
|
||||
#if defined(GVARS)
|
||||
else if (func == FUNC_ADJUST_GVAR) {
|
||||
@@ -260,7 +260,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
#endif
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
val_max = 59*60+59;
|
||||
putsTimer(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
drawTimer(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
}
|
||||
else if (func == FUNC_PLAY_SOUND) {
|
||||
val_max = AU_SPECIAL_SOUND_LAST-AU_SPECIAL_SOUND_FIRST-1;
|
||||
@@ -301,7 +301,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
}
|
||||
else if (func == FUNC_PLAY_VALUE) {
|
||||
val_max = MIXSRC_LAST_TELEM;
|
||||
putsMixerSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
if (active) {
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(functions == g_eeGeneral.customFn ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
|
||||
@@ -310,7 +310,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
#endif
|
||||
else if (func == FUNC_VOLUME) {
|
||||
val_max = MIXSRC_LAST_CH;
|
||||
putsMixerSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
if (active) {
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
@@ -342,7 +342,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
break;
|
||||
case FUNC_ADJUST_GVAR_SOURCE:
|
||||
val_max = MIXSRC_LAST_CH;
|
||||
putsMixerSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
if (active) {
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
@@ -415,6 +415,6 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
|
||||
bool menuModelSpecialFunctions(event_t event)
|
||||
{
|
||||
MENU(STR_MENUCUSTOMFUNC, MODEL_ICONS, menuTabModel, MENU_MODEL_SPECIAL_FUNCTIONS, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
MENU(STR_MENUCUSTOMFUNC, MODEL_ICONS, menuTabModel, MENU_MODEL_SPECIAL_FUNCTIONS, MAX_SPECIAL_FUNCTIONS, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
return menuSpecialFunctions(event, g_model.customFn, modelFunctionsContext);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user