diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Patchage.cpp | 15 | ||||
-rw-r--r-- | src/Patchage.hpp | 2 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 3d2853c..cc746b7 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -528,11 +528,9 @@ Patchage::refresh() } #endif -#ifdef HAVE_ALSA if (_alsa_driver) { _alsa_driver->refresh(sink); } -#endif } } @@ -631,22 +629,21 @@ Patchage::process_events() } } -#ifdef HAVE_ALSA void Patchage::menu_alsa_connect() { - _alsa_driver->attach(false); - _alsa_driver->refresh( - [this](const PatchageEvent& event) { handle_event(*this, event); }); + if (_alsa_driver) { + _alsa_driver->attach(false); + } } void Patchage::menu_alsa_disconnect() { - _alsa_driver->detach(); - refresh(); + if (_alsa_driver) { + _alsa_driver->detach(); + } } -#endif void Patchage::on_arrange() diff --git a/src/Patchage.hpp b/src/Patchage.hpp index c55953c..b0c2630 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -152,12 +152,10 @@ protected: std::mutex _events_mutex; std::queue<PatchageEvent> _driver_events; -#ifdef HAVE_ALSA std::unique_ptr<Driver> _alsa_driver; void menu_alsa_connect(); void menu_alsa_disconnect(); -#endif std::shared_ptr<PatchageCanvas> _canvas; |