Format: 000:000 TG1

pull/840/head
probonopd 2 months ago committed by GitHub
parent a10e61b781
commit 839f0b5f22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      src/uimenu.cpp

@ -702,18 +702,24 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event)
CUIMenu::EditProgramNumber (pUIMenu, MenuEventStepDown); CUIMenu::EditProgramNumber (pUIMenu, MenuEventStepDown);
} }
} else { } else {
// Show bank:voice number on the top line, e.g. 005:012 // Format: 000:000 TG1 (bank:voice padded, TGx right-aligned)
int nBank = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TGParameterVoiceBank, nTG); int nBank = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TGParameterVoiceBank, nTG);
std::string topLine = "000"; std::string left = "000";
topLine += std::to_string(nBank+1); left += std::to_string(nBank+1);
topLine = topLine.substr(topLine.length()-3,3); left = left.substr(left.length()-3,3);
topLine += ":"; left += ":";
std::string voiceNum = "000"; std::string voiceNum = "000";
voiceNum += std::to_string(nValue+1); voiceNum += std::to_string(nValue+1);
voiceNum = voiceNum.substr(voiceNum.length()-3,3); voiceNum = voiceNum.substr(voiceNum.length()-3,3);
topLine += voiceNum; left += voiceNum;
std::string tgLabel = "TG" + std::to_string(nTG+1);
unsigned lcdCols = pUIMenu->m_pConfig->GetLCDColumns();
unsigned pad = 0;
if (lcdCols > left.length() + tgLabel.length())
pad = lcdCols - (unsigned)(left.length() + tgLabel.length());
std::string topLine = left + std::string(pad, ' ') + tgLabel;
// Only show the voice name on the bottom line
std::string Value = pUIMenu->m_pMiniDexed->GetVoiceName (nTG); std::string Value = pUIMenu->m_pMiniDexed->GetVoiceName (nTG);
pUIMenu->m_pUI->DisplayWrite (topLine.c_str(), pUIMenu->m_pUI->DisplayWrite (topLine.c_str(),

Loading…
Cancel
Save