summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ingen/EngineBase.hpp9
-rw-r--r--src/ingen/ingen.cpp9
-rw-r--r--src/server/Engine.cpp6
-rw-r--r--src/server/Engine.hpp1
4 files changed, 24 insertions, 1 deletions
diff --git a/ingen/EngineBase.hpp b/ingen/EngineBase.hpp
index f857f14a..272faa47 100644
--- a/ingen/EngineBase.hpp
+++ b/ingen/EngineBase.hpp
@@ -49,6 +49,15 @@ public:
size_t seq_size) = 0;
/**
+ Return true iff the engine and driver supports dynamic ports.
+
+ This returns false in situations where top level ports can not be
+ created once the driver is running, which is the case for most
+ environments outside Jack.
+ */
+ virtual bool supports_dynamic_ports() const = 0;
+
+ /**
Activate the engine.
*/
virtual bool activate() = 0;
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index 1932b793..4eacfa97 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -158,7 +158,14 @@ main(int argc, char** argv)
if (!world->load_module("jack") && !world->load_module("portaudio")) {
cerr << "ingen: error: Failed to load driver module" << endl;
delete world;
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
+ }
+
+ if (!world->engine()->supports_dynamic_ports() &&
+ !conf.option("load").is_valid()) {
+ cerr << "ingen: error: Initial graph required for driver" << endl;
+ delete world;
+ return EXIT_FAILURE;
}
}
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 2fa079f1..8ec74829 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -400,6 +400,12 @@ Engine::init(double sample_rate, uint32_t block_length, size_t seq_size)
}
bool
+Engine::supports_dynamic_ports() const
+{
+ return !_driver || _driver->dynamic_ports();
+}
+
+bool
Engine::activate()
{
if (!_driver) {
diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp
index f951eaf3..cf13f5e6 100644
--- a/src/server/Engine.hpp
+++ b/src/server/Engine.hpp
@@ -77,6 +77,7 @@ public:
// EngineBase methods
virtual void init(double sample_rate, uint32_t block_length, size_t seq_size);
+ virtual bool supports_dynamic_ports() const;
virtual bool activate();
virtual void deactivate();
virtual bool pending_events() const;