From 61ec873481a0b65ba2e3f3f208688bbfd9a6c4c1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 26 Oct 2023 21:37:28 +0200 Subject: [PATCH] Console1: another attempt to fix uncaught exeptions --- libs/surfaces/console1/c1_operations.cc | 8 ++++++-- libs/surfaces/console1/console1.cc | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/libs/surfaces/console1/c1_operations.cc b/libs/surfaces/console1/c1_operations.cc index 4042679d8d..0163fdf70b 100644 --- a/libs/surfaces/console1/c1_operations.cc +++ b/libs/surfaces/console1/c1_operations.cc @@ -583,9 +583,13 @@ Console1::map_mute () DEBUG_TRACE (DEBUG::Console1, "Console1::map_mute ...\n"); if (_current_stripable) { if (_current_stripable->mute_control ()->muted ()) { - get_button (swap_solo_mute ? SOLO : MUTE)->set_led_state (true); + try { + get_button (swap_solo_mute ? SOLO : MUTE)->set_led_state (true); + } catch (ControlNotFoundException const&) { + DEBUG_TRACE (DEBUG::Console1, "solo/mute button not found\n"); + } } else if (_current_stripable->mute_control ()->muted_by_others_soloing () || - _current_stripable->mute_control ()->muted_by_masters ()) { + _current_stripable->mute_control ()->muted_by_masters ()) { DEBUG_TRACE (DEBUG::Console1, "Console1::map_mute start blinking\n"); start_blinking (swap_solo_mute ? SOLO : MUTE); diff --git a/libs/surfaces/console1/console1.cc b/libs/surfaces/console1/console1.cc index 3743d41b5d..b0a12418fc 100644 --- a/libs/surfaces/console1/console1.cc +++ b/libs/surfaces/console1/console1.cc @@ -894,15 +894,23 @@ Console1::map_stripable_state () void Console1::stop_blinking (ControllerID id) { - blinkers.remove (id); - get_button (id)->set_led_state (false); + try { + blinkers.remove (id); + get_button (id)->set_led_state (false); + } catch (ControlNotFoundException const&) { + DEBUG_TRACE (DEBUG::Console1, "Button to stop blinking not found ...\n"); + } } void Console1::start_blinking (ControllerID id) { - blinkers.push_back (id); - get_button (id)->set_led_state (true); + try { + blinkers.push_back (id); + get_button (id)->set_led_state (true); + } catch (ControlNotFoundException const&) { + DEBUG_TRACE (DEBUG::Console1, "Button to start blinking not found ...\n"); + } } bool