2 * Copyright (C) 2006-2007 John Anderson
3 * Copyright (C) 2012-2015 Paul Davis <paul@linuxaudiosystems.com>
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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include "ardour/automation_control.h"
25 #include "pbd/enumwriter.h"
30 #include "control_group.h"
40 using namespace ArdourSurface;
41 using namespace Mackie;
43 using ARDOUR::AutomationControl;
45 void Group::add (Control& control)
47 _controls.push_back (&control);
50 Control::Control (int id, std::string name, Group & group)
58 /** @return true if the control is in use, or false otherwise.
59 Buttons are `in use' when they are held down.
60 Faders with touch support are `in use' when they are being touched.
61 Pots, or faders without touch support, are `in use' from the first move
62 event until a timeout after the last move event.
65 Control::in_use () const
71 Control::set_in_use (bool in_use)
77 Control::set_control (boost::shared_ptr<AutomationControl> ac)
83 Control::set_value (float val, PBD::Controllable::GroupControlDisposition group_override)
86 normal_ac->set_value (normal_ac->interface_to_internal (val), group_override);
96 return normal_ac->internal_to_interface (normal_ac->get_value());
100 Control::start_touch (double when)
103 return normal_ac->start_touch (when);
108 Control::stop_touch (double when)
111 return normal_ac->stop_touch (when);
115 ostream & operator << (ostream & os, const ArdourSurface::Mackie::Control & control)
117 os << typeid (control).name();
119 os << "name: " << control.name();
121 os << "id: " << "0x" << setw(2) << setfill('0') << hex << control.id() << setfill(' ');
123 os << "group: " << control.group().name();