|
|
|
@ -486,6 +486,7 @@ void CUIMenu::EditGlobalParameter (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
void CUIMenu::EditVoiceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
{ |
|
|
|
|
unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-1]; |
|
|
|
|
int nLoadedBanks = pUIMenu->m_pMiniDexed->GetSysExFileLoader ()->GetNumLoadedBanks(); |
|
|
|
|
|
|
|
|
|
int nValue = pUIMenu->m_pMiniDexed->GetTGParameter (CMiniDexed::TGParameterVoiceBank, nTG); |
|
|
|
|
|
|
|
|
@ -504,9 +505,9 @@ void CUIMenu::EditVoiceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case MenuEventStepUp: |
|
|
|
|
if (++nValue > (int) CSysExFileLoader::MaxVoiceBankID) |
|
|
|
|
if (++nValue > (int) nLoadedBanks-1) |
|
|
|
|
{ |
|
|
|
|
nValue = CSysExFileLoader::MaxVoiceBankID; |
|
|
|
|
nValue = nLoadedBanks-1; |
|
|
|
|
} |
|
|
|
|
pUIMenu->m_pMiniDexed->SetTGParameter ( |
|
|
|
|
CMiniDexed::TGParameterVoiceBank, nValue, nTG); |
|
|
|
@ -536,6 +537,7 @@ void CUIMenu::EditVoiceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
{ |
|
|
|
|
unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-1]; |
|
|
|
|
int nLoadedBanks = pUIMenu->m_pMiniDexed->GetSysExFileLoader ()->GetNumLoadedBanks(); |
|
|
|
|
|
|
|
|
|
int nValue = pUIMenu->m_pMiniDexed->GetTGParameter (CMiniDexed::TGParameterProgram, nTG); |
|
|
|
|
|
|
|
|
@ -547,7 +549,15 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
case MenuEventStepDown: |
|
|
|
|
if (--nValue < 0) |
|
|
|
|
{ |
|
|
|
|
nValue = 0; |
|
|
|
|
// Switch down a voice bank and set to the last voice
|
|
|
|
|
nValue = CSysExFileLoader::VoicesPerBank-1; |
|
|
|
|
int nVB = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TGParameterVoiceBank, nTG); |
|
|
|
|
if (--nVB < 0) |
|
|
|
|
{ |
|
|
|
|
// Wrap around to last loaded bank
|
|
|
|
|
nVB = nLoadedBanks-1; |
|
|
|
|
} |
|
|
|
|
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TGParameterVoiceBank, nVB, nTG); |
|
|
|
|
} |
|
|
|
|
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TGParameterProgram, nValue, nTG); |
|
|
|
|
break; |
|
|
|
@ -555,7 +565,15 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event) |
|
|
|
|
case MenuEventStepUp: |
|
|
|
|
if (++nValue > (int) CSysExFileLoader::VoicesPerBank-1) |
|
|
|
|
{ |
|
|
|
|
nValue = CSysExFileLoader::VoicesPerBank-1; |
|
|
|
|
// Switch up a voice bank and reset to voice 0
|
|
|
|
|
nValue = 0; |
|
|
|
|
int nVB = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TGParameterVoiceBank, nTG); |
|
|
|
|
if (++nVB > (int) nLoadedBanks-1) |
|
|
|
|
{ |
|
|
|
|
// Wrap around to first bank
|
|
|
|
|
nVB = 0; |
|
|
|
|
} |
|
|
|
|
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TGParameterVoiceBank, nVB, nTG); |
|
|
|
|
} |
|
|
|
|
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TGParameterProgram, nValue, nTG); |
|
|
|
|
break; |
|
|
|
|