1 /* 2 * Copyright (C) 2017 Ben Loftis <ben@harrisonconsoles.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 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. 13 * 14 * You should have received a copy of the GNU General Public License along 15 * with this program; if not, write to the Free Software Foundation, Inc., 16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 */ 18 19 #ifndef __ardour_us2400_control_protocol_led_h__ 20 #define __ardour_us2400_control_protocol_led_h__ 21 22 #include "controls.h" 23 #include "midi_byte_array.h" 24 #include "types.h" 25 26 namespace ArdourSurface { 27 28 namespace US2400 { 29 30 class Led : public Control 31 { 32 public: 33 static const int FaderTouch; 34 static const int Timecode; 35 static const int Beats; 36 static const int RudeSolo; 37 static const int RelayClick; 38 Led(int id,std::string name,Group & group)39 Led (int id, std::string name, Group & group) 40 : Control (id, name, group) 41 , last_state (none) 42 , llast_state (none) 43 { 44 } 45 mark_dirty()46 void mark_dirty() { last_state = llast_state = none; } 47 led()48 Led & led() { return *this; } 49 MidiByteArray set_state (LedState); 50 zero()51 MidiByteArray zero() { return set_state (off); } 52 53 static Control* factory (Surface&, int id, const char*, Group&); 54 55 private: 56 LedState last_state; 57 LedState llast_state; 58 }; 59 60 } 61 } 62 63 #endif /* __ardour_us2400_control_protocol_led_h__ */ 64