summaryrefslogtreecommitdiff
path: root/drumgizmo/enginefactory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo/enginefactory.cc')
-rw-r--r--drumgizmo/enginefactory.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/drumgizmo/enginefactory.cc b/drumgizmo/enginefactory.cc
index c9f2ef3..8c40a28 100644
--- a/drumgizmo/enginefactory.cc
+++ b/drumgizmo/enginefactory.cc
@@ -49,7 +49,11 @@
#include "output/alsa.h"
#endif
-InputEnginePtr createInputEngine(std::string const & name) {
+#ifdef HAVE_OUTPUT_JACKAUDIO
+#include "output/jackaudio.h"
+#endif
+
+InputEnginePtr createInputEngine(JackClientPtr& jack, std::string const & name) {
#ifdef HAVE_INPUT_DUMMY
if (name == "dummy") {
return std::make_unique<DummyInputEngine>();
@@ -67,7 +71,7 @@ InputEnginePtr createInputEngine(std::string const & name) {
return nullptr;
}
-OutputEnginePtr createOutputEngine(std::string const & name) {
+OutputEnginePtr createOutputEngine(JackClientPtr& jack, std::string const & name) {
#ifdef HAVE_OUTPUT_DUMMY
if (name == "dummy") {
return std::make_unique<DummyOutputEngine>();
@@ -83,6 +87,14 @@ OutputEnginePtr createOutputEngine(std::string const & name) {
return std::make_unique<AlsaOutputEngine>();
}
#endif
+#ifdef HAVE_OUTPUT_JACKAUDIO
+ if (name == "jackaudio") {
+ if (jack.get() == nullptr) {
+ jack = std::make_unique<JackClient>();
+ }
+ return std::make_unique<JackaudioOutputEngine>(*jack);
+ }
+#endif
// todo: add more engines