summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-08 16:30:57 +0000
committerDavid Robillard <d@drobilla.net>2007-10-08 16:30:57 +0000
commit763bba9de67fb1bd06658a0bac91440727ee5a51 (patch)
tree39e7af069828981c2c06d78e015686062eba73dc /src/libs/engine/events
parent260a406b12997fdab7446a9980e921d8cfc46915 (diff)
downloadingen-763bba9de67fb1bd06658a0bac91440727ee5a51.tar.gz
ingen-763bba9de67fb1bd06658a0bac91440727ee5a51.tar.bz2
ingen-763bba9de67fb1bd06658a0bac91440727ee5a51.zip
SharedPtr-ify engine side store.
Fix reattaching to engine. Fix connection paths. Remove last dependencies on client (model) library from Serialiser. Fix Raul::PathTable::find_descendants_end. git-svn-id: http://svn.drobilla.net/lad/ingen@847 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/AllNotesOffEvent.cpp6
-rw-r--r--src/libs/engine/events/AllNotesOffEvent.hpp8
-rw-r--r--src/libs/engine/events/ClearPatchEvent.cpp4
-rw-r--r--src/libs/engine/events/ClearPatchEvent.hpp8
-rw-r--r--src/libs/engine/events/ConnectionEvent.cpp12
-rw-r--r--src/libs/engine/events/ConnectionEvent.hpp8
-rw-r--r--src/libs/engine/events/CreateNodeEvent.cpp6
-rw-r--r--src/libs/engine/events/CreateNodeEvent.hpp4
-rw-r--r--src/libs/engine/events/CreatePatchEvent.cpp8
-rw-r--r--src/libs/engine/events/CreatePatchEvent.hpp14
-rw-r--r--src/libs/engine/events/CreatePortEvent.cpp4
-rw-r--r--src/libs/engine/events/CreatePortEvent.hpp4
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp24
-rw-r--r--src/libs/engine/events/DestroyEvent.hpp26
-rw-r--r--src/libs/engine/events/DisconnectNodeEvent.cpp4
-rw-r--r--src/libs/engine/events/DisconnectNodeEvent.hpp4
-rw-r--r--src/libs/engine/events/DisconnectPortEvent.cpp6
-rw-r--r--src/libs/engine/events/DisconnectPortEvent.hpp6
-rw-r--r--src/libs/engine/events/DisconnectionEvent.cpp12
-rw-r--r--src/libs/engine/events/DisconnectionEvent.hpp4
-rw-r--r--src/libs/engine/events/EnablePatchEvent.cpp2
-rw-r--r--src/libs/engine/events/EnablePatchEvent.hpp4
-rw-r--r--src/libs/engine/events/RenameEvent.cpp10
-rw-r--r--src/libs/engine/events/RenameEvent.hpp4
-rw-r--r--src/libs/engine/events/RequestAllObjectsEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestObjectEvent.cpp4
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.cpp2
-rw-r--r--src/libs/engine/events/SetPolyphonyEvent.cpp4
-rw-r--r--src/libs/engine/events/SetPolyphonyEvent.hpp9
29 files changed, 107 insertions, 106 deletions
diff --git a/src/libs/engine/events/AllNotesOffEvent.cpp b/src/libs/engine/events/AllNotesOffEvent.cpp
index f3491dac..2e1f45fa 100644
--- a/src/libs/engine/events/AllNotesOffEvent.cpp
+++ b/src/libs/engine/events/AllNotesOffEvent.cpp
@@ -25,7 +25,7 @@ namespace Ingen {
/** Note off with patch explicitly passed - triggered by MIDI.
*/
-AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Patch* patch)
+AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, PatchImpl* patch)
: Event(engine, responder, timestamp),
_patch(patch)
{
@@ -36,8 +36,8 @@ AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responde
*/
AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path)
: Event(engine, responder, timestamp),
- _patch(NULL),
- _patch_path(patch_path)
+ _patch_path(patch_path),
+ _patch(NULL)
{
}
diff --git a/src/libs/engine/events/AllNotesOffEvent.hpp b/src/libs/engine/events/AllNotesOffEvent.hpp
index 4c2a9309..3e4d56b3 100644
--- a/src/libs/engine/events/AllNotesOffEvent.hpp
+++ b/src/libs/engine/events/AllNotesOffEvent.hpp
@@ -24,7 +24,7 @@ using std::string;
namespace Ingen {
-class Patch;
+class PatchImpl;
/** A note off event for all active voices.
@@ -34,15 +34,15 @@ class Patch;
class AllNotesOffEvent : public Event
{
public:
- AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Patch* patch);
+ AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, PatchImpl* patch);
AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path);
void execute(ProcessContext& context);
void post_process();
private:
- Patch* _patch;
- string _patch_path;
+ const string _patch_path;
+ PatchImpl* _patch;
};
diff --git a/src/libs/engine/events/ClearPatchEvent.cpp b/src/libs/engine/events/ClearPatchEvent.cpp
index 0d76724a..211ca79e 100644
--- a/src/libs/engine/events/ClearPatchEvent.cpp
+++ b/src/libs/engine/events/ClearPatchEvent.cpp
@@ -19,7 +19,7 @@
#include "ClearPatchEvent.hpp"
#include "Responder.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "util.hpp"
#include "ObjectStore.hpp"
@@ -92,7 +92,7 @@ ClearPatchEvent::post_process()
_patch->nodes().clear();
// Delete all connections
- for (Patch::Connections::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i)
+ for (PatchImpl::Connections::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i)
(*i).reset();
_patch->connections().clear();
diff --git a/src/libs/engine/events/ClearPatchEvent.hpp b/src/libs/engine/events/ClearPatchEvent.hpp
index b1174c04..afe66eed 100644
--- a/src/libs/engine/events/ClearPatchEvent.hpp
+++ b/src/libs/engine/events/ClearPatchEvent.hpp
@@ -26,7 +26,7 @@ using std::string;
namespace Ingen {
-class Patch;
+class PatchImpl;
/** Delete all nodes from a patch.
@@ -43,9 +43,9 @@ public:
void post_process();
private:
- string _patch_path;
- Patch* _patch;
- bool _process;
+ const string _patch_path;
+ PatchImpl* _patch;
+ bool _process;
};
diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp
index 3a954781..ee2c1694 100644
--- a/src/libs/engine/events/ConnectionEvent.cpp
+++ b/src/libs/engine/events/ConnectionEvent.cpp
@@ -25,7 +25,7 @@
#include "ConnectionImpl.hpp"
#include "InputPort.hpp"
#include "OutputPort.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "PortImpl.hpp"
#include "ObjectStore.hpp"
@@ -98,13 +98,13 @@ ConnectionEvent::pre_process()
assert(src_node->parent() == dst_node || dst_node->parent() == src_node);
if (src_node->parent() == dst_node)
- _patch = dynamic_cast<Patch*>(dst_node);
+ _patch = dynamic_cast<PatchImpl*>(dst_node);
else
- _patch = dynamic_cast<Patch*>(src_node);
+ _patch = dynamic_cast<PatchImpl*>(src_node);
// Connection from a patch input to a patch output (pass through)
- } else if (src_node == dst_node && dynamic_cast<Patch*>(src_node)) {
- _patch = dynamic_cast<Patch*>(src_node);
+ } else if (src_node == dst_node && dynamic_cast<PatchImpl*>(src_node)) {
+ _patch = dynamic_cast<PatchImpl*>(src_node);
// Normal connection between nodes with the same parent
} else {
@@ -126,7 +126,7 @@ ConnectionEvent::pre_process()
}
_connection = SharedPtr<ConnectionImpl>(new ConnectionImpl(_src_port, _dst_port));
- _patch_listnode = new Patch::Connections::Node(_connection);
+ _patch_listnode = new PatchImpl::Connections::Node(_connection);
_port_listnode = new InputPort::Connections::Node(_connection);
// Need to be careful about patch port connections here and adding a node's
diff --git a/src/libs/engine/events/ConnectionEvent.hpp b/src/libs/engine/events/ConnectionEvent.hpp
index 1d46be6f..89407957 100644
--- a/src/libs/engine/events/ConnectionEvent.hpp
+++ b/src/libs/engine/events/ConnectionEvent.hpp
@@ -21,7 +21,7 @@
#include <string>
#include <raul/Path.hpp>
#include "QueuedEvent.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "InputPort.hpp"
#include "types.hpp"
using std::string;
@@ -33,7 +33,7 @@ namespace Raul {
namespace Ingen {
-class Patch;
+class PatchImpl;
class NodeImpl;
class ConnectionImpl;
class MidiMessage;
@@ -71,7 +71,7 @@ private:
Raul::Path _src_port_path;
Raul::Path _dst_port_path;
- Patch* _patch;
+ PatchImpl* _patch;
PortImpl* _src_port;
PortImpl* _dst_port;
OutputPort* _src_output_port;
@@ -80,7 +80,7 @@ private:
CompiledPatch* _compiled_patch; ///< New process order for Patch
SharedPtr<ConnectionImpl> _connection;
- Patch::Connections::Node* _patch_listnode;
+ PatchImpl::Connections::Node* _patch_listnode;
InputPort::Connections::Node* _port_listnode;
ErrorType _error;
diff --git a/src/libs/engine/events/CreateNodeEvent.cpp b/src/libs/engine/events/CreateNodeEvent.cpp
index a863e008..a0a8d08f 100644
--- a/src/libs/engine/events/CreateNodeEvent.cpp
+++ b/src/libs/engine/events/CreateNodeEvent.cpp
@@ -20,11 +20,11 @@
#include <raul/Path.hpp>
#include "CreateNodeEvent.hpp"
#include "Responder.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "NodeImpl.hpp"
#include "PluginImpl.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "NodeFactory.hpp"
#include "ClientBroadcaster.hpp"
#include "ObjectStore.hpp"
@@ -91,7 +91,7 @@ CreateNodeEvent::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 Patch::Nodes::Node(_node));
+ _patch->add_node(new PatchImpl::Nodes::Node(_node));
//_node->add_to_store(_engine.object_store());
_engine.object_store()->add(_node);
diff --git a/src/libs/engine/events/CreateNodeEvent.hpp b/src/libs/engine/events/CreateNodeEvent.hpp
index 75dfe3d7..6c3f2a94 100644
--- a/src/libs/engine/events/CreateNodeEvent.hpp
+++ b/src/libs/engine/events/CreateNodeEvent.hpp
@@ -28,7 +28,7 @@ template<typename T> class TreeNode;
namespace Ingen {
-class Patch;
+class PatchImpl;
class NodeImpl;
class CompiledPatch;
@@ -69,7 +69,7 @@ private:
string _plugin_lib;
string _plugin_label;
bool _poly;
- Patch* _patch;
+ PatchImpl* _patch;
NodeImpl* _node;
CompiledPatch* _compiled_patch; ///< Patch's new process order
bool _node_already_exists;
diff --git a/src/libs/engine/events/CreatePatchEvent.cpp b/src/libs/engine/events/CreatePatchEvent.cpp
index 3d08a44b..8642dc1d 100644
--- a/src/libs/engine/events/CreatePatchEvent.cpp
+++ b/src/libs/engine/events/CreatePatchEvent.cpp
@@ -19,7 +19,7 @@
#include <raul/Path.hpp>
#include "CreatePatchEvent.hpp"
#include "Responder.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "NodeImpl.hpp"
#include "PluginImpl.hpp"
#include "Engine.hpp"
@@ -65,13 +65,13 @@ CreatePatchEvent::pre_process()
}
uint32_t poly = 1;
- if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_parent->internal_poly()))
+ if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_parent->internal_polyphony()))
poly = _poly;
- _patch = new Patch(_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.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), _poly);
if (_parent != NULL) {
- _parent->add_node(new Patch::Nodes::Node(_patch));
+ _parent->add_node(new PatchImpl::Nodes::Node(_patch));
if (_parent->enabled())
_compiled_patch = _parent->compile();
diff --git a/src/libs/engine/events/CreatePatchEvent.hpp b/src/libs/engine/events/CreatePatchEvent.hpp
index 15b67ffb..bcbcf35b 100644
--- a/src/libs/engine/events/CreatePatchEvent.hpp
+++ b/src/libs/engine/events/CreatePatchEvent.hpp
@@ -29,7 +29,7 @@ template<typename T> class TreeNode;
namespace Ingen {
-class Patch;
+class PatchImpl;
class CompiledPatch;
@@ -49,12 +49,12 @@ public:
private:
enum ErrorType { NO_ERROR, OBJECT_EXISTS, PARENT_NOT_FOUND, INVALID_POLY };
- Raul::Path _path;
- Patch* _patch;
- Patch* _parent;
- CompiledPatch* _compiled_patch;
- int _poly;
- ErrorType _error;
+ Raul::Path _path;
+ PatchImpl* _patch;
+ PatchImpl* _parent;
+ CompiledPatch* _compiled_patch;
+ int _poly;
+ ErrorType _error;
};
diff --git a/src/libs/engine/events/CreatePortEvent.cpp b/src/libs/engine/events/CreatePortEvent.cpp
index cba4dd77..27dcf7bc 100644
--- a/src/libs/engine/events/CreatePortEvent.cpp
+++ b/src/libs/engine/events/CreatePortEvent.cpp
@@ -21,10 +21,10 @@
#include <raul/Maid.hpp>
#include "Responder.hpp"
#include "CreatePortEvent.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "PluginImpl.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "QueuedEventSource.hpp"
#include "ObjectStore.hpp"
#include "ClientBroadcaster.hpp"
diff --git a/src/libs/engine/events/CreatePortEvent.hpp b/src/libs/engine/events/CreatePortEvent.hpp
index d7835a25..5ddd8aa3 100644
--- a/src/libs/engine/events/CreatePortEvent.hpp
+++ b/src/libs/engine/events/CreatePortEvent.hpp
@@ -29,7 +29,7 @@ template <typename T> class Array;
namespace Ingen {
-class Patch;
+class PatchImpl;
class PortImpl;
class DriverPort;
@@ -59,7 +59,7 @@ private:
string _type;
bool _is_output;
DataType _data_type;
- Patch* _patch;
+ PatchImpl* _patch;
PortImpl* _patch_port;
Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports array for Patch
DriverPort* _driver_port; ///< Driver (eg Jack) port if this is a toplevel port
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp
index 7fdda39f..cf250f2f 100644
--- a/src/libs/engine/events/DestroyEvent.cpp
+++ b/src/libs/engine/events/DestroyEvent.cpp
@@ -20,7 +20,7 @@
#include "DestroyEvent.hpp"
#include "Responder.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "NodeBase.hpp"
#include "PluginImpl.hpp"
#include "AudioDriver.hpp"
@@ -40,8 +40,6 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame
_path(path),
_store_iterator(engine.object_store()->objects().end()),
_removed_table(NULL),
- _node(NULL),
- _port(NULL),
_driver_port(NULL),
_patch_node_listnode(NULL),
_patch_port_listnode(NULL),
@@ -67,10 +65,10 @@ DestroyEvent::pre_process()
_store_iterator = _engine.object_store()->find(_path);
if (_store_iterator != _engine.object_store()->objects().end()) {
- _node = dynamic_cast<NodeImpl*>(_store_iterator->second);
+ _node = PtrCast<NodeImpl>(_store_iterator->second);
if (!_node)
- _port = dynamic_cast<PortImpl*>(_store_iterator->second);
+ _port = PtrCast<PortImpl>(_store_iterator->second);
}
if (_store_iterator != _engine.object_store()->objects().end()) {
@@ -81,9 +79,9 @@ DestroyEvent::pre_process()
assert(_node->parent_patch());
_patch_node_listnode = _node->parent_patch()->remove_node(_path.name());
if (_patch_node_listnode) {
- assert(_patch_node_listnode->elem() == _node);
+ assert(_patch_node_listnode->elem() == _node.get());
- _disconnect_node_event = new DisconnectNodeEvent(_engine, _node);
+ _disconnect_node_event = new DisconnectNodeEvent(_engine, _node.get());
_disconnect_node_event->pre_process();
if (_node->parent_patch()->enabled()) {
@@ -92,7 +90,7 @@ DestroyEvent::pre_process()
#ifndef NDEBUG
// Be sure node is removed from process order, so it can be destroyed
for (size_t i=0; i < _compiled_patch->size(); ++i) {
- assert(_compiled_patch->at(i).node() != _node);
+ assert(_compiled_patch->at(i).node() != _node.get());
// FIXME: check providers/dependants too
}
#endif
@@ -102,11 +100,11 @@ DestroyEvent::pre_process()
assert(_port->parent_patch());
_patch_port_listnode = _port->parent_patch()->remove_port(_path.name());
if (_patch_port_listnode) {
- assert(_patch_port_listnode->elem() == _port);
+ assert(_patch_port_listnode->elem() == _port.get());
//_port->remove_from_store();
- _disconnect_port_event = new DisconnectPortEvent(_engine, _port->parent_patch(), _port);
+ _disconnect_port_event = new DisconnectPortEvent(_engine, _port->parent_patch(), _port.get());
_disconnect_port_event->pre_process();
if (_port->parent_patch()->enabled()) {
@@ -187,7 +185,8 @@ DestroyEvent::post_process()
_disconnect_node_event->post_process();
_engine.broadcaster()->send_destroyed(_path);
_engine.maid()->push(_patch_node_listnode);
- _engine.maid()->push(_node);
+ //_engine.maid()->push(_node);
+ _node.reset();
} else if (_patch_port_listnode) {
assert(_port);
_responder->respond_ok();
@@ -195,7 +194,8 @@ DestroyEvent::post_process()
_disconnect_port_event->post_process();
_engine.broadcaster()->send_destroyed(_path);
_engine.maid()->push(_patch_port_listnode);
- _engine.maid()->push(_port);
+ //_engine.maid()->push(_port);
+ _port.reset();
} else {
_responder->respond_error("Unable to destroy object");
}
diff --git a/src/libs/engine/events/DestroyEvent.hpp b/src/libs/engine/events/DestroyEvent.hpp
index e253167f..10e59751 100644
--- a/src/libs/engine/events/DestroyEvent.hpp
+++ b/src/libs/engine/events/DestroyEvent.hpp
@@ -22,7 +22,7 @@
#include <raul/Path.hpp>
#include "QueuedEvent.hpp"
#include "ObjectStore.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
using std::string;
@@ -58,18 +58,18 @@ public:
void post_process();
private:
- Path _path;
- ObjectStore::Objects::iterator _store_iterator;
- Table<Path,GraphObjectImpl*> _removed_table;
- NodeImpl* _node; ///< Same as _object if it is a Node, otherwise NULL
- PortImpl* _port; ///< Same as _object if it is a Port, otherwise NULL
- DriverPort* _driver_port;
- Patch::Nodes::Node* _patch_node_listnode;
- Raul::List<PortImpl*>::Node* _patch_port_listnode;
- Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports array for Patch
- CompiledPatch* _compiled_patch; ///< Patch's new process order
- DisconnectNodeEvent* _disconnect_node_event;
- DisconnectPortEvent* _disconnect_port_event;
+ Path _path;
+ ObjectStore::Objects::iterator _store_iterator;
+ Table<Path, SharedPtr<Shared::GraphObject> > _removed_table;
+ SharedPtr<NodeImpl> _node; ///< Non-NULL iff a node
+ SharedPtr<PortImpl> _port; ///< Non-NULL iff a port
+ DriverPort* _driver_port;
+ PatchImpl::Nodes::Node* _patch_node_listnode;
+ Raul::List<PortImpl*>::Node* _patch_port_listnode;
+ Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Patch
+ CompiledPatch* _compiled_patch; ///< 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 f085e974..4fa92af0 100644
--- a/src/libs/engine/events/DisconnectNodeEvent.cpp
+++ b/src/libs/engine/events/DisconnectNodeEvent.cpp
@@ -28,7 +28,7 @@
#include "NodeImpl.hpp"
#include "ObjectStore.hpp"
#include "OutputPort.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "PortImpl.hpp"
#include "Responder.hpp"
#include "util.hpp"
@@ -88,7 +88,7 @@ DisconnectNodeEvent::pre_process()
}
}
- for (Patch::Connections::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) {
+ for (PatchImpl::Connections::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) {
ConnectionImpl* c = (ConnectionImpl*)i->get();
if ((c->src_port()->parent_node() == _node || c->dst_port()->parent_node() == _node) && !c->pending_disconnection()) {
DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr<Responder>(new Responder()), _time,
diff --git a/src/libs/engine/events/DisconnectNodeEvent.hpp b/src/libs/engine/events/DisconnectNodeEvent.hpp
index cefe5a25..6d38c768 100644
--- a/src/libs/engine/events/DisconnectNodeEvent.hpp
+++ b/src/libs/engine/events/DisconnectNodeEvent.hpp
@@ -28,7 +28,7 @@ using std::string;
namespace Ingen {
class DisconnectionEvent;
-class Patch;
+class PatchImpl;
class NodeImpl;
class Connection;
class PortImpl;
@@ -53,7 +53,7 @@ public:
private:
Raul::Path _node_path;
- Patch* _patch;
+ PatchImpl* _patch;
NodeImpl* _node;
Raul::List<DisconnectionEvent*> _disconnection_events;
diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp
index 9aaf5c45..617d86a2 100644
--- a/src/libs/engine/events/DisconnectPortEvent.cpp
+++ b/src/libs/engine/events/DisconnectPortEvent.cpp
@@ -28,7 +28,7 @@
#include "PortImpl.hpp"
#include "InputPort.hpp"
#include "OutputPort.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "util.hpp"
#include "ObjectStore.hpp"
@@ -51,7 +51,7 @@ DisconnectPortEvent::DisconnectPortEvent(Engine& engine, SharedPtr<Responder> re
}
-DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Patch* patch, Port* port)
+DisconnectPortEvent::DisconnectPortEvent(Engine& engine, PatchImpl* patch, Port* port)
: QueuedEvent(engine),
_port_path(port->path()),
_patch(patch),
@@ -103,7 +103,7 @@ DisconnectPortEvent::pre_process()
return;
}
- for (Patch::Connections::const_iterator i = _patch->connections().begin();
+ for (PatchImpl::Connections::const_iterator i = _patch->connections().begin();
i != _patch->connections().end(); ++i) {
ConnectionImpl* c = (ConnectionImpl*)i->get();
if ((c->src_port() == _port || c->dst_port() == _port) && !c->pending_disconnection()) {
diff --git a/src/libs/engine/events/DisconnectPortEvent.hpp b/src/libs/engine/events/DisconnectPortEvent.hpp
index b30151ed..de75ddf2 100644
--- a/src/libs/engine/events/DisconnectPortEvent.hpp
+++ b/src/libs/engine/events/DisconnectPortEvent.hpp
@@ -28,7 +28,7 @@ namespace Raul { template <typename T> class Array; }
namespace Ingen {
-class Patch;
+class PatchImpl;
class NodeImpl;
class Connection;
class PortImpl;
@@ -45,7 +45,7 @@ class DisconnectPortEvent : public QueuedEvent
{
public:
DisconnectPortEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& port_path);
- DisconnectPortEvent(Engine& engine, Patch* patch, Port* port);
+ DisconnectPortEvent(Engine& engine, PatchImpl* patch, Port* port);
~DisconnectPortEvent();
void pre_process();
@@ -54,7 +54,7 @@ public:
private:
Path _port_path;
- Patch* _patch;
+ PatchImpl* _patch;
Port* _port;
Raul::List<DisconnectionEvent*> _disconnection_events;
diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp
index 6e69c3ba..e85b4fcf 100644
--- a/src/libs/engine/events/DisconnectionEvent.cpp
+++ b/src/libs/engine/events/DisconnectionEvent.cpp
@@ -24,7 +24,7 @@
#include "ConnectionImpl.hpp"
#include "InputPort.hpp"
#include "OutputPort.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "PortImpl.hpp"
#include "ObjectStore.hpp"
@@ -111,13 +111,13 @@ DisconnectionEvent::pre_process()
assert(src_node->parent() == dst_node || dst_node->parent() == src_node);
if (src_node->parent() == dst_node)
- _patch = dynamic_cast<Patch*>(dst_node);
+ _patch = dynamic_cast<PatchImpl*>(dst_node);
else
- _patch = dynamic_cast<Patch*>(src_node);
+ _patch = dynamic_cast<PatchImpl*>(src_node);
// Connection from a patch input to a patch output (pass through)
- } else if (src_node == dst_node && dynamic_cast<Patch*>(src_node)) {
- _patch = dynamic_cast<Patch*>(src_node);
+ } else if (src_node == dst_node && dynamic_cast<PatchImpl*>(src_node)) {
+ _patch = dynamic_cast<PatchImpl*>(src_node);
// Normal connection between nodes with the same parent
} else {
@@ -161,7 +161,7 @@ DisconnectionEvent::execute(ProcessContext& context)
= _dst_input_port->remove_connection(_src_output_port);
if (port_connection != NULL) {
- Patch::Connections::Node* const patch_connection
+ PatchImpl::Connections::Node* const patch_connection
= _patch->remove_connection(_src_port, _dst_port);
assert(patch_connection);
diff --git a/src/libs/engine/events/DisconnectionEvent.hpp b/src/libs/engine/events/DisconnectionEvent.hpp
index 603eaf47..ea4dbbda 100644
--- a/src/libs/engine/events/DisconnectionEvent.hpp
+++ b/src/libs/engine/events/DisconnectionEvent.hpp
@@ -31,7 +31,7 @@ namespace Raul {
namespace Ingen {
-class Patch;
+class PatchImpl;
class NodeImpl;
class ConnectionImpl;
class MidiMessage;
@@ -70,7 +70,7 @@ private:
Raul::Path _src_port_path;
Raul::Path _dst_port_path;
- Patch* _patch;
+ PatchImpl* _patch;
PortImpl* _src_port;
PortImpl* _dst_port;
OutputPort* _src_output_port;
diff --git a/src/libs/engine/events/EnablePatchEvent.cpp b/src/libs/engine/events/EnablePatchEvent.cpp
index e380340f..b1cda98a 100644
--- a/src/libs/engine/events/EnablePatchEvent.cpp
+++ b/src/libs/engine/events/EnablePatchEvent.cpp
@@ -18,7 +18,7 @@
#include "EnablePatchEvent.hpp"
#include "Responder.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "util.hpp"
#include "ClientBroadcaster.hpp"
#include "ObjectStore.hpp"
diff --git a/src/libs/engine/events/EnablePatchEvent.hpp b/src/libs/engine/events/EnablePatchEvent.hpp
index fa36aae4..dad1803a 100644
--- a/src/libs/engine/events/EnablePatchEvent.hpp
+++ b/src/libs/engine/events/EnablePatchEvent.hpp
@@ -27,7 +27,7 @@ namespace Raul { template <typename T> class Array; }
namespace Ingen {
-class Patch;
+class PatchImpl;
class NodeImpl;
class CompiledPatch;
@@ -51,7 +51,7 @@ public:
private:
string _patch_path;
- Patch* _patch;
+ PatchImpl* _patch;
CompiledPatch* _compiled_patch; // Patch's new process order
bool _enable;
};
diff --git a/src/libs/engine/events/RenameEvent.cpp b/src/libs/engine/events/RenameEvent.cpp
index 72e27ec9..d0ef532a 100644
--- a/src/libs/engine/events/RenameEvent.cpp
+++ b/src/libs/engine/events/RenameEvent.cpp
@@ -20,7 +20,7 @@
#include "Engine.hpp"
#include "NodeImpl.hpp"
#include "ObjectStore.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "RenameEvent.hpp"
#include "Responder.hpp"
#include "AudioDriver.hpp"
@@ -77,10 +77,10 @@ RenameEvent::pre_process()
return;
}
- Table<Path,GraphObjectImpl*> removed = _engine.object_store()->remove(_store_iterator);
+ Table<Path, SharedPtr<Shared::GraphObject> > removed = _engine.object_store()->remove(_store_iterator);
assert(removed.size() > 0);
- for (Table<Path,GraphObjectImpl*>::iterator i = removed.begin(); i != removed.end(); ++i) {
+ for (Table<Path, SharedPtr<Shared::GraphObject> >::iterator i = removed.begin(); i != removed.end(); ++i) {
const Path& child_old_path = i->first;
assert(Path::descendant_comparator(_old_path, child_old_path));
@@ -90,7 +90,7 @@ RenameEvent::pre_process()
else
child_new_path = _new_path.base() + child_old_path.substr(_old_path.length()+1);
- i->second->set_path(child_new_path);
+ PtrCast<GraphObjectImpl>(i->second)->set_path(child_new_path);
i->first = child_new_path;
}
@@ -105,7 +105,7 @@ RenameEvent::execute(ProcessContext& context)
{
QueuedEvent::execute(context);
- PortImpl* port = dynamic_cast<PortImpl*>(_store_iterator->second);
+ SharedPtr<PortImpl> port = PtrCast<PortImpl>(_store_iterator->second);
if (port && port->parent()->parent() == NULL) {
DriverPort* driver_port = NULL;
diff --git a/src/libs/engine/events/RenameEvent.hpp b/src/libs/engine/events/RenameEvent.hpp
index 1a68173f..fae3a060 100644
--- a/src/libs/engine/events/RenameEvent.hpp
+++ b/src/libs/engine/events/RenameEvent.hpp
@@ -31,7 +31,7 @@ template<typename T> class ListNode;
namespace Ingen {
class GraphObjectImpl;
-class Patch;
+class PatchImpl;
class NodeImpl;
class Plugin;
class DisconnectNodeEvent;
@@ -58,7 +58,7 @@ private:
Path _old_path;
string _name;
Path _new_path;
- Patch* _parent_patch;
+ PatchImpl* _parent_patch;
ObjectStore::Objects::iterator _store_iterator;
ErrorType _error;
};
diff --git a/src/libs/engine/events/RequestAllObjectsEvent.cpp b/src/libs/engine/events/RequestAllObjectsEvent.cpp
index e4d0f083..7865cd9b 100644
--- a/src/libs/engine/events/RequestAllObjectsEvent.cpp
+++ b/src/libs/engine/events/RequestAllObjectsEvent.cpp
@@ -45,7 +45,7 @@ RequestAllObjectsEvent::post_process()
_responder->respond_ok();
// Everything is a child of the root patch, so this sends it all
- Patch* root = _engine.object_store()->find_patch("/");
+ PatchImpl* root = _engine.object_store()->find_patch("/");
if (root && _responder->client())
ObjectSender::send_patch(_responder->client(), root, true);
diff --git a/src/libs/engine/events/RequestObjectEvent.cpp b/src/libs/engine/events/RequestObjectEvent.cpp
index 13ad936e..34c04889 100644
--- a/src/libs/engine/events/RequestObjectEvent.cpp
+++ b/src/libs/engine/events/RequestObjectEvent.cpp
@@ -22,7 +22,7 @@
#include "Engine.hpp"
#include "ObjectStore.hpp"
#include "ClientBroadcaster.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "NodeImpl.hpp"
#include "PortImpl.hpp"
#include "ObjectSender.hpp"
@@ -65,7 +65,7 @@ RequestObjectEvent::post_process()
_responder->respond_error("Unable to find object requested.");
} else if (_responder->client()) {
- Patch* const patch = dynamic_cast<Patch*>(_object);
+ PatchImpl* const patch = dynamic_cast<PatchImpl*>(_object);
if (patch) {
_responder->respond_ok();
ObjectSender::send_patch(_responder->client(), patch, true);
diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp
index 51ab2dc8..ebaf9a22 100644
--- a/src/libs/engine/events/SetPolyphonicEvent.cpp
+++ b/src/libs/engine/events/SetPolyphonicEvent.cpp
@@ -19,7 +19,7 @@
#include "SetPolyphonicEvent.hpp"
#include "Responder.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "util.hpp"
#include "ObjectStore.hpp"
diff --git a/src/libs/engine/events/SetPolyphonyEvent.cpp b/src/libs/engine/events/SetPolyphonyEvent.cpp
index 56e95486..7efa7386 100644
--- a/src/libs/engine/events/SetPolyphonyEvent.cpp
+++ b/src/libs/engine/events/SetPolyphonyEvent.cpp
@@ -19,7 +19,7 @@
#include "SetPolyphonyEvent.hpp"
#include "Responder.hpp"
#include "Engine.hpp"
-#include "Patch.hpp"
+#include "PatchImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "util.hpp"
#include "ObjectStore.hpp"
@@ -44,7 +44,7 @@ void
SetPolyphonyEvent::pre_process()
{
_patch = _engine.object_store()->find_patch(_patch_path);
- if (_patch && _poly > _patch->internal_poly())
+ if (_patch && _poly > _patch->internal_polyphony())
_patch->prepare_internal_poly(_poly);
QueuedEvent::pre_process();
diff --git a/src/libs/engine/events/SetPolyphonyEvent.hpp b/src/libs/engine/events/SetPolyphonyEvent.hpp
index a2ac1862..8aba997a 100644
--- a/src/libs/engine/events/SetPolyphonyEvent.hpp
+++ b/src/libs/engine/events/SetPolyphonyEvent.hpp
@@ -26,7 +26,7 @@ using std::string;
namespace Ingen {
-class Patch;
+class PatchImpl;
/** Delete all nodes from a patch.
@@ -43,9 +43,10 @@ public:
void post_process();
private:
- string _patch_path;
- Patch* _patch;
- uint32_t _poly;
+ const string _patch_path;
+ PatchImpl* _patch;
+ const uint32_t _poly;
+
};