Insert FX UI improvements

pull/764/head
jnonis 7 months ago
parent 881149e119
commit 897c35aad0
  1. 4
      src/effects.h
  2. 103
      src/uimenu.cpp
  3. 1
      src/uimenu.h

@ -36,12 +36,12 @@ inline std::string getFXTypeName(int nValue)
{
switch (nValue)
{
case EFFECT_CHORUS: return "Juno Chorus";
case EFFECT_CHORUS: return "YKChorus";
case EFFECT_DELAY: return "Delay";
case EFFECT_LPF: return "LP Filter";
case EFFECT_DS1: return "DS1";
case EFFECT_BIGMUFF: return "Big Muff";
case EFFECT_TALREVERB3: return "Tal Reverb 3";
case EFFECT_TALREVERB3: return "TalRvrb3";
case EFFECT_NONE:
default: return "None";
}

@ -65,7 +65,7 @@ const CUIMenu::TMenuItem CUIMenu::s_TGMenu[] =
#ifdef ARM_ALLOW_MULTI_CORE
{"Pan", EditTGParameter, 0, CMiniDexed::TGParameterPan},
#endif
{"Insert FX", MenuHandler, s_InsertFX},
{"Insert FX", MenuHandlerInsertFX},
{"Reverb-Send", EditTGParameter, 0, CMiniDexed::TGParameterReverbSend},
{"Detune", EditTGParameter, 0, CMiniDexed::TGParameterMasterTune},
{"Cutoff", EditTGParameter, 0, CMiniDexed::TGParameterCutoff},
@ -139,8 +139,8 @@ const CUIMenu::TMenuItem CUIMenu::s_ReverbMenu[] =
const CUIMenu::TMenuItem CUIMenu::s_InsertFX[] =
{
{"Type", EditTGParameter2, 0, CMiniDexed::TGParameterInsertFXType},
{"Edit", EditInsertFX},
{"Type:", EditTGParameter2, 0, CMiniDexed::TGParameterInsertFXType},
{"Edit:", EditInsertFX},
{0}
};
@ -623,6 +623,93 @@ void CUIMenu::MenuHandler (CUIMenu *pUIMenu, TMenuEvent Event)
}
}
void CUIMenu::MenuHandlerInsertFX (CUIMenu *pUIMenu, TMenuEvent Event)
{
// Setup menu when it's open
if (!pUIMenu->m_pCurrentMenu)
{
pUIMenu->m_pCurrentMenu = s_InsertFX;
}
switch (Event)
{
case MenuEventUpdate:
break;
case MenuEventSelect: // push menu
assert (pUIMenu->m_nCurrentMenuDepth < MaxMenuDepth);
pUIMenu->m_MenuStackParent[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_pParentMenu;
pUIMenu->m_MenuStackMenu[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_pCurrentMenu;
pUIMenu->m_nMenuStackItem[pUIMenu->m_nCurrentMenuDepth]
= pUIMenu->m_nCurrentMenuItem;
pUIMenu->m_nMenuStackSelection[pUIMenu->m_nCurrentMenuDepth]
= pUIMenu->m_nCurrentSelection;
pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth]
= pUIMenu->m_nCurrentParameter;
pUIMenu->m_nCurrentMenuDepth++;
pUIMenu->m_pParentMenu = pUIMenu->m_pCurrentMenu;
pUIMenu->m_nCurrentParameter =
pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].Parameter;
pUIMenu->m_pCurrentMenu =
pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].MenuItem;
pUIMenu->m_nCurrentMenuItem = pUIMenu->m_nCurrentSelection;
pUIMenu->m_nCurrentSelection = 0;
break;
case MenuEventStepDown:
if (pUIMenu->m_nCurrentSelection > 0)
{
pUIMenu->m_nCurrentSelection--;
}
break;
case MenuEventStepUp:
++pUIMenu->m_nCurrentSelection;
if (!pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].Name) // more entries?
{
pUIMenu->m_nCurrentSelection--;
}
break;
case MenuEventPressAndStepDown:
case MenuEventPressAndStepUp:
pUIMenu->TGShortcutHandler (Event);
return;
default:
return;
}
if (pUIMenu->m_pCurrentMenu) // if this is another menu?
{
// Identify TG
unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-1];
// Create TG label
string TG ("TG");
TG += to_string (nTG+1);
// Get current FX type
int fxType = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TGParameterInsertFXType, nTG);
// Create Paramter with type label
std::string value;
value.append(pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].Name);
value.append(getFXTypeName(fxType));
pUIMenu->m_pUI->DisplayWrite (
TG.c_str (),
pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name,
value.c_str(),
pUIMenu->m_nCurrentSelection > 0,
!!pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection+1].Name);
}
else
{
pUIMenu->EventHandler (MenuEventUpdate); // no, update parameter display
}
}
void CUIMenu::EditGlobalParameter (CUIMenu *pUIMenu, TMenuEvent Event)
{
CMiniDexed::TParameter Param = (CMiniDexed::TParameter) pUIMenu->m_nCurrentParameter;
@ -966,9 +1053,15 @@ void CUIMenu::EditInsertFX (CUIMenu *pUIMenu, TMenuEvent Event)
if (pUIMenu->m_pCurrentMenu) // if this is another menu?
{
string TG ("TG");
TG += to_string (nTG+1);
// Get current FX type
int fxType = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TGParameterInsertFXType, nTG);
pUIMenu->m_pUI->DisplayWrite (
pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name,
"",
TG.c_str (),
getFXTypeName(fxType).c_str(),
pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].Name,
pUIMenu->m_nCurrentSelection > 0,
!!pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection+1].Name);

@ -93,6 +93,7 @@ private:
static void SavePerformanceNewFile (CUIMenu *pUIMenu, TMenuEvent Event);
static void EditPerformanceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event);
static void MenuHandlerInsertFX (CUIMenu *pUIMenu, TMenuEvent Event);
static void EditInsertFX (CUIMenu *pUIMenu, TMenuEvent Event);
static void EditTGFXParameter (CUIMenu *pUIMenu, TMenuEvent Event);

Loading…
Cancel
Save