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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1992 - (hide annotations) (download) (as text)
Fri Aug 28 07:48:47 2009 UTC (14 years, 7 months ago) by iliev
File MIME type: text/x-c++hdr
File size: 3219 byte(s)
* bugfix: AU plugin failed to destroy its audio/MIDI devices

1 persson 1777 /***************************************************************************
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 persson 1922 LSCPServer* pLSCPServer;
42 persson 1777 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 iliev 1835 Plugin(bool bDoPreInit = true);
68     virtual ~Plugin();
69     void PreInit();
70     void Init(int SampleRate, int FragmentSize, int Channels = -1);
71 persson 1777
72     void InitState();
73     String GetState();
74     bool SetState(String State);
75 iliev 1835 void RemoveChannels();
76 iliev 1992 void DestroyDevice(AudioOutputDevicePlugin* pDevice);
77     void DestroyDevice(MidiInputDevicePlugin* pDevice);
78 persson 1777
79     AudioOutputDevicePlugin* pAudioDevice;
80     MidiInputDevicePlugin* pMidiDevice;
81     static PluginGlobal* global;
82 iliev 1835
83 persson 1777 private:
84 iliev 1835 bool bPreInitDone;
85 persson 1777 };
86     }
87    
88     #endif

  ViewVC Help
Powered by ViewVC