/[svn]/linuxsampler/trunk/src/hostplugins/dssi/PluginDssi.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/hostplugins/dssi/PluginDssi.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2013 - (show annotations) (download) (as text)
Sat Oct 24 09:07:38 2009 UTC (14 years, 6 months ago) by persson
File MIME type: text/x-c++hdr
File size: 4138 byte(s)
* fixed compilation error in DSSI plugin
* removed gig engine dependency in DSSI plugin

1 /***************************************************************************
2 * *
3 * Copyright (C) 2008 - 2009 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_PLUGINDSSI_H
22 #define LS_PLUGINDSSI_H
23
24 #include <ladspa.h>
25 #include <dssi.h>
26
27 #include "../../drivers/Plugin.h"
28
29 namespace {
30
31 class PluginDssi : public LinuxSampler::Plugin {
32 public:
33 PluginDssi(unsigned long SampleRate);
34 private:
35 int RefCount;
36 friend class PluginInstance;
37 };
38
39 class PluginInstance {
40 public:
41 PluginInstance(unsigned long SampleRate);
42 ~PluginInstance();
43 void ConnectPort(unsigned long Port, LADSPA_Data* DataLocation);
44 char* Configure(const char* Key, const char* Value);
45 void Activate();
46 static void RunMultipleSynths(unsigned long InstanceCount,
47 LADSPA_Handle* Instances,
48 unsigned long SampleCount,
49 snd_seq_event_t** Events,
50 unsigned long* EventCounts);
51 private:
52 static PluginDssi* plugin;
53 LinuxSampler::SamplerChannel* pChannel;
54 LinuxSampler::MidiInputPort* pPort;
55 LADSPA_Data* Out[2];
56 };
57
58 class PluginInfo {
59 public:
60 static const LADSPA_Descriptor* LadspaDescriptor() {
61 return &Instance.Ladspa;
62 }
63 static const DSSI_Descriptor* DssiDescriptor() {
64 return &Instance.Dssi;
65 }
66 private:
67 LADSPA_Descriptor Ladspa;
68 DSSI_Descriptor Dssi;
69 LADSPA_PortDescriptor PortDescriptors[2];
70 LADSPA_PortRangeHint PortRangeHints[2];
71 const char* PortNames[2];
72
73 PluginInfo();
74 static PluginInfo Instance;
75 };
76
77 extern "C" {
78 // LADSPA interface
79 static LADSPA_Handle instantiate(const LADSPA_Descriptor* Descriptor,
80 unsigned long SampleRate);
81 static void connect_port(LADSPA_Handle Instance, unsigned long Port,
82 LADSPA_Data* DataLocation);
83 static void activate(LADSPA_Handle Instance);
84 static void run(LADSPA_Handle Instance, unsigned long SampleCount);
85 static void cleanup(LADSPA_Handle Instance);
86
87 // DSSI interface
88 static char* configure(LADSPA_Handle Instance,
89 const char* Key,
90 const char* Value);
91 static void run_multiple_synths(unsigned long InstanceCount,
92 LADSPA_Handle* Instances,
93 unsigned long SampleCount,
94 snd_seq_event_t** Events,
95 unsigned long* EventCounts);
96 }
97 }
98
99 #endif

  ViewVC Help
Powered by ViewVC