comparison plugin/RealTimePluginInstance.h @ 51:c2913298cf94

* Make RealTimePluginInstances also provide the PluginInstance interface
author Chris Cannam
date Mon, 20 Mar 2006 13:48:58 +0000
parents 39ae3dee27b9
children d397ea0a79f5
comparison
equal deleted inserted replaced
50:080ad875395a 51:c2913298cf94
14 */ 14 */
15 15
16 #ifndef _REALTIME_PLUGIN_INSTANCE_H_ 16 #ifndef _REALTIME_PLUGIN_INSTANCE_H_
17 #define _REALTIME_PLUGIN_INSTANCE_H_ 17 #define _REALTIME_PLUGIN_INSTANCE_H_
18 18
19 #include "PluginInstance.h"
20
19 #include <QString> 21 #include <QString>
20 #include <QStringList> 22 #include <QStringList>
21 #include <vector> 23 #include <vector>
24 #include <string>
22 25
23 #include "base/RealTime.h" 26 #include "base/RealTime.h"
24 27
25 class RealTimePluginFactory; 28 class RealTimePluginFactory;
26 29
32 * The audio code calls run() on an instance that has been passed to 35 * The audio code calls run() on an instance that has been passed to
33 * it, and assumes that the passing code has already initialised the 36 * it, and assumes that the passing code has already initialised the
34 * plugin, connected its inputs and outputs and so on, and that there 37 * plugin, connected its inputs and outputs and so on, and that there
35 * is an understanding in place about the sizes of the buffers in use 38 * is an understanding in place about the sizes of the buffers in use
36 * by the plugin. All of this depends on the subclass implementation. 39 * by the plugin. All of this depends on the subclass implementation.
40 *
41 * The PluginInstance base class includes additional abstract methods
42 * which the subclass of RealTimePluginInstance must implement.
37 */ 43 */
38 44
39 // These names are taken from LADSPA, but the values are not 45 // These names are taken from LADSPA, but the values are not
40 // guaranteed to match 46 // guaranteed to match
41 47
52 static const int Integer = 2; 58 static const int Integer = 2;
53 static const int Logarithmic = 4; 59 static const int Logarithmic = 4;
54 static const int SampleRate = 8; 60 static const int SampleRate = 8;
55 } 61 }
56 62
57 class RealTimePluginInstance 63 class RealTimePluginInstance : public PluginInstance
58 { 64 {
59 public: 65 public:
60 typedef float sample_t; 66 typedef float sample_t;
61 67
62 virtual ~RealTimePluginInstance(); 68 virtual ~RealTimePluginInstance();
78 virtual size_t getAudioOutputCount() const = 0; 84 virtual size_t getAudioOutputCount() const = 0;
79 85
80 virtual sample_t **getAudioInputBuffers() = 0; 86 virtual sample_t **getAudioInputBuffers() = 0;
81 virtual sample_t **getAudioOutputBuffers() = 0; 87 virtual sample_t **getAudioOutputBuffers() = 0;
82 88
83 virtual QStringList getPrograms() const { return QStringList(); } 89 // virtual QStringList getPrograms() const { return QStringList(); }
84 virtual QString getCurrentProgram() const { return QString(); } 90 // virtual QString getCurrentProgram() const { return QString(); }
85 virtual QString getProgram(int /* bank */, int /* program */) const { return QString(); } 91 virtual std::string getProgram(int /* bank */, int /* program */) const { return std::string(); }
86 virtual unsigned long getProgram(QString /* name */) const { return 0; } // bank << 16 + program 92 // virtual unsigned long getProgram(QString /* name */) const { return 0; } // bank << 16 + program
87 virtual void selectProgram(QString) { } 93 // virtual void selectProgram(QString) { }
88 94
89 virtual unsigned int getParameterCount() const = 0; 95 virtual unsigned int getParameterCount() const = 0;
90 virtual void setParameterValue(unsigned int parameter, float value) = 0; 96 virtual void setParameterValue(unsigned int parameter, float value) = 0;
91 virtual float getParameterValue(unsigned int parameter) const = 0; 97 virtual float getParameterValue(unsigned int parameter) const = 0;
92 virtual float getParameterDefault(unsigned int parameter) const = 0; 98 virtual float getParameterDefault(unsigned int parameter) const = 0;
93 99
94 virtual QString configure(QString /* key */, QString /* value */) { return QString(); } 100 virtual std::string configure(std::string /* key */, std::string /* value */) { return std::string(); }
95 101
96 virtual void sendEvent(const RealTime & /* eventTime */, 102 virtual void sendEvent(const RealTime & /* eventTime */,
97 const void * /* event */) { } 103 const void * /* event */) { }
98 virtual void clearEvents() { } 104 virtual void clearEvents() { }
99 105