diff options
Diffstat (limited to 'src/libs/engine/events')
20 files changed, 83 insertions, 73 deletions
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*>(_node)); + _patch->add_node(new Raul::ListNode<Node*>(_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 <string> using std::string; -template <typename T> class Array; +namespace Raul { template <typename T> class Array; } template<typename T> class TreeNode; namespace Ingen { @@ -71,7 +71,7 @@ private: bool _poly; Patch* _patch; Node* _node; - Array<Node*>* _process_order; ///< Patch's new process order + Raul::Array<Node*>* _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 <raul/List.h> #include "Driver.h" #include "DuplexPort.h" -#include "Array.h" +#include <raul/Array.h> namespace Ingen { @@ -97,14 +97,14 @@ AddPortEvent::pre_process() if (_patch_port) { if (_is_output) - _patch->add_output(new ListNode<Port*>(_patch_port)); + _patch->add_output(new Raul::ListNode<Port*>(_patch_port)); else - _patch->add_input(new ListNode<Port*>(_patch_port)); + _patch->add_input(new Raul::ListNode<Port*>(_patch_port)); if (_patch->external_ports()) - _ports_array = new Array<Port*>(old_num_ports + 1, *_patch->external_ports()); + _ports_array = new Raul::Array<Port*>(old_num_ports + 1, *_patch->external_ports()); else - _ports_array = new Array<Port*>(old_num_ports + 1, NULL); + _ports_array = new Raul::Array<Port*>(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 <raul/Path.h> +#include <raul/Array.h> #include "DataType.h" -#include "Array.h" #include <string> using std::string; @@ -55,7 +55,7 @@ private: DataType _data_type; Patch* _patch; Port* _patch_port; - Array<Port*>* _ports_array; ///< New (external) ports array for Patch + Raul::Array<Port*>* _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<MidiInNode*>::iterator j = _patch->midi_in_nodes().begin(); j != _patch->midi_in_nodes().end(); ++j) + // for (Raul::List<MidiInNode*>::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<Node*>::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) + for (Raul::List<Node*>::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<Node*>::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) + //for (Raul::List<Node*>::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<Node*>::iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) { + for (Raul::List<Node*>::iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) { (*i)->deactivate(); delete *i; } _patch->nodes().clear(); // Delete all connections - for (List<Connection*>::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) + for (Raul::List<Connection*>::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 <string> +#include <raul/Array.h> #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<T>::pre_process() } _connection = new TypedConnection<T>(_src_port, _dst_port); - _port_listnode = new ListNode<TypedConnection<T>*>(_connection); - _patch_listnode = new ListNode<Connection*>(_connection); + _port_listnode = new Raul::ListNode<TypedConnection<T>*>(_connection); + _patch_listnode = new Raul::ListNode<Connection*>(_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<Node*>(src_node)); - src_node->dependants()->push_back(new ListNode<Node*>(dst_node)); + dst_node->providers()->push_back(new Raul::ListNode<Node*>(src_node)); + src_node->dependants()->push_back(new Raul::ListNode<Node*>(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 <typename T> class ListNode; -template <typename T> class Array; +namespace Raul { + template <typename T> class ListNode; + template <typename T> class Array; +} namespace Ingen { @@ -92,10 +94,10 @@ private: InputPort<T>* _dst_port; Patch* _patch; - Array<Node*>* _process_order; ///< New process order for Patch + Raul::Array<Node*>* _process_order; ///< New process order for Patch TypedConnection<T>* _connection; - ListNode<Connection*>* _patch_listnode; - ListNode<TypedConnection<T>*>* _port_listnode; + Raul::ListNode<Connection*>* _patch_listnode; + Raul::ListNode<TypedConnection<T>*>* _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<Node*>(_patch)); + _parent->add_node(new Raul::ListNode<Node*>(_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 <string> +#include <raul/Path.h> +#include "QueuedEvent.h" + using std::string; -template<typename T> class Array; +namespace Raul { template<typename T> class Array; } template<typename T> class TreeNode; namespace Ingen { @@ -52,7 +53,7 @@ private: Path _path; Patch* _patch; Patch* _parent; - Array<Node*>* _process_order; + Raul::Array<Node*>* _process_order; TreeNode<Node*>* _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 <string> +#include <raul/Path.h> +#include "QueuedEvent.h" + using std::string; -template<typename T> class Array; -template<typename T> class ListNode; +namespace Raul { + template<typename T> class Array; + template<typename T> class ListNode; +} template<typename T> 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<Node*>* _patch_node_listnode; - ListNode<Port*>* _patch_port_listnode; + Raul::ListNode<Node*>* _patch_node_listnode; + Raul::ListNode<Port*>* _patch_port_listnode; TreeNode<GraphObject*>* _store_treenode; - Array<Port*>* _ports_array; ///< New (external) ports array for Patch - Array<Node*>* _process_order; ///< Patch's new process order + Raul::Array<Port*>* _ports_array; ///< New (external) ports array for Patch + Raul::Array<Node*>* _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 <iostream> +#include <raul/List.h> +#include <raul/Array.h> #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<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) delete (*i); } @@ -73,7 +73,7 @@ DisconnectNodeEvent::~DisconnectNodeEvent() void DisconnectNodeEvent::pre_process() { - typedef List<Connection*>::const_iterator ConnectionListIterator; + typedef Raul::List<Connection*>::const_iterator ConnectionListIterator; // cerr << "Preparing disconnection event...\n"; @@ -102,7 +102,7 @@ DisconnectNodeEvent::pre_process() DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr<Responder>(new Responder()), _time, c->src_port(), c->dst_port()); ev->pre_process(); - _disconnection_events.push_back(new ListNode<DisconnectionEvent*>(ev)); + _disconnection_events.push_back(new Raul::ListNode<DisconnectionEvent*>(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<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List<DisconnectionEvent*>::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<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List<DisconnectionEvent*>::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 <string> -#include "raul/Path.h" +#include <raul/List.h> +#include <raul/Path.h> #include "QueuedEvent.h" -#include "List.h" + using std::string; namespace Ingen { @@ -55,7 +56,7 @@ private: Path _node_path; Patch* _patch; Node* _node; - List<DisconnectionEvent*> _disconnection_events; + Raul::List<DisconnectionEvent*> _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 <raul/List.h> #include "Node.h" #include "Connection.h" #include "DisconnectionEvent.h" #include "Port.h" -#include "Array.h" +#include <raul/Array.h> #include "InputPort.h" #include "OutputPort.h" #include "Patch.h" @@ -66,7 +66,7 @@ DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Port* port) DisconnectPortEvent::~DisconnectPortEvent() { - for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) delete (*i); } @@ -101,13 +101,13 @@ DisconnectPortEvent::pre_process() } Connection* c = NULL; - for (List<Connection*>::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { + for (Raul::List<Connection*>::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<Responder>(new Responder()), _time, c->src_port(), c->dst_port()); ev->pre_process(); - _disconnection_events.push_back(new ListNode<DisconnectionEvent*>(ev)); + _disconnection_events.push_back(new Raul::ListNode<DisconnectionEvent*>(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<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List<DisconnectionEvent*>::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<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) + for (Raul::List<DisconnectionEvent*>::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 <string> #include "raul/Path.h" #include "QueuedEvent.h" -#include "List.h" +#include <raul/List.h> -template <typename T> class Array; +namespace Raul { template <typename T> class Array; } namespace Ingen { @@ -56,9 +56,9 @@ private: Path _port_path; Patch* _patch; Port* _port; - List<DisconnectionEvent*> _disconnection_events; + Raul::List<DisconnectionEvent*> _disconnection_events; - Array<Node*>* _process_order; // Patch's new process order + Raul::Array<Node*>* _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<T>::pre_process() return; } - for (List<Node*>::iterator i = dst_node->providers()->begin(); i != dst_node->providers()->end(); ++i) + for (Raul::List<Node*>::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<Node*>::iterator i = src_node->dependants()->begin(); i != src_node->dependants()->end(); ++i) + for (Raul::List<Node*>::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<T>::execute(SampleCount nframes, FrameTime start, FrameT if (_succeeded) { - ListNode<TypedConnection<T>*>* const port_connection + Raul::ListNode<TypedConnection<T>*>* const port_connection = _dst_port->remove_connection(_src_port); if (port_connection != NULL) { - ListNode<Connection*>* const patch_connection + Raul::ListNode<Connection*>* 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 <string> -#include "raul/Path.h" +#include <raul/Path.h> #include "QueuedEvent.h" #include "types.h" using std::string; -template <typename T> class ListNode; -template <typename T> class Array; +namespace Raul { + template <typename T> class ListNode; + template <typename T> class Array; +} namespace Ingen { @@ -94,7 +96,7 @@ private: InputPort<T>* _dst_port; Patch* _patch; - Array<Node*>* _process_order; ///< New process order for Patch + Raul::Array<Node*>* _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 <typename T> class Array; +namespace Raul { template <typename T> class Array; } namespace Ingen { @@ -47,7 +47,7 @@ public: private: string _patch_path; Patch* _patch; - Array<Node*>* _process_order; // Patch's new process order + Raul::Array<Node*>* _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 <string> +#include "QueuedEvent.h" +#include <raul/Path.h> + using std::string; template<typename T> class TreeNode; |