From 358ebde106dce1bc67ef86fabbd096e4e01b40cb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 28 Nov 2014 18:04:51 -0500 Subject: Set the toggled default metadata of parameters. This is so generic code looking at the Parameter for gain, solo, and rec-enable will get the correct value for toggled. --- libs/ardour/event_type_map.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libs/ardour/event_type_map.cc') diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc index ee6270356c..cc15d72356 100644 --- a/libs/ardour/event_type_map.cc +++ b/libs/ardour/event_type_map.cc @@ -154,9 +154,10 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const { Evoral::Parameter p(type, channel, id); - double min = 0.0f; - double max = 1.0f; - double normal = 0.0f; + double min = 0.0f; + double max = 1.0f; + double normal = 0.0f; + bool toggled = false; switch((AutomationType)type) { case NullAutomation: @@ -178,6 +179,7 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const break; case RecEnableAutomation: /* default 0.0 - 1.0 is fine */ + toggled = true; break; case PluginAutomation: case FadeInAutomation: @@ -190,6 +192,7 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const case MuteAutomation: max = 1.0f; normal = 0.0f; + toggled = true; break; case MidiCCAutomation: case MidiPgmChangeAutomation: @@ -203,7 +206,7 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const return p; } - p.set_range(type, min, max, normal, false); + p.set_range(type, min, max, normal, toggled); return p; } -- cgit v1.2.3