/[svn]/linuxsampler/trunk/src/drivers/Plugin.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/drivers/Plugin.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2174 - (show annotations) (download) (as text)
Tue Apr 12 15:19:56 2011 UTC (13 years ago) by capela
File MIME type: text/x-c++hdr
File size: 3346 byte(s)
* plugin changes:
    - LV2 Persist + Files support (patch by David Robillard)

1 /***************************************************************************
2 * *
3 * Copyright (C) 2008 Andreas Persson *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
18 * MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #ifndef LS_PLUGIN_H
22 #define LS_PLUGIN_H
23
24 #include "../Sampler.h"
25 #include "../common/Thread.h"
26 #include "../network/lscpserver.h"
27 #include "audio/AudioOutputDevicePlugin.h"
28 #include "midi/MidiInputDevicePlugin.h"
29
30 namespace LinuxSampler {
31
32 class EventThread;
33
34 class PluginGlobal {
35 public:
36 PluginGlobal();
37 virtual ~PluginGlobal();
38
39 Sampler* pSampler;
40 int RefCount;
41 LSCPServer* pLSCPServer;
42 private:
43 EventThread* pEventThread;
44 };
45
46 class EventThread : public Thread {
47 public:
48 EventThread(Sampler* pSampler);
49 int Main();
50 private:
51 Sampler* pSampler;
52 };
53
54
55 /** @brief Base class for LinuxSampler plugin implementations
56 *
57 * When LinuxSampler is run as a plugin in a sequencer, the
58 * classes that implement the different type of plugin interfaces
59 * (VST, DSSI, LV2, etc) can inherit from this class.
60 *
61 * The plugin gets access to audio and midi devices that it can
62 * use to let the engine render the audio. Methods to get and set
63 * the state of the sampler is also provided.
64 */
65 class Plugin {
66 protected:
67 Plugin(bool bDoPreInit = true);
68 virtual ~Plugin();
69 void PreInit();
70 void Init(int SampleRate, int FragmentSize, int Channels = -1);
71
72 virtual String PathToState(const String& string);
73 virtual String PathFromState(const String& string);
74
75 void InitState();
76 String GetState();
77 bool SetState(String State);
78 void RemoveChannels();
79 void DestroyDevice(AudioOutputDevicePlugin* pDevice);
80 void DestroyDevice(MidiInputDevicePlugin* pDevice);
81
82 AudioOutputDevicePlugin* pAudioDevice;
83 MidiInputDevicePlugin* pMidiDevice;
84 static PluginGlobal* global;
85
86 private:
87 bool bPreInitDone;
88 };
89 }
90
91 #endif

  ViewVC Help
Powered by ViewVC