summaryrefslogtreecommitdiffstats
path: root/src/Patchage.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-29 00:51:09 +0100
committerDavid Robillard <d@drobilla.net>2020-11-29 00:53:17 +0100
commitcfa6965004b73f26b7385e08db797e6af638f04c (patch)
tree3052e0cd01f9fd9987950494ce9fcc43ee0ce87e /src/Patchage.cpp
parentfb54982c5ade5bee05b8d4a817d258ba89df701b (diff)
downloadpatchage-cfa6965004b73f26b7385e08db797e6af638f04c.tar.gz
patchage-cfa6965004b73f26b7385e08db797e6af638f04c.tar.bz2
patchage-cfa6965004b73f26b7385e08db797e6af638f04c.zip
Reduce preprocessor gunk
Now that the ALSA driver is only used through the base class, the pointer can always be there, even if AlsaDriver isn't actually compiled in.
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r--src/Patchage.cpp15
1 files changed, 6 insertions, 9 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()