summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-03-08 01:34:42 -0500
committerDavid Robillard <d@drobilla.net>2015-03-08 01:36:53 -0500
commitb35504a71eb9fe58201745a5d6331612f9da4766 (patch)
tree02b2f09f72142129658e7264ab0019174c95883c
parent80bb72bbe2c868d14a352b58d028a771253c59b5 (diff)
Fix compilation with --no-lv2 (#0006169).
Not that I condone such backwards behaviour. (Different issue in the ticket, but it was still broken at link time).
-rw-r--r--libs/ardour/ardour/event_type_map.h6
-rw-r--r--libs/ardour/automatable.cc2
-rw-r--r--libs/ardour/event_type_map.cc14
-rw-r--r--libs/ardour/globals.cc2
4 files changed, 17 insertions, 7 deletions
diff --git a/libs/ardour/ardour/event_type_map.h b/libs/ardour/ardour/event_type_map.h
index 8110a28f9d..d7adfa8f62 100644
--- a/libs/ardour/ardour/event_type_map.h
+++ b/libs/ardour/ardour/event_type_map.h
@@ -54,14 +54,12 @@ public:
void set_descriptor(const Evoral::Parameter& param,
const Evoral::ParameterDescriptor& desc);
- URIMap& uri_map() { return _uri_map; }
-
private:
typedef std::map<Evoral::Parameter, Evoral::ParameterDescriptor> Descriptors;
- EventTypeMap(URIMap& uri_map) : _uri_map(uri_map) {}
+ EventTypeMap(URIMap* uri_map) : _uri_map(uri_map) {}
- URIMap& _uri_map;
+ URIMap* _uri_map;
Descriptors _descriptors;
static EventTypeMap* event_type_map;
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index 5e4991fe6e..310592ae4b 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -173,8 +173,10 @@ Automatable::describe_parameter (Evoral::Parameter param)
return string_compose("Bender [%1]", int(param.channel()) + 1);
} else if (param.type() == MidiChannelPressureAutomation) {
return string_compose("Pressure [%1]", int(param.channel()) + 1);
+#ifdef LV2_SUPPORT
} else if (param.type() == PluginPropertyAutomation) {
return string_compose("Property %1", URIMap::instance().id_to_uri(param.id()));
+#endif
} else {
return EventTypeMap::instance().to_symbol(param);
}
diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc
index f818b30172..cd3aeacebd 100644
--- a/libs/ardour/event_type_map.cc
+++ b/libs/ardour/event_type_map.cc
@@ -41,7 +41,11 @@ EventTypeMap&
EventTypeMap::instance()
{
if (!EventTypeMap::event_type_map) {
- EventTypeMap::event_type_map = new EventTypeMap(URIMap::instance());
+#ifdef LV2_SUPPORT
+ EventTypeMap::event_type_map = new EventTypeMap(&URIMap::instance());
+#else
+ EventTypeMap::event_type_map = new EventTypeMap(NULL);
+#endif
}
return *EventTypeMap::event_type_map;
}
@@ -149,14 +153,16 @@ EventTypeMap::from_symbol(const string& str) const
} else if (str.length() > 10 && str.substr(0, 10) == "parameter-") {
p_type = PluginAutomation;
p_id = atoi(str.c_str()+10);
+#ifdef LV2_SUPPORT
} else if (str.length() > 9 && str.substr(0, 9) == "property-") {
p_type = PluginPropertyAutomation;
const char* name = str.c_str() + 9;
if (isdigit(str.c_str()[0])) {
p_id = atoi(name);
} else {
- p_id = _uri_map.uri_to_id(name);
+ p_id = _uri_map->uri_to_id(name);
}
+#endif
} else if (str.length() > 7 && str.substr(0, 7) == "midicc-") {
p_type = MidiCCAutomation;
uint32_t channel = 0;
@@ -223,13 +229,15 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
return "envelope";
} else if (t == PluginAutomation) {
return string_compose("parameter-%1", param.id());
+#ifdef LV2_SUPPORT
} else if (t == PluginPropertyAutomation) {
- const char* uri = _uri_map.id_to_uri(param.id());
+ const char* uri = _uri_map->id_to_uri(param.id());
if (uri) {
return string_compose("property-%1", uri);
} else {
return string_compose("property-%1", param.id());
}
+#endif
} else if (t == MidiCCAutomation) {
return string_compose("midicc-%1-%2", int(param.channel()), param.id());
} else if (t == MidiPgmChangeAutomation) {
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 5554513d16..5f98a130b1 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -328,7 +328,9 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
/* singletons - first object is "it" */
(void) PluginManager::instance();
+#ifdef LV2_SUPPORT
(void) URIMap::instance();
+#endif
(void) EventTypeMap::instance();
ProcessThread::init ();