summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTérence Clastres <t.clastres@gmail.com>2018-08-09 20:10:40 +0200
committerTérence Clastres <t.clastres@gmail.com>2018-08-09 21:05:55 +0200
commita9958840b00135efffe718980c36d8d61af855af (patch)
tree228582826ff6562ca1462652d70d13b04740934d
parent2c460135c51580f8660ea18d1b699438c4c257d6 (diff)
Add reset method and use it during start-up/shutdown
-rw-r--r--libs/surfaces/launch_control_xl/launch_control_xl.cc10
-rw-r--r--libs/surfaces/launch_control_xl/launch_control_xl.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc
index d8dfb8ee5d..d583aa05dd 100644
--- a/libs/surfaces/launch_control_xl/launch_control_xl.cc
+++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc
@@ -149,7 +149,6 @@ LaunchControlXL::begin_using_device ()
connect_session_signals ();
-
init_buttons (true);
in_use = true;
@@ -251,6 +250,8 @@ LaunchControlXL::bundles ()
void
LaunchControlXL::init_buttons (bool startup)
{
+ reset(template_number());
+
if (startup) {
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
LaunchControlXL::set_active (bool yn)
{
diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.h b/libs/surfaces/launch_control_xl/launch_control_xl.h
index 606645a10b..a37eec8734 100644
--- a/libs/surfaces/launch_control_xl/launch_control_xl.h
+++ b/libs/surfaces/launch_control_xl/launch_control_xl.h
@@ -351,6 +351,7 @@ public:
static std::string fader_name_by_id(FaderID);
void write(const MidiByteArray &);
+ void reset(uint8_t chan);
TrackMode track_mode() const { return _track_mode; }
void set_track_mode(TrackMode mode);