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