summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-12-26 00:30:22 +0000
committerDavid Robillard <d@drobilla.net>2013-12-26 00:30:22 +0000
commit848893c6a25e70a6f898ceaa8a647558060ac06e (patch)
tree949edae2438e7f671fcd3fe89f427a770cf24d2e /src/server
parent12949a786324a758c1dbfca5bb68605ca4ca35ea (diff)
downloadingen-848893c6a25e70a6f898ceaa8a647558060ac06e.tar.gz
ingen-848893c6a25e70a6f898ceaa8a647558060ac06e.tar.bz2
ingen-848893c6a25e70a6f898ceaa8a647558060ac06e.zip
Implement port methods for DirectDriver.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5210 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/DirectDriver.hpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp
index 87192599..301a43cc 100644
--- a/src/server/DirectDriver.hpp
+++ b/src/server/DirectDriver.hpp
@@ -17,6 +17,8 @@
#ifndef INGEN_ENGINE_DIRECT_DRIVER_HPP
#define INGEN_ENGINE_DIRECT_DRIVER_HPP
+#include <boost/intrusive/list.hpp>
+
#include "Driver.hpp"
namespace Ingen {
@@ -39,13 +41,26 @@ public:
virtual void deactivate() {}
virtual EnginePort* create_port(DuplexPort* graph_port) {
+ return new EnginePort(graph_port);
+ }
+
+ virtual EnginePort* get_port(const Raul::Path& path) {
+ for (auto& p : _ports) {
+ if (p.graph_port()->path() == path) {
+ return &p;
+ }
+ }
+
return NULL;
}
- virtual EnginePort* get_port(const Raul::Path& path) { return NULL; }
+ virtual void add_port(ProcessContext& context, EnginePort* port) {
+ _ports.push_back(*port);
+ }
- virtual void add_port(ProcessContext& context, EnginePort* port) {}
- virtual void remove_port(ProcessContext& context, EnginePort* port) {}
+ virtual void remove_port(ProcessContext& context, EnginePort* port) {
+ _ports.erase(_ports.iterator_to(*port));
+ }
virtual void rename_port(const Raul::Path& old_path,
const Raul::Path& new_path) {}
@@ -57,18 +72,17 @@ public:
virtual SampleCount sample_rate() const { return _sample_rate; }
- virtual SampleCount frame_time() const {
- return 0;
- }
+ virtual SampleCount frame_time() const { return 0; }
- virtual bool is_realtime() const {
- return false;
- }
+ virtual bool is_realtime() const { return false; }
virtual void append_time_events(ProcessContext& context,
Buffer& buffer) {}
private:
+ typedef boost::intrusive::list<EnginePort> Ports;
+
+ Ports _ports;
SampleCount _sample_rate;
SampleCount _block_length;
};