first vaguely working version using PresentationInfo
[ardour.git] / libs / surfaces / mackie / led.cc
index 43628e92bf7e94bff5baa1d827f2a0396d73dc4d..59b9f6cb20a9026ac99b1e648dfb6b709f70c69c 100644 (file)
 #include "surface.h"
 #include "control_group.h"
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
+const int Led::FaderTouch = 0x70;
+const int Led::Timecode = 0x71;
+const int Led::Beats = 0x72;
+const int Led::RudeSolo = 0x73;
+const int Led::RelayClick = 0x74;
+
 Control*
 Led::factory (Surface& surface, int id, const char* name, Group& group)
 {
@@ -33,27 +40,26 @@ Led::factory (Surface& surface, int id, const char* name, Group& group)
        return l;
 }
 
-MidiByteArray 
+MidiByteArray
 Led::set_state (LedState new_state)
 {
-       if (new_state != state) {
-               return MidiByteArray();
-       }
-       
        state = new_state;
 
        MIDI::byte msg = 0;
 
        switch  (state.state()) {
-       case LedState::on:                      
-               msg = 0x7f; break;
-       case LedState::off:                     
-               msg = 0x00; break;
-       case LedState::flashing:        
-               msg = 0x01; break;
-       case LedState::none:                    
+       case LedState::on:
+               msg = 0x7f;
+               break;
+       case LedState::off:
+               msg = 0x00;
+               break;
+       case LedState::flashing:
+               msg = 0x01;
+               break;
+       case LedState::none:
                return MidiByteArray ();
        }
-       
+
        return MidiByteArray  (3, 0x90, id(), msg);
 }