|
|
|
@@ -370,7 +370,7 @@ struct VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0 |
|
|
|
tresult PLUGIN_API popup (Steinberg::UCoord x, Steinberg::UCoord y) override;
|
|
|
|
|
|
|
|
#if ! JUCE_MODAL_LOOPS_PERMITTED
|
|
|
|
static void menuFinished (int modalResult, ComSmartPtr<ContextMenu> menu) { menu->handleResult (modalResult); }
|
|
|
|
static void menuFinished (int modalResult, VSTComSmartPtr<ContextMenu> menu) { menu->handleResult (modalResult); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
@@ -382,7 +382,7 @@ struct VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0 |
|
|
|
struct ItemAndTarget
|
|
|
|
{
|
|
|
|
Item item;
|
|
|
|
ComSmartPtr<IContextMenuTarget> target;
|
|
|
|
VSTComSmartPtr<IContextMenuTarget> target;
|
|
|
|
};
|
|
|
|
|
|
|
|
Array<ItemAndTarget> items;
|
|
|
|
@@ -446,7 +446,7 @@ struct VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0 |
|
|
|
|
|
|
|
if (doUIDsMatch (cid, Vst::IMessage::iid) && doUIDsMatch (iid, Vst::IMessage::iid))
|
|
|
|
{
|
|
|
|
ComSmartPtr<Message> m (new Message (attributeList));
|
|
|
|
VSTComSmartPtr<Message> m (new Message (attributeList));
|
|
|
|
messageQueue.add (m);
|
|
|
|
m->addRef();
|
|
|
|
*obj = m;
|
|
|
|
@@ -454,7 +454,7 @@ struct VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0 |
|
|
|
}
|
|
|
|
else if (doUIDsMatch (cid, Vst::IAttributeList::iid) && doUIDsMatch (iid, Vst::IAttributeList::iid))
|
|
|
|
{
|
|
|
|
ComSmartPtr<AttributeList> l (new AttributeList (this));
|
|
|
|
VSTComSmartPtr<AttributeList> l (new AttributeList (this));
|
|
|
|
l->addRef();
|
|
|
|
*obj = l;
|
|
|
|
return kResultOk;
|
|
|
|
@@ -541,14 +541,14 @@ private: |
|
|
|
var value;
|
|
|
|
|
|
|
|
private:
|
|
|
|
ComSmartPtr<Vst::IAttributeList> attributeList;
|
|
|
|
VSTComSmartPtr<Vst::IAttributeList> attributeList;
|
|
|
|
String messageId;
|
|
|
|
Atomic<int> refCount;
|
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Message)
|
|
|
|
};
|
|
|
|
|
|
|
|
Array<ComSmartPtr<Message>, CriticalSection> messageQueue;
|
|
|
|
Array<VSTComSmartPtr<Message>, CriticalSection> messageQueue;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
struct AttributeList : public Vst::IAttributeList
|
|
|
|
@@ -664,7 +664,7 @@ private: |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
owner->messageQueue.add (ComSmartPtr<Message> (new Message (this, id, value)));
|
|
|
|
owner->messageQueue.add (VSTComSmartPtr<Message> (new Message (this, id, value)));
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Type>
|
|
|
|
@@ -687,7 +687,7 @@ private: |
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AttributeList)
|
|
|
|
};
|
|
|
|
|
|
|
|
ComSmartPtr<AttributeList> attributeList;
|
|
|
|
VSTComSmartPtr<AttributeList> attributeList;
|
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VST3HostContext)
|
|
|
|
};
|
|
|
|
@@ -731,8 +731,8 @@ struct DescriptionFactory |
|
|
|
std::unique_ptr<PClassInfoW> infoW;
|
|
|
|
|
|
|
|
{
|
|
|
|
ComSmartPtr<IPluginFactory2> pf2;
|
|
|
|
ComSmartPtr<IPluginFactory3> pf3;
|
|
|
|
VSTComSmartPtr<IPluginFactory2> pf2;
|
|
|
|
VSTComSmartPtr<IPluginFactory3> pf3;
|
|
|
|
|
|
|
|
if (pf2.loadFrom (factory))
|
|
|
|
{
|
|
|
|
@@ -752,7 +752,7 @@ struct DescriptionFactory |
|
|
|
PluginDescription desc;
|
|
|
|
|
|
|
|
{
|
|
|
|
ComSmartPtr<Vst::IComponent> component;
|
|
|
|
VSTComSmartPtr<Vst::IComponent> component;
|
|
|
|
|
|
|
|
if (component.loadFrom (factory, info.cid))
|
|
|
|
{
|
|
|
|
@@ -790,8 +790,8 @@ struct DescriptionFactory |
|
|
|
virtual Result performOnDescription (PluginDescription&) = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
ComSmartPtr<VST3HostContext> vst3HostContext;
|
|
|
|
ComSmartPtr<IPluginFactory> factory;
|
|
|
|
VSTComSmartPtr<VST3HostContext> vst3HostContext;
|
|
|
|
VSTComSmartPtr<IPluginFactory> factory;
|
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DescriptionFactory)
|
|
|
|
};
|
|
|
|
@@ -849,7 +849,7 @@ struct DLLHandle |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** The factory should begin with a refCount of 1, so don't increment the reference count
|
|
|
|
(ie: don't use a ComSmartPtr in here)! Its lifetime will be handled by this DLLHandle.
|
|
|
|
(ie: don't use a VSTComSmartPtr in here)! Its lifetime will be handled by this DLLHandle.
|
|
|
|
*/
|
|
|
|
IPluginFactory* JUCE_CALLTYPE getPluginFactory()
|
|
|
|
{
|
|
|
|
@@ -1102,8 +1102,8 @@ private: |
|
|
|
//==============================================================================
|
|
|
|
bool open (const PluginDescription& description)
|
|
|
|
{
|
|
|
|
ComSmartPtr<IPluginFactory> pluginFactory (DLLHandleCache::getInstance()->findOrCreateHandle (file.getFullPathName())
|
|
|
|
.getPluginFactory());
|
|
|
|
VSTComSmartPtr<IPluginFactory> pluginFactory (DLLHandleCache::getInstance()->findOrCreateHandle (file.getFullPathName())
|
|
|
|
.getPluginFactory());
|
|
|
|
|
|
|
|
if (pluginFactory != nullptr)
|
|
|
|
{
|
|
|
|
@@ -1511,7 +1511,7 @@ private: |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
Atomic<int> refCount { 1 };
|
|
|
|
ComSmartPtr<IPlugView> view;
|
|
|
|
VSTComSmartPtr<IPlugView> view;
|
|
|
|
|
|
|
|
#if JUCE_WINDOWS
|
|
|
|
struct ChildComponent : public Component
|
|
|
|
@@ -1569,7 +1569,7 @@ struct VST3ComponentHolder |
|
|
|
// transfers ownership to the plugin instance!
|
|
|
|
AudioPluginInstance* createPluginInstance();
|
|
|
|
|
|
|
|
bool fetchController (ComSmartPtr<Vst::IEditController>& editController)
|
|
|
|
bool fetchController (VSTComSmartPtr<Vst::IEditController>& editController)
|
|
|
|
{
|
|
|
|
if (! isComponentInitialised && ! initialise())
|
|
|
|
return false;
|
|
|
|
@@ -1618,8 +1618,8 @@ struct VST3ComponentHolder |
|
|
|
ignoreUnused (success);
|
|
|
|
jassert (success);
|
|
|
|
|
|
|
|
ComSmartPtr<IPluginFactory2> pf2;
|
|
|
|
ComSmartPtr<IPluginFactory3> pf3;
|
|
|
|
VSTComSmartPtr<IPluginFactory2> pf2;
|
|
|
|
VSTComSmartPtr<IPluginFactory3> pf3;
|
|
|
|
|
|
|
|
std::unique_ptr<PClassInfo2> info2;
|
|
|
|
std::unique_ptr<PClassInfoW> infoW;
|
|
|
|
@@ -1683,7 +1683,7 @@ struct VST3ComponentHolder |
|
|
|
JUCE_ASSERT_MESSAGE_THREAD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
factory = ComSmartPtr<IPluginFactory> (module->getPluginFactory());
|
|
|
|
factory = VSTComSmartPtr<IPluginFactory> (module->getPluginFactory());
|
|
|
|
|
|
|
|
int classIdx;
|
|
|
|
if ((classIdx = getClassIndex (module->getName())) < 0)
|
|
|
|
@@ -1734,9 +1734,9 @@ struct VST3ComponentHolder |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
VST3ModuleHandle::Ptr module;
|
|
|
|
ComSmartPtr<IPluginFactory> factory;
|
|
|
|
ComSmartPtr<VST3HostContext> host;
|
|
|
|
ComSmartPtr<Vst::IComponent> component;
|
|
|
|
VSTComSmartPtr<IPluginFactory> factory;
|
|
|
|
VSTComSmartPtr<VST3HostContext> host;
|
|
|
|
VSTComSmartPtr<Vst::IComponent> component;
|
|
|
|
FUID cidOfComponent;
|
|
|
|
|
|
|
|
bool isComponentInitialised = false;
|
|
|
|
@@ -2292,7 +2292,7 @@ public: |
|
|
|
{
|
|
|
|
if (trackInfoListener != nullptr)
|
|
|
|
{
|
|
|
|
ComSmartPtr<Vst::IAttributeList> l (new TrackPropertiesAttributeList (properties));
|
|
|
|
VSTComSmartPtr<Vst::IAttributeList> l (new TrackPropertiesAttributeList (properties));
|
|
|
|
trackInfoListener->setChannelContextInfos (l);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -2427,7 +2427,7 @@ public: |
|
|
|
if (getActiveEditor() != nullptr)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
ComSmartPtr<IPlugView> view (tryCreatingView(), false);
|
|
|
|
VSTComSmartPtr<IPlugView> view (tryCreatingView(), false);
|
|
|
|
return view != nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2509,7 +2509,7 @@ public: |
|
|
|
bool setStateFromPresetFile (const MemoryBlock& rawData)
|
|
|
|
{
|
|
|
|
MemoryBlock rawDataCopy (rawData);
|
|
|
|
ComSmartPtr<Steinberg::MemoryStream> memoryStream = new Steinberg::MemoryStream (rawDataCopy.getData(), (int) rawDataCopy.getSize());
|
|
|
|
VSTComSmartPtr<Steinberg::MemoryStream> memoryStream = new Steinberg::MemoryStream (rawDataCopy.getData(), (int) rawDataCopy.getSize());
|
|
|
|
|
|
|
|
if (memoryStream == nullptr || holder->component == nullptr)
|
|
|
|
return false;
|
|
|
|
@@ -2676,17 +2676,17 @@ private: |
|
|
|
std::unique_ptr<PClassInfoW> infoW;
|
|
|
|
|
|
|
|
// Rudimentary interfaces:
|
|
|
|
ComSmartPtr<Vst::IEditController> editController;
|
|
|
|
ComSmartPtr<Vst::IEditController2> editController2;
|
|
|
|
ComSmartPtr<Vst::IMidiMapping> midiMapping;
|
|
|
|
ComSmartPtr<Vst::IAudioProcessor> processor;
|
|
|
|
ComSmartPtr<Vst::IComponentHandler> componentHandler;
|
|
|
|
ComSmartPtr<Vst::IComponentHandler2> componentHandler2;
|
|
|
|
ComSmartPtr<Vst::IUnitInfo> unitInfo;
|
|
|
|
ComSmartPtr<Vst::IUnitData> unitData;
|
|
|
|
ComSmartPtr<Vst::IProgramListData> programListData;
|
|
|
|
ComSmartPtr<Vst::IConnectionPoint> componentConnection, editControllerConnection;
|
|
|
|
ComSmartPtr<Vst::ChannelContext::IInfoListener> trackInfoListener;
|
|
|
|
VSTComSmartPtr<Vst::IEditController> editController;
|
|
|
|
VSTComSmartPtr<Vst::IEditController2> editController2;
|
|
|
|
VSTComSmartPtr<Vst::IMidiMapping> midiMapping;
|
|
|
|
VSTComSmartPtr<Vst::IAudioProcessor> processor;
|
|
|
|
VSTComSmartPtr<Vst::IComponentHandler> componentHandler;
|
|
|
|
VSTComSmartPtr<Vst::IComponentHandler2> componentHandler2;
|
|
|
|
VSTComSmartPtr<Vst::IUnitInfo> unitInfo;
|
|
|
|
VSTComSmartPtr<Vst::IUnitData> unitData;
|
|
|
|
VSTComSmartPtr<Vst::IProgramListData> programListData;
|
|
|
|
VSTComSmartPtr<Vst::IConnectionPoint> componentConnection, editControllerConnection;
|
|
|
|
VSTComSmartPtr<Vst::ChannelContext::IInfoListener> trackInfoListener;
|
|
|
|
|
|
|
|
/** The number of IO buses MUST match that of the plugin,
|
|
|
|
even if there aren't enough channels to process,
|
|
|
|
@@ -2701,7 +2701,7 @@ private: |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
template <typename Type>
|
|
|
|
static void appendStateFrom (XmlElement& head, ComSmartPtr<Type>& object, const String& identifier)
|
|
|
|
static void appendStateFrom (XmlElement& head, VSTComSmartPtr<Type>& object, const String& identifier)
|
|
|
|
{
|
|
|
|
if (object != nullptr)
|
|
|
|
{
|
|
|
|
@@ -2715,7 +2715,7 @@ private: |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static ComSmartPtr<Steinberg::MemoryStream> createMemoryStreamForState (XmlElement& head, StringRef identifier)
|
|
|
|
static VSTComSmartPtr<Steinberg::MemoryStream> createMemoryStreamForState (XmlElement& head, StringRef identifier)
|
|
|
|
{
|
|
|
|
if (auto* state = head.getChildByName (identifier))
|
|
|
|
{
|
|
|
|
@@ -2723,7 +2723,7 @@ private: |
|
|
|
|
|
|
|
if (mem.fromBase64Encoding (state->getAllSubText()))
|
|
|
|
{
|
|
|
|
ComSmartPtr<Steinberg::MemoryStream> stream (new Steinberg::MemoryStream(), false);
|
|
|
|
VSTComSmartPtr<Steinberg::MemoryStream> stream (new Steinberg::MemoryStream(), false);
|
|
|
|
stream->setSize ((TSize) mem.getSize());
|
|
|
|
mem.copyTo (stream->getData(), 0, mem.getSize());
|
|
|
|
return stream;
|
|
|
|
@@ -2733,8 +2733,8 @@ private: |
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
ComSmartPtr<ParamValueQueueList> inputParameterChanges, outputParameterChanges;
|
|
|
|
ComSmartPtr<MidiEventList> midiInputs, midiOutputs;
|
|
|
|
VSTComSmartPtr<ParamValueQueueList> inputParameterChanges, outputParameterChanges;
|
|
|
|
VSTComSmartPtr<MidiEventList> midiInputs, midiOutputs;
|
|
|
|
Vst::ProcessContext timingInfo; //< Only use this in processBlock()!
|
|
|
|
bool isControllerInitialised = false, isActive = false, lastProcessBlockCallWasBypass = false;
|
|
|
|
VST3Parameter* bypassParam = nullptr;
|
|
|
|
@@ -2872,10 +2872,10 @@ private: |
|
|
|
setRateAndBufferSizeDetails (setup.sampleRate, (int) setup.maxSamplesPerBlock);
|
|
|
|
}
|
|
|
|
|
|
|
|
static AudioProcessor::BusesProperties getBusProperties (ComSmartPtr<Vst::IComponent>& component)
|
|
|
|
static AudioProcessor::BusesProperties getBusProperties (VSTComSmartPtr<Vst::IComponent>& component)
|
|
|
|
{
|
|
|
|
AudioProcessor::BusesProperties busProperties;
|
|
|
|
ComSmartPtr<Vst::IAudioProcessor> processor;
|
|
|
|
VSTComSmartPtr<Vst::IAudioProcessor> processor;
|
|
|
|
processor.loadFrom (component.get());
|
|
|
|
|
|
|
|
for (int dirIdx = 0; dirIdx < 2; ++dirIdx)
|
|
|
|
@@ -3252,7 +3252,7 @@ tresult VST3HostContext::ContextMenu::popup (Steinberg::UCoord x, Steinberg::UCo |
|
|
|
// Unfortunately, Steinberg's docs explicitly say this should be modal..
|
|
|
|
handleResult (topLevelMenu->showMenu (options));
|
|
|
|
#else
|
|
|
|
topLevelMenu->showMenuAsync (options, ModalCallbackFunction::create (menuFinished, ComSmartPtr<ContextMenu> (this)));
|
|
|
|
topLevelMenu->showMenuAsync (options, ModalCallbackFunction::create (menuFinished, VSTComSmartPtr<ContextMenu> (this)));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return kResultOk;
|
|
|
|
@@ -3314,12 +3314,12 @@ void VST3PluginFormat::findAllTypesForFile (OwnedArray<PluginDescription>& resul |
|
|
|
for every housed plugin.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ComSmartPtr<IPluginFactory> pluginFactory (DLLHandleCache::getInstance()->findOrCreateHandle (fileOrIdentifier)
|
|
|
|
.getPluginFactory());
|
|
|
|
VSTComSmartPtr<IPluginFactory> pluginFactory (DLLHandleCache::getInstance()->findOrCreateHandle (fileOrIdentifier)
|
|
|
|
.getPluginFactory());
|
|
|
|
|
|
|
|
if (pluginFactory != nullptr)
|
|
|
|
{
|
|
|
|
ComSmartPtr<VST3HostContext> host (new VST3HostContext());
|
|
|
|
VSTComSmartPtr<VST3HostContext> host (new VST3HostContext());
|
|
|
|
DescriptionLister lister (host, pluginFactory);
|
|
|
|
lister.findDescriptionsAndPerform (File (fileOrIdentifier));
|
|
|
|
|
|
|
|
|