Browse Source

Fix loading VST3 plugins, closes #155

tags/1.9.6
falkTX 11 years ago
parent
commit
71528d7daa
5 changed files with 36 additions and 14 deletions
  1. +9
    -7
      source/backend/plugin/JucePlugin.cpp
  2. +18
    -4
      source/discovery/carla-discovery.cpp
  3. +2
    -1
      source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  4. +6
    -0
      source/utils/CarlaJuceUtils.hpp
  5. +1
    -2
      source/utils/CarlaStateUtils.cpp

+ 9
- 7
source/backend/plugin/JucePlugin.cpp View File

@@ -1147,14 +1147,14 @@ public:
return false; return false;
} }


if (std::strcmp(format, "AU") == 0)
if (label == nullptr || label[0] == '\0')
{ {
if (label == nullptr || label[0] == '\0')
{
pData->engine->setLastError("null label");
return false;
}
pData->engine->setLastError("null label");
return false;
}


if (std::strcmp(format, "AU") == 0)
{
fDesc.fileOrIdentifier = label; fDesc.fileOrIdentifier = label;
} }
else else
@@ -1168,7 +1168,8 @@ public:
String jfilename(filename); String jfilename(filename);


#ifdef CARLA_OS_WIN #ifdef CARLA_OS_WIN
if (jfilename.startsWith("/"))
// Fix for wine usage
if (juce_isRunningInWine() && filename[0] == '/')
{ {
jfilename.replace("/", "\\"); jfilename.replace("/", "\\");
jfilename = "Z:" + jfilename; jfilename = "Z:" + jfilename;
@@ -1176,6 +1177,7 @@ public:
#endif #endif


fDesc.fileOrIdentifier = jfilename; fDesc.fileOrIdentifier = jfilename;
fDesc.name = label;
fDesc.uid = static_cast<int>(uniqueId); fDesc.uid = static_cast<int>(uniqueId);
} }




+ 18
- 4
source/discovery/carla-discovery.cpp View File

@@ -1381,10 +1381,21 @@ static void do_juce_check(const char* const filename_, const char* const stype,
carla_debug("do_juce_check(%s, %s, %s)", filename_, stype, bool2str(doInit)); carla_debug("do_juce_check(%s, %s, %s)", filename_, stype, bool2str(doInit));


using namespace juce; using namespace juce;
juce::String filename;


juce::String filename(File(filename_).getFullPathName());
#ifdef CARLA_OS_WIN
// Fix for wine usage
if (juce_isRunningInWine() && filename_[0] == '/')
{
filename = filename_;
filename.replace("/", "\\");
filename = "Z:" + filename;
}
else
#endif
filename = File(filename_).getFullPathName();


ScopedPointer<AudioPluginFormat> pluginFormat;
juce::ScopedPointer<AudioPluginFormat> pluginFormat;


/* */ if (std::strcmp(stype, "VST") == 0) /* */ if (std::strcmp(stype, "VST") == 0)
{ {
@@ -1417,6 +1428,9 @@ static void do_juce_check(const char* const filename_, const char* const stype,
return; return;
} }


#ifdef CARLA_OS_WIN
CARLA_SAFE_ASSERT_RETURN(File(filename).existsAsFile(),);
#endif
CARLA_SAFE_ASSERT_RETURN(pluginFormat->fileMightContainThisPluginType(filename),); CARLA_SAFE_ASSERT_RETURN(pluginFormat->fileMightContainThisPluginType(filename),);


OwnedArray<PluginDescription> results; OwnedArray<PluginDescription> results;
@@ -1464,8 +1478,8 @@ static void do_juce_check(const char* const filename_, const char* const stype,
DISCOVERY_OUT("init", "-----------"); DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("build", BINARY_NATIVE); DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("hints", hints); DISCOVERY_OUT("hints", hints);
DISCOVERY_OUT("name", desc->name);
DISCOVERY_OUT("label", desc->descriptiveName);
DISCOVERY_OUT("name", desc->descriptiveName);
DISCOVERY_OUT("label", desc->name);
DISCOVERY_OUT("maker", desc->manufacturerName); DISCOVERY_OUT("maker", desc->manufacturerName);
DISCOVERY_OUT("uniqueId", desc->uid); DISCOVERY_OUT("uniqueId", desc->uid);
DISCOVERY_OUT("audio.ins", audioIns); DISCOVERY_OUT("audio.ins", audioIns);


+ 2
- 1
source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -1403,7 +1403,8 @@ private:
const Result result (finder.findDescriptionsAndPerform (f)); const Result result (finder.findDescriptionsAndPerform (f));
if (result.getErrorMessage() == MatchingDescriptionFinder::getSuccessString())
if (result.getErrorMessage() == MatchingDescriptionFinder::getSuccessString() ||
result.getErrorMessage().isEmpty())
{ {
name = description.name; name = description.name;
return true; return true;


+ 6
- 0
source/utils/CarlaJuceUtils.hpp View File

@@ -193,4 +193,10 @@ private:
CARLA_PREVENT_HEAP_ALLOCATION CARLA_PREVENT_HEAP_ALLOCATION
}; };


#ifdef CARLA_OS_WIN
namespace juce {
extern bool juce_isRunningInWine();
}
#endif

#endif // CARLA_JUCE_UTILS_HPP_INCLUDED #endif // CARLA_JUCE_UTILS_HPP_INCLUDED

+ 1
- 2
source/utils/CarlaStateUtils.cpp View File

@@ -506,9 +506,8 @@ String StateSave::toString() const
infoXml << " <UniqueID>" << uniqueId << "</UniqueID>\n"; infoXml << " <UniqueID>" << uniqueId << "</UniqueID>\n";
break; break;
case PLUGIN_VST3: case PLUGIN_VST3:
// TODO?
infoXml << " <Binary>" << xmlSafeString(binary, true) << "</Binary>\n"; infoXml << " <Binary>" << xmlSafeString(binary, true) << "</Binary>\n";
infoXml << " <UniqueID>" << uniqueId << "</UniqueID>\n";
infoXml << " <Label>" << xmlSafeString(label, true) << "</Label>\n";
break; break;
case PLUGIN_AU: case PLUGIN_AU:
infoXml << " <Identifier>" << xmlSafeString(label, true) << "</Identifier>\n"; infoXml << " <Identifier>" << xmlSafeString(label, true) << "</Identifier>\n";


Loading…
Cancel
Save