00001
00002 #ifndef _LadspaWrapper_hxx_
00003 #define _LadspaWrapper_hxx_
00004
00005 #include "DataTypes.hxx"
00006 #include "OutControl.hxx"
00007 #include "InControl.hxx"
00008 #include "Processing.hxx"
00009 #include "RunTimeLibraryLoader.hxx"
00010
00011 #include <ladspa.h>
00012
00013 #include <string>
00014
00015 namespace CLAM
00016 {
00017 class AudioInPort;
00018 class AudioOutPort;
00019 class InControl;
00020 class OutControl;
00021
00022 class LadspaWrapper : public Processing
00023 {
00024 private:
00025 typedef void * SOPointer;
00026 LADSPA_Handle _instance;
00027 const LADSPA_Descriptor * _descriptor;
00028 SOPointer _sharedObject;
00029 std::string _libraryFileName;
00030
00031 std::vector< AudioInPort* > _inputPorts;
00032 std::vector< AudioOutPort* > outputPorts;
00033
00034 std::vector< InControl* > _inputControls;
00035 std::vector< OutControl* > _outputControls;
00036 std::vector< LADSPA_Data > _outputControlValues;
00037 unsigned _bufferSize;
00038 std::string _factoryKey;
00039 void RemovePortsAndControls();
00040 void ConfigurePortsAndControls();
00041 void ConfigureControlsPointers();
00042 void DoUpdatePortsPointers();
00043
00044 public:
00045 LadspaWrapper( const Config & c = Config());
00046 LadspaWrapper( const std::string& libraryFileName, unsigned index, const std::string& factoryKey );
00047 bool ConcreteStart();
00048 bool ConcreteStop();
00049 bool ConcreteConfigure(const ProcessingConfig&);
00050
00051 bool Do();
00052 virtual ~LadspaWrapper();
00053
00054 const char * GetClassName() const;
00055
00056 bool LoadLibraryFunction(const std::string& libraryFileName, unsigned index, const std::string& factoryKey);
00057
00058 };
00059
00060 }
00061
00062 #endif
00063
00064
00065