summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_control.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-21 16:17:02 +0000
committerDavid Robillard <d@drobilla.net>2008-09-21 16:17:02 +0000
commite14187aadd574d46c82d8eb0d151b526b84ddcc7 (patch)
treea80073703c5c3f4a68b4d50aee2c14be7cc1e204 /libs/ardour/automation_control.cc
parenteec19ca7afde0da57b2a4d9abc6ef847e6924975 (diff)
Display recorded controller data (fix show all/existing automation).
git-svn-id: svn://localhost/ardour2/branches/3.0@3779 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/automation_control.cc')
-rw-r--r--libs/ardour/automation_control.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc
index a16306838a..afa14c3f98 100644
--- a/libs/ardour/automation_control.cc
+++ b/libs/ardour/automation_control.cc
@@ -29,9 +29,13 @@ using namespace ARDOUR;
using namespace PBD;
-AutomationControl::AutomationControl(Session& session, boost::shared_ptr<AutomationList> list, string name)
- : Controllable((name == "unnamed controllable") ? list->parameter().symbol() : name)
- , Evoral::Control(list)
+AutomationControl::AutomationControl(
+ ARDOUR::Session& session,
+ const Parameter& parameter,
+ boost::shared_ptr<ARDOUR::AutomationList> list,
+ const string& name)
+ : Controllable((name != "") ? name : parameter.symbol())
+ , Evoral::Control(parameter, list)
, _session(session)
{
}
@@ -42,7 +46,7 @@ AutomationControl::AutomationControl(Session& session, boost::shared_ptr<Automat
float
AutomationControl::get_value() const
{
- bool from_list = ((AutomationList*)_list.get())->automation_playback();
+ bool from_list = _list && ((AutomationList*)_list.get())->automation_playback();
return Control::get_value(from_list, _session.transport_frame());
}
@@ -50,7 +54,7 @@ AutomationControl::get_value() const
void
AutomationControl::set_value(float value)
{
- bool to_list = _session.transport_stopped()
+ bool to_list = _list && _session.transport_stopped()
&& ((AutomationList*)_list.get())->automation_playback();
Control::set_value(value, to_list, _session.transport_frame());