1 /**
2 Generic host interface.
3 
4 Copyright: Auburn Sounds 2015-2016.
5 License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
6 */
7 module dplug.host;
8 
9 public import dplug.host.host;
10 public import dplug.host.vst;
11 public import dplug.host.window;
12 
13 import std.algorithm.mutation;
14 
15 /// Loads an audio plugin.
16 IPluginHost createPluginHost(string dynlibPath)
17 {
18     import std..string;
19     import dplug.core.sharedlib;
20 
21     // FUTURE support OSX plugin bundles
22     SharedLib lib;
23     lib.load(dynlibPath);
24 
25     auto VSTPluginMain = getVSTEntryPoint(lib);
26     if (VSTPluginMain != null) // is this is a VST plugin?
27     {
28         return new VSTPluginHost(move(lib));
29     }
30     else
31         throw new Exception(format("Couldn't load plugin '%s': unknown format", dynlibPath));
32 }