Loader.hpp
1 #pragma once
2 // Taken and refactored from ofxVstHostPluginLoader.h
3 // https://github.com/Meach/ofxVstHost
4 
5 #include <Vst/vst-compat.hpp>
6 
7 #include <QString>
8 
9 #include <string>
10 
11 namespace vst
12 {
13 using PluginEntryProc = AEffect* (*)(audioMasterCallback audioMaster);
14 
15 struct Module
16 {
17  std::string path;
18  void* module{};
19 
20  Module(std::string fileName);
21  ~Module();
22  PluginEntryProc getMain();
23 
24  int use_count{};
25 };
26 
27 #if defined(__APPLE__)
28 static const constexpr auto default_path = "/Library/Audio/Plug-Ins/VST";
29 static const constexpr auto default_filter = "*.vst *.dylib *.component";
30 #elif defined(__linux__)
31 static const auto default_path = QStringLiteral("/usr/lib/vst");
32 static const constexpr auto default_filter = "*.so";
33 #elif defined(_WIN32)
34 static const constexpr auto default_path = "c:\\vst";
35 static const constexpr auto default_filter = "*.dll";
36 #else
37 static const constexpr auto default_path = "";
38 static const constexpr auto default_filter = "";
39 #endif
40 }
Definition: Loader.hpp:16