probonopd 2 weeks ago committed by GitHub
parent 4fa9e167b2
commit 8306fcddbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 19
      src/minidexed.cpp

@ -1763,13 +1763,20 @@ bool CMiniDexed::IsValidPerformanceBank(unsigned nBankID)
return m_PerformanceConfig.IsValidPerformanceBank(nBankID);
}
void CMiniDexed::SetVoiceName (std::string VoiceName, unsigned nTG)
void CMiniDexed::SetVoiceName(std::string VoiceName, unsigned nTG)
{
assert (nTG < CConfig::ToneGenerators);
assert (m_pTG[nTG]);
char Name[10];
strncpy(Name, VoiceName.c_str(),10);
m_pTG[nTG]->getName (Name);
assert(nTG < CConfig::ToneGenerators);
assert(m_pTG[nTG]);
// Define a buffer with enough space for the string and null terminator
char Name[VoiceName.size() + 1];
// Copy the string and ensure null termination
strncpy(Name, VoiceName.c_str(), VoiceName.size());
Name[VoiceName.size()] = '\0';
// Pass the null-terminated string to getName
m_pTG[nTG]->getName(Name);
}
bool CMiniDexed::DeletePerformance(unsigned nID)

Loading…
Cancel
Save