CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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