From 63e1184f97f890f69346983a6569526945676f23 Mon Sep 17 00:00:00 2001 From: Luca <51792528+donluca@users.noreply.github.com> Date: Sat, 1 Apr 2023 17:06:30 +0200 Subject: [PATCH] Skip empty voices while scrolling --- src/uimenu.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/uimenu.cpp b/src/uimenu.cpp index a1d44ce..f6a23b9 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -587,15 +587,25 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event) return; } - string TG ("TG"); - TG += to_string (nTG+1); + string voiceName = pUIMenu->m_pMiniDexed->GetVoiceName (nTG); // Skip empty voices + if (voiceName == "INIT VOICE") { + if (Event == MenuEventStepUp) { + CUIMenu::EditProgramNumber (pUIMenu, MenuEventStepUp); + } + if (Event == MenuEventStepDown) { + CUIMenu::EditProgramNumber (pUIMenu, MenuEventStepDown); + } + } else { + string TG ("TG"); + TG += to_string (nTG+1); - string Value = to_string (nValue+1) + "=" + pUIMenu->m_pMiniDexed->GetVoiceName (nTG); + string Value = to_string (nValue+1) + "=" + pUIMenu->m_pMiniDexed->GetVoiceName (nTG); - pUIMenu->m_pUI->DisplayWrite (TG.c_str (), - pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name, - Value.c_str (), - nValue > 0, nValue < (int) CSysExFileLoader::VoicesPerBank-1); + pUIMenu->m_pUI->DisplayWrite (TG.c_str (), + pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name, + Value.c_str (), + nValue > 0, nValue < (int) CSysExFileLoader::VoicesPerBank-1); + } } void CUIMenu::EditTGParameter (CUIMenu *pUIMenu, TMenuEvent Event)