CSL  6.0
VSTIO.h
Go to the documentation of this file.
1 //
2 // VSTIO.h -- IO using VSTIO
3 //
4 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT
5 //
6 
7 #ifndef CSL_VSTIO_H
8 #define CSL_VSTIO_H
9 
10 #include "CSL_Core.h"
11 #include "Instrument.h"
12 
13 #include "audioeffectx.h"
14 
15 namespace csl {
16 
17 ///
18 /// VSTIO is an IO that answers the VST processReplacing() call by calling its CSL graph
19 ///
20 
21 class VSTIO : public IO, public AudioEffectX {
22 public:
23  VSTIO (); ///< Constructor
24  VSTIO (audioMasterCallback audioMaster,
25  unsigned s_rate = 44100, unsigned b_size = 512,
26  unsigned in_chans = 2, unsigned out_chans = 2);
27  virtual ~VSTIO();
28 
29  void open() throw(CException); ///< open/close start/stop methods
30  void close() throw(CException);
31  void start() throw(CException); ///< start my timer thread
32  void stop() throw(CException); ///< stop the timer thread
33 
34  // Processing
35  virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
36  virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames) { };
37 
38  // Program
39  virtual void setProgramName (char* name);
40  virtual void getProgramName (char* name);
41 
42  // Parameters
43  virtual void setParameter (VstInt32 index, float value);
44  virtual float getParameter (VstInt32 index);
45  virtual void getParameterLabel (VstInt32 index, char* label);
46  virtual void getParameterDisplay (VstInt32 index, char* text);
47  virtual void getParameterName (VstInt32 index, char* text);
48 
49  virtual bool getEffectName (char* name);
50  virtual bool getVendorString (char* text);
51  virtual bool getProductString (char* text);
52  virtual VstInt32 getVendorVersion ();
53 
54 protected:
55  InOut * mInOut; ///< the in-out object
56  Filter * mFilter; ///< BPF filter
57  float mFreq; ///< Example: filter center freq
58 
59 };
60 
61 #if 0
62 
63 /// VSTInst is an instrument, get it?
64 
65 class VSTInst : public IO, public AudioEffectX {
66 public:
67  VSTInst (); ///< Constructor
68  VSTInst (audioMasterCallback audioMaster, Instrument * theInstrument,
69  unsigned s_rate = 44100, unsigned b_size = 512,
70  unsigned in_chans = 0, unsigned out_chans = 2);
71  virtual ~VSTInst();
72 
73  void open() throw(CException); ///< open/close start/stop methods
74  void close() throw(CException);
75  void start() throw(CException); ///< start my timer thread
76  void stop() throw(CException); ///< stop the timer thread
77 
78  // Processing
79  virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
80  virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames) { };
81 
82  // Program
83  virtual void setProgramName (char* name);
84  virtual void getProgramName (char* name);
85 
86  // Parameters
87  virtual void setParameter (VstInt32 index, float value);
88  virtual float getParameter (VstInt32 index);
89  virtual void getParameterLabel (VstInt32 index, char* label);
90  virtual void getParameterDisplay (VstInt32 index, char* text);
91  virtual void getParameterName (VstInt32 index, char* text);
92 
93  virtual bool getEffectName (char* name);
94  virtual bool getVendorString (char* text);
95  virtual bool getProductString (char* text);
96  virtual VstInt32 getVendorVersion ();
97 
98 protected:
99  Instrument * mInstrument;
100 };
101 
102 #endif
103 
104 } // end of namespace
105 
106 #endif
InOut class copies the IO port's input buffer to the output buffer, possibly with channel remap and s...
Definition: InOut.h:37
virtual void getParameterName(VstInt32 index, char *text)
Definition: VSTIO.cpp:89
float mFreq
Example: filter center freq.
Definition: VSTIO.h:57
virtual void processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
Definition: VSTIO.h:36
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Definition: Accessor.h:17
void open()
open/close start/stop methods
Definition: VSTIO.cpp:46
virtual bool getVendorString(char *text)
Definition: VSTIO.cpp:98
virtual void processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
Definition: VSTIO.cpp:114
virtual void setProgramName(char *name)
Definition: VSTIO.cpp:56
virtual VstInt32 getVendorVersion()
Definition: VSTIO.cpp:108
Filter: the canonical-form n-pole/m-zero filter class.
Definition: Filters.h:99
void close()
open/close start/stop methods
Definition: VSTIO.cpp:48
VSTIO is an IO that answers the VST processReplacing() call by calling its CSL graph.
Definition: VSTIO.h:21
IO – the abstract I/O scheduling class; subclasses interface to specific I/O APIs.
Definition: CSL_Core.h:752
void stop()
stop the timer thread
Definition: VSTIO.cpp:52
Instrument class (abstract)
Definition: Instrument.h:56
void start()
start my timer thread
Definition: VSTIO.cpp:50
virtual void getParameterLabel(VstInt32 index, char *label)
Definition: VSTIO.cpp:81
virtual float getParameter(VstInt32 index)
Definition: VSTIO.cpp:71
virtual void getProgramName(char *name)
Definition: VSTIO.cpp:60
InOut * mInOut
the in-out object
Definition: VSTIO.h:55
virtual bool getProductString(char *text)
Definition: VSTIO.cpp:103
VSTIO()
Constructor.
Definition: VSTIO.cpp:17
virtual void getParameterDisplay(VstInt32 index, char *text)
Definition: VSTIO.cpp:85
virtual void setParameter(VstInt32 index, float value)
Definition: VSTIO.cpp:67
virtual bool getEffectName(char *name)
Definition: VSTIO.cpp:93
virtual ~VSTIO()
Definition: VSTIO.cpp:42
Filter * mFilter
BPF filter.
Definition: VSTIO.h:56
Base class of CSL exceptions (written upper-case). Has a string message.