2 #include <Vst3/Plugin.hpp>
4 #include <score/plugins/application/GUIApplicationPlugin.hpp>
6 #include <ossia/detail/fmt.hpp>
7 #include <ossia/detail/string_map.hpp>
9 #include <QElapsedTimer>
11 #include <QWebSocketServer>
13 #include <base/source/fstring.h>
14 #include <pluginterfaces/vst/ivstmessage.h>
25 std::vector<VST3::Hosting::ClassInfo> classInfo;
30 struct HostApp final :
public Steinberg::Vst::IHostApplication
32 Steinberg::Vst::PlugInterfaceSupport m_support;
35 Steinberg::tresult getName(Steinberg::Vst::String128 name)
override
37 Steinberg::String str(
"ossia score");
38 str.copyTo16(name, 0, 127);
39 return Steinberg::kResultTrue;
43 createInstance(Steinberg::TUID cid, Steinberg::TUID _iid,
void** obj)
override
45 using namespace Steinberg;
46 using namespace Steinberg::Vst;
47 FUID classID(FUID::fromTUID(cid));
48 FUID interfaceID(FUID::fromTUID(_iid));
49 if(classID == Vst::IMessage::iid && interfaceID == Vst::IMessage::iid)
51 *obj =
new HostMessage;
55 classID == Vst::IAttributeList::iid && interfaceID == Vst::IAttributeList::iid)
57 *obj = Vst::HostAttributeList::make();
64 Steinberg::tresult queryInterface(
const char* _iid,
void** obj)
override
66 using namespace Steinberg;
67 using namespace Steinberg::Vst;
68 QUERY_INTERFACE(_iid, obj, FUnknown::iid, IHostApplication)
69 QUERY_INTERFACE(_iid, obj, IHostApplication::iid, IHostApplication)
71 if(m_support.isPlugInterfaceSupported(_iid) == kResultTrue)
78 Steinberg::uint32 addRef()
override {
return 1; }
80 Steinberg::uint32 release()
override {
return 1; }
91 void initialize()
override;
93 VST3::Hosting::Module::Ptr getModule(
const std::string& path);
96 void rescan(
const QStringList& paths);
97 void vstChanged() W_SIGNAL(vstChanged)
99 void processIncomingMessage(
const QString& txt);
100 void addInvalidVST(
const QString& path);
101 void addVST(
const QString& path,
const QJsonObject& json);
103 void scanVSTsEvent();
105 std::pair<const AvailablePlugin*, const VST3::Hosting::ClassInfo*>
106 classInfo(
const VST3::UID& uid)
const noexcept;
107 QString pathForClass(
const VST3::UID& uid)
const noexcept;
108 std::optional<VST3::UID>
109 uidForPathAndClassName(
const QString& path,
const QString& cls)
const noexcept;
111 #if QT_CONFIG(process)
112 struct ScanningProcess
115 std::unique_ptr<QProcess> process;
120 std::vector<ScanningProcess> m_processes;
121 QWebSocketServer m_wsServer;
125 ossia::string_map<VST3::Hosting::Module::Ptr> modules;
126 std::vector<AvailablePlugin> vst_infos;
Definition: GUIApplicationPlugin.hpp:31
Definition: score-plugin-vst3/Vst3/ApplicationPlugin.hpp:86
Used to access all the application-wide state and structures.
Definition: ApplicationContext.hpp:24
Definition: score-plugin-vst3/Vst3/ApplicationPlugin.hpp:22
Definition: score-plugin-vst3/Vst3/ApplicationPlugin.hpp:31