From aeac944ff0907ce1d89b62d29d529602f9a5bf6f Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:46:52 -0800 Subject: [PATCH] Ensure bank selection works when PCCH is not enabled, and that UI remains consistent when changing banks. --- src/minidexed.cpp | 13 +++++-------- src/performanceconfig.cpp | 1 - src/uimenu.cpp | 6 ++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 8ce5ca2..968320a 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -432,16 +432,13 @@ void CMiniDexed::BankSelectPerformance (unsigned nBank) { nBank=constrain((int)nBank,0,16383); - if (m_nParameter[ParameterPerformanceSelectChannel] != CMIDIDevice::Disabled) + if (GetPerformanceConfig ()->IsValidPerformanceBank(nBank)) { - if (GetPerformanceConfig ()->IsValidPerformanceBank(nBank)) - { - // Only change if we have the bank loaded - m_nVoiceBankIDPerformance = nBank; - SetNewPerformanceBank (nBank); + // Only change if we have the bank loaded + m_nVoiceBankIDPerformance = nBank; + SetNewPerformanceBank (nBank); - m_UI.ParameterChanged (); - } + m_UI.ParameterChanged (); } } diff --git a/src/performanceconfig.cpp b/src/performanceconfig.cpp index 53a3eeb..8cd6275 100644 --- a/src/performanceconfig.cpp +++ b/src/performanceconfig.cpp @@ -1,4 +1,3 @@ - // // performanceconfig.cpp // diff --git a/src/uimenu.cpp b/src/uimenu.cpp index e09e301..82a426a 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -1390,6 +1390,12 @@ void CUIMenu::PerformanceMenu (CUIMenu *pUIMenu, TMenuEvent Event) unsigned nLastPerformance = pUIMenu->m_pMiniDexed->GetLastPerformance(); unsigned nValue = pUIMenu->m_nSelectedPerformanceID; unsigned nStart = nValue; + if (pUIMenu->m_pMiniDexed->IsValidPerformance(nValue) != true) + { + // A bank change has left the selected performance out of sync + nValue = pUIMenu->m_pMiniDexed->GetActualPerformanceID(); + pUIMenu->m_nSelectedPerformanceID = nValue; + } std::string Value; if (Event == MenuEventUpdate)