diff options
Diffstat (limited to 'src/server/DirectDriver.hpp')
-rw-r--r-- | src/server/DirectDriver.hpp | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp index bb949a14..bc52fc3a 100644 --- a/src/server/DirectDriver.hpp +++ b/src/server/DirectDriver.hpp @@ -18,29 +18,50 @@ #define INGEN_ENGINE_DIRECT_DRIVER_HPP #include "Driver.hpp" +#include "DuplexPort.hpp" #include "Engine.hpp" +#include "EnginePort.hpp" +#include "RunContext.hpp" +#include "types.hpp" + +#include <raul/Path.hpp> #include <boost/intrusive/slist.hpp> +#include <cstddef> +#include <cstdint> +#include <string> + +namespace boost::intrusive { +template <bool Enabled> struct cache_last; +} // namespace boost::intrusive + namespace ingen { + +class Atom; +class URI; + namespace server { +class Buffer; + /** Driver for running Ingen directly as a library. * \ingroup engine */ -class DirectDriver : public Driver { +class DirectDriver : public Driver +{ public: DirectDriver(Engine& engine, double sample_rate, SampleCount block_length, - size_t seq_size) + uint32_t seq_size) : _engine(engine) , _sample_rate(sample_rate) , _block_length(block_length) , _seq_size(seq_size) {} - virtual ~DirectDriver() { + ~DirectDriver() override { _ports.clear_and_dispose([](EnginePort* p) { delete p; }); } @@ -50,7 +71,7 @@ public: return new EnginePort(graph_port); } - EnginePort* get_port(const Raul::Path& path) override { + EnginePort* get_port(const raul::Path& path) override { for (auto& p : _ports) { if (p.graph_port()->path() == path) { return &p; @@ -60,18 +81,18 @@ public: return nullptr; } - void add_port(RunContext& context, EnginePort* port) override { + void add_port(RunContext&, EnginePort* port) override { _ports.push_back(*port); } - void remove_port(RunContext& context, EnginePort* port) override { + void remove_port(RunContext&, EnginePort* port) override { _ports.erase(_ports.iterator_to(*port)); } - void rename_port(const Raul::Path& old_path, - const Raul::Path& new_path) override {} + void rename_port(const raul::Path& old_path, + const raul::Path& new_path) override {} - void port_property(const Raul::Path& path, + void port_property(const raul::Path& path, const URI& uri, const Atom& value) override {} @@ -80,7 +101,7 @@ public: SampleCount block_length() const override { return _block_length; } - size_t seq_size() const override { return _seq_size; } + uint32_t seq_size() const override { return _seq_size; } SampleCount sample_rate() const override { return _sample_rate; } @@ -88,7 +109,7 @@ public: return _engine.run_context().start(); } - void append_time_events(RunContext& context, Buffer& buffer) override {} + void append_time_events(RunContext&, Buffer&) override {} int real_time_priority() override { return 60; } @@ -100,7 +121,7 @@ private: Ports _ports; SampleCount _sample_rate; SampleCount _block_length; - size_t _seq_size; + uint32_t _seq_size; }; } // namespace server |