/[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 1835 - (show annotations) (download) (as text)
Mon Feb 16 17:56:50 2009 UTC (15 years, 2 months ago) by iliev
File MIME type: text/x-c++hdr
File size: 3097 byte(s)
* Adapted drivers/Plugin class to be used as a base class for the
  AudioUnit plugin and fixed orphaned pointers when deleting PluginGlobal
* Fixed possible iterator invalidations when resetting the sampler
* Fixed memory leaks when issuing the following LSCP commands:
  GET AUDIO_OUTPUT_DRIVER INFO
  GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO
  GET MIDI_INPUT_DRIVER INFO
  GET MIDI_INPUT_DRIVER_PARAMETER INFO
* Fixed possible compilation error when sqlite is not present

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 private:
42 LSCPServer* pLSCPServer;
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 void InitState();
73 String GetState();
74 bool SetState(String State);
75 void RemoveChannels();
76
77 AudioOutputDevicePlugin* pAudioDevice;
78 MidiInputDevicePlugin* pMidiDevice;
79 static PluginGlobal* global;
80
81 private:
82 bool bPreInitDone;
83 };
84 }
85
86 #endif

  ViewVC Help
Powered by ViewVC