faderport: allow forcing LED state for use in ::all_lights_out()
This commit is contained in:
@@ -234,8 +234,7 @@ void
|
||||
FaderPort::all_lights_out ()
|
||||
{
|
||||
for (ButtonMap::iterator b = buttons.begin(); b != buttons.end(); ++b) {
|
||||
b->second.set_led_state (_output_port, false);
|
||||
g_usleep (1000);
|
||||
b->second.set_led_state (_output_port, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,9 +733,9 @@ FaderPort::ButtonInfo::set_action (boost::function<void()> f, bool when_pressed,
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort::ButtonInfo::set_led_state (boost::shared_ptr<MIDI::Port> port, int onoff)
|
||||
FaderPort::ButtonInfo::set_led_state (boost::shared_ptr<MIDI::Port> port, int onoff, bool force)
|
||||
{
|
||||
if (led_on == (bool) onoff) {
|
||||
if (!force && (led_on == (bool) onoff)) {
|
||||
/* nothing to do */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
|
||||
|
||||
void set_action (std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
|
||||
void set_action (boost::function<void()> function, bool on_press, FaderPort::ButtonState = ButtonState (0));
|
||||
void set_led_state (boost::shared_ptr<MIDI::Port>, int onoff);
|
||||
void set_led_state (boost::shared_ptr<MIDI::Port>, int onoff, bool force = false);
|
||||
void invoke (ButtonState bs, bool press);
|
||||
bool uses_flash () const { return flash; }
|
||||
void set_flash (bool yn) { flash = yn; }
|
||||
|
||||
Reference in New Issue
Block a user