LMMS
Loading...
Searching...
No Matches
cmt.h
Go to the documentation of this file.
1/* cmt.h
2
3 Computer Music Toolkit - a library of LADSPA plugins. Copyright (C)
4 2000-2002 Richard W.E. Furse.
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public Licence as
8 published by the Free Software Foundation; either version 2 of the
9 Licence, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307, USA. */
20
21#ifndef CMT_BASE_INCLUDED
22#define CMT_BASE_INCLUDED
23
24#ifndef M_PI
25#define M_PI 3.14159265358979323846264338327
26#endif
27
28/*****************************************************************************/
29
30#include "ladspa_types.h"
31
32/*****************************************************************************/
33
37public:
39 }
40};
41
42/*****************************************************************************/
43
52
54private:
55
57 return *this;
58 }
61
62public:
63
65
73 CMT_Descriptor(unsigned long lUniqueID,
74 const char * pcLabel,
75 LADSPA_Properties iProperties,
76 const char * pcName,
77 const char * pcMaker,
78 const char * pcCopyright,
79 CMT_ImplementationData * poImplementationData,
80 LADSPA_Instantiate_Function fInstantiate,
85 LADSPA_Deactivate_Function fDeactivate);
86
90 void addPort(LADSPA_PortDescriptor iPortDescriptor,
91 const char * pcPortName,
92 LADSPA_PortRangeHintDescriptor iHintDescriptor = 0,
93 LADSPA_Data fLowerBound = 0,
94 LADSPA_Data fUpperBound = 0);
95
96};
97
99
100/*****************************************************************************/
101
111
112/*****************************************************************************/
113
125private:
126
128 return *this;
129 }
132
133protected:
134
136
137 CMT_PluginInstance(const unsigned long lPortCount)
138 : m_ppfPorts(new LADSPA_Data_ptr[lPortCount]) {
139 }
141 delete [] m_ppfPorts;
142 }
143
144 friend void CMT_ConnectPort(LADSPA_Handle Instance,
145 unsigned long Port,
146 LADSPA_Data * DataLocation);
147 friend void CMT_Cleanup(LADSPA_Handle Instance);
148
149};
150
151/*****************************************************************************/
152
160template <class T> LADSPA_Handle
162 unsigned long SampleRate) {
163 return new T(Descriptor, SampleRate);
164}
165
166/*****************************************************************************/
167
170#define CMT_MAKER(AUTHORS) \
171 "CMT (http://www.ladspa.org/cmt, plugin by " AUTHORS ")"
172
175#define CMT_COPYRIGHT(YEARS, AUTHORS) \
176 "(C)" YEARS ", " AUTHORS ". " \
177 "GNU General Public Licence Version 2 applies."
178
179/*****************************************************************************/
180
181#endif
182
183/* EOF */
Definition cmt.h:36
virtual ~CMT_ImplementationData()
Definition cmt.h:38
CMT_PluginInstance & operator=(const CMT_PluginInstance &)
Definition cmt.h:127
CMT_PluginInstance(const unsigned long lPortCount)
Definition cmt.h:137
LADSPA_Data ** m_ppfPorts
Definition cmt.h:135
friend void CMT_Cleanup(LADSPA_Handle Instance)
Definition cmt.cpp:77
virtual ~CMT_PluginInstance()
Definition cmt.h:140
CMT_PluginInstance(const CMT_PluginInstance &)
Definition cmt.h:130
friend void CMT_ConnectPort(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data *DataLocation)
Definition cmt.cpp:67
Definition Descriptor.h:84
LADSPA_Handle CMT_Instantiate(const LADSPA_Descriptor *Descriptor, unsigned long SampleRate)
Definition cmt.h:161
void registerNewPluginDescriptor(CMT_Descriptor *psDescriptor)
Definition init.cpp:66
CMT_Descriptor * CMT_Descriptor_ptr
Definition cmt.h:98
int LADSPA_Properties
Definition ladspa.h:94
int LADSPA_PortRangeHintDescriptor
Definition ladspa.h:200
int LADSPA_PortDescriptor
Definition ladspa.h:152
float LADSPA_Data
Definition ladspa.h:84
void * LADSPA_Handle
Definition ladspa.h:363
struct _LADSPA_Descriptor LADSPA_Descriptor
void(* LADSPA_Run_Adding_Function)(LADSPA_Handle Instance, unsigned long SampleCount)
Definition ladspa_types.h:60
void(* LADSPA_Set_Run_Adding_Gain_Function)(LADSPA_Handle Instance, LADSPA_Data Gain)
Definition ladspa_types.h:64
void(* LADSPA_Activate_Function)(LADSPA_Handle Instance)
Definition ladspa_types.h:53
LADSPA_Handle(* LADSPA_Instantiate_Function)(const struct _LADSPA_Descriptor *Descriptor, unsigned long SampleRate)
Definition ladspa_types.h:44
void(* LADSPA_Run_Function)(LADSPA_Handle Instance, unsigned long SampleCount)
Definition ladspa_types.h:56
void(* LADSPA_Deactivate_Function)(LADSPA_Handle Instance)
Definition ladspa_types.h:68
LADSPA_Data * LADSPA_Data_ptr
Definition ladspa_types.h:73
Definition ladspa.h:373
Definition cmt.h:53
void addPort(LADSPA_PortDescriptor iPortDescriptor, const char *pcPortName, LADSPA_PortRangeHintDescriptor iHintDescriptor=0, LADSPA_Data fLowerBound=0, LADSPA_Data fUpperBound=0)
Definition cmt.cpp:124
CMT_Descriptor & operator=(const CMT_Descriptor &)
Definition cmt.h:56
~CMT_Descriptor()
Definition cmt.cpp:41
CMT_Descriptor(const CMT_Descriptor &)
Definition cmt.h:59
Definition lv2apply.c:40