2 Copyright (C) 2007 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <ardour/automation_control.h>
23 #include <ardour/session.h>
24 #include <ardour/automatable.h>
25 #include <ardour/midi_track.h>
28 using namespace ARDOUR;
32 AutomationControl::AutomationControl(
33 ARDOUR::Session& session,
34 const Parameter& parameter,
35 boost::shared_ptr<ARDOUR::AutomationList> list,
37 : Controllable((name != "") ? name : parameter.symbol())
38 , Evoral::Control(parameter, list)
44 /** Get the currently effective value (ie the one that corresponds to current output)
47 AutomationControl::get_value() const
49 bool from_list = _list && ((AutomationList*)_list.get())->automation_playback();
50 return Control::get_value(from_list, _session.transport_frame());
55 AutomationControl::set_value(float value)
57 bool to_list = _list && _session.transport_stopped()
58 && ((AutomationList*)_list.get())->automation_playback();
60 Control::set_value(value, to_list, _session.transport_frame());
62 Changed(); /* EMIT SIGNAL */
67 AutomationControl::set_list(boost::shared_ptr<Evoral::ControlList> list)
69 Control::set_list(list);
70 Changed(); /* EMIT SIGNAL */