From 66409c6739589b6e7301049f55ebc1e8c8c03a7b Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:51:44 -0800 Subject: [PATCH] Suggested update to UI to show bank/performance numbers. --- src/minidexed.cpp | 5 +++++ src/minidexed.h | 1 + src/uimenu.cpp | 20 +++++++++++++++----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 2395aa2..cdad60a 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -1546,6 +1546,11 @@ unsigned CMiniDexed::GetLastPerformance() return m_PerformanceConfig.GetLastPerformance(); } +unsigned CMiniDexed::GetPerformanceBank() +{ + return m_PerformanceConfig.GetPerformanceBank(); +} + unsigned CMiniDexed::GetLastPerformanceBank() { return m_PerformanceConfig.GetLastPerformanceBank(); diff --git a/src/minidexed.h b/src/minidexed.h index 14aa88b..38f9841 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -121,6 +121,7 @@ public: std::string GetPerformanceFileName(unsigned nID); std::string GetPerformanceName(unsigned nID); unsigned GetLastPerformance(); + unsigned GetPerformanceBank(); unsigned GetLastPerformanceBank(); unsigned GetActualPerformanceID(); void SetActualPerformanceID(unsigned nID); diff --git a/src/uimenu.cpp b/src/uimenu.cpp index a7f241c..2bacb68 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -1513,12 +1513,19 @@ void CUIMenu::PerformanceMenu (CUIMenu *pUIMenu, TMenuEvent Event) if(!pUIMenu->m_bPerformanceDeleteMode) { Value = pUIMenu->m_pMiniDexed->GetPerformanceName(nValue); + unsigned nBankNum = pUIMenu->m_pMiniDexed->GetPerformanceBank(); - - std::string nPSelected = ""; + std::string nPSelected = "000"; + nPSelected += std::to_string(nBankNum+1); // Convert to user-facing bank number rather than index + nPSelected = nPSelected.substr(nPSelected.length()-3,3); + std::string nPPerf = "000"; + nPPerf += std::to_string(nValue+1); // Convert to user-facing performance number rather than index + nPPerf = nPPerf.substr(nPPerf.length()-3,3); + + nPSelected += ":"+nPPerf; if(nValue == pUIMenu->m_pMiniDexed->GetActualPerformanceID()) { - nPSelected= "[L]"; + nPSelected += " [L]"; } pUIMenu->m_pUI->DisplayWrite (pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name, nPSelected.c_str(), @@ -1600,10 +1607,13 @@ void CUIMenu::EditPerformanceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event) } Value = pUIMenu->m_pMiniDexed->GetPerformanceConfig ()->GetPerformanceBankName(nValue); - std::string nPSelected = ""; + std::string nPSelected = "000"; + nPSelected += std::to_string(nValue+1); // Convert to user-facing number rather than index + nPSelected = nPSelected.substr(nPSelected.length()-3,3); + if(nValue == (unsigned)pUIMenu->m_pMiniDexed->GetParameter (CMiniDexed::ParameterPerformanceBank)) { - nPSelected= "[L]"; + nPSelected += " [L]"; } pUIMenu->m_pUI->DisplayWrite (pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name, nPSelected.c_str(),