summaryrefslogtreecommitdiffstats
path: root/src/Patchage.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-28 12:32:24 +0100
committerDavid Robillard <d@drobilla.net>2020-11-28 12:45:57 +0100
commitdb5d1f603e0dd3076444f27008fcf1a61a4e151c (patch)
tree78af24e87c81e54fab14a59389adea859577f49e /src/Patchage.cpp
parent0ae4276ac187a9a361950f26bd67eb2d54636aff (diff)
downloadpatchage-db5d1f603e0dd3076444f27008fcf1a61a4e151c.tar.gz
patchage-db5d1f603e0dd3076444f27008fcf1a61a4e151c.tar.bz2
patchage-db5d1f603e0dd3076444f27008fcf1a61a4e151c.zip
Factor out Connector from PatchageCanvas
This finally breaks the dependency of the canvas on the entire application, and fixes the confusing situation where it wasn't clear whether connect/disconnect methods made/broke connections on the canvas or on the system.
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r--src/Patchage.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index fb269d5..fdd0ce9 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -168,6 +168,7 @@ Patchage::Patchage(int argc, char** argv)
, INIT_WIDGET(_status_text)
, _legend(nullptr)
, _log(_status_text)
+ , _connector(_log)
, _pane_initialized(false)
, _attach(true)
, _driver_detached(false)
@@ -179,7 +180,7 @@ Patchage::Patchage(int argc, char** argv)
#endif
{
_conf = new Configuration();
- _canvas = std::make_shared<PatchageCanvas>(this, 1600 * 2, 1200 * 2);
+ _canvas = std::make_shared<PatchageCanvas>(_connector, 1600 * 2, 1200 * 2);
while (argc > 0) {
if (!strcmp(*argv, "-h") || !strcmp(*argv, "--help")) {
@@ -338,6 +339,8 @@ Patchage::Patchage(int argc, char** argv)
#if defined(PATCHAGE_LIBJACK) || defined(HAVE_JACK_DBUS)
_jack_driver = new JackDriver(this, _log);
+ _connector.add_driver(PortID::Type::jack, _jack_driver);
+
_jack_driver->signal_detached.connect(
sigc::mem_fun(this, &Patchage::driver_detached));
@@ -349,6 +352,7 @@ Patchage::Patchage(int argc, char** argv)
#ifdef HAVE_ALSA
_alsa_driver = new AlsaDriver(this, _log);
+ _connector.add_driver(PortID::Type::alsa, _alsa_driver);
#endif
connect_widgets();