2 Copyright (C) 2006,2007 John Anderson
3 Copyright (C) 2012 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.
20 #ifndef __mackie_controls_h__
21 #define __mackie_controls_h__
28 #include "pbd/signals.h"
30 #include "mackie_control_exception.h"
31 #include "midi_byte_array.h"
47 fader_touch_button_base_id = 0xe0,
48 vselect_button_base_id = 0x20,
49 select_button_base_id = 0x18,
50 mute_button_base_id = 0x10,
51 solo_button_base_id = 0x08,
52 recenable_button_base_id = 0x0,
56 Control (int id, std::string name, Group& group);
59 /// the value of the second bytes of the message. It's
60 /// the id of the control, but only guaranteed to be
61 /// unique within the control type.
62 int raw_id() const { return _id; }
64 const std::string & name() const { return _name; }
65 Group & group() const { return _group; }
67 virtual bool accepts_feedback() const { return true; }
70 void set_in_use (bool);
72 /// Keep track of the timeout so it can be updated with more incoming events
73 sigc::connection in_use_connection;
75 virtual MidiByteArray zero() = 0;
77 /** If we are doing an in_use timeout for a fader without touch, this
78 * is its touch button control; otherwise 0.
80 Control* in_use_touch_control;
89 std::ostream & operator << (std::ostream & os, const Control & control);
93 #endif /* __mackie_controls_h__ */