X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fautomatable.cc;h=10d2565c90c4be3ce7f96e965e42856cf59ac8f7;hb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;hp=f85bc83e8549a49e78ce806cb4edc444ee5cc2fd;hpb=17ace643e4edbec1e5bd7b446d039f8c94beef75;p=ardour.git diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index f85bc83e85..10d2565c90 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -29,16 +29,18 @@ #include "ardour/automatable.h" #include "ardour/event_type_map.h" #include "ardour/gain_control.h" +#include "ardour/monitor_control.h" #include "ardour/midi_track.h" #include "ardour/pan_controllable.h" #include "ardour/pannable.h" #include "ardour/plugin.h" #include "ardour/plugin_insert.h" +#include "ardour/record_enable_control.h" #include "ardour/session.h" #include "ardour/uri_map.h" #include "ardour/value_as_string.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace ARDOUR; @@ -148,7 +150,9 @@ Automatable::add_control(boost::shared_ptr ac) boost::shared_ptr al = boost::dynamic_pointer_cast (ac->list ()); - if (al) { + boost::shared_ptr actl (boost::dynamic_pointer_cast (ac)); + + if ((!actl || !(actl->flags() & Controllable::NotAutomatable)) && al) { al->automation_state_changed.connect_same_thread ( _list_connections, boost::bind (&Automatable::automation_list_automation_state_changed, @@ -157,7 +161,7 @@ Automatable::add_control(boost::shared_ptr ac) ControlSet::add_control (ac); - if (al) { + if ((!actl || !(actl->flags() & Controllable::NotAutomatable)) && al) { _can_automate_list.insert (param); automation_list_automation_state_changed (param, al->automation_state ()); // sync everything up } @@ -229,7 +233,12 @@ Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter le if (param.type() == NullAutomation) { warning << "Automation has null type" << endl; continue; - } + } + + if (_can_automate_list.find (param) == _can_automate_list.end ()) { + warning << "Ignored automation data for non-automatable parameter" << endl; + continue; + } if (!id_prop) { warning << "AutomationList node without automation-id property, " @@ -420,6 +429,7 @@ Automatable::control_factory(const Evoral::Parameter& param) bool make_list = true; ParameterDescriptor desc(param); boost::shared_ptr list; + if (param.type() >= MidiCCAutomation && param.type() <= MidiChannelPressureAutomation) { MidiTrack* mt = dynamic_cast(this); if (mt) { @@ -460,6 +470,27 @@ Automatable::control_factory(const Evoral::Parameter& param) } else { warning << "PanAutomation for non-Pannable" << endl; } + } else if (param.type() == RecEnableAutomation) { + Recordable* re = dynamic_cast (this); + if (re) { + control = new RecordEnableControl (_a_session, X_("recenable"), *re); + } + } else if (param.type() == MonitoringAutomation) { + Monitorable* m = dynamic_cast(this); + if (m) { + control = new MonitorControl (_a_session, X_("monitor"), *m); + } + } else if (param.type() == SoloAutomation) { + Soloable* s = dynamic_cast(this); + Muteable* m = dynamic_cast(this); + if (s && m) { + control = new SoloControl (_a_session, X_("solo"), *s, *m); + } + } else if (param.type() == MuteAutomation) { + Muteable* m = dynamic_cast(this); + if (m) { + control = new MuteControl (_a_session, X_("mute"), *m); + } } if (make_list && !list) { @@ -493,7 +524,7 @@ Automatable::clear_controls () } string -Automatable::value_as_string (boost::shared_ptr ac) const +Automatable::value_as_string (boost::shared_ptr ac) const { return ARDOUR::value_as_string(ac->desc(), ac->get_value()); }