2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef _ardour_surfaces_fp8controls_h_
20 #define _ardour_surfaces_fp8controls_h_
25 #include "fp8_button.h"
26 #include "fp8_strip.h"
28 namespace ArdourSurface {
33 FP8Controls (FP8Base&);
34 virtual ~FP8Controls ();
61 // Pan/Param encoder press
78 BtnF1, BtnF2, BtnF3, BtnF4,
79 BtnF5, BtnF6, BtnF7, BtnF8,
117 typedef std::map <ButtonId, std::string> UserButtonMap;
119 UserButtonMap const& user_buttons () const {
120 return _user_buttons;
123 bool button_name_to_enum (std::string const&, ButtonId&) const;
124 bool button_enum_to_name (ButtonId, std::string&) const;
126 PBD::Signal0<void> FaderModeChanged;
127 PBD::Signal0<void> MixModeChanged;
129 FP8Types::FaderMode fader_mode () const { return _fadermode; }
130 FP8Types::NavigationMode nav_mode () const { return _navmode; }
131 FP8Types::MixMode mix_mode () const { return _mixmode; }
132 bool display_timecode () const { return _display_timecode; }
134 FP8ButtonInterface& button (ButtonId id);
135 FP8Strip& strip (uint8_t id);
137 bool midi_event (uint8_t id, uint8_t val);
138 bool midi_touch (uint8_t id, uint8_t val);
139 bool midi_fader (uint8_t id, unsigned short val);
142 void all_lights_off () const;
144 void set_fader_mode (FP8Types::FaderMode);
146 typedef std::map <uint8_t, FP8ButtonInterface*> MidiButtonMap;
147 typedef std::map <ButtonId, FP8ButtonInterface*> CtrlButtonMap;
149 void set_nav_mode (FP8Types::NavigationMode);
150 void set_mix_mode (FP8Types::MixMode);
151 void toggle_timecode ();
153 MidiButtonMap _midimap;
154 CtrlButtonMap _ctrlmap;
155 MidiButtonMap _midimap_strip;
157 FP8Strip* chanstrip[8];
159 FP8Types::FaderMode _fadermode;
160 FP8Types::NavigationMode _navmode;
161 FP8Types::MixMode _mixmode;
162 bool _display_timecode;
164 UserButtonMap _user_buttons;
165 FP8DummyButton _dummy_button;
167 std::map<std::string, ButtonId> _user_str_to_enum;
168 std::map<ButtonId, std::string> _user_enum_to_str;
170 PBD::ScopedConnectionList button_connections;
174 #endif /* _ardour_surfaces_fp8controls_h_ */