summaryrefslogtreecommitdiffstats
path: root/ingen
diff options
context:
space:
mode:
Diffstat (limited to 'ingen')
-rw-r--r--ingen/EngineBase.hpp7
-rw-r--r--ingen/shared/Module.hpp17
2 files changed, 20 insertions, 4 deletions
diff --git a/ingen/EngineBase.hpp b/ingen/EngineBase.hpp
index c9acb512..5288eafa 100644
--- a/ingen/EngineBase.hpp
+++ b/ingen/EngineBase.hpp
@@ -37,6 +37,13 @@ public:
virtual ~EngineBase() {}
/**
+ Initialise the engine for local use (e.g. without a Jack driver).
+ @param sample_rate Audio sampling rate in Hz.
+ @param block_length Audio block length (i.e. buffer size) in frames.
+ */
+ virtual void init(double sample_rate, uint32_t block_length) = 0;
+
+ /**
Activate the engine.
*/
virtual bool activate() = 0;
diff --git a/ingen/shared/Module.hpp b/ingen/shared/Module.hpp
index 1552a225..81179426 100644
--- a/ingen/shared/Module.hpp
+++ b/ingen/shared/Module.hpp
@@ -19,8 +19,6 @@
#include <glibmm/module.h>
-#include "raul/SharedPtr.hpp"
-
namespace Ingen {
namespace Shared {
@@ -32,12 +30,23 @@ class World;
* @ingroup IngenShared
*/
struct Module {
- virtual ~Module();
+ Module() : library(NULL) {}
+ virtual ~Module() {}
virtual void load(Ingen::Shared::World* world) = 0;
virtual void run(Ingen::Shared::World* world) {}
- SharedPtr<Glib::Module> library;
+ /** Library implementing this module.
+ *
+ * This is managed by the World and not this class, since closing the library
+ * in this destructor could possibly reference code from the library
+ * afterwards and cause a segfault on exit.
+ */
+ Glib::Module* library;
+
+private:
+ Module(const Module& noncopyable);
+ Module& operator=(const Module& noncopyable);
};
} // namespace Shared