From 253dac007df2e6e53efe46f44ffb4eaa309beb8d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 31 Aug 2022 10:22:24 -0600 Subject: [PATCH] push2: fully init and de-init buttons and pads at startup and shutdown --- libs/surfaces/push2/push2.cc | 49 +++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index d331b7d42b..a3e538ea6d 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -245,6 +245,12 @@ Push2::stop_using_device () init_buttons (false); strip_buttons_off (); + for (auto & pad : _xy_pad_map) { + pad->set_color (LED::Black); + pad->set_state (LED::NoTransition); + write (pad->state_msg()); + } + _vblank_connection.disconnect (); session_connections.drop_connections (); @@ -405,26 +411,24 @@ Push2::init_buttons (bool startup) in ardour related (loosely, sometimes) to their illuminated label. */ - ButtonID buttons[] = { Mute, Solo, Master, Up, Right, Left, Down, Note, Session, Mix, AddTrack, Delete, Undo, - Metronome, Shift, Select, Play, RecordEnable, Automate, Repeat, Note, Session, - Quantize, Duplicate, Browse, PageRight, PageLeft, OctaveUp, OctaveDown, Layout, Scale, - Stop - }; - - for (size_t n = 0; n < sizeof (buttons) / sizeof (buttons[0]); ++n) { - boost::shared_ptr