summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-20 21:56:12 +0000
committerDavid Robillard <d@drobilla.net>2006-06-20 21:56:12 +0000
commit032d526710d174b30e0c9f33ff9f7e60e99fb172 (patch)
tree21eefe5891ccf7f3bb7bd618c125afd928fc81c5 /src/libs/engine
parent34d46336eeccb2430df4d1ef00097890c400ab05 (diff)
downloadingen-032d526710d174b30e0c9f33ff9f7e60e99fb172.tar.gz
ingen-032d526710d174b30e0c9f33ff9f7e60e99fb172.tar.bz2
ingen-032d526710d174b30e0c9f33ff9f7e60e99fb172.zip
Renamed OmObject GraphObject;
Merged Port::prepare_buffers and Node::run into GraphObject::process. git-svn-id: http://svn.drobilla.net/lad/grauph@69 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/ClientBroadcaster.cpp4
-rw-r--r--src/libs/engine/DSSINode.cpp6
-rw-r--r--src/libs/engine/DSSINode.h2
-rw-r--r--src/libs/engine/Driver.h2
-rw-r--r--src/libs/engine/GraphObject.h (renamed from src/libs/engine/OmObject.h)54
-rw-r--r--src/libs/engine/InputPort.cpp8
-rw-r--r--src/libs/engine/InputPort.h4
-rw-r--r--src/libs/engine/InternalNode.h2
-rw-r--r--src/libs/engine/JackAudioDriver.cpp2
-rw-r--r--src/libs/engine/LADSPANode.cpp4
-rw-r--r--src/libs/engine/LADSPANode.h2
-rw-r--r--src/libs/engine/LV2Node.cpp4
-rw-r--r--src/libs/engine/LV2Node.h2
-rw-r--r--src/libs/engine/Makefile.am2
-rw-r--r--src/libs/engine/MidiControlNode.cpp4
-rw-r--r--src/libs/engine/MidiControlNode.h2
-rw-r--r--src/libs/engine/MidiNoteNode.cpp4
-rw-r--r--src/libs/engine/MidiNoteNode.h2
-rw-r--r--src/libs/engine/MidiTriggerNode.cpp4
-rw-r--r--src/libs/engine/MidiTriggerNode.h2
-rw-r--r--src/libs/engine/Node.h10
-rw-r--r--src/libs/engine/NodeBase.cpp10
-rw-r--r--src/libs/engine/NodeBase.h2
-rw-r--r--src/libs/engine/OSCClient.cpp4
-rw-r--r--src/libs/engine/ObjectSender.cpp2
-rw-r--r--src/libs/engine/ObjectSender.h2
-rw-r--r--src/libs/engine/ObjectStore.cpp18
-rw-r--r--src/libs/engine/ObjectStore.h18
-rw-r--r--src/libs/engine/OmApp.cpp4
-rw-r--r--src/libs/engine/OutputPort.h2
-rw-r--r--src/libs/engine/Patch.cpp30
-rw-r--r--src/libs/engine/Patch.h2
-rw-r--r--src/libs/engine/Port.cpp4
-rw-r--r--src/libs/engine/Port.h6
-rw-r--r--src/libs/engine/TransportNode.cpp2
-rw-r--r--src/libs/engine/TypedConnection.cpp9
-rw-r--r--src/libs/engine/TypedConnection.h2
-rw-r--r--src/libs/engine/TypedPort.cpp10
-rw-r--r--src/libs/engine/TypedPort.h2
-rw-r--r--src/libs/engine/events/DestroyEvent.h4
-rw-r--r--src/libs/engine/events/RenameEvent.cpp2
-rw-r--r--src/libs/engine/events/RenameEvent.h6
-rw-r--r--src/libs/engine/events/RequestMetadataEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestMetadataEvent.h4
-rw-r--r--src/libs/engine/events/SetMetadataEvent.cpp2
-rw-r--r--src/libs/engine/events/SetMetadataEvent.h6
-rw-r--r--src/libs/engine/instantiations.cpp26
47 files changed, 155 insertions, 152 deletions
diff --git a/src/libs/engine/ClientBroadcaster.cpp b/src/libs/engine/ClientBroadcaster.cpp
index 55896536..2678f3cb 100644
--- a/src/libs/engine/ClientBroadcaster.cpp
+++ b/src/libs/engine/ClientBroadcaster.cpp
@@ -296,7 +296,7 @@ ClientBroadcaster::send_patch(const Patch* const p)
}
-/** Sends notification of an OmObject's renaming
+/** Sends notification of an GraphObject's renaming
*/
void
ClientBroadcaster::send_rename(const string& old_path, const string& new_path)
@@ -306,7 +306,7 @@ ClientBroadcaster::send_rename(const string& old_path, const string& new_path)
}
-/** Sends all OmObjects known to the engine.
+/** Sends all GraphObjects known to the engine.
*/
void
ClientBroadcaster::send_all_objects()
diff --git a/src/libs/engine/DSSINode.cpp b/src/libs/engine/DSSINode.cpp
index f6cfb6f8..dcf0f645 100644
--- a/src/libs/engine/DSSINode.cpp
+++ b/src/libs/engine/DSSINode.cpp
@@ -160,9 +160,9 @@ DSSINode::has_midi_input() const
void
-DSSINode::run(size_t nframes)
+DSSINode::process(samplecount nframes)
{
- NodeBase::run(nframes);
+ NodeBase::process(nframes);
if (_dssi_descriptor->run_synth) {
convert_events();
@@ -176,7 +176,7 @@ DSSINode::run(size_t nframes)
_dssi_descriptor->run_multiple_synths(1, _instances, nframes,
events, events_sizes);
} else {
- LADSPANode::run(nframes);
+ LADSPANode::process(nframes);
}
}
diff --git a/src/libs/engine/DSSINode.h b/src/libs/engine/DSSINode.h
index deef0b8b..726b24f6 100644
--- a/src/libs/engine/DSSINode.h
+++ b/src/libs/engine/DSSINode.h
@@ -53,7 +53,7 @@ public:
void configure(const string& key, const string& val);
void program(int bank, int program);
- void run(size_t nframes);
+ void process(samplecount nframes);
bool update_programs(bool send_events);
void set_default_program();
diff --git a/src/libs/engine/Driver.h b/src/libs/engine/Driver.h
index 11060c04..bbc8d2a8 100644
--- a/src/libs/engine/Driver.h
+++ b/src/libs/engine/Driver.h
@@ -53,7 +53,7 @@ protected:
/** Driver abstract base class.
*
- * A Driver is, from the perspective of OmObjects (nodes, patches, ports) an
+ * A Driver is, from the perspective of GraphObjects (nodes, patches, ports) an
* interface for managing system ports. An implementation of Driver basically
* needs to manage DriverPorts, and handle writing/reading data to/from them.
*
diff --git a/src/libs/engine/OmObject.h b/src/libs/engine/GraphObject.h
index 2f873ff5..cf46f895 100644
--- a/src/libs/engine/OmObject.h
+++ b/src/libs/engine/GraphObject.h
@@ -23,7 +23,7 @@
#include <cassert>
#include "MaidObject.h"
#include "util/Path.h"
-
+#include "types.h"
using std::string; using std::map;
namespace Om {
@@ -33,7 +33,7 @@ class Node;
class Port;
-/** An object in the "synth space" of Om - Patch, Node, Port, etc.
+/** An object on the audio graph - Patch, Node, Port, etc.
*
* Each of these is a MaidObject and so can be deleted in a realtime safe
* way from anywhere, and they all have a map of metadata for clients to store
@@ -41,40 +41,50 @@ class Port;
*
* \ingroup engine
*/
-class OmObject : public MaidObject
+class GraphObject : public MaidObject
{
public:
- OmObject(OmObject* parent, const string& name)
+ GraphObject(GraphObject* parent, const string& name)
: _parent(parent), _name(name)
{
assert(parent == NULL || _name.length() > 0);
assert(parent == NULL || _name.find("/") == string::npos);
- //assert(((string)path()).find("//") == string::npos);
+ assert(((string)path()).find("//") == string::npos);
}
- virtual ~OmObject() {}
+ virtual ~GraphObject() {}
- OmObject* parent() const { return _parent; }
-
- inline const string& name() const { return _name; }
+ inline GraphObject* parent() const { return _parent; }
+ inline const string& name() const { return _name; }
+ virtual void process(samplecount nframes) = 0;
+
+ /** Rename */
virtual void set_path(const Path& new_path) {
+ assert(new_path.parent() == path().parent());
_name = new_path.name();
assert(_name.find("/") == string::npos);
}
- void set_metadata(const string& key, const string& value) { _metadata[key] = value; }
+ void set_metadata(const string& key, const string& value)
+ { _metadata[key] = value; }
+
const string& get_metadata(const string& key) {
static const string empty_string = "";
map<string, string>::iterator i = _metadata.find(key);
- if (i != _metadata.end())
- return (*i).second;
- else
- return empty_string;
+ return (i != _metadata.end()) ? (*i).second : empty_string;
}
const map<string, string>& metadata() const { return _metadata; }
+
+ /** Patch and Node override this to recursively add their children. */
+ virtual void add_to_store() = 0;
+
+ /** Patch and Node override this to recursively remove their children. */
+ virtual void remove_from_store() = 0;
+
+ /** Path is dynamically generated from parent to ease renaming */
inline const Path path() const {
if (_parent == NULL)
return Path(string("/").append(_name));
@@ -84,22 +94,14 @@ public:
return Path(_parent->path() +"/"+ _name);
}
- /** Patch and Node override this to recursively add their children. */
- virtual void add_to_store() = 0;
-
- /** Patch and Node override this to recursively remove their children. */
- virtual void remove_from_store() = 0;
-
protected:
- OmObject() {}
-
- OmObject* _parent;
- string _name;
+ GraphObject* _parent;
+ string _name;
private:
// Prevent copies (undefined)
- OmObject(const OmObject&);
- OmObject& operator=(const OmObject& copy);
+ GraphObject(const GraphObject&);
+ GraphObject& operator=(const GraphObject& copy);
map<string, string> _metadata;
};
diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp
index 752efde4..960972e5 100644
--- a/src/libs/engine/InputPort.cpp
+++ b/src/libs/engine/InputPort.cpp
@@ -210,7 +210,7 @@ template void InputPort<MidiMessage>::tie(OutputPort<MidiMessage>* const port);
*/
template<>
void
-InputPort<sample>::prepare_buffers(size_t nframes)
+InputPort<sample>::process(samplecount nframes)
{
//assert(!m_is_tied || m_tied_port != NULL);
@@ -220,7 +220,7 @@ InputPort<sample>::prepare_buffers(size_t nframes)
if (m_connections.size() == 0) return;
for (TypedConnectionListIterator c = m_connections.begin(); c != m_connections.end(); ++c)
- (*c)->prepare_buffers();
+ (*c)->process(nframes);
// If only one connection, buffer is (maybe) used directly (no copying)
if (m_connections.size() == 1) {
@@ -270,7 +270,7 @@ InputPort<sample>::prepare_buffers(size_t nframes)
*/
template <>
void
-InputPort<MidiMessage>::prepare_buffers(size_t nframes)
+InputPort<MidiMessage>::process(samplecount nframes)
{
//assert(!m_is_tied || m_tied_port != NULL);
@@ -283,7 +283,7 @@ InputPort<MidiMessage>::prepare_buffers(size_t nframes)
assert(_poly == 1);
for (TypedConnectionListIterator c = m_connections.begin(); c != m_connections.end(); ++c)
- (*c)->prepare_buffers();
+ (*c)->process(nframes);
// If only one connection, buffer is used directly (no copying)
diff --git a/src/libs/engine/InputPort.h b/src/libs/engine/InputPort.h
index 60e96167..789d98ab 100644
--- a/src/libs/engine/InputPort.h
+++ b/src/libs/engine/InputPort.h
@@ -55,9 +55,9 @@ public:
const List<TypedConnection<T>*>& connections() { return m_connections; }
- void prepare_buffers(size_t nframes);
+ void process(samplecount nframes);
- void tie(OutputPort<T>* const port);
+ //void tie(OutputPort<T>* const port);
bool is_connected() const { return (m_connections.size() > 0); }
bool is_connected_to(const OutputPort<T>* const port) const;
diff --git a/src/libs/engine/InternalNode.h b/src/libs/engine/InternalNode.h
index e7c35ebd..19846390 100644
--- a/src/libs/engine/InternalNode.h
+++ b/src/libs/engine/InternalNode.h
@@ -44,7 +44,7 @@ public:
virtual void deactivate() { if (_is_added) remove_from_patch(); NodeBase::deactivate(); }
- virtual void run(size_t nframes) { NodeBase::run(nframes); }
+ virtual void process(samplecount nframes) { NodeBase::process(nframes); }
virtual void add_to_patch() { assert(!_is_added); _is_added = true; }
virtual void remove_from_patch() { assert(_is_added); _is_added = false; }
diff --git a/src/libs/engine/JackAudioDriver.cpp b/src/libs/engine/JackAudioDriver.cpp
index 5fc786f2..59e30e5c 100644
--- a/src/libs/engine/JackAudioDriver.cpp
+++ b/src/libs/engine/JackAudioDriver.cpp
@@ -328,7 +328,7 @@ JackAudioDriver::m_process_cb(jack_nframes_t nframes)
// Run root patch
assert(m_root_patch != NULL);
- m_root_patch->run(nframes);
+ m_root_patch->process(nframes);
return 0;
}
diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp
index 5dcef91e..1c36177c 100644
--- a/src/libs/engine/LADSPANode.cpp
+++ b/src/libs/engine/LADSPANode.cpp
@@ -171,9 +171,9 @@ LADSPANode::deactivate()
void
-LADSPANode::run(size_t nframes)
+LADSPANode::process(samplecount nframes)
{
- NodeBase::run(nframes); // mixes down input ports
+ NodeBase::process(nframes); // mixes down input ports
for (size_t i=0; i < _poly; ++i)
_descriptor->run(_instances[i], nframes);
}
diff --git a/src/libs/engine/LADSPANode.h b/src/libs/engine/LADSPANode.h
index 155857ed..de965eb3 100644
--- a/src/libs/engine/LADSPANode.h
+++ b/src/libs/engine/LADSPANode.h
@@ -41,7 +41,7 @@ public:
void activate();
void deactivate();
- void run(size_t nframes);
+ void process(samplecount nframes);
void set_port_buffer(size_t voice, size_t port_num, void* buf);
diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp
index 5a037c70..cd7c1b2b 100644
--- a/src/libs/engine/LV2Node.cpp
+++ b/src/libs/engine/LV2Node.cpp
@@ -163,9 +163,9 @@ LV2Node::deactivate()
void
-LV2Node::run(size_t nframes)
+LV2Node::process(samplecount nframes)
{
- NodeBase::run(nframes); // mixes down input ports
+ NodeBase::process(nframes); // mixes down input ports
for (size_t i=0; i < _poly; ++i)
slv2_instance_run(_instances[i], nframes);
}
diff --git a/src/libs/engine/LV2Node.h b/src/libs/engine/LV2Node.h
index 002e3e9e..ddb1c27e 100644
--- a/src/libs/engine/LV2Node.h
+++ b/src/libs/engine/LV2Node.h
@@ -47,7 +47,7 @@ public:
void activate();
void deactivate();
- void run(size_t nframes);
+ void process(samplecount nframes);
void set_port_buffer(size_t voice, size_t port_num, void* buf);
diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am
index 56b7724c..322b5933 100644
--- a/src/libs/engine/Makefile.am
+++ b/src/libs/engine/Makefile.am
@@ -64,7 +64,7 @@ libom_la_SOURCES = \
QueuedEventSource.cpp \
QueuedEngineInterface.h \
QueuedEngineInterface.cpp \
- OmObject.h \
+ GraphObject.h \
Maid.h \
Maid.cpp \
MaidObject.h \
diff --git a/src/libs/engine/MidiControlNode.cpp b/src/libs/engine/MidiControlNode.cpp
index 225c3753..c9aa37ff 100644
--- a/src/libs/engine/MidiControlNode.cpp
+++ b/src/libs/engine/MidiControlNode.cpp
@@ -63,9 +63,9 @@ MidiControlNode::MidiControlNode(const string& path, size_t poly, Patch* parent,
void
-MidiControlNode::run(size_t nframes)
+MidiControlNode::process(samplecount nframes)
{
- InternalNode::run(nframes);
+ InternalNode::process(nframes);
MidiMessage ev;
diff --git a/src/libs/engine/MidiControlNode.h b/src/libs/engine/MidiControlNode.h
index 763c67e6..16bb2b6b 100644
--- a/src/libs/engine/MidiControlNode.h
+++ b/src/libs/engine/MidiControlNode.h
@@ -42,7 +42,7 @@ class MidiControlNode : public InternalNode
public:
MidiControlNode(const string& path, size_t poly, Patch* parent, samplerate srate, size_t buffer_size);
- void run(size_t nframes);
+ void process(samplecount nframes);
void control(uchar control_num, uchar val, samplecount offset);
diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp
index a2a95039..df214be5 100644
--- a/src/libs/engine/MidiNoteNode.cpp
+++ b/src/libs/engine/MidiNoteNode.cpp
@@ -72,9 +72,9 @@ MidiNoteNode::~MidiNoteNode()
void
-MidiNoteNode::run(size_t nframes)
+MidiNoteNode::process(samplecount nframes)
{
- InternalNode::run(nframes);
+ InternalNode::process(nframes);
MidiMessage ev;
diff --git a/src/libs/engine/MidiNoteNode.h b/src/libs/engine/MidiNoteNode.h
index 45f6633a..2ffd2e56 100644
--- a/src/libs/engine/MidiNoteNode.h
+++ b/src/libs/engine/MidiNoteNode.h
@@ -42,7 +42,7 @@ public:
MidiNoteNode(const string& path, size_t poly, Patch* parent, samplerate srate, size_t buffer_size);
~MidiNoteNode();
- void run(size_t nframes);
+ void process(samplecount nframes);
void note_on(uchar note_num, uchar velocity, samplecount offset);
void note_off(uchar note_num, samplecount offset);
diff --git a/src/libs/engine/MidiTriggerNode.cpp b/src/libs/engine/MidiTriggerNode.cpp
index 6a2e0a1c..174117f3 100644
--- a/src/libs/engine/MidiTriggerNode.cpp
+++ b/src/libs/engine/MidiTriggerNode.cpp
@@ -55,9 +55,9 @@ MidiTriggerNode::MidiTriggerNode(const string& path, size_t poly, Patch* parent,
void
-MidiTriggerNode::run(size_t nframes)
+MidiTriggerNode::process(samplecount nframes)
{
- InternalNode::run(nframes);
+ InternalNode::process(nframes);
MidiMessage ev;
diff --git a/src/libs/engine/MidiTriggerNode.h b/src/libs/engine/MidiTriggerNode.h
index 04d347d5..a3e4694f 100644
--- a/src/libs/engine/MidiTriggerNode.h
+++ b/src/libs/engine/MidiTriggerNode.h
@@ -45,7 +45,7 @@ class MidiTriggerNode : public InternalNode
public:
MidiTriggerNode(const string& path, size_t poly, Patch* parent, samplerate srate, size_t buffer_size);
- void run(size_t nframes);
+ void process(samplecount nframes);
void note_on(uchar note_num, uchar velocity, samplecount offset);
void note_off(uchar note_num, samplecount offset);
diff --git a/src/libs/engine/Node.h b/src/libs/engine/Node.h
index 27d59e32..b4214f13 100644
--- a/src/libs/engine/Node.h
+++ b/src/libs/engine/Node.h
@@ -19,7 +19,7 @@
#include <string>
#include "types.h"
-#include "OmObject.h"
+#include "GraphObject.h"
#include "Array.h"
using std::string;
@@ -39,7 +39,7 @@ namespace Shared {
/** A Node (or "module") in a Patch (which is also a Node).
*
- * A Node is a unit with input/output ports, a run() method, and some other
+ * A Node is a unit with input/output ports, a process() method, and some other
* things.
*
* This is a pure abstract base class for any Node, it contains no
@@ -48,10 +48,10 @@ namespace Shared {
*
* \ingroup engine
*/
-class Node : public OmObject
+class Node : public GraphObject
{
public:
- Node(OmObject* parent, const string& name) : OmObject(parent, name) {}
+ Node(GraphObject* parent, const string& name) : GraphObject(parent, name) {}
virtual ~Node() {}
/** Activate this Node.
@@ -64,8 +64,6 @@ public:
virtual void deactivate() = 0;
virtual bool activated() = 0;
- virtual void run(size_t nframes) = 0;
-
virtual void set_port_buffer(size_t voice, size_t port_num, void* buf) = 0;
// FIXME: Only used by client senders. Remove?
diff --git a/src/libs/engine/NodeBase.cpp b/src/libs/engine/NodeBase.cpp
index a5f23e84..790c9e93 100644
--- a/src/libs/engine/NodeBase.cpp
+++ b/src/libs/engine/NodeBase.cpp
@@ -102,7 +102,7 @@ void
NodeBase::remove_from_store()
{
// Remove self
- TreeNode<OmObject*>* node = om->object_store()->remove(path());
+ TreeNode<GraphObject*>* node = om->object_store()->remove(path());
if (node != NULL) {
assert(om->object_store()->find(path()) == NULL);
delete node;
@@ -122,12 +122,12 @@ NodeBase::remove_from_store()
/** Runs the Node for the specified number of frames (block size)
*/
void
-NodeBase::run(size_t nframes)
+NodeBase::process(samplecount nframes)
{
assert(_activated);
// Mix down any ports with multiple inputs
for (size_t i=0; i < _ports->size(); ++i)
- _ports->at(i)->prepare_buffers(nframes);
+ _ports->at(i)->process(nframes);
}
@@ -142,7 +142,7 @@ NodeBase::set_path(const Path& new_path)
const Path old_path = path();
//cerr << "Renaming " << old_path << " -> " << new_path << endl;
- TreeNode<OmObject*>* treenode = NULL;
+ TreeNode<GraphObject*>* treenode = NULL;
// Reinsert ports
for (size_t i=0; i < num_ports(); ++i) {
@@ -157,7 +157,7 @@ NodeBase::set_path(const Path& new_path)
treenode = om->object_store()->remove(old_path);
assert(treenode != NULL);
assert(treenode->node() == this);
- OmObject::set_path(new_path);
+ GraphObject::set_path(new_path);
treenode->key(new_path);
om->object_store()->add(treenode);
diff --git a/src/libs/engine/NodeBase.h b/src/libs/engine/NodeBase.h
index 7dffc0c9..f2d5ab79 100644
--- a/src/libs/engine/NodeBase.h
+++ b/src/libs/engine/NodeBase.h
@@ -48,7 +48,7 @@ public:
virtual void deactivate();
bool activated() { return _activated; }
- virtual void run(size_t nframes);
+ virtual void process(samplecount nframes);
virtual void set_port_buffer(size_t voice, size_t port_num, void* buf) {}
diff --git a/src/libs/engine/OSCClient.cpp b/src/libs/engine/OSCClient.cpp
index ff7c379f..7b92476b 100644
--- a/src/libs/engine/OSCClient.cpp
+++ b/src/libs/engine/OSCClient.cpp
@@ -468,13 +468,13 @@ OSCClient::object_renamed(const string& old_path, const string& new_path)
}
-/** Sends all OmObjects known to the engine.
+/** Sends all GraphObjects known to the engine.
*/
/*
void
OSCClient::all_objects()
{
- for (Tree<OmObject*>::iterator i = om->object_store()->objects().begin();
+ for (Tree<GraphObject*>::iterator i = om->object_store()->objects().begin();
i != om->object_store()->objects().end(); ++i)
if ((*i)->as_node() != NULL && (*i)->parent() == NULL)
(*i)->as_node()->send_creation_messages(this);
diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp
index 354820f7..c382ea55 100644
--- a/src/libs/engine/ObjectSender.cpp
+++ b/src/libs/engine/ObjectSender.cpp
@@ -36,7 +36,7 @@ ObjectSender::send_all(ClientInterface* client)
Patch* root = om->object_store()->find_patch("/");
assert(root);
send_patch(client, root);
- /*for (Tree<OmObject*>::iterator i = om->object_store()->objects().begin();
+ /*for (Tree<GraphObject*>::iterator i = om->object_store()->objects().begin();
i != om->object_store()->objects().end(); ++i)
if ((*i)->as_patch() != NULL && (*i)->parent() == NULL)
send_patch(client, (*i)->as_patch());*/
diff --git a/src/libs/engine/ObjectSender.h b/src/libs/engine/ObjectSender.h
index f97f1f9e..06241080 100644
--- a/src/libs/engine/ObjectSender.h
+++ b/src/libs/engine/ObjectSender.h
@@ -28,7 +28,7 @@ class Node;
class Port;
-/** Utility class for sending OmObjects to clients through ClientInterface.
+/** Utility class for sending GraphObjects to clients through ClientInterface.
*
* While ClientInterface is the direct low level message-based interface
* (protocol), this is used from the engine to easily send proper Objects
diff --git a/src/libs/engine/ObjectStore.cpp b/src/libs/engine/ObjectStore.cpp
index b35737b0..5154e276 100644
--- a/src/libs/engine/ObjectStore.cpp
+++ b/src/libs/engine/ObjectStore.cpp
@@ -32,7 +32,7 @@ namespace Om {
Patch*
ObjectStore::find_patch(const Path& path)
{
- OmObject* const object = find(path);
+ GraphObject* const object = find(path);
return dynamic_cast<Patch*>(object);
}
@@ -42,7 +42,7 @@ ObjectStore::find_patch(const Path& path)
Node*
ObjectStore::find_node(const Path& path)
{
- OmObject* const object = find(path);
+ GraphObject* const object = find(path);
return dynamic_cast<Node*>(object);
}
@@ -52,14 +52,14 @@ ObjectStore::find_node(const Path& path)
Port*
ObjectStore::find_port(const Path& path)
{
- OmObject* const object = find(path);
+ GraphObject* const object = find(path);
return dynamic_cast<Port*>(object);
}
/** Find the Object at the given path.
*/
-OmObject*
+GraphObject*
ObjectStore::find(const Path& path)
{
return m_objects.find(path);
@@ -69,17 +69,17 @@ ObjectStore::find(const Path& path)
/** Add an object to the store. Not realtime safe.
*/
void
-ObjectStore::add(OmObject* o)
+ObjectStore::add(GraphObject* o)
{
//cerr << "[ObjectStore] Adding " << o->path() << endl;
- m_objects.insert(new TreeNode<OmObject*>(o->path(), o));
+ m_objects.insert(new TreeNode<GraphObject*>(o->path(), o));
}
/** Add an object to the store. Not realtime safe.
*/
void
-ObjectStore::add(TreeNode<OmObject*>* tn)
+ObjectStore::add(TreeNode<GraphObject*>* tn)
{
//cerr << "[ObjectStore] Adding " << tn->key() << endl;
m_objects.insert(tn);
@@ -92,10 +92,10 @@ ObjectStore::add(TreeNode<OmObject*>* tn)
*
* @returns TreeNode containing object removed on success, NULL if not found.
*/
-TreeNode<OmObject*>*
+TreeNode<GraphObject*>*
ObjectStore::remove(const string& path)
{
- TreeNode<OmObject*>* const removed = m_objects.remove(path);
+ TreeNode<GraphObject*>* const removed = m_objects.remove(path);
if (removed == NULL)
cerr << "[ObjectStore] WARNING: Removing " << path << " failed." << endl;
diff --git a/src/libs/engine/ObjectStore.h b/src/libs/engine/ObjectStore.h
index 8c71c002..e008887c 100644
--- a/src/libs/engine/ObjectStore.h
+++ b/src/libs/engine/ObjectStore.h
@@ -28,13 +28,13 @@ namespace Om {
class Patch;
class Node;
class Port;
-class OmObject;
+class GraphObject;
-/** Storage for all OmObjects (tree of OmObject's sorted by path).
+/** Storage for all GraphObjects (tree of GraphObject's sorted by path).
*
* All looking up in pre_process() methods (and anything else that isn't in-band
- * with the audio thread) should use this (to read and modify the OmObject
+ * with the audio thread) should use this (to read and modify the GraphObject
* tree).
*/
class ObjectStore
@@ -43,16 +43,16 @@ public:
Patch* find_patch(const Path& path);
Node* find_node(const Path& path);
Port* find_port(const Path& path);
- OmObject* find(const Path& path);
+ GraphObject* find(const Path& path);
- void add(OmObject* o);
- void add(TreeNode<OmObject*>* o);
- TreeNode<OmObject*>* remove(const string& key);
+ void add(GraphObject* o);
+ void add(TreeNode<GraphObject*>* o);
+ TreeNode<GraphObject*>* remove(const string& key);
- const Tree<OmObject*>& objects() { return m_objects; }
+ const Tree<GraphObject*>& objects() { return m_objects; }
private:
- Tree<OmObject*> m_objects;
+ Tree<GraphObject*> m_objects;
};
diff --git a/src/libs/engine/OmApp.cpp b/src/libs/engine/OmApp.cpp
index e3529127..eed6d90f 100644
--- a/src/libs/engine/OmApp.cpp
+++ b/src/libs/engine/OmApp.cpp
@@ -122,7 +122,7 @@ OmApp::~OmApp()
{
deactivate();
- for (Tree<OmObject*>::iterator i = m_object_store->objects().begin();
+ for (Tree<GraphObject*>::iterator i = m_object_store->objects().begin();
i != m_object_store->objects().end(); ++i) {
if ((*i)->parent() == NULL)
delete (*i);
@@ -214,7 +214,7 @@ OmApp::deactivate()
m_audio_driver->root_patch()->process(false);
m_audio_driver->root_patch()->deactivate();
- /*for (Tree<OmObject*>::iterator i = m_object_store->objects().begin();
+ /*for (Tree<GraphObject*>::iterator i = m_object_store->objects().begin();
i != m_object_store->objects().end(); ++i)
if ((*i)->as_node() != NULL && (*i)->as_node()->parent() == NULL)
(*i)->as_node()->deactivate();*/
diff --git a/src/libs/engine/OutputPort.h b/src/libs/engine/OutputPort.h
index 25a03325..23f91089 100644
--- a/src/libs/engine/OutputPort.h
+++ b/src/libs/engine/OutputPort.h
@@ -45,7 +45,7 @@ public:
OutputPort(Node* parent, const string& name, size_t index, size_t poly, DataType type, size_t buffer_size);
virtual ~OutputPort() {}
- void set_tied_port(InputPort<T>* port);
+ //void set_tied_port(InputPort<T>* port);
bool is_input() const { return false; }
bool is_output() const { return true; }
diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp
index 7d22c673..8a8ca60a 100644
--- a/src/libs/engine/Patch.cpp
+++ b/src/libs/engine/Patch.cpp
@@ -122,8 +122,8 @@ Patch::process(bool p)
*
* Calls all Nodes in the order _process_order specifies.
*/
-inline void
-Patch::run(size_t nframes)
+void
+Patch::process(samplecount nframes)
{
if (_process_order == NULL || !_process)
return;
@@ -132,20 +132,19 @@ Patch::run(size_t nframes)
// Prepare input ports for nodes to consume
for (List<Port*>::iterator i = _input_ports.begin(); i != _input_ports.end(); ++i)
- (*i)->prepare_buffers(nframes);
+ (*i)->process(nframes);
// Run all nodes (consume input ports)
for (size_t i=0; i < _process_order->size(); ++i) {
// Could be a gap due to a node removal event (see RemoveNodeEvent.cpp)
// Yes, this is ugly
if (_process_order->at(i) != NULL)
- _process_order->at(i)->run(nframes);
+ _process_order->at(i)->process(nframes);
}
// Prepare output ports (for caller to consume)
for (List<Port*>::iterator i = _output_ports.begin(); i != _output_ports.end(); ++i)
- if ((*i)->is_output())
- (*i)->prepare_buffers(nframes);
+ (*i)->process(nframes);
}
@@ -302,6 +301,8 @@ Patch::create_port(const string& name, DataType type, size_t buffer_size, bool i
return new DuplexPort<sample>(this, name, 0, _poly, type, buffer_size, is_output);
else if (type == DataType::MIDI)
return new DuplexPort<MidiMessage>(this, name, 0, _poly, type, buffer_size, is_output);
+ else
+ return NULL;
}
@@ -355,16 +356,15 @@ Patch::build_process_order() const
// Traverse backwards starting at outputs
for (List<Port*>::const_iterator p = _output_ports.begin(); p != _output_ports.end(); ++p) {
+
/*const Port* const port = (*p);
- if (port->port_info()->is_output()) {
- for (List<Connection*>::const_iterator c = port->connections().begin();
- c != port->connections().end(); ++c) {
- const Connection* const connection = (*c);
- assert(connection->dst_port() == port);
- assert(connection->src_port());
- assert(connection->src_port()->parent_node());
- build_process_order_recursive(connection->src_port()->parent_node(), process_order);
- }
+ for (List<Connection*>::const_iterator c = port->connections().begin();
+ c != port->connections().end(); ++c) {
+ const Connection* const connection = (*c);
+ assert(connection->dst_port() == port);
+ assert(connection->src_port());
+ assert(connection->src_port()->parent_node());
+ build_process_order_recursive(connection->src_port()->parent_node(), process_order);
}*/
}
diff --git a/src/libs/engine/Patch.h b/src/libs/engine/Patch.h
index f0e06368..0b40d705 100644
--- a/src/libs/engine/Patch.h
+++ b/src/libs/engine/Patch.h
@@ -54,7 +54,7 @@ public:
void activate();
void deactivate();
- void run(size_t nframes);
+ void process(samplecount nframes);
//void send_creation_messages(ClientInterface* client) const;
diff --git a/src/libs/engine/Port.cpp b/src/libs/engine/Port.cpp
index 63456873..a8706102 100644
--- a/src/libs/engine/Port.cpp
+++ b/src/libs/engine/Port.cpp
@@ -29,7 +29,7 @@ const char* const DataType::type_uris[3] = { "UNKNOWN", "FLOAT", "MIDI" };
Port::Port(Node* const node, const string& name, size_t index, size_t poly, DataType type, size_t buffer_size)
-: OmObject(node, name),
+: GraphObject(node, name),
_index(index),
_poly(poly),
_type(type),
@@ -51,7 +51,7 @@ void
Port::remove_from_store()
{
// Remove self
- TreeNode<OmObject*>* node = om->object_store()->remove(path());
+ TreeNode<GraphObject*>* node = om->object_store()->remove(path());
assert(node != NULL);
assert(om->object_store()->find(path()) == NULL);
delete node;
diff --git a/src/libs/engine/Port.h b/src/libs/engine/Port.h
index 37603fcb..4d8160b4 100644
--- a/src/libs/engine/Port.h
+++ b/src/libs/engine/Port.h
@@ -20,7 +20,7 @@
#include <cstdlib>
#include <string>
#include "types.h"
-#include "OmObject.h"
+#include "GraphObject.h"
#include "DataType.h"
using std::string;
@@ -38,7 +38,7 @@ class Node;
*
* \ingroup engine
*/
-class Port : public OmObject
+class Port : public GraphObject
{
public:
virtual ~Port() {}
@@ -50,7 +50,7 @@ public:
Node* parent_node() const { return (Node*)_parent; }
/** Called once per process cycle */
- virtual void prepare_buffers(size_t nframes) = 0;
+ virtual void process(samplecount nframes) = 0;
/** Empty buffer contents completely (ie silence) */
virtual void clear_buffers() = 0;
diff --git a/src/libs/engine/TransportNode.cpp b/src/libs/engine/TransportNode.cpp
index faa647a2..8a48b1a6 100644
--- a/src/libs/engine/TransportNode.cpp
+++ b/src/libs/engine/TransportNode.cpp
@@ -83,7 +83,7 @@ TransportNode::TransportNode(const string& path, size_t poly, Patch* parent, sam
void
TransportNode::run(size_t nframes)
{
- NodeBase::run(nframes);
+ NodeBase::process(nframes);
#if 0
// FIXME: this will die horribly with any driver other than jack (in theory)
diff --git a/src/libs/engine/TypedConnection.cpp b/src/libs/engine/TypedConnection.cpp
index ccfd36a1..94806f85 100644
--- a/src/libs/engine/TypedConnection.cpp
+++ b/src/libs/engine/TypedConnection.cpp
@@ -59,8 +59,11 @@ template TypedConnection<MidiMessage>::~TypedConnection();
template <typename sample>
void
-TypedConnection<sample>::prepare_buffers()
+TypedConnection<sample>::process(samplecount nframes)
{
+ // FIXME: nframes parameter not used
+ assert(nframes == m_buffer_size);
+
/* Thought: A poly output port can be connected to multiple mono input
* ports, which means this mix down would have to happen many times.
* Adding a method to OutputPort that mixes down all it's outputs into
@@ -81,13 +84,13 @@ TypedConnection<sample>::prepare_buffers()
m_local_buffer->scale(1.0f/(float)src_port()->poly(), 0, m_buffer_size-1);
}
}
-template void TypedConnection<sample>::prepare_buffers();
+template void TypedConnection<sample>::process(samplecount nframes);
// FIXME: MIDI mixing not implemented
template <>
void
-TypedConnection<MidiMessage>::prepare_buffers()
+TypedConnection<MidiMessage>::process(samplecount nframes)
{
}
diff --git a/src/libs/engine/TypedConnection.h b/src/libs/engine/TypedConnection.h
index 953c77e9..c75ece6e 100644
--- a/src/libs/engine/TypedConnection.h
+++ b/src/libs/engine/TypedConnection.h
@@ -39,7 +39,7 @@ public:
TypedConnection(OutputPort<T>* const src_port, InputPort<T>* const dst_port);
virtual ~TypedConnection();
- void prepare_buffers();
+ void process(samplecount nframes);
inline OutputPort<T>* src_port() const { return dynamic_cast<OutputPort<T>*>(m_src_port); }
inline InputPort<T>* dst_port() const { return dynamic_cast<InputPort<T>*>(m_dst_port); }
diff --git a/src/libs/engine/TypedPort.cpp b/src/libs/engine/TypedPort.cpp
index 4fb1dfa7..a5d954c6 100644
--- a/src/libs/engine/TypedPort.cpp
+++ b/src/libs/engine/TypedPort.cpp
@@ -97,22 +97,22 @@ TypedPort<T>::allocate_buffers()
template void TypedPort<sample>::allocate_buffers();
template void TypedPort<MidiMessage>::allocate_buffers();
-
+
+/*
template<>
void
-TypedPort<sample>::prepare_buffers(size_t nframes)
+TypedPort<sample>::process(samplecount nframes)
{
for (size_t i=0; i < _poly; ++i)
m_buffers.at(i)->prepare(nframes);
}
-
template<>
void
-TypedPort<MidiMessage>::prepare_buffers(size_t nframes)
+TypedPort<MidiMessage>::process(samplecount nframes)
{
}
-
+*/
template<typename T>
void
diff --git a/src/libs/engine/TypedPort.h b/src/libs/engine/TypedPort.h
index 332741a6..1fd51fb0 100644
--- a/src/libs/engine/TypedPort.h
+++ b/src/libs/engine/TypedPort.h
@@ -49,7 +49,7 @@ public:
Buffer<T>* buffer(size_t voice) const { return m_buffers.at(voice); }
- virtual void prepare_buffers(size_t nframes);
+ virtual void process(samplecount nframes) {}
virtual void clear_buffers();
//TypedPort* tied_port() const { return m_tied_port; }
diff --git a/src/libs/engine/events/DestroyEvent.h b/src/libs/engine/events/DestroyEvent.h
index 8ad5deba..a0008ea6 100644
--- a/src/libs/engine/events/DestroyEvent.h
+++ b/src/libs/engine/events/DestroyEvent.h
@@ -29,7 +29,7 @@ template<typename T> class TreeNode;
namespace Om {
-class OmObject;
+class GraphObject;
class Patch;
class Node;
class Plugin;
@@ -56,7 +56,7 @@ private:
Path m_path;
Node* m_node;
ListNode<Node*>* m_patch_listnode;
- TreeNode<OmObject*>* m_store_treenode;
+ TreeNode<GraphObject*>* m_store_treenode;
Array<Node*>* m_process_order; // Patch's new process order
DisconnectNodeEvent* m_disconnect_event;
DisconnectPortEvent* m_parent_disconnect_event; // used for input/output nodes
diff --git a/src/libs/engine/events/RenameEvent.cpp b/src/libs/engine/events/RenameEvent.cpp
index f1b74c59..98125fa4 100644
--- a/src/libs/engine/events/RenameEvent.cpp
+++ b/src/libs/engine/events/RenameEvent.cpp
@@ -65,7 +65,7 @@ RenameEvent::pre_process()
return;
}
- OmObject* obj = om->object_store()->find(m_old_path);
+ GraphObject* obj = om->object_store()->find(m_old_path);
if (obj == NULL) {
m_error = OBJECT_NOT_FOUND;
diff --git a/src/libs/engine/events/RenameEvent.h b/src/libs/engine/events/RenameEvent.h
index c1c9fe91..2fd0840e 100644
--- a/src/libs/engine/events/RenameEvent.h
+++ b/src/libs/engine/events/RenameEvent.h
@@ -27,7 +27,7 @@ template<typename T> class ListNode;
namespace Om {
-class OmObject;
+class GraphObject;
class Patch;
class Node;
class Plugin;
@@ -35,7 +35,7 @@ class DisconnectNodeEvent;
class DisconnectPortEvent;
-/** An event to change the name of an OmObject.
+/** An event to change the name of an GraphObject.
*
* \ingroup engine
*/
@@ -56,7 +56,7 @@ private:
string m_name;
Path m_new_path;
Patch* m_parent_patch;
- TreeNode<OmObject*>* m_store_treenode;
+ TreeNode<GraphObject*>* m_store_treenode;
ErrorType m_error;
};
diff --git a/src/libs/engine/events/RequestMetadataEvent.cpp b/src/libs/engine/events/RequestMetadataEvent.cpp
index 10e1007c..79185b8a 100644
--- a/src/libs/engine/events/RequestMetadataEvent.cpp
+++ b/src/libs/engine/events/RequestMetadataEvent.cpp
@@ -19,7 +19,7 @@
#include "Responder.h"
#include "Om.h"
#include "OmApp.h"
-#include "OmObject.h"
+#include "GraphObject.h"
#include "ObjectStore.h"
#include "interface/ClientInterface.h"
#include "ClientBroadcaster.h"
diff --git a/src/libs/engine/events/RequestMetadataEvent.h b/src/libs/engine/events/RequestMetadataEvent.h
index e4243eb3..e8450210 100644
--- a/src/libs/engine/events/RequestMetadataEvent.h
+++ b/src/libs/engine/events/RequestMetadataEvent.h
@@ -24,7 +24,7 @@ using std::string;
namespace Om {
-class OmObject;
+class GraphObject;
namespace Shared {
class ClientInterface;
} using Shared::ClientInterface;
@@ -46,7 +46,7 @@ private:
string m_path;
string m_key;
string m_value;
- OmObject* m_object;
+ GraphObject* m_object;
CountedPtr<ClientInterface> m_client;
};
diff --git a/src/libs/engine/events/SetMetadataEvent.cpp b/src/libs/engine/events/SetMetadataEvent.cpp
index 614f7ca9..905c377c 100644
--- a/src/libs/engine/events/SetMetadataEvent.cpp
+++ b/src/libs/engine/events/SetMetadataEvent.cpp
@@ -20,7 +20,7 @@
#include "Om.h"
#include "OmApp.h"
#include "ClientBroadcaster.h"
-#include "OmObject.h"
+#include "GraphObject.h"
#include "ObjectStore.h"
using std::string;
diff --git a/src/libs/engine/events/SetMetadataEvent.h b/src/libs/engine/events/SetMetadataEvent.h
index ef471033..6e98158f 100644
--- a/src/libs/engine/events/SetMetadataEvent.h
+++ b/src/libs/engine/events/SetMetadataEvent.h
@@ -24,10 +24,10 @@ using std::string;
namespace Om {
-class OmObject;
+class GraphObject;
-/** An event to set a piece of metadata for an OmObject.
+/** An event to set a piece of metadata for an GraphObject.
*
* \ingroup engine
*/
@@ -44,7 +44,7 @@ private:
string m_path;
string m_key;
string m_value;
- OmObject* m_object;
+ GraphObject* m_object;
};
diff --git a/src/libs/engine/instantiations.cpp b/src/libs/engine/instantiations.cpp
index e2b0088d..34718406 100644
--- a/src/libs/engine/instantiations.cpp
+++ b/src/libs/engine/instantiations.cpp
@@ -24,7 +24,7 @@
#include "Tree.h"
#include "TreeImplementation.h"
-#include "OmObject.h"
+#include "GraphObject.h"
#include "Node.h"
@@ -32,18 +32,18 @@
template class Tree<Om::Node*>;
template class TreeNode<Om::Node*>;
-template Tree<Om::OmObject*>::Tree();
-template Tree<Om::OmObject*>::~Tree();
-template void Tree<Om::OmObject*>::insert(TreeNode<Om::OmObject*>* const n);
-template TreeNode<Om::OmObject*>* Tree<Om::OmObject*>::remove(const string& key);
-template Om::OmObject* Tree<Om::OmObject*>::find(const string& key) const;
-template TreeNode<Om::OmObject*>* Tree<Om::OmObject*>::find_treenode(const string& key) const;
+template Tree<Om::GraphObject*>::Tree();
+template Tree<Om::GraphObject*>::~Tree();
+template void Tree<Om::GraphObject*>::insert(TreeNode<Om::GraphObject*>* const n);
+template TreeNode<Om::GraphObject*>* Tree<Om::GraphObject*>::remove(const string& key);
+template Om::GraphObject* Tree<Om::GraphObject*>::find(const string& key) const;
+template TreeNode<Om::GraphObject*>* Tree<Om::GraphObject*>::find_treenode(const string& key) const;
-template Tree<Om::OmObject*>::iterator Tree<Om::OmObject*>::begin() const;
-template Tree<Om::OmObject*>::iterator Tree<Om::OmObject*>::end() const;
+template Tree<Om::GraphObject*>::iterator Tree<Om::GraphObject*>::begin() const;
+template Tree<Om::GraphObject*>::iterator Tree<Om::GraphObject*>::end() const;
-template Tree<Om::OmObject*>::iterator::~iterator();
-template Om::OmObject* Tree<Om::OmObject*>::iterator::operator*() const;
-template Tree<Om::OmObject*>::iterator& Tree<Om::OmObject*>::iterator::operator++();
-template bool Tree<Om::OmObject*>::iterator::operator!=(const iterator& iter) const;
+template Tree<Om::GraphObject*>::iterator::~iterator();
+template Om::GraphObject* Tree<Om::GraphObject*>::iterator::operator*() const;
+template Tree<Om::GraphObject*>::iterator& Tree<Om::GraphObject*>::iterator::operator++();
+template bool Tree<Om::GraphObject*>::iterator::operator!=(const iterator& iter) const;