summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-05 21:32:55 +0000
committerDavid Robillard <d@drobilla.net>2010-01-05 21:32:55 +0000
commit534b3d2248884d5a8352c2239c668e632ab16b41 (patch)
tree1307d53d6c62d3ab51b1ad0f3056d387fba9a682 /src/engine/events
parentf4800095303dbcdec079d9c96b921f169696903c (diff)
downloadingen-534b3d2248884d5a8352c2239c668e632ab16b41.tar.gz
ingen-534b3d2248884d5a8352c2239c668e632ab16b41.tar.bz2
ingen-534b3d2248884d5a8352c2239c668e632ab16b41.zip
Merge JackMidiDriver and JackAudioDriver.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2343 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/CreateNode.cpp2
-rw-r--r--src/engine/events/CreatePatch.cpp7
-rw-r--r--src/engine/events/CreatePort.cpp24
-rw-r--r--src/engine/events/Delete.cpp8
-rw-r--r--src/engine/events/Move.cpp11
-rw-r--r--src/engine/events/SetPortValue.cpp4
6 files changed, 17 insertions, 39 deletions
diff --git a/src/engine/events/CreateNode.cpp b/src/engine/events/CreateNode.cpp
index 9a9e0826..bc43620d 100644
--- a/src/engine/events/CreateNode.cpp
+++ b/src/engine/events/CreateNode.cpp
@@ -31,7 +31,7 @@
#include "ClientBroadcaster.hpp"
#include "EngineStore.hpp"
#include "PortImpl.hpp"
-#include "AudioDriver.hpp"
+#include "Driver.hpp"
using namespace std;
using namespace Raul;
diff --git a/src/engine/events/CreatePatch.cpp b/src/engine/events/CreatePatch.cpp
index aab2e6f6..b76efcdc 100644
--- a/src/engine/events/CreatePatch.cpp
+++ b/src/engine/events/CreatePatch.cpp
@@ -24,7 +24,7 @@
#include "PluginImpl.hpp"
#include "Engine.hpp"
#include "ClientBroadcaster.hpp"
-#include "AudioDriver.hpp"
+#include "Driver.hpp"
#include "EngineStore.hpp"
using namespace std;
@@ -83,7 +83,8 @@ CreatePatch::pre_process()
if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_parent->internal_polyphony()))
poly = _poly;
- _patch = new PatchImpl(_engine, path.name(), poly, _parent, _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), _poly);
+ _patch = new PatchImpl(_engine, path.name(), poly, _parent,
+ _engine.driver()->sample_rate(), _engine.driver()->buffer_size(), _poly);
_patch->meta().properties().insert(_properties.begin(), _properties.end());
_patch->meta().set_property("rdf:type", Atom(Atom::URI, "ingen:Patch"));
_patch->set_property("rdf:type", Atom(Atom::URI, "ingen:Node"));
@@ -114,7 +115,7 @@ CreatePatch::execute(ProcessContext& context)
if (_parent == NULL) {
assert(_path.is_root());
assert(_patch->parent_patch() == NULL);
- _engine.audio_driver()->set_root_patch(_patch);
+ _engine.driver()->set_root_patch(_patch);
} else {
assert(_parent != NULL);
assert(!_path.is_root());
diff --git a/src/engine/events/CreatePort.cpp b/src/engine/events/CreatePort.cpp
index 60fd7cf9..ea2b3efa 100644
--- a/src/engine/events/CreatePort.cpp
+++ b/src/engine/events/CreatePort.cpp
@@ -30,9 +30,7 @@
#include "EngineStore.hpp"
#include "ClientBroadcaster.hpp"
#include "PortImpl.hpp"
-#include "AudioDriver.hpp"
-#include "MidiDriver.hpp"
-#include "OSCDriver.hpp"
+#include "Driver.hpp"
#include "DuplexPort.hpp"
using namespace std;
@@ -94,7 +92,7 @@ CreatePort::pre_process()
size_t buffer_size = 1;
if (_type.str() != "ingen:Float")
- buffer_size = _engine.audio_driver()->buffer_size();
+ buffer_size = _engine.driver()->buffer_size();
const uint32_t old_num_ports = _patch->num_ports();
@@ -120,15 +118,9 @@ CreatePort::pre_process()
_ports_array->at(_patch->num_ports()-1) = _patch_port;
_engine.engine_store()->add(_patch_port);
- if (!_patch->parent()) {
- if (_type.str() == "lv2:AudioPort") {
- _driver_port = _engine.audio_driver()->create_port(
- dynamic_cast<DuplexPort*>(_patch_port));
- } else if (_type.str() == "lv2ev:EventPort") {
- _driver_port = _engine.midi_driver()->create_port(
- dynamic_cast<DuplexPort*>(_patch_port));
- }
- }
+ if (!_patch->parent())
+ _driver_port = _engine.driver()->create_port(
+ dynamic_cast<DuplexPort*>(_patch_port));
assert(_ports_array->size() == _patch->num_ports());
@@ -151,11 +143,7 @@ CreatePort::execute(ProcessContext& context)
}
if (_driver_port) {
- if (_type.str() == "lv2:AudioPort") {
- _engine.audio_driver()->add_port(_driver_port);
- } else if (_type.str() == "lv2ev:EventPort") {
- _engine.midi_driver()->add_port(_driver_port);
- }
+ _engine.driver()->add_port(_driver_port);
}
}
diff --git a/src/engine/events/Delete.cpp b/src/engine/events/Delete.cpp
index 3c27ea94..62ddedf1 100644
--- a/src/engine/events/Delete.cpp
+++ b/src/engine/events/Delete.cpp
@@ -23,8 +23,7 @@
#include "PatchImpl.hpp"
#include "NodeBase.hpp"
#include "PluginImpl.hpp"
-#include "AudioDriver.hpp"
-#include "MidiDriver.hpp"
+#include "Driver.hpp"
#include "DisconnectAll.hpp"
#include "ClientBroadcaster.hpp"
#include "EngineStore.hpp"
@@ -153,10 +152,7 @@ Delete::execute(ProcessContext& context)
_port->parent_patch()->external_ports(_ports_array);
if ( ! _port->parent_patch()->parent()) {
- if (_port->type() == PortType::AUDIO)
- _driver_port = _engine.audio_driver()->remove_port(_port->path());
- else if (_port->type() == PortType::EVENTS)
- _driver_port = _engine.midi_driver()->remove_port(_port->path());
+ _driver_port = _engine.driver()->remove_port(_port->path());
// Apparently this needs to be called in post_process??
//if (_driver_port)
diff --git a/src/engine/events/Move.cpp b/src/engine/events/Move.cpp
index d386ce44..d8e119f5 100644
--- a/src/engine/events/Move.cpp
+++ b/src/engine/events/Move.cpp
@@ -23,8 +23,7 @@
#include "EngineStore.hpp"
#include "PatchImpl.hpp"
#include "Responder.hpp"
-#include "AudioDriver.hpp"
-#include "MidiDriver.hpp"
+#include "Driver.hpp"
using namespace std;
using namespace Raul;
@@ -104,13 +103,7 @@ Move::execute(ProcessContext& context)
SharedPtr<PortImpl> port = PtrCast<PortImpl>(_store_iterator->second);
if (port && port->parent()->parent() == NULL) {
- DriverPort* driver_port = NULL;
-
- if (port->type() == PortType::AUDIO)
- driver_port = _engine.audio_driver()->driver_port(_new_path);
- else if (port->type() == PortType::EVENTS)
- driver_port = _engine.midi_driver()->driver_port(_new_path);
-
+ DriverPort* driver_port = _engine.driver()->driver_port(_new_path);
if (driver_port)
driver_port->move(_new_path);
}
diff --git a/src/engine/events/SetPortValue.cpp b/src/engine/events/SetPortValue.cpp
index 7fe6377d..5efc35ae 100644
--- a/src/engine/events/SetPortValue.cpp
+++ b/src/engine/events/SetPortValue.cpp
@@ -22,7 +22,7 @@
#include "shared/LV2Object.hpp"
#include "module/World.hpp"
#include "AudioBuffer.hpp"
-#include "AudioDriver.hpp"
+#include "Driver.hpp"
#include "ClientBroadcaster.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
@@ -120,7 +120,7 @@ SetPortValue::pre_process()
apply(*_engine.message_context());
_port->parent_node()->set_port_valid(_port->index());
_engine.message_context()->run(_port,
- _engine.audio_driver()->frame_time() + _engine.audio_driver()->buffer_size());
+ _engine.driver()->frame_time() + _engine.driver()->buffer_size());
}
if (_port) {