diff options
author | David Robillard <d@drobilla.net> | 2007-07-26 19:33:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-07-26 19:33:51 +0000 |
commit | 3f445b19aaf42ae9442a9a7e40f95b4502f06047 (patch) | |
tree | 4221e5038072da726e0f50222dbe8011a0b2c88c /src | |
parent | 057069ef9f2129e9f0d3bce9066d75c621282d17 (diff) | |
download | ingen-3f445b19aaf42ae9442a9a7e40f95b4502f06047.tar.gz ingen-3f445b19aaf42ae9442a9a7e40f95b4502f06047.tar.bz2 ingen-3f445b19aaf42ae9442a9a7e40f95b4502f06047.zip |
Trim the fat.
git-svn-id: http://svn.drobilla.net/lad/ingen@640 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/engine/Engine.cpp | 1 | ||||
-rw-r--r-- | src/libs/engine/GraphObject.cpp | 28 | ||||
-rw-r--r-- | src/libs/engine/GraphObject.hpp | 7 | ||||
-rw-r--r-- | src/libs/engine/NodeBase.cpp | 80 | ||||
-rw-r--r-- | src/libs/engine/NodeBase.hpp | 26 | ||||
-rw-r--r-- | src/libs/engine/Patch.cpp | 65 | ||||
-rw-r--r-- | src/libs/engine/Patch.hpp | 9 |
7 files changed, 9 insertions, 207 deletions
diff --git a/src/libs/engine/Engine.cpp b/src/libs/engine/Engine.cpp index cbc4d507..c7e2ed8d 100644 --- a/src/libs/engine/Engine.cpp +++ b/src/libs/engine/Engine.cpp @@ -212,7 +212,6 @@ Engine::activate() Patch* root_patch = new Patch("", 1, NULL, _audio_driver->sample_rate(), _audio_driver->buffer_size(), 1); root_patch->activate(); - //root_patch->add_to_store(_object_store); _object_store->add(root_patch); root_patch->process_order(root_patch->build_process_order()); root_patch->enable(); diff --git a/src/libs/engine/GraphObject.cpp b/src/libs/engine/GraphObject.cpp index 5f44ad2d..b18e9687 100644 --- a/src/libs/engine/GraphObject.cpp +++ b/src/libs/engine/GraphObject.cpp @@ -29,32 +29,4 @@ GraphObject::parent_patch() const } -// FIXME: these functions are stupid/ugly -#if 0 -void -GraphObject::add_to_store(ObjectStore* store) -{ - assert(!_store); - store->add(this); - _store = store; -} - - -void -GraphObject::remove_from_store() -{ - assert(_store); - - if (_store) { - TreeNode<GraphObject*>* node = _store->remove(path()); - if (node != NULL) { - assert(_store->find(path()) == NULL); - delete node; - } - } - - _store = NULL; -} -#endif - } // namespace Ingen diff --git a/src/libs/engine/GraphObject.hpp b/src/libs/engine/GraphObject.hpp index ad49bcc5..1a6f0d7e 100644 --- a/src/libs/engine/GraphObject.hpp +++ b/src/libs/engine/GraphObject.hpp @@ -85,13 +85,6 @@ public: const MetadataMap& metadata() const { return _metadata; } -#if 0 - /** Patch and Node override this to recursively add their children. */ - virtual void add_to_store(ObjectStore* store); - - /** Patch and Node override this to recursively remove their children. */ - virtual void remove_from_store(); -#endif /** The Patch this object is a child of. */ virtual Patch* parent_patch() const; diff --git a/src/libs/engine/NodeBase.cpp b/src/libs/engine/NodeBase.cpp index 24faee4b..7914eab3 100644 --- a/src/libs/engine/NodeBase.cpp +++ b/src/libs/engine/NodeBase.cpp @@ -78,40 +78,6 @@ NodeBase::deactivate() _activated = false; } -#if 0 -void -NodeBase::add_to_store(ObjectStore* store) -{ - assert(!_store); - - GraphObject::add_to_store(store); - - for (size_t i=0; i < num_ports(); ++i) - store->add(_ports->at(i)); - - _store = store; -} - - -void -NodeBase::remove_from_store() -{ - // Remove ports - for (size_t i=0; i < num_ports(); ++i) { - TreeNode<GraphObject*>* node = _store->remove(_ports->at(i)->path()); - if (node != NULL) { - assert(_store->find(_ports->at(i)->path()) == NULL); - delete node; - } - } - - // Remove self - GraphObject::remove_from_store(); - - assert(_store == NULL); -} -#endif - void NodeBase::set_buffer_size(size_t size) @@ -148,51 +114,5 @@ NodeBase::post_process(SampleCount nframes, FrameTime start, FrameTime end) } - -/** Rename this Node. - * - * This is responsible for updating the ObjectStore so the Node can be - * found at it's new path, as well as all it's children. - */ -void -NodeBase::set_path(const Path& new_path) -{ -#if 0 - const Path old_path = path(); - //cerr << "Renaming " << old_path << " -> " << new_path << endl; - - TreeNode<GraphObject*>* treenode = NULL; - - // Reinsert ports - for (size_t i=0; i < num_ports(); ++i) { - treenode = _store->remove(old_path +"/"+ _ports->at(i)->name()); - assert(treenode != NULL); - assert(treenode->node() == _ports->at(i)); - treenode->key(new_path +"/" + _ports->at(i)->name()); - _store->add(treenode); - } - - // Rename and reinsert self - treenode = _store->remove(old_path); - assert(treenode != NULL); - assert(treenode->node() == this); - GraphObject::set_path(new_path); - treenode->key(new_path); - _store->add(treenode); - - - assert(_store->find(new_path) == this); -#endif - GraphObject::set_path(new_path); - - // Rename children (ports) - for (size_t i=0; i < num_ports(); ++i) { - Port* const port = _ports->at(i); - const string name = port->path().name(); - port->set_path(new_path.base() + name); - } -} - - } // namespace Ingen diff --git a/src/libs/engine/NodeBase.hpp b/src/libs/engine/NodeBase.hpp index 4d20e4fb..7368dc9d 100644 --- a/src/libs/engine/NodeBase.hpp +++ b/src/libs/engine/NodeBase.hpp @@ -60,10 +60,6 @@ public: virtual void set_port_buffer(size_t voice, size_t port_num, Buffer* buf) {} virtual void set_buffer_size(size_t size); -#if 0 - void add_to_store(ObjectStore* store); - void remove_from_store(); -#endif SampleRate sample_rate() const { return _srate; } size_t buffer_size() const { return _buffer_size; } @@ -82,25 +78,21 @@ public: virtual const Plugin* plugin() const { return _plugin; } - virtual void set_path(const Path& new_path); - /** A node's parent is always a patch, so static cast should be safe */ Patch* parent_patch() const { return (Patch*)_parent; } protected: const Plugin* _plugin; - size_t _poly; - - SampleRate _srate; - size_t _buffer_size; - bool _activated; - - Raul::Array<Port*>* _ports; ///< Access in audio thread only - - bool _traversed; ///< Flag for process order algorithm - Raul::List<Node*>* _providers; ///< Nodes connected to this one's input ports - Raul::List<Node*>* _dependants; ///< Nodes this one's output ports are connected to + size_t _poly; + SampleRate _srate; + size_t _buffer_size; + bool _activated; + + bool _traversed; ///< Flag for process order algorithm + Raul::Array<Port*>* _ports; ///< Access in audio thread only + Raul::List<Node*>* _providers; ///< Nodes connected to this one's input ports + Raul::List<Node*>* _dependants; ///< Nodes this one's output ports are connected to }; diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp index fb1b970e..e791a074 100644 --- a/src/libs/engine/Patch.cpp +++ b/src/libs/engine/Patch.cpp @@ -148,30 +148,6 @@ Patch::set_buffer_size(size_t size) (*j)->set_buffer_size(size); } -#if 0 -void -Patch::add_to_store(ObjectStore* store) -{ - // Add self and ports - NodeBase::add_to_store(store); - - // Add nodes - for (Raul::List<Node*>::iterator j = _nodes.begin(); j != _nodes.end(); ++j) - (*j)->add_to_store(store); -} - - -void -Patch::remove_from_store() -{ - // Remove self and ports - NodeBase::remove_from_store(); - - // Remove nodes - for (Raul::List<Node*>::iterator j = _nodes.begin(); j != _nodes.end(); ++j) - (*j)->remove_from_store(); -} -#endif // Patch specific stuff @@ -222,28 +198,6 @@ Patch::remove_connection(const Port* src_port, const Port* dst_port) return connection; } -#if 0 -/** Remove a bridge_node. Realtime safe. - */ -Raul::ListNode<InternalNode*>* -Patch::remove_bridge_node(const InternalNode* node) -{ - bool found = false; - Raul::ListNode<InternalNode*>* bridge_node = NULL; - for (Raul::List<InternalNode*>::iterator i = _bridge_nodes.begin(); i != _bridge_nodes.end(); ++i) { - if ((*i) == node) { - bridge_node = _bridge_nodes.remove(i); - found = true; - } - } - - if ( ! found) - cerr << "WARNING: [Patch::remove_bridge_node] InternalNode not found !" << endl; - - return bridge_node; -} -#endif - size_t Patch::num_ports() const @@ -398,23 +352,4 @@ Patch::build_process_order() const } -/** Rename this Patch. - * - * This is responsible for updating the ObjectStore so the Patch can be - * found at it's new path, as well as all it's children. - */ -void -Patch::set_path(const Path& new_path) -{ - const Path old_path = path(); - - // Update nodes - for (Raul::List<Node*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) - (*i)->set_path(new_path.base() + (*i)->name()); - - // Update self - NodeBase::set_path(new_path); -} - - } // namespace Ingen diff --git a/src/libs/engine/Patch.hpp b/src/libs/engine/Patch.hpp index f016f95d..6671d204 100644 --- a/src/libs/engine/Patch.hpp +++ b/src/libs/engine/Patch.hpp @@ -32,10 +32,6 @@ template <typename T> class Array; namespace Ingen { class Connection; -class InternalNode; -namespace Shared { - class ClientInterface; -} using Shared::ClientInterface; /** A group of nodes in a graph, possibly polyphonic. @@ -58,11 +54,6 @@ public: void process(SampleCount nframes, FrameTime start, FrameTime end); void set_buffer_size(size_t size); -#if 0 - void add_to_store(ObjectStore* store); - void remove_from_store(); -#endif - void set_path(const Path& new_path); // Patch specific stuff not inherited from Node |