summaryrefslogtreecommitdiffstats
path: root/src/Patchage.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-28 23:15:04 +0100
committerDavid Robillard <d@drobilla.net>2020-11-28 23:15:04 +0100
commitf95ca1978dd463d1e6c640bb00d4d420ccb9d593 (patch)
tree94e479f783b43a1eccabdd8df80e2d72ac74be8a /src/Patchage.cpp
parent0124e669bd43b5d40bff33886dee8a3d464254f7 (diff)
downloadpatchage-f95ca1978dd463d1e6c640bb00d4d420ccb9d593.tar.gz
patchage-f95ca1978dd463d1e6c640bb00d4d420ccb9d593.tar.bz2
patchage-f95ca1978dd463d1e6c640bb00d4d420ccb9d593.zip
Use AlsaDriver only through base class interface
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r--src/Patchage.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index b071fd2..1df1903 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -125,9 +125,6 @@ port_order(const GanvPort* a, const GanvPort* b, void*)
Patchage::Patchage(int argc, char** argv)
: _xml(UIFile::open("patchage"))
-#ifdef HAVE_ALSA
- , _alsa_driver(nullptr)
-#endif
, _jack_driver(nullptr)
, _conf(nullptr)
, _gtk_main(nullptr)
@@ -340,10 +337,10 @@ Patchage::Patchage(int argc, char** argv)
#endif
#ifdef HAVE_ALSA
- _alsa_driver = new AlsaDriver(
- _log, [this](const PatchageEvent& event) { on_driver_event(event); });
+ _alsa_driver = std::unique_ptr<Driver>{new AlsaDriver(
+ _log, [this](const PatchageEvent& event) { on_driver_event(event); })};
- _connector.add_driver(PortID::Type::alsa, _alsa_driver);
+ _connector.add_driver(PortID::Type::alsa, _alsa_driver.get());
#endif
connect_widgets();
@@ -386,7 +383,7 @@ Patchage::~Patchage()
delete _jack_driver;
#endif
#ifdef HAVE_ALSA
- delete _alsa_driver;
+ _alsa_driver.reset();
#endif
delete _conf;