summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PluginModel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/client/PluginModel.h')
-rw-r--r--src/libs/client/PluginModel.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/libs/client/PluginModel.h b/src/libs/client/PluginModel.h
index 51a251da..76edc737 100644
--- a/src/libs/client/PluginModel.h
+++ b/src/libs/client/PluginModel.h
@@ -35,11 +35,11 @@ class PluginModel
public:
enum Type { LV2, LADSPA, DSSI, Internal, Patch };
- PluginModel(const string& uri, const string& name)
+ PluginModel(const string& uri, const string& type_uri, const string& name)
: m_uri(uri),
m_name(name)
{
- //cerr << "FIXME: plugin type" << endl;
+ set_type_from_uri(type_uri);
}
Type type() const { return m_type; }
@@ -49,15 +49,25 @@ public:
const string& name() const { return m_name; }
void name(const string& s) { m_name = s; }
- const char* const type_string() const {
+ /*const char* const type_string() const {
if (m_type == LV2) return "LV2";
else if (m_type == LADSPA) return "LADSPA";
else if (m_type == DSSI) return "DSSI";
else if (m_type == Internal) return "Internal";
else if (m_type == Patch) return "Patch";
else return "";
- }
+ }*/
+ const char* const type_uri() const {
+ if (m_type == LV2) return "ingen:LV2";
+ else if (m_type == LADSPA) return "ingen:LADSPA";
+ else if (m_type == DSSI) return "ingen:DSSI";
+ else if (m_type == Internal) return "ingen:Internal";
+ else if (m_type == Patch) return "ingen:Patch";
+ else return "";
+ }
+
+ /** DEPRECATED */
void set_type(const string& type_string) {
if (type_string == "LV2") m_type = LV2;
else if (type_string == "LADSPA") m_type = LADSPA;
@@ -65,6 +75,14 @@ public:
else if (type_string == "Internal") m_type = Internal;
else if (type_string == "Patch") m_type = Patch;
}
+
+ void set_type_from_uri(const string& type_uri) {
+ if (type_uri.substr(0, 6) != "ingen:") {
+ cerr << "INVALID TYPE STRING!" << endl;
+ } else {
+ set_type(type_uri.substr(6));
+ }
+ }
string default_node_name() { return Path::nameify(m_name); }