13
0

Add reset method and use it during start-up/shutdown

This commit is contained in:
Térence Clastres 2018-08-09 20:10:40 +02:00
parent 2c460135c5
commit a9958840b0
2 changed files with 10 additions and 1 deletions

View File

@ -149,7 +149,6 @@ LaunchControlXL::begin_using_device ()
connect_session_signals (); connect_session_signals ();
init_buttons (true); init_buttons (true);
in_use = true; in_use = true;
@ -251,6 +250,8 @@ LaunchControlXL::bundles ()
void void
LaunchControlXL::init_buttons (bool startup) LaunchControlXL::init_buttons (bool startup)
{ {
reset(template_number());
if (startup) { if (startup) {
button_track_mode(track_mode()); button_track_mode(track_mode());
} }
@ -286,6 +287,13 @@ LaunchControlXL::do_request (LaunchControlRequest * req)
} }
} }
void
LaunchControlXL::reset(uint8_t chan)
{
MidiByteArray msg (3, 176 + chan, 0, 0); // turn off all leds, reset buffer settings and duty cycle
write(msg);
}
int int
LaunchControlXL::set_active (bool yn) LaunchControlXL::set_active (bool yn)
{ {

View File

@ -351,6 +351,7 @@ public:
static std::string fader_name_by_id(FaderID); static std::string fader_name_by_id(FaderID);
void write(const MidiByteArray &); void write(const MidiByteArray &);
void reset(uint8_t chan);
TrackMode track_mode() const { return _track_mode; } TrackMode track_mode() const { return _track_mode; }
void set_track_mode(TrackMode mode); void set_track_mode(TrackMode mode);