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 { namespace FP_NAMESPACE {
33 FP8Controls (FP8Base&);
34 virtual ~FP8Controls ();
63 // Pan/Param encoder press
80 BtnF1, BtnF2, BtnF3, BtnF4,
81 BtnF5, BtnF6, BtnF7, BtnF8,
126 typedef std::map <ButtonId, std::string> UserButtonMap;
128 UserButtonMap const& user_buttons () const {
129 return _user_buttons;
132 bool button_name_to_enum (std::string const&, ButtonId&) const;
133 bool button_enum_to_name (ButtonId, std::string&) const;
135 PBD::Signal0<void> FaderModeChanged;
136 PBD::Signal0<void> MixModeChanged;
139 FP8Types::FaderMode fader_mode () const { return FP8Types::ModeTrack; }
140 FP8Types::MixMode mix_mode () const { return FP8Types::MixUser; }
142 FP8Types::FaderMode fader_mode () const { return _fadermode; }
143 FP8Types::MixMode mix_mode () const { return _mixmode; }
146 FP8Types::NavigationMode nav_mode () const { return _navmode; }
147 bool display_timecode () const { return _display_timecode; }
149 FP8ButtonInterface& button (ButtonId id);
150 FP8Strip& strip (uint8_t id);
152 bool midi_event (uint8_t id, uint8_t val);
153 bool midi_touch (uint8_t id, uint8_t val);
154 bool midi_fader (uint8_t id, unsigned short val);
157 void all_lights_off () const;
159 void set_fader_mode (FP8Types::FaderMode);
161 typedef std::map <uint8_t, FP8ButtonInterface*> MidiButtonMap;
162 typedef std::map <ButtonId, FP8ButtonInterface*> CtrlButtonMap;
164 void set_nav_mode (FP8Types::NavigationMode);
165 void set_mix_mode (FP8Types::MixMode);
166 void toggle_timecode ();
168 MidiButtonMap _midimap;
169 CtrlButtonMap _ctrlmap;
170 MidiButtonMap _midimap_strip;
172 FP8Strip* chanstrip[N_STRIPS];
174 FP8Types::FaderMode _fadermode;
175 FP8Types::NavigationMode _navmode;
176 FP8Types::MixMode _mixmode;
177 bool _display_timecode;
179 UserButtonMap _user_buttons;
180 FP8DummyButton _dummy_button;
182 std::map<std::string, ButtonId> _user_str_to_enum;
183 std::map<ButtonId, std::string> _user_enum_to_str;
185 PBD::ScopedConnectionList button_connections;
189 #endif /* _ardour_surfaces_fp8controls_h_ */