00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LV2_PLUGIN_H
00024 #define LV2_PLUGIN_H
00025
00026 #include <slv2/slv2.h>
00027 #include <QList>
00028 #include <QString>
00029 #include <QObject>
00030
00031 #include "Plugin.h"
00032
00033 class AudioBus;
00034 class LV2ControlPort;
00035 class AudioInputPort;
00036 class AudioOutputPort;
00037 class Sheet;
00038
00039 class LV2Plugin : public Plugin
00040 {
00041 Q_OBJECT
00042 Q_CLASSINFO("toggle_bypass", tr("Bypass: On/Off"))
00043
00044 public:
00045 LV2Plugin(Sheet* sheet, bool slave=false);
00046 LV2Plugin(Sheet* sheet, char* pluginUri);
00047 ~LV2Plugin();
00048
00049 void process(AudioBus* bus, unsigned long nframes);
00050
00051 SLV2Instance get_instance() const {return m_instance; }
00052 SLV2Plugin get_slv2_plugin() const {return m_plugin; }
00053 LV2Plugin* create_copy();
00054
00055 QDomNode get_state(QDomDocument doc);
00056 QString get_name();
00057
00058 int init();
00059 int set_state(const QDomNode & node );
00060
00061 static PluginInfo get_plugin_info(SLV2Plugin plugin);
00062
00063 private:
00064 QString m_pluginUri;
00065 SLV2Plugin m_plugin;
00066 SLV2Instance m_instance;
00067 uint32_t m_num_ports;
00068 struct Port* m_ports;
00069 SLV2Value m_input_class;
00070 SLV2Value m_output_class;
00071 SLV2Value m_control_class;
00072 SLV2Value m_audio_class;
00073 SLV2Value m_event_class;
00074 SLV2Value optional;
00075 bool m_isSlave;
00076
00077 LV2ControlPort* create_port(int portIndex, float defaultValue);
00078
00079 int create_instance();
00080
00081 public slots:
00082 Command* toggle_bypass();
00083 };
00084
00085
00086 class LV2ControlPort : public PluginControlPort
00087 {
00088
00089 public:
00090 LV2ControlPort(LV2Plugin* plugin, int index, float value);
00091 LV2ControlPort(LV2Plugin* plugin, const QDomNode node);
00092 ~LV2ControlPort(){};
00093
00094 float get_min_control_value();
00095 float get_max_control_value();
00096 float get_default_value();
00097
00098 QDomNode get_state(QDomDocument doc);
00099
00100 QString get_description();
00101 QString get_symbol();
00102
00103 private:
00104 LV2Plugin* m_lv2plugin;
00105
00106 void init();
00107 QStringList get_hints();
00108 };
00109
00110
00111 #endif