CLAM-Development  1.4.0
LadspaWrapper.hxx
Go to the documentation of this file.
1 
2 #ifndef _LadspaWrapper_hxx_
3 #define _LadspaWrapper_hxx_
4 
5 #include "DataTypes.hxx"
6 #include "OutControl.hxx"
7 #include "InControl.hxx"
8 #include "Processing.hxx"
10 
11 #include <ladspa.h>
12 
13 #include <string>
14 
15 namespace CLAM
16 {
17  class AudioInPort;
18  class AudioOutPort;
19 
20 class LadspaWrapper : public Processing
21 {
22 private:
23  typedef void * SOPointer;
24  LADSPA_Handle _instance;
25  const LADSPA_Descriptor * _descriptor;
26  SOPointer _sharedObject;
27  std::string _libraryFileName;
28 
29  std::vector< AudioInPort* > _inputPorts;
30  std::vector< AudioOutPort* > _outputPorts;
31 
32  std::vector< FloatInControl* > _inputControls;
33  std::vector< FloatOutControl* > _outputControls;
34  std::vector< LADSPA_Data > _outputControlValues;
35  unsigned _bufferSize;
36  std::string _factoryKey;
37  void RemovePortsAndControls();
38  void ConfigurePortsAndControls();
39  void ConfigureControlsPointers();
40  void DoUpdatePortsPointers();
41 
42 public:
43  LadspaWrapper( const Config & c = Config());
44  LadspaWrapper( const std::string& libraryFileName, unsigned index, const std::string& factoryKey );
45  bool ConcreteStart();
46  bool ConcreteStop();
48 
49  bool Do();
50  virtual ~LadspaWrapper();
51 
52  const char * GetClassName() const;
53 
54  bool LoadLibraryFunction(const std::string& libraryFileName, unsigned index, const std::string& factoryKey);
55 
56 };
57 
58 } //namespace CLAM
59 
60 #endif
61 
62 
63