Browse Source

VST string encoding tweak.

tags/2021-05-28
jules 13 years ago
parent
commit
9fe7c939e0
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp

+ 11
- 7
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -2582,7 +2582,7 @@ void VSTPluginInstance::updateStoredProgramNames()
{
if (effect != nullptr && getNumPrograms() > 0)
{
char nm [256] = { 0 };
char nm[256] = { 0 };
// only do this if the plugin can't use indexed names..
if (dispatch (effGetProgramNameIndexed, 0, -1, nm, 0) == 0)
@@ -2605,24 +2605,28 @@ void VSTPluginInstance::updateStoredProgramNames()
const String VSTPluginInstance::getCurrentProgramName()
{
String name;
if (effect != nullptr)
{
char nm [256] = { 0 };
dispatch (effGetProgramName, 0, 0, nm, 0);
{
char nm[256] = { 0 };
dispatch (effGetProgramName, 0, 0, nm, 0);
name = String (CharPointer_UTF8 (nm)).trim();
}
const int index = getCurrentProgram();
if (programNames[index].isEmpty())
{
while (programNames.size() < index)
programNames.add (String::empty);
programNames.set (index, String (nm).trim());
programNames.set (index, name);
}
return String (nm).trim();
}
return String::empty;
return name;
}
//==============================================================================


Loading…
Cancel
Save