00001 /* 00002 00003 This file is part of la Marmite. 00004 Copyright (C) 2005 Nicolas Falquet. 00005 00006 La Marmite is free software ; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License as 00008 published by the Free Software Foundation ; either version 2 of 00009 the License, or (at your option) any later version. 00010 00011 La Marmite is distributed in the hope that it will be useful, but 00012 WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with la Marmite ; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00019 02111-1307 USA 00020 00021 */ 00022 00023 #ifndef M_PLUGIN_DESCRIPTOR_H 00024 #define M_PLUGIN_DESCRIPTOR_H 00025 00026 using namespace std; 00027 00028 #include <string> 00029 #include <vector> 00030 #include <ladspa.h> 00031 00032 class MPlugin; 00033 class MPluginPortDescriptor; 00034 00046 class MPluginDescriptor 00047 { 00048 00049 public: 00050 00051 // constructor - destructor 00052 00060 static MPluginDescriptor * CreateFromLibrary ( const string & library, const string & name ); 00061 00062 virtual ~ MPluginDescriptor ( ) { } 00063 00064 // functions 00065 00070 static const LADSPA_Descriptor * GetLADSPADescriptorFromLibrary ( const string & library, const string & name ); 00071 00075 virtual const LADSPA_Descriptor * LADSPADescriptor ( ) const; 00076 00080 virtual string LADSPAName ( ) const; 00081 00085 virtual string Label ( ) const; 00086 00090 virtual unsigned long UniqueID ( ) const; 00091 00095 virtual string Maker ( ) const; 00096 00100 virtual string Copyright ( ) const; 00101 00109 virtual bool IsRealtime ( ) const; 00110 00120 virtual bool IsInplaceBroken ( ) const; 00121 00129 virtual bool IsHardRTCapable ( ) const; 00130 00138 virtual MPluginPortDescriptor * AudioInputDescriptor ( const unsigned int n ) const; 00139 00147 virtual MPluginPortDescriptor * AudioOutputDescriptor ( const unsigned int n ) const; 00148 00156 virtual MPluginPortDescriptor * ControlInputDescriptor ( const unsigned int n ) const; 00157 00165 virtual MPluginPortDescriptor * ControlOutputDescriptor ( const unsigned int n ) const; 00166 00171 virtual unsigned int NumberOfAudioInputs ( ) const; 00172 00177 virtual unsigned int NumberOfAudioOutputs ( ) const; 00178 00183 virtual unsigned int NumberOfControlInputs ( ) const; 00184 00189 virtual unsigned int NumberOfControlOutputs ( ) const; 00190 00191 // methods 00192 00199 MPlugin * Instantiate ( ) const; 00200 00210 LADSPA_Handle LADSPAInstantiate ( ) const; 00211 00212 protected: 00213 00214 // protected constructor 00215 00219 MPluginDescriptor ( const LADSPA_Descriptor * descriptor ); 00220 00221 // protected methods 00222 00227 virtual void createPorts ( ); 00228 00238 virtual void createAudioInput ( const unsigned long portNumber ); 00239 00249 virtual void createAudioOutput ( const unsigned long portNumber ); 00250 00260 virtual void createControlInput ( const unsigned long portNumber ); 00261 00271 virtual void createControlOutput ( const unsigned long portNumber ); 00272 00273 // attributes 00274 00276 const LADSPA_Descriptor * _descriptor; 00277 00279 vector < MPluginPortDescriptor * > _audioInputDescriptor; 00280 00282 vector < MPluginPortDescriptor * > _audioOutputDescriptor; 00283 00285 vector < MPluginPortDescriptor * > _controlInputDescriptor; 00286 00288 vector < MPluginPortDescriptor * > _controlOutputDescriptor; 00289 00290 }; 00291 00292 #endif // M_PLUGIN_DESCRIPTOR_H