From e343345cf54172720f3494ccef87d62b2c688d0a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 9 Feb 2007 22:39:56 +0000 Subject: Moved Deletable (formerly MaidObject), List, and Array from Ingen to Raul. git-svn-id: http://svn.drobilla.net/lad/ingen@294 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/AddNodeEvent.cpp | 2 +- src/libs/engine/events/AddNodeEvent.h | 4 ++-- src/libs/engine/events/AddPortEvent.cpp | 12 ++++++------ src/libs/engine/events/AddPortEvent.h | 6 +++--- src/libs/engine/events/AllNotesOffEvent.cpp | 2 +- src/libs/engine/events/ClearPatchEvent.cpp | 8 ++++---- src/libs/engine/events/ClearPatchEvent.h | 2 +- src/libs/engine/events/ConnectionEvent.cpp | 8 ++++---- src/libs/engine/events/ConnectionEvent.h | 12 +++++++----- src/libs/engine/events/CreatePatchEvent.cpp | 2 +- src/libs/engine/events/CreatePatchEvent.h | 9 +++++---- src/libs/engine/events/DestroyEvent.h | 19 +++++++++++-------- src/libs/engine/events/DisconnectNodeEvent.cpp | 14 +++++++------- src/libs/engine/events/DisconnectNodeEvent.h | 7 ++++--- src/libs/engine/events/DisconnectPortEvent.cpp | 14 +++++++------- src/libs/engine/events/DisconnectPortEvent.h | 8 ++++---- src/libs/engine/events/DisconnectionEvent.cpp | 8 ++++---- src/libs/engine/events/DisconnectionEvent.h | 10 ++++++---- src/libs/engine/events/EnablePatchEvent.h | 4 ++-- src/libs/engine/events/RenameEvent.h | 5 +++-- 20 files changed, 83 insertions(+), 73 deletions(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/AddNodeEvent.cpp b/src/libs/engine/events/AddNodeEvent.cpp index 485bd1cd..146ca3b6 100644 --- a/src/libs/engine/events/AddNodeEvent.cpp +++ b/src/libs/engine/events/AddNodeEvent.cpp @@ -94,7 +94,7 @@ AddNodeEvent::pre_process() // This can be done here because the audio thread doesn't touch the // node tree - just the process order array - _patch->add_node(new ListNode(_node)); + _patch->add_node(new Raul::ListNode(_node)); _node->add_to_store(_engine.object_store()); // FIXME: not really necessary to build process order since it's not connected, diff --git a/src/libs/engine/events/AddNodeEvent.h b/src/libs/engine/events/AddNodeEvent.h index 8ac88b08..6b68f627 100644 --- a/src/libs/engine/events/AddNodeEvent.h +++ b/src/libs/engine/events/AddNodeEvent.h @@ -23,7 +23,7 @@ #include using std::string; -template class Array; +namespace Raul { template class Array; } template class TreeNode; namespace Ingen { @@ -71,7 +71,7 @@ private: bool _poly; Patch* _patch; Node* _node; - Array* _process_order; ///< Patch's new process order + Raul::Array* _process_order; ///< Patch's new process order bool _node_already_exists; }; diff --git a/src/libs/engine/events/AddPortEvent.cpp b/src/libs/engine/events/AddPortEvent.cpp index 74345df5..c775fe04 100644 --- a/src/libs/engine/events/AddPortEvent.cpp +++ b/src/libs/engine/events/AddPortEvent.cpp @@ -31,10 +31,10 @@ #include "Port.h" #include "AudioDriver.h" #include "MidiDriver.h" -#include "List.h" +#include #include "Driver.h" #include "DuplexPort.h" -#include "Array.h" +#include namespace Ingen { @@ -97,14 +97,14 @@ AddPortEvent::pre_process() if (_patch_port) { if (_is_output) - _patch->add_output(new ListNode(_patch_port)); + _patch->add_output(new Raul::ListNode(_patch_port)); else - _patch->add_input(new ListNode(_patch_port)); + _patch->add_input(new Raul::ListNode(_patch_port)); if (_patch->external_ports()) - _ports_array = new Array(old_num_ports + 1, *_patch->external_ports()); + _ports_array = new Raul::Array(old_num_ports + 1, *_patch->external_ports()); else - _ports_array = new Array(old_num_ports + 1, NULL); + _ports_array = new Raul::Array(old_num_ports + 1, NULL); _ports_array->at(_patch->num_ports()-1) = _patch_port; diff --git a/src/libs/engine/events/AddPortEvent.h b/src/libs/engine/events/AddPortEvent.h index 46c013ca..84302029 100644 --- a/src/libs/engine/events/AddPortEvent.h +++ b/src/libs/engine/events/AddPortEvent.h @@ -19,9 +19,9 @@ #define ADDPORTEVENT_H #include "QueuedEvent.h" -#include "raul/Path.h" +#include +#include #include "DataType.h" -#include "Array.h" #include using std::string; @@ -55,7 +55,7 @@ private: DataType _data_type; Patch* _patch; Port* _patch_port; - Array* _ports_array; ///< New (external) ports array for Patch + Raul::Array* _ports_array; ///< New (external) ports array for Patch DriverPort* _driver_port; ///< Driver (eg Jack) port if this is a toplevel port bool _succeeded; }; diff --git a/src/libs/engine/events/AllNotesOffEvent.cpp b/src/libs/engine/events/AllNotesOffEvent.cpp index 16e54fc5..6c87e52a 100644 --- a/src/libs/engine/events/AllNotesOffEvent.cpp +++ b/src/libs/engine/events/AllNotesOffEvent.cpp @@ -51,7 +51,7 @@ AllNotesOffEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) _patch = _engine.object_store()->find_patch(_patch_path); //if (_patch != NULL) - // for (List::iterator j = _patch->midi_in_nodes().begin(); j != _patch->midi_in_nodes().end(); ++j) + // for (Raul::List::iterator j = _patch->midi_in_nodes().begin(); j != _patch->midi_in_nodes().end(); ++j) // (*j)->all_notes_off(offset); } diff --git a/src/libs/engine/events/ClearPatchEvent.cpp b/src/libs/engine/events/ClearPatchEvent.cpp index d300e2ff..d776df8b 100644 --- a/src/libs/engine/events/ClearPatchEvent.cpp +++ b/src/libs/engine/events/ClearPatchEvent.cpp @@ -49,7 +49,7 @@ ClearPatchEvent::pre_process() _process = _patch->enabled(); - for (List::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) + for (Raul::List::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) (*i)->remove_from_store(); } @@ -66,7 +66,7 @@ ClearPatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) _patch->disable(); cerr << "FIXME: CLEAR PATCH\n"; - //for (List::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) + //for (Raul::List::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) // (*i)->remove_from_patch(); if (_patch->process_order() != NULL) { @@ -82,14 +82,14 @@ ClearPatchEvent::post_process() { if (_patch != NULL) { // Delete all nodes - for (List::iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) { + for (Raul::List::iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) { (*i)->deactivate(); delete *i; } _patch->nodes().clear(); // Delete all connections - for (List::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) + for (Raul::List::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) delete *i; _patch->connections().clear(); diff --git a/src/libs/engine/events/ClearPatchEvent.h b/src/libs/engine/events/ClearPatchEvent.h index e50f599e..c3570518 100644 --- a/src/libs/engine/events/ClearPatchEvent.h +++ b/src/libs/engine/events/ClearPatchEvent.h @@ -19,8 +19,8 @@ #define CLEARPATCHEVENT_H #include +#include #include "QueuedEvent.h" -#include "Array.h" using std::string; diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index fef7892b..c0dcc18c 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -214,14 +214,14 @@ TypedConnectionEvent::pre_process() } _connection = new TypedConnection(_src_port, _dst_port); - _port_listnode = new ListNode*>(_connection); - _patch_listnode = new ListNode(_connection); + _port_listnode = new Raul::ListNode*>(_connection); + _patch_listnode = new Raul::ListNode(_connection); // Need to be careful about patch port connections here and adding a node's // parent as a dependant/provider, or adding a patch as it's own provider... if (src_node != dst_node && src_node->parent() == dst_node->parent()) { - dst_node->providers()->push_back(new ListNode(src_node)); - src_node->dependants()->push_back(new ListNode(dst_node)); + dst_node->providers()->push_back(new Raul::ListNode(src_node)); + src_node->dependants()->push_back(new Raul::ListNode(dst_node)); } if (_patch->enabled()) diff --git a/src/libs/engine/events/ConnectionEvent.h b/src/libs/engine/events/ConnectionEvent.h index b0c81923..79ffeaa3 100644 --- a/src/libs/engine/events/ConnectionEvent.h +++ b/src/libs/engine/events/ConnectionEvent.h @@ -24,8 +24,10 @@ #include "types.h" using std::string; -template class ListNode; -template class Array; +namespace Raul { + template class ListNode; + template class Array; +} namespace Ingen { @@ -92,10 +94,10 @@ private: InputPort* _dst_port; Patch* _patch; - Array* _process_order; ///< New process order for Patch + Raul::Array* _process_order; ///< New process order for Patch TypedConnection* _connection; - ListNode* _patch_listnode; - ListNode*>* _port_listnode; + Raul::ListNode* _patch_listnode; + Raul::ListNode*>* _port_listnode; bool _succeeded; }; diff --git a/src/libs/engine/events/CreatePatchEvent.cpp b/src/libs/engine/events/CreatePatchEvent.cpp index 53837255..96d9c8e3 100644 --- a/src/libs/engine/events/CreatePatchEvent.cpp +++ b/src/libs/engine/events/CreatePatchEvent.cpp @@ -72,7 +72,7 @@ CreatePatchEvent::pre_process() _patch = new Patch(_path.name(), poly, _parent, _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), _poly); if (_parent != NULL) { - _parent->add_node(new ListNode(_patch)); + _parent->add_node(new Raul::ListNode(_patch)); if (_parent->enabled()) _process_order = _parent->build_process_order(); diff --git a/src/libs/engine/events/CreatePatchEvent.h b/src/libs/engine/events/CreatePatchEvent.h index 88eb780b..dd492a33 100644 --- a/src/libs/engine/events/CreatePatchEvent.h +++ b/src/libs/engine/events/CreatePatchEvent.h @@ -18,12 +18,13 @@ #ifndef CREATEPATCHEVENT_H #define CREATEPATCHEVENT_H -#include "raul/Path.h" -#include "QueuedEvent.h" #include +#include +#include "QueuedEvent.h" + using std::string; -template class Array; +namespace Raul { template class Array; } template class TreeNode; namespace Ingen { @@ -52,7 +53,7 @@ private: Path _path; Patch* _patch; Patch* _parent; - Array* _process_order; + Raul::Array* _process_order; TreeNode* _patch_treenode; int _poly; ErrorType _error; diff --git a/src/libs/engine/events/DestroyEvent.h b/src/libs/engine/events/DestroyEvent.h index 49c7b074..435736aa 100644 --- a/src/libs/engine/events/DestroyEvent.h +++ b/src/libs/engine/events/DestroyEvent.h @@ -18,14 +18,17 @@ #ifndef DESTROYEVENT_H #define DESTROYEVENT_H -#include "raul/Path.h" -#include "QueuedEvent.h" #include +#include +#include "QueuedEvent.h" + using std::string; -template class Array; -template class ListNode; +namespace Raul { + template class Array; + template class ListNode; +} template class TreeNode; namespace Ingen { @@ -61,11 +64,11 @@ private: Node* _node; ///< Same as _object if it is a Node, otherwise NULL Port* _port; ///< Same as _object if it is a Port, otherwise NULL DriverPort* _driver_port; - ListNode* _patch_node_listnode; - ListNode* _patch_port_listnode; + Raul::ListNode* _patch_node_listnode; + Raul::ListNode* _patch_port_listnode; TreeNode* _store_treenode; - Array* _ports_array; ///< New (external) ports array for Patch - Array* _process_order; ///< Patch's new process order + Raul::Array* _ports_array; ///< New (external) ports array for Patch + Raul::Array* _process_order; ///< Patch's new process order DisconnectNodeEvent* _disconnect_node_event; DisconnectPortEvent* _disconnect_port_event; }; diff --git a/src/libs/engine/events/DisconnectNodeEvent.cpp b/src/libs/engine/events/DisconnectNodeEvent.cpp index 6be22572..1dc5121f 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.cpp +++ b/src/libs/engine/events/DisconnectNodeEvent.cpp @@ -17,15 +17,15 @@ #include "DisconnectNodeEvent.h" #include +#include +#include #include "Responder.h" #include "Engine.h" #include "Maid.h" -#include "List.h" #include "Node.h" #include "TypedConnection.h" #include "DisconnectionEvent.h" #include "Port.h" -#include "Array.h" #include "InputPort.h" #include "OutputPort.h" #include "Patch.h" @@ -65,7 +65,7 @@ DisconnectNodeEvent::DisconnectNodeEvent(Engine& engine, Node* node) DisconnectNodeEvent::~DisconnectNodeEvent() { - for (List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) delete (*i); } @@ -73,7 +73,7 @@ DisconnectNodeEvent::~DisconnectNodeEvent() void DisconnectNodeEvent::pre_process() { - typedef List::const_iterator ConnectionListIterator; + typedef Raul::List::const_iterator ConnectionListIterator; // cerr << "Preparing disconnection event...\n"; @@ -102,7 +102,7 @@ DisconnectNodeEvent::pre_process() DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr(new Responder()), _time, c->src_port(), c->dst_port()); ev->pre_process(); - _disconnection_events.push_back(new ListNode(ev)); + _disconnection_events.push_back(new Raul::ListNode(ev)); c->pending_disconnection(true); } } @@ -118,7 +118,7 @@ DisconnectNodeEvent::execute(SampleCount nframes, FrameTime start, FrameTime end QueuedEvent::execute(nframes, start, end); if (_succeeded) { - for (List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->execute(nframes, start, end); } } @@ -130,7 +130,7 @@ DisconnectNodeEvent::post_process() if (_succeeded) { if (_responder) _responder->respond_ok(); - for (List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->post_process(); } else { if (_responder) diff --git a/src/libs/engine/events/DisconnectNodeEvent.h b/src/libs/engine/events/DisconnectNodeEvent.h index 7a028aca..bf4644ad 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.h +++ b/src/libs/engine/events/DisconnectNodeEvent.h @@ -19,9 +19,10 @@ #define DISCONNECTNODEEVENT_H #include -#include "raul/Path.h" +#include +#include #include "QueuedEvent.h" -#include "List.h" + using std::string; namespace Ingen { @@ -55,7 +56,7 @@ private: Path _node_path; Patch* _patch; Node* _node; - List _disconnection_events; + Raul::List _disconnection_events; bool _succeeded; bool _lookup; diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp index 9f4d7b74..76c95ef9 100644 --- a/src/libs/engine/events/DisconnectPortEvent.cpp +++ b/src/libs/engine/events/DisconnectPortEvent.cpp @@ -20,12 +20,12 @@ #include "Responder.h" #include "Engine.h" #include "Maid.h" -#include "List.h" +#include #include "Node.h" #include "Connection.h" #include "DisconnectionEvent.h" #include "Port.h" -#include "Array.h" +#include #include "InputPort.h" #include "OutputPort.h" #include "Patch.h" @@ -66,7 +66,7 @@ DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Port* port) DisconnectPortEvent::~DisconnectPortEvent() { - for (List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) delete (*i); } @@ -101,13 +101,13 @@ DisconnectPortEvent::pre_process() } Connection* c = NULL; - for (List::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { + for (Raul::List::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { c = (*i); if ((c->src_port() == _port || c->dst_port() == _port) && !c->pending_disconnection()) { DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr(new Responder()), _time, c->src_port(), c->dst_port()); ev->pre_process(); - _disconnection_events.push_back(new ListNode(ev)); + _disconnection_events.push_back(new Raul::ListNode(ev)); c->pending_disconnection(true); } } @@ -123,7 +123,7 @@ DisconnectPortEvent::execute(SampleCount nframes, FrameTime start, FrameTime end QueuedEvent::execute(nframes, start, end); if (_succeeded) { - for (List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->execute(nframes, start, end); } } @@ -135,7 +135,7 @@ DisconnectPortEvent::post_process() if (_succeeded) { if (_responder) _responder->respond_ok(); - for (List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->post_process(); } else { if (_responder) diff --git a/src/libs/engine/events/DisconnectPortEvent.h b/src/libs/engine/events/DisconnectPortEvent.h index e09688a1..f3058fa1 100644 --- a/src/libs/engine/events/DisconnectPortEvent.h +++ b/src/libs/engine/events/DisconnectPortEvent.h @@ -21,9 +21,9 @@ #include #include "raul/Path.h" #include "QueuedEvent.h" -#include "List.h" +#include -template class Array; +namespace Raul { template class Array; } namespace Ingen { @@ -56,9 +56,9 @@ private: Path _port_path; Patch* _patch; Port* _port; - List _disconnection_events; + Raul::List _disconnection_events; - Array* _process_order; // Patch's new process order + Raul::Array* _process_order; // Patch's new process order bool _succeeded; bool _lookup; diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp index 20c1b371..84ca49ff 100644 --- a/src/libs/engine/events/DisconnectionEvent.cpp +++ b/src/libs/engine/events/DisconnectionEvent.cpp @@ -214,13 +214,13 @@ TypedDisconnectionEvent::pre_process() return; } - for (List::iterator i = dst_node->providers()->begin(); i != dst_node->providers()->end(); ++i) + for (Raul::List::iterator i = dst_node->providers()->begin(); i != dst_node->providers()->end(); ++i) if ((*i) == src_node) { delete dst_node->providers()->remove(i); break; } - for (List::iterator i = src_node->dependants()->begin(); i != src_node->dependants()->end(); ++i) + for (Raul::List::iterator i = src_node->dependants()->begin(); i != src_node->dependants()->end(); ++i) if ((*i) == dst_node) { delete src_node->dependants()->remove(i); break; @@ -242,11 +242,11 @@ TypedDisconnectionEvent::execute(SampleCount nframes, FrameTime start, FrameT if (_succeeded) { - ListNode*>* const port_connection + Raul::ListNode*>* const port_connection = _dst_port->remove_connection(_src_port); if (port_connection != NULL) { - ListNode* const patch_connection + Raul::ListNode* const patch_connection = _patch->remove_connection(_src_port, _dst_port); assert(patch_connection); diff --git a/src/libs/engine/events/DisconnectionEvent.h b/src/libs/engine/events/DisconnectionEvent.h index e8802017..01a72e85 100644 --- a/src/libs/engine/events/DisconnectionEvent.h +++ b/src/libs/engine/events/DisconnectionEvent.h @@ -19,13 +19,15 @@ #define DISCONNECTIONEVENT_H #include -#include "raul/Path.h" +#include #include "QueuedEvent.h" #include "types.h" using std::string; -template class ListNode; -template class Array; +namespace Raul { + template class ListNode; + template class Array; +} namespace Ingen { @@ -94,7 +96,7 @@ private: InputPort* _dst_port; Patch* _patch; - Array* _process_order; ///< New process order for Patch + Raul::Array* _process_order; ///< New process order for Patch bool _succeeded; }; diff --git a/src/libs/engine/events/EnablePatchEvent.h b/src/libs/engine/events/EnablePatchEvent.h index 9d2a8db6..350c9f3e 100644 --- a/src/libs/engine/events/EnablePatchEvent.h +++ b/src/libs/engine/events/EnablePatchEvent.h @@ -23,7 +23,7 @@ using std::string; -template class Array; +namespace Raul { template class Array; } namespace Ingen { @@ -47,7 +47,7 @@ public: private: string _patch_path; Patch* _patch; - Array* _process_order; // Patch's new process order + Raul::Array* _process_order; // Patch's new process order }; diff --git a/src/libs/engine/events/RenameEvent.h b/src/libs/engine/events/RenameEvent.h index 56232640..9cba840d 100644 --- a/src/libs/engine/events/RenameEvent.h +++ b/src/libs/engine/events/RenameEvent.h @@ -18,9 +18,10 @@ #ifndef RENAMEEVENT_H #define RENAMEEVENT_H -#include "QueuedEvent.h" -#include "raul/Path.h" #include +#include "QueuedEvent.h" +#include + using std::string; template class TreeNode; -- cgit v1.2.1