summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Patchage.cpp11
-rw-r--r--src/Patchage.hpp8
2 files changed, 8 insertions, 11 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;
diff --git a/src/Patchage.hpp b/src/Patchage.hpp
index 8f0cb9a..8c0ccb5 100644
--- a/src/Patchage.hpp
+++ b/src/Patchage.hpp
@@ -53,7 +53,6 @@
#include <set>
#include <string>
-class AlsaDriver;
class JackDriver;
class PatchageCanvas;
class Configuration;
@@ -152,9 +151,10 @@ protected:
std::queue<PatchageEvent> _driver_events;
#ifdef HAVE_ALSA
- AlsaDriver* _alsa_driver;
- void menu_alsa_connect();
- void menu_alsa_disconnect();
+ std::unique_ptr<Driver> _alsa_driver;
+
+ void menu_alsa_connect();
+ void menu_alsa_disconnect();
#endif
std::shared_ptr<PatchageCanvas> _canvas;