From 2dbd0cd81dff72aea42344188d20f7d7f6d20e1a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 18 Jul 2006 05:46:24 +0000 Subject: Removed globals (Om.h) git-svn-id: http://svn.drobilla.net/lad/ingen@96 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/Patch.cpp | 61 ++++------------------------------------------- 1 file changed, 4 insertions(+), 57 deletions(-) (limited to 'src/libs/engine/Patch.cpp') diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp index 418bb79e..358bc778 100644 --- a/src/libs/engine/Patch.cpp +++ b/src/libs/engine/Patch.cpp @@ -21,24 +21,15 @@ #include "Patch.h" #include "Plugin.h" #include "Port.h" -#include "ClientBroadcaster.h" -#include "InternalNode.h" #include "Connection.h" -#include "Om.h" -#include "OmApp.h" -#include "TypedPort.h" -#include "ObjectStore.h" -#include "InputPort.h" -#include "OutputPort.h" #include "DuplexPort.h" -#include "interface/ClientInterface.h" using std::cerr; using std::cout; using std::endl; namespace Om { -Patch::Patch(const string& path, size_t poly, Patch* parent, samplerate srate, size_t buffer_size, size_t internal_poly) +Patch::Patch(const string& path, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size, size_t internal_poly) : NodeBase(new Plugin(Plugin::Patch, "Om:Patch"), path, poly, parent, srate, buffer_size), _internal_poly(internal_poly), _process_order(NULL), @@ -123,7 +114,7 @@ Patch::process(bool p) * Calls all Nodes in the order _process_order specifies. */ void -Patch::process(samplecount nframes) +Patch::process(SampleCount nframes) { if (_process_order == NULL || !_process) return; @@ -148,48 +139,6 @@ Patch::process(samplecount nframes) } -#if 0 -void -Patch::send_creation_messages(ClientInterface* client) const -{ - cerr << "FIXME: creation\n"; - - om->client_broadcaster()->send_patch_to(client, this); - - for (List::const_iterator j = _nodes.begin(); j != _nodes.end(); ++j) { - Node* node = (*j); - Port* port = node->as_port(); // NULL unless a bridge node - node->send_creation_messages(client); - - usleep(100); - - // If this is a bridge (input/output) node, send the patch control value as well - if (port != NULL && port->port_info()->is_control()) - om->client_broadcaster()->send_control_change_to(client, port->path(), - ((TypedPort*)port)->buffer(0)->value_at(0)); - } - - for (List::const_iterator j = _connections.begin(); j != _connections.end(); ++j) { - om->client_broadcaster()->send_connection_to(client, *j); - } - - // Send port information - /*for (size_t i=0; i < _ports.size(); ++i) { - Port* const port = _ports.at(i); - - // Send metadata - const map& data = port->metadata(); - for (map::const_iterator i = data.begin(); i != data.end(); ++i) - om->client_broadcaster()->send_metadata_update_to(client, port->path(), (*i).first, (*i).second); - - if (port->port_info()->is_control()) - om->client_broadcaster()->send_control_change_to(client, port->path(), - ((TypedPort*)port)->buffer(0)->value_at(0)); - }*/ -} -#endif - - void Patch::add_to_store() { @@ -209,10 +158,8 @@ Patch::remove_from_store() NodeBase::remove_from_store(); // Remove nodes - for (List::iterator j = _nodes.begin(); j != _nodes.end(); ++j) { + for (List::iterator j = _nodes.begin(); j != _nodes.end(); ++j) (*j)->remove_from_store(); - assert(om->object_store()->find((*j)->path()) == NULL); - } } @@ -298,7 +245,7 @@ Patch::create_port(const string& name, DataType type, size_t buffer_size, bool i // FIXME: is it possible to just "pass" the type directly as the template parameter somehow? if (type == DataType::FLOAT) - return new DuplexPort(this, name, 0, _poly, type, buffer_size, is_output); + return new DuplexPort(this, name, 0, _poly, type, buffer_size, is_output); else if (type == DataType::MIDI) return new DuplexPort(this, name, 0, _poly, type, buffer_size, is_output); else -- cgit v1.2.1