diff options
106 files changed, 864 insertions, 861 deletions
diff --git a/ingen/GraphObject.hpp b/ingen/GraphObject.hpp index 25d6ea75..5ad3b156 100644 --- a/ingen/GraphObject.hpp +++ b/ingen/GraphObject.hpp @@ -33,7 +33,7 @@ class Edge; class Plugin; class Store; -/** An object on the audio graph - Patch, Node, Port, etc. +/** An object on the audio graph - Patch, Block, Port, etc. * * @ingroup Ingen */ @@ -42,7 +42,7 @@ class GraphObject : public Resource public: enum GraphType { PATCH, - NODE, + BLOCK, PORT }; @@ -53,7 +53,7 @@ public: Edges& edges() { return _edges; } const Edges& edges() const { return _edges; } - // Nodes and patches only + // Blocks and patches only virtual uint32_t num_ports() const { return 0; } virtual GraphObject* port(uint32_t index) const { return NULL; } virtual const Plugin* plugin() const { return NULL; } diff --git a/ingen/LV2Features.hpp b/ingen/LV2Features.hpp index b7b1395c..34c43a79 100644 --- a/ingen/LV2Features.hpp +++ b/ingen/LV2Features.hpp @@ -41,7 +41,7 @@ public: virtual ~Feature() {} virtual SharedPtr<LV2_Feature> feature(World* world, - GraphObject* node) = 0; + GraphObject* block) = 0; }; class FeatureArray : public Raul::Noncopyable { @@ -62,7 +62,7 @@ public: void add_feature(SharedPtr<Feature> feature); SharedPtr<FeatureArray> lv2_features(World* world, - GraphObject* node) const; + GraphObject* block) const; private: typedef std::vector< SharedPtr<Feature> > Features; diff --git a/ingen/Plugin.hpp b/ingen/Plugin.hpp index 6b0ac63a..17601385 100644 --- a/ingen/Plugin.hpp +++ b/ingen/Plugin.hpp @@ -25,7 +25,7 @@ namespace Ingen { -/** A plugin which instantiates to a Node. +/** A plugin which instantiates to a Block. * @ingroup Ingen */ class Plugin : public Resource diff --git a/ingen/Resource.hpp b/ingen/Resource.hpp index 028579fb..c9bbc2ab 100644 --- a/ingen/Resource.hpp +++ b/ingen/Resource.hpp @@ -159,7 +159,7 @@ public: static bool type(const URIs& uris, const Properties& properties, bool& patch, - bool& node, + bool& block, bool& port, bool& is_output); diff --git a/ingen/URIs.hpp b/ingen/URIs.hpp index 174e5e9e..25a26c95 100644 --- a/ingen/URIs.hpp +++ b/ingen/URIs.hpp @@ -70,22 +70,23 @@ public: const Quark atom_eventTransfer; const Quark atom_supports; const Quark doap_name; + const Quark ingen_Block; const Quark ingen_Edge; const Quark ingen_Internal; - const Quark ingen_Node; const Quark ingen_Patch; const Quark ingen_activity; + const Quark ingen_block; const Quark ingen_broadcast; const Quark ingen_canvasX; const Quark ingen_canvasY; const Quark ingen_controlBinding; const Quark ingen_document; + const Quark ingen_edge; const Quark ingen_enabled; const Quark ingen_engine; const Quark ingen_head; const Quark ingen_incidentTo; const Quark ingen_nil; - const Quark ingen_node; const Quark ingen_polyphonic; const Quark ingen_polyphony; const Quark ingen_prototype; @@ -103,13 +104,16 @@ public: const Quark lv2_InputPort; const Quark lv2_OutputPort; const Quark lv2_Plugin; + const Quark lv2_binary; const Quark lv2_connectionOptional; const Quark lv2_default; + const Quark lv2_extensionData; const Quark lv2_index; const Quark lv2_integer; const Quark lv2_maximum; const Quark lv2_minimum; const Quark lv2_name; + const Quark lv2_port; const Quark lv2_portProperty; const Quark lv2_sampleRate; const Quark lv2_scalePoint; diff --git a/ingen/client/NodeModel.hpp b/ingen/client/BlockModel.hpp index 9f2fab6e..dbb0faf3 100644 --- a/ingen/client/NodeModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_CLIENT_NODEMODEL_HPP -#define INGEN_CLIENT_NODEMODEL_HPP +#ifndef INGEN_CLIENT_BLOCKMODEL_HPP +#define INGEN_CLIENT_BLOCKMODEL_HPP #include <cstdlib> #include <string> @@ -38,15 +38,15 @@ namespace Client { class PluginModel; class ClientStore; -/** Node model class, used by the client to store engine's state. +/** Block model class, used by the client to store engine's state. * * @ingroup IngenClient */ -class NodeModel : public ObjectModel +class BlockModel : public ObjectModel { public: - NodeModel(const NodeModel& copy); - virtual ~NodeModel(); + BlockModel(const BlockModel& copy); + virtual ~BlockModel(); GraphType graph_type() const { return GraphObject::PATCH; } @@ -79,13 +79,13 @@ public: protected: friend class ClientStore; - NodeModel(URIs& uris, - const Raul::URI& plugin_uri, - const Raul::Path& path); - NodeModel(URIs& uris, - SharedPtr<PluginModel> plugin, - const Raul::Path& path); - explicit NodeModel(const Raul::Path& path); + BlockModel(URIs& uris, + const Raul::URI& plugin_uri, + const Raul::Path& path); + BlockModel(URIs& uris, + SharedPtr<PluginModel> plugin, + const Raul::Path& path); + explicit BlockModel(const Raul::Path& path); void add_child(SharedPtr<ObjectModel> c); bool remove_child(SharedPtr<ObjectModel> c); @@ -98,7 +98,7 @@ protected: Ports _ports; ///< Vector of ports Raul::URI _plugin_uri; ///< Plugin URI (if PluginModel is unknown) - SharedPtr<PluginModel> _plugin; ///< The plugin this node is an instance of + SharedPtr<PluginModel> _plugin; ///< The plugin this block is an instance of private: mutable uint32_t _num_values; ///< Size of _min_values and _max_values @@ -109,4 +109,4 @@ private: } // namespace Client } // namespace Ingen -#endif // INGEN_CLIENT_NODEMODEL_HPP +#endif // INGEN_CLIENT_BLOCKMODEL_HPP diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 42519158..6da7310e 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -37,7 +37,7 @@ class URIs; namespace Client { -class NodeModel; +class BlockModel; class ObjectModel; class PatchModel; class PluginModel; diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index 69ad3e22..b51e82e6 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -41,7 +41,7 @@ namespace Client { class ClientStore; -/** Base class for all GraphObject models (NodeModel, PatchModel, PortModel). +/** Base class for all GraphObject models (BlockModel, PatchModel, PortModel). * * There are no non-const public methods intentionally, models are not allowed * to be manipulated directly by anything (but the Store) because of the diff --git a/ingen/client/PatchModel.hpp b/ingen/client/PatchModel.hpp index d4c8f511..b4f56799 100644 --- a/ingen/client/PatchModel.hpp +++ b/ingen/client/PatchModel.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_CLIENT_PATCHMODEL_HPP #define INGEN_CLIENT_PATCHMODEL_HPP -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "raul/SharedPtr.hpp" namespace Ingen { @@ -30,7 +30,7 @@ class EdgeModel; * * @ingroup IngenClient */ -class PatchModel : public NodeModel +class PatchModel : public BlockModel { public: /* WARNING: Copy constructor creates a shallow copy WRT connections */ @@ -45,8 +45,8 @@ public: uint32_t internal_poly() const; // Signals - INGEN_SIGNAL(new_node, void, SharedPtr<NodeModel>); - INGEN_SIGNAL(removed_node, void, SharedPtr<NodeModel>); + INGEN_SIGNAL(new_block, void, SharedPtr<BlockModel>); + INGEN_SIGNAL(removed_block, void, SharedPtr<BlockModel>); INGEN_SIGNAL(new_edge, void, SharedPtr<EdgeModel>); INGEN_SIGNAL(removed_edge, void, SharedPtr<EdgeModel>); @@ -54,7 +54,7 @@ private: friend class ClientStore; PatchModel(URIs& uris, const Raul::Path& patch_path) - : NodeModel( + : BlockModel( uris, Raul::URI("http://drobilla.net/ns/ingen#Patch"), patch_path) { } diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index 13375c95..7475e57a 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -38,7 +38,7 @@ class URIs; namespace Client { class PatchModel; -class NodeModel; +class BlockModel; class PluginUI; /** Model for a plugin available for loading. @@ -57,7 +57,7 @@ public: virtual const Raul::Atom& get_property(const Raul::URI& key) const; - Raul::Symbol default_node_symbol() const; + Raul::Symbol default_block_symbol() const; std::string human_name() const; std::string port_human_name(uint32_t index) const; @@ -74,8 +74,8 @@ public: bool has_ui() const; - SharedPtr<PluginUI> ui(Ingen::World* world, - SharedPtr<const NodeModel> node) const; + SharedPtr<PluginUI> ui(Ingen::World* world, + SharedPtr<const BlockModel> block) const; const std::string& icon_path() const; static std::string get_lv2_icon_path(const LilvPlugin* plugin); diff --git a/ingen/client/PluginUI.hpp b/ingen/client/PluginUI.hpp index 1c45bd56..60403570 100644 --- a/ingen/client/PluginUI.hpp +++ b/ingen/client/PluginUI.hpp @@ -32,7 +32,7 @@ class World; namespace Client { -class NodeModel; +class BlockModel; /** Model for a plugin available for loading. * @@ -42,9 +42,9 @@ class PluginUI { public: ~PluginUI(); - static SharedPtr<PluginUI> create(Ingen::World* world, - SharedPtr<const NodeModel> node, - const LilvPlugin* plugin); + static SharedPtr<PluginUI> create(Ingen::World* world, + SharedPtr<const BlockModel> block, + const LilvPlugin* plugin); SuilWidget get_widget(); @@ -55,18 +55,18 @@ public: bool is_resizable() const; - Ingen::World* world() const { return _world; } - SharedPtr<const NodeModel> node() const { return _node; } + Ingen::World* world() const { return _world; } + SharedPtr<const BlockModel> block() const { return _block; } private: - PluginUI(Ingen::World* world, - SharedPtr<const NodeModel> node, - const LilvNode* ui_node); - - Ingen::World* _world; - SharedPtr<const NodeModel> _node; - SuilInstance* _instance; - LilvNode* _ui_node; + PluginUI(Ingen::World* world, + SharedPtr<const BlockModel> block, + const LilvNode* ui_node); + + Ingen::World* _world; + SharedPtr<const BlockModel> _block; + SuilInstance* _instance; + LilvNode* _ui_node; static SuilHost* ui_host; diff --git a/src/Resource.cpp b/src/Resource.cpp index 60e79642..a317ff67 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -111,14 +111,14 @@ bool Resource::type(const URIs& uris, const Properties& properties, bool& patch, - bool& node, + bool& block, bool& port, bool& is_output) { typedef Resource::Properties::const_iterator iterator; const std::pair<iterator, iterator> types_range = properties.equal_range(uris.rdf_type); - patch = node = port = is_output = false; + patch = block = port = is_output = false; for (iterator i = types_range.first; i != types_range.second; ++i) { const Raul::Atom& atom = i->second; if (atom.type() != uris.forge.URI && atom.type() != uris.forge.URID) { @@ -127,8 +127,8 @@ Resource::type(const URIs& uris, if (atom == uris.ingen_Patch) { patch = true; - } else if (atom == uris.ingen_Node) { - node = true; + } else if (atom == uris.ingen_Block) { + block = true; } else if (atom == uris.lv2_InputPort) { port = true; is_output = false; @@ -138,13 +138,13 @@ Resource::type(const URIs& uris, } } - if (patch && node && !port) { // => patch - node = false; + if (patch && block && !port) { // => patch + block = false; return true; - } else if (port && (patch || node)) { // nonsense + } else if (port && (patch || block)) { // nonsense port = false; return false; - } else if (patch || node || port) { // recognized type + } else if (patch || block || port) { // recognized type return true; } else { // unknown return false; diff --git a/src/URIs.cpp b/src/URIs.cpp index c5564aa7..227b6162 100644 --- a/src/URIs.cpp +++ b/src/URIs.cpp @@ -55,22 +55,23 @@ URIs::URIs(Forge& f, URIMap* map) , atom_eventTransfer (forge, map, LV2_ATOM__eventTransfer) , atom_supports (forge, map, LV2_ATOM__supports) , doap_name (forge, map, "http://usefulinc.com/ns/doap#name") + , ingen_Block (forge, map, NS_INGEN "Block") , ingen_Edge (forge, map, NS_INGEN "Edge") , ingen_Internal (forge, map, NS_INGEN "Internal") - , ingen_Node (forge, map, NS_INGEN "Node") , ingen_Patch (forge, map, NS_INGEN "Patch") , ingen_activity (forge, map, NS_INGEN "activity") + , ingen_block (forge, map, NS_INGEN "block") , ingen_broadcast (forge, map, NS_INGEN "broadcast") , ingen_canvasX (forge, map, NS_INGEN "canvasX") , ingen_canvasY (forge, map, NS_INGEN "canvasY") , ingen_controlBinding (forge, map, NS_INGEN "controlBinding") , ingen_document (forge, map, NS_INGEN "document") + , ingen_edge (forge, map, NS_INGEN "edge") , ingen_enabled (forge, map, NS_INGEN "enabled") , ingen_engine (forge, map, NS_INGEN "engine") , ingen_head (forge, map, NS_INGEN "head") , ingen_incidentTo (forge, map, NS_INGEN "incidentTo") , ingen_nil (forge, map, NS_INGEN "nil") - , ingen_node (forge, map, NS_INGEN "node") , ingen_polyphonic (forge, map, NS_INGEN "polyphonic") , ingen_polyphony (forge, map, NS_INGEN "polyphony") , ingen_prototype (forge, map, NS_INGEN "prototype") @@ -88,13 +89,16 @@ URIs::URIs(Forge& f, URIMap* map) , lv2_InputPort (forge, map, LV2_CORE__InputPort) , lv2_OutputPort (forge, map, LV2_CORE__OutputPort) , lv2_Plugin (forge, map, LV2_CORE__Plugin) + , lv2_binary (forge, map, LV2_CORE__binary) , lv2_connectionOptional(forge, map, LV2_CORE__connectionOptional) , lv2_default (forge, map, LV2_CORE__default) + , lv2_extensionData (forge, map, LV2_CORE__extensionData) , lv2_index (forge, map, LV2_CORE__index) , lv2_integer (forge, map, LV2_CORE__integer) , lv2_maximum (forge, map, LV2_CORE__maximum) , lv2_minimum (forge, map, LV2_CORE__minimum) , lv2_name (forge, map, LV2_CORE__name) + , lv2_port (forge, map, LV2_CORE__port) , lv2_portProperty (forge, map, LV2_CORE__portProperty) , lv2_sampleRate (forge, map, LV2_CORE__sampleRate) , lv2_scalePoint (forge, map, LV2_CORE__scalePoint) diff --git a/src/client/NodeModel.cpp b/src/client/BlockModel.cpp index 06a3320d..865f081c 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/BlockModel.cpp @@ -18,16 +18,16 @@ #include <cmath> #include <string> -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/URIs.hpp" #include "ingen/World.hpp" namespace Ingen { namespace Client { -NodeModel::NodeModel(URIs& uris, - SharedPtr<PluginModel> plugin, - const Raul::Path& path) +BlockModel::BlockModel(URIs& uris, + SharedPtr<PluginModel> plugin, + const Raul::Path& path) : ObjectModel(uris, path) , _plugin_uri(plugin->uri()) , _plugin(plugin) @@ -37,9 +37,9 @@ NodeModel::NodeModel(URIs& uris, { } -NodeModel::NodeModel(URIs& uris, - const Raul::URI& plugin_uri, - const Raul::Path& path) +BlockModel::BlockModel(URIs& uris, + const Raul::URI& plugin_uri, + const Raul::Path& path) : ObjectModel(uris, path) , _plugin_uri(plugin_uri) , _num_values(0) @@ -48,7 +48,7 @@ NodeModel::NodeModel(URIs& uris, { } -NodeModel::NodeModel(const NodeModel& copy) +BlockModel::BlockModel(const BlockModel& copy) : ObjectModel(copy) , _plugin_uri(copy._plugin_uri) , _num_values(copy._num_values) @@ -59,13 +59,13 @@ NodeModel::NodeModel(const NodeModel& copy) memcpy(_max_values, copy._max_values, sizeof(float) * _num_values); } -NodeModel::~NodeModel() +BlockModel::~BlockModel() { clear(); } void -NodeModel::remove_port(SharedPtr<PortModel> port) +BlockModel::remove_port(SharedPtr<PortModel> port) { for (Ports::iterator i = _ports.begin(); i != _ports.end(); ++i) { if ((*i) == port) { @@ -77,7 +77,7 @@ NodeModel::remove_port(SharedPtr<PortModel> port) } void -NodeModel::remove_port(const Raul::Path& port_path) +BlockModel::remove_port(const Raul::Path& port_path) { for (Ports::iterator i = _ports.begin(); i != _ports.end(); ++i) { if ((*i)->path() == port_path) { @@ -88,7 +88,7 @@ NodeModel::remove_port(const Raul::Path& port_path) } void -NodeModel::clear() +BlockModel::clear() { _ports.clear(); assert(_ports.empty()); @@ -99,7 +99,7 @@ NodeModel::clear() } void -NodeModel::add_child(SharedPtr<ObjectModel> c) +BlockModel::add_child(SharedPtr<ObjectModel> c) { assert(c->parent().get() == this); @@ -111,7 +111,7 @@ NodeModel::add_child(SharedPtr<ObjectModel> c) } bool -NodeModel::remove_child(SharedPtr<ObjectModel> c) +BlockModel::remove_child(SharedPtr<ObjectModel> c) { assert(c->path().is_child_of(path())); assert(c->parent().get() == this); @@ -127,7 +127,7 @@ NodeModel::remove_child(SharedPtr<ObjectModel> c) } void -NodeModel::add_port(SharedPtr<PortModel> pm) +BlockModel::add_port(SharedPtr<PortModel> pm) { assert(pm); assert(pm->path().is_child_of(path())); @@ -141,7 +141,7 @@ NodeModel::add_port(SharedPtr<PortModel> pm) } SharedPtr<const PortModel> -NodeModel::get_port(const Raul::Symbol& symbol) const +BlockModel::get_port(const Raul::Symbol& symbol) const { for (Ports::const_iterator i = _ports.begin(); i != _ports.end(); ++i) if ((*i)->symbol() == symbol) @@ -150,7 +150,7 @@ NodeModel::get_port(const Raul::Symbol& symbol) const } Ingen::GraphObject* -NodeModel::port(uint32_t index) const +BlockModel::port(uint32_t index) const { assert(index < num_ports()); return const_cast<Ingen::GraphObject*>( @@ -158,10 +158,10 @@ NodeModel::port(uint32_t index) const } void -NodeModel::default_port_value_range(SharedPtr<const PortModel> port, - float& min, - float& max, - uint32_t srate) const +BlockModel::default_port_value_range(SharedPtr<const PortModel> port, + float& min, + float& max, + uint32_t srate) const { // Default control values min = 0.0; @@ -174,7 +174,7 @@ NodeModel::default_port_value_range(SharedPtr<const PortModel> port, _min_values = new float[_num_values]; _max_values = new float[_num_values]; lilv_plugin_get_port_ranges_float(_plugin->lilv_plugin(), - _min_values, _max_values, 0); + _min_values, _max_values, 0); } if (!std::isnan(_min_values[port->index()])) @@ -190,8 +190,8 @@ NodeModel::default_port_value_range(SharedPtr<const PortModel> port, } void -NodeModel::port_value_range(SharedPtr<const PortModel> port, - float& min, float& max, uint32_t srate) const +BlockModel::port_value_range(SharedPtr<const PortModel> port, + float& min, float& max, uint32_t srate) const { assert(port->parent().get() == this); @@ -215,7 +215,7 @@ NodeModel::port_value_range(SharedPtr<const PortModel> port, } std::string -NodeModel::label() const +BlockModel::label() const { const Raul::Atom& name_property = get_property(_uris.lv2_name); if (name_property.type() == _uris.forge.String) { @@ -228,7 +228,7 @@ NodeModel::label() const } std::string -NodeModel::port_label(SharedPtr<const PortModel> port) const +BlockModel::port_label(SharedPtr<const PortModel> port) const { const Raul::Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); if (name.is_valid()) { @@ -255,12 +255,12 @@ NodeModel::port_label(SharedPtr<const PortModel> port) const } void -NodeModel::set(SharedPtr<ObjectModel> model) +BlockModel::set(SharedPtr<ObjectModel> model) { - SharedPtr<NodeModel> node = PtrCast<NodeModel>(model); - if (node) { - _plugin_uri = node->_plugin_uri; - _plugin = node->_plugin; + SharedPtr<BlockModel> block = PtrCast<BlockModel>(model); + if (block) { + _plugin_uri = block->_plugin_uri; + _plugin = block->_plugin; } ObjectModel::set(model); diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 7a6f69c1..07b44b84 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -17,7 +17,7 @@ #include "ingen/Log.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/EdgeModel.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/ObjectModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" @@ -223,9 +223,9 @@ ClientStore::put(const Raul::URI& uri, std::cerr << "}" << endl; #endif - bool is_patch, is_node, is_port, is_output; + bool is_patch, is_block, is_port, is_output; Resource::type(uris(), properties, - is_patch, is_node, is_port, is_output); + is_patch, is_block, is_port, is_output); // Check if uri is a plugin Iterator t = properties.find(_uris.rdf_type); @@ -265,7 +265,7 @@ ClientStore::put(const Raul::URI& uri, SharedPtr<PatchModel> model(new PatchModel(uris(), path)); model->set_properties(properties); add_object(model); - } else if (is_node) { + } else if (is_block) { const Iterator p = properties.find(_uris.ingen_prototype); SharedPtr<PluginModel> plug; if (p->second.is_valid() && p->second.type() == _uris.forge.URI) { @@ -280,11 +280,11 @@ ClientStore::put(const Raul::URI& uri, add_plugin(plug); } - SharedPtr<NodeModel> n(new NodeModel(uris(), plug, path)); - n->set_properties(properties); - add_object(n); + SharedPtr<BlockModel> bm(new BlockModel(uris(), plug, path)); + bm->set_properties(properties); + add_object(bm); } else { - _log.warn(Raul::fmt("Node %1% has no plugin\n") + _log.warn(Raul::fmt("Block %1% has no plugin\n") % path.c_str()); } } else if (is_port) { diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index 72c17009..9b622cda 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -18,7 +18,7 @@ #include "ingen/client/ClientStore.hpp" #include "ingen/client/EdgeModel.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/URIs.hpp" @@ -38,9 +38,10 @@ PatchModel::add_child(SharedPtr<ObjectModel> c) return; } - SharedPtr<NodeModel> nm = PtrCast<NodeModel>(c); - if (nm) - _signal_new_node.emit(nm); + SharedPtr<BlockModel> bm = PtrCast<BlockModel>(c); + if (bm) { + _signal_new_block.emit(bm); + } } bool @@ -72,9 +73,10 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) if (pm) remove_port(pm); - SharedPtr<NodeModel> nm = PtrCast<NodeModel>(o); - if (nm) - _signal_removed_node.emit(nm); + SharedPtr<BlockModel> bm = PtrCast<BlockModel>(o); + if (bm) { + _signal_removed_block.emit(bm); + } return true; } @@ -84,7 +86,7 @@ PatchModel::clear() { _edges.clear(); - NodeModel::clear(); + BlockModel::clear(); assert(_edges.empty()); assert(_ports.empty()); diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 0f422a89..53736a3e 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -153,7 +153,7 @@ PluginModel::set(SharedPtr<PluginModel> p) } Raul::Symbol -PluginModel::default_node_symbol() const +PluginModel::default_block_symbol() const { const Raul::Atom& name_atom = get_property(_uris.lv2_symbol); if (name_atom.is_valid() && name_atom.type() == _uris.forge.String) @@ -169,7 +169,7 @@ PluginModel::human_name() const if (name_atom.type() == _uris.forge.String) return name_atom.get_string(); else - return default_node_symbol().c_str(); + return default_block_symbol().c_str(); } string @@ -215,14 +215,14 @@ PluginModel::has_ui() const } SharedPtr<PluginUI> -PluginModel::ui(Ingen::World* world, - SharedPtr<const NodeModel> node) const +PluginModel::ui(Ingen::World* world, + SharedPtr<const BlockModel> block) const { if (!_lilv_plugin) { return SharedPtr<PluginUI>(); } - return PluginUI::create(world, node, _lilv_plugin); + return PluginUI::create(world, block, _lilv_plugin); } const string& diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 2a63296a..7a4c88e8 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -17,7 +17,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" #include "ingen/URIs.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginUI.hpp" #include "ingen/client/PortModel.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" @@ -39,11 +39,11 @@ lv2_ui_write(SuilController controller, { PluginUI* const ui = (PluginUI*)controller; - const NodeModel::Ports& ports = ui->node()->ports(); + const BlockModel::Ports& ports = ui->block()->ports(); if (port_index >= ports.size()) { ui->world()->log().error( Raul::fmt("%1% UI tried to write to invalid port %2%\n") - % ui->node()->plugin()->uri().c_str() % port_index); + % ui->block()->plugin()->uri().c_str() % port_index); return; } @@ -73,15 +73,15 @@ lv2_ui_write(SuilController controller, } else { ui->world()->log().warn( Raul::fmt("Unknown value format %1% from LV2 UI\n") - % format % ui->node()->plugin()->uri().c_str()); + % format % ui->block()->plugin()->uri().c_str()); } } -PluginUI::PluginUI(Ingen::World* world, - SharedPtr<const NodeModel> node, - const LilvNode* ui_node) +PluginUI::PluginUI(Ingen::World* world, + SharedPtr<const BlockModel> block, + const LilvNode* ui_node) : _world(world) - , _node(node) + , _block(block) , _instance(NULL) , _ui_node(lilv_node_duplicate(ui_node)) { @@ -94,9 +94,9 @@ PluginUI::~PluginUI() } SharedPtr<PluginUI> -PluginUI::create(Ingen::World* world, - SharedPtr<const NodeModel> node, - const LilvPlugin* plugin) +PluginUI::create(Ingen::World* world, + SharedPtr<const BlockModel> block, + const LilvPlugin* plugin) { if (!PluginUI::ui_host) { PluginUI::ui_host = suil_host_new(lv2_ui_write, NULL, NULL, NULL); @@ -126,9 +126,9 @@ PluginUI::create(Ingen::World* world, return SharedPtr<PluginUI>(); } - SharedPtr<PluginUI> ret(new PluginUI(world, node, lilv_ui_get_uri(ui))); + SharedPtr<PluginUI> ret(new PluginUI(world, block, lilv_ui_get_uri(ui))); ret->_features = world->lv2_features().lv2_features( - world, const_cast<NodeModel*>(node.get())); + world, const_cast<BlockModel*>(block.get())); SuilInstance* instance = suil_instance_new( PluginUI::ui_host, diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index c2493563..54db0ca1 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -14,7 +14,7 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PortModel.hpp" namespace Ingen { diff --git a/src/client/wscript b/src/client/wscript index b0b0620e..c85ee5ab 100644 --- a/src/client/wscript +++ b/src/client/wscript @@ -12,8 +12,8 @@ def build(bld): autowaf.use_lib(bld, obj, 'GLIBMM LV2 LILV SUIL RAUL SORD SIGCPP') obj.source = ''' + BlockModel.cpp ClientStore.cpp - NodeModel.cpp ObjectModel.cpp PatchModel.cpp PluginModel.cpp diff --git a/src/gui/App.cpp b/src/gui/App.cpp index cfba10c7..de35de54 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -112,7 +112,7 @@ App::create(Ingen::World* world) app->_about_dialog->property_logo_icon_name() = "ingen"; gtk_window_set_default_icon_name("ingen"); - // Set style for embedded node GUIs + // Set style for embedded block GUIs const string rc_style = "style \"ingen_embedded_node_gui_style\" {\n" "bg[NORMAL] = \"#212222\"\n" diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index 57c932af..7ba348a6 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -22,8 +22,8 @@ #include <glibmm/miscutils.h> #include "ingen/Interface.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/NodeModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/runtime_paths.hpp" diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 69a4f53c..f5f7a7d7 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -50,7 +50,7 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, { xml->get_widget("load_plugin_plugins_treeview", _plugins_treeview); xml->get_widget("load_plugin_polyphonic_checkbutton", _polyphonic_checkbutton); - xml->get_widget("load_plugin_name_entry", _node_name_entry); + xml->get_widget("load_plugin_name_entry", _name_entry); xml->get_widget("load_plugin_add_button", _add_button); xml->get_widget("load_plugin_close_button", _close_button); @@ -98,7 +98,7 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); _search_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::filter_changed)); - _node_name_entry->signal_changed().connect( + _name_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::name_changed)); #ifdef HAVE_NEW_GTKMM @@ -131,7 +131,7 @@ LoadPluginWindow::name_changed() { // Toggle add button sensitivity according name legality if (_selection->get_selected_rows().size() == 1) { - const string sym = _node_name_entry->get_text(); + const string sym = _name_entry->get_text(); if (!Raul::Symbol::is_valid(sym)) { _add_button->property_sensitive() = false; } else if (_app->store()->find(_patch->path().child(Raul::Symbol(sym))) @@ -282,8 +282,8 @@ LoadPluginWindow::plugin_selection_changed() size_t n_selected = _selection->get_selected_rows().size(); if (n_selected == 0) { _name_offset = 0; - _node_name_entry->set_text(""); - _node_name_entry->set_sensitive(false); + _name_entry->set_text(""); + _name_entry->set_sensitive(false); } else if (n_selected == 1) { Gtk::TreeModel::iterator iter = _plugins_liststore->get_iter( *_selection->get_selected_rows().begin()); @@ -292,17 +292,17 @@ LoadPluginWindow::plugin_selection_changed() boost::shared_ptr<const PluginModel> p = row.get_value( _plugins_columns._col_plugin); _name_offset = _app->store()->child_name_offset( - _patch->path(), p->default_node_symbol()); - _node_name_entry->set_text(generate_module_name(p, _name_offset)); - _node_name_entry->set_sensitive(true); + _patch->path(), p->default_block_symbol()); + _name_entry->set_text(generate_module_name(p, _name_offset)); + _name_entry->set_sensitive(true); } else { _name_offset = 0; - _node_name_entry->set_text(""); - _node_name_entry->set_sensitive(false); + _name_entry->set_text(""); + _name_entry->set_sensitive(false); } } else { - _node_name_entry->set_text(""); - _node_name_entry->set_sensitive(false); + _name_entry->set_text(""); + _name_entry->set_sensitive(false); } } @@ -317,7 +317,7 @@ LoadPluginWindow::generate_module_name(SharedPtr<const PluginModel> plugin, int offset) { std::stringstream ss; - ss << plugin->default_node_symbol(); + ss << plugin->default_block_symbol(); if (offset != 0) ss << "_" << offset; return ss.str(); @@ -330,14 +330,14 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) Gtk::TreeModel::Row row = *iter; SharedPtr<const PluginModel> plugin = row.get_value(_plugins_columns._col_plugin); bool polyphonic = _polyphonic_checkbutton->get_active(); - string name = _node_name_entry->get_text(); + string name = _name_entry->get_text(); if (name.empty()) name = generate_module_name(plugin, _name_offset); if (name.empty() || !Raul::Symbol::is_valid(name)) { Gtk::MessageDialog dialog(*this, - "Unable to chose a default name for this node. Please enter a name.", + "Unable to choose a default name, please provide one", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); dialog.run(); @@ -345,7 +345,7 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) Raul::Path path = _patch->path().child(Raul::Symbol::symbolify(name)); Resource::Properties props = _initial_data; props.insert(make_pair(uris.rdf_type, - uris.ingen_Node)); + uris.ingen_Block)); props.insert(make_pair(uris.ingen_prototype, _app->forge().alloc_uri(plugin->uri()))); props.insert(make_pair(uris.ingen_polyphonic, @@ -354,10 +354,10 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) if (_selection->get_selected_rows().size() == 1) { _name_offset = (_name_offset == 0) ? 2 : _name_offset + 1; - _node_name_entry->set_text(generate_module_name(plugin, _name_offset)); + _name_entry->set_text(generate_module_name(plugin, _name_offset)); } - // Cascade next node + // Cascade next block Raul::Atom& x = _initial_data.find(uris.ingen_canvasX)->second; x = _app->forge().make(x.get_float() + 20.0f); Raul::Atom& y = _initial_data.find(uris.ingen_canvasY)->second; diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index 081bc6cc..e9b874a2 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -147,7 +147,7 @@ private: bool _refresh_list; Gtk::TreeView* _plugins_treeview; Gtk::CheckButton* _polyphonic_checkbutton; - Gtk::Entry* _node_name_entry; + Gtk::Entry* _name_entry; Gtk::Button* _close_button; Gtk::Button* _add_button; Gtk::ComboBox* _filter_combo; diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp index fbdc5f0d..1124afb3 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubpatchWindow.cpp @@ -101,7 +101,7 @@ NewSubpatchWindow::ok_clicked() props.insert(make_pair(_app->uris().ingen_enabled, _app->forge().make(bool(true)))); _app->interface()->put(GraphObject::path_to_uri(path), props, Resource::INTERNAL); - // Set external (node perspective) properties + // Set external (block perspective) properties props = _initial_data; props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Patch)); _app->interface()->put(GraphObject::path_to_uri(path), _initial_data, Resource::EXTERNAL); diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 35a35c39..fe01c713 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -21,7 +21,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginModel.hpp" #include "lv2/lv2plug.in/ns/ext/presets/presets.h" @@ -49,9 +49,9 @@ NodeMenu::NodeMenu(BaseObjectType* cobject, } void -NodeMenu::init(App& app, SharedPtr<const Client::NodeModel> node) +NodeMenu::init(App& app, SharedPtr<const Client::BlockModel> block) { - ObjectMenu::init(app, node); + ObjectMenu::init(app, block); _learn_menuitem->signal_activate().connect(sigc::mem_fun(this, &NodeMenu::on_menu_learn)); @@ -62,11 +62,11 @@ NodeMenu::init(App& app, SharedPtr<const Client::NodeModel> node) _randomize_menuitem->signal_activate().connect( sigc::mem_fun(this, &NodeMenu::on_menu_randomize)); - const PluginModel* plugin = dynamic_cast<const PluginModel*>(node->plugin()); + const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin()); if (plugin && plugin->type() == PluginModel::LV2 && plugin->has_ui()) { _popup_gui_menuitem->show(); _embed_gui_menuitem->show(); - const Raul::Atom& ui_embedded = node->get_property( + const Raul::Atom& ui_embedded = block->get_property( _app->uris().ingen_uiEmbedded); _embed_gui_menuitem->set_active( ui_embedded.is_valid() && ui_embedded.get_bool()); @@ -150,11 +150,11 @@ NodeMenu::on_menu_randomize() { _app->interface()->bundle_begin(); - const NodeModel* const nm = (const NodeModel*)_object.get(); - for (NodeModel::Ports::const_iterator i = nm->ports().begin(); i != nm->ports().end(); ++i) { + const BlockModel* const bm = (const BlockModel*)_object.get(); + for (BlockModel::Ports::const_iterator i = bm->ports().begin(); i != bm->ports().end(); ++i) { if ((*i)->is_input() && _app->can_control(i->get())) { float min = 0.0f, max = 1.0f; - nm->port_value_range(*i, min, max, _app->sample_rate()); + bm->port_value_range(*i, min, max, _app->sample_rate()); const float val = g_random_double_range(0.0, 1.0) * (max - min) + min; _app->interface()->set_property( (*i)->uri(), @@ -175,8 +175,8 @@ NodeMenu::on_menu_disconnect() void NodeMenu::on_preset_activated(const std::string& uri) { - const NodeModel* const node = (const NodeModel*)_object.get(); - const PluginModel* const plugin = dynamic_cast<const PluginModel*>(node->plugin()); + const BlockModel* const block = (const BlockModel*)_object.get(); + const PluginModel* const plugin = dynamic_cast<const PluginModel*>(block->plugin()); LilvNode* port_pred = lilv_new_uri(plugin->lilv_world(), LV2_CORE__port); @@ -202,7 +202,7 @@ NodeMenu::on_preset_activated(const std::string& uri) const LilvNode* sym = lilv_nodes_get_first(symbols); _app->interface()->set_property( GraphObject::path_to_uri( - node->path().child(Raul::Symbol(lilv_node_as_string(sym)))), + block->path().child(Raul::Symbol(lilv_node_as_string(sym)))), _app->uris().ingen_value, _app->forge().make(lilv_node_as_float(val))); } @@ -224,8 +224,8 @@ NodeMenu::on_preset_clicked(const std::string& uri, GdkEventButton* ev) bool NodeMenu::has_control_inputs() { - const NodeModel* const nm = (const NodeModel*)_object.get(); - for (NodeModel::Ports::const_iterator i = nm->ports().begin(); i != nm->ports().end(); ++i) + const BlockModel* const bm = (const BlockModel*)_object.get(); + for (BlockModel::Ports::const_iterator i = bm->ports().begin(); i != bm->ports().end(); ++i) if ((*i)->is_input() && (*i)->is_numeric()) return true; diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index 07a25367..b307b9a4 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -24,7 +24,7 @@ #include <gtkmm/menushell.h> #include "ObjectMenu.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "raul/SharedPtr.hpp" namespace Ingen { @@ -40,7 +40,7 @@ public: NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); - void init(App& app, SharedPtr<const Client::NodeModel> node); + void init(App& app, SharedPtr<const Client::BlockModel> block); bool has_control_inputs(); diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 89ecc4a1..bbd569fc 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -23,7 +23,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" @@ -49,22 +49,20 @@ using namespace Client; namespace GUI { -NodeModule::NodeModule(PatchCanvas& canvas, - SharedPtr<const NodeModel> node) - : Ganv::Module(canvas, node->path().symbol(), 0, 0, true) - , _node(node) +NodeModule::NodeModule(PatchCanvas& canvas, + SharedPtr<const BlockModel> block) + : Ganv::Module(canvas, block->path().symbol(), 0, 0, true) + , _block(block) , _gui_widget(NULL) , _gui_window(NULL) { - assert(_node); - - node->signal_new_port().connect( + block->signal_new_port().connect( sigc::mem_fun(this, &NodeModule::new_port_view)); - node->signal_removed_port().connect( + block->signal_removed_port().connect( sigc::hide_return(sigc::mem_fun(this, &NodeModule::delete_port_view))); - node->signal_property().connect( + block->signal_property().connect( sigc::mem_fun(this, &NodeModule::property_changed)); - node->signal_moved().connect( + block->signal_moved().connect( sigc::mem_fun(this, &NodeModule::rename)); signal_event().connect( @@ -73,7 +71,7 @@ NodeModule::NodeModule(PatchCanvas& canvas, signal_moved().connect( sigc::mem_fun(this, &NodeModule::store_location)); - const PluginModel* plugin = dynamic_cast<const PluginModel*>(node->plugin()); + const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin()); if (plugin) { plugin->signal_changed().connect( sigc::mem_fun(this, &NodeModule::plugin_changed)); @@ -90,7 +88,7 @@ bool NodeModule::show_menu(GdkEventButton* ev) { WidgetFactory::get_widget_derived("object_menu", _menu); - _menu->init(app(), _node); + _menu->init(app(), _block); _menu->signal_embed_gui.connect( sigc::mem_fun(this, &NodeModule::on_embed_gui_toggled)); _menu->signal_popup_gui.connect( @@ -100,27 +98,25 @@ NodeModule::show_menu(GdkEventButton* ev) } NodeModule* -NodeModule::create(PatchCanvas& canvas, - SharedPtr<const NodeModel> node, - bool human) +NodeModule::create(PatchCanvas& canvas, + SharedPtr<const BlockModel> block, + bool human) { - NodeModule* ret; - - SharedPtr<const PatchModel> patch = PtrCast<const PatchModel>(node); - if (patch) - ret = new SubpatchModule(canvas, patch); - else - ret = new NodeModule(canvas, node); - - for (GraphObject::Properties::const_iterator m = node->properties().begin(); - m != node->properties().end(); ++m) + SharedPtr<const PatchModel> patch = PtrCast<const PatchModel>(block); + + NodeModule* ret = (patch) + ? new SubpatchModule(canvas, patch) + : new NodeModule(canvas, block); + + for (GraphObject::Properties::const_iterator m = block->properties().begin(); + m != block->properties().end(); ++m) ret->property_changed(m->first, m->second); - for (NodeModel::Ports::const_iterator p = node->ports().begin(); - p != node->ports().end(); ++p) + for (BlockModel::Ports::const_iterator p = block->ports().begin(); + p != block->ports().end(); ++p) ret->new_port_view(*p); - ret->set_stacked(node->polyphonic()); + ret->set_stacked(block->polyphonic()); if (human) ret->show_human_names(human); // FIXME: double port iteration @@ -140,9 +136,9 @@ NodeModule::show_human_names(bool b) const URIs& uris = app().uris(); if (b) { - set_label(node()->label().c_str()); + set_label(block()->label().c_str()); } else { - set_label(node()->symbol().c_str()); + set_label(block()->symbol().c_str()); } for (iterator i = begin(); i != end(); ++i) { @@ -153,7 +149,7 @@ NodeModule::show_human_names(bool b) if (name_property.type() == uris.forge.String) { label = name_property.get_string(); } else { - Glib::ustring hn = node()->plugin_model()->port_human_name( + Glib::ustring hn = block()->plugin_model()->port_human_name( port->model()->index()); if (!hn.empty()) label = hn; @@ -210,7 +206,7 @@ void NodeModule::on_embed_gui_toggled(bool embed) { embed_gui(embed); - app().interface()->set_property(_node->uri(), + app().interface()->set_property(_block->uri(), app().uris().ingen_uiEmbedded, app().forge().make(embed)); } @@ -225,8 +221,8 @@ NodeModule::embed_gui(bool embed) } if (!_plugin_ui) { - const PluginModel* const pm = dynamic_cast<const PluginModel*>(_node->plugin()); - _plugin_ui = pm->ui(app().world(), _node); + const PluginModel* const pm = dynamic_cast<const PluginModel*>(_block->plugin()); + _plugin_ui = pm->ui(app().world(), _block); } if (_plugin_ui) { @@ -257,7 +253,7 @@ void NodeModule::rename() { if (app().configuration()->name_style() == Configuration::PATH) { - set_label(_node->path().symbol()); + set_label(_block->path().symbol()); } } @@ -295,23 +291,23 @@ NodeModule::delete_port_view(SharedPtr<const PortModel> model) delete p; } else { app().log().warn(Raul::fmt("Failed to find port %1% on module %2%\n") - % model->path() % _node->path()); + % model->path() % _block->path()); } } bool NodeModule::popup_gui() { - if (_node->plugin() && _node->plugin()->type() == PluginModel::LV2) { + if (_block->plugin() && _block->plugin()->type() == PluginModel::LV2) { if (_plugin_ui) { app().log().warn("LV2 GUI already embedded, cannot pop up\n"); return false; } - const PluginModel* const plugin = dynamic_cast<const PluginModel*>(_node->plugin()); + const PluginModel* const plugin = dynamic_cast<const PluginModel*>(_block->plugin()); assert(plugin); - _plugin_ui = plugin->ui(app().world(), _node); + _plugin_ui = plugin->ui(app().world(), _block); if (_plugin_ui) { GtkWidget* c_widget = (GtkWidget*)_plugin_ui->get_widget(); @@ -321,7 +317,7 @@ NodeModule::popup_gui() if (!_plugin_ui->is_resizable()) { _gui_window->set_resizable(false); } - _gui_window->set_title(_node->path() + " UI - Ingen"); + _gui_window->set_title(_block->path() + " UI - Ingen"); _gui_window->set_role("plugin_ui"); _gui_window->add(*_gui_widget); _gui_widget->show_all(); @@ -333,7 +329,7 @@ NodeModule::popup_gui() return true; } else { - app().log().warn(Raul::fmt("No LV2 GUI for %1%\n") % _node->path()); + app().log().warn(Raul::fmt("No LV2 GUI for %1%\n") % _block->path()); } } @@ -353,10 +349,11 @@ void NodeModule::set_control_values() { uint32_t index = 0; - for (NodeModel::Ports::const_iterator p = _node->ports().begin(); - p != _node->ports().end(); ++p) { - if (app().can_control(p->get())) + for (BlockModel::Ports::const_iterator p = _block->ports().begin(); + p != _block->ports().end(); ++p) { + if (app().can_control(p->get())) { value_changed(index, (*p)->value()); + } ++index; } } @@ -387,8 +384,8 @@ NodeModule::store_location(double ax, double ay) const Raul::Atom x(app().forge().make(static_cast<float>(ax))); const Raul::Atom y(app().forge().make(static_cast<float>(ay))); - if (x != _node->get_property(uris.ingen_canvasX) || - y != _node->get_property(uris.ingen_canvasY)) + if (x != _block->get_property(uris.ingen_canvasX) || + y != _block->get_property(uris.ingen_canvasY)) { Resource::Properties remove; remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard)); @@ -396,7 +393,7 @@ NodeModule::store_location(double ax, double ay) Resource::Properties add; add.insert(make_pair(uris.ingen_canvasX, x)); add.insert(make_pair(uris.ingen_canvasY, y)); - app().interface()->delta(_node->uri(), remove, add); + app().interface()->delta(_block->uri(), remove, add); } } @@ -435,12 +432,12 @@ NodeModule::set_selected(gboolean b) Ganv::Module::set_selected(b); #if 0 if (b) { - PatchWindow* win = app().window_factory()->parent_patch_window(node()); + PatchWindow* win = app().window_factory()->parent_patch_window(block()); if (win) { std::string doc; bool html = false; - if (node()->plugin_model()) { - doc = node()->plugin_model()->documentation(&html); + if (block()->plugin_model()) { + doc = block()->plugin_model()->documentation(&html); } if (!doc.empty()) { win->show_documentation(doc, html); diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 42ad0fc4..73295d1a 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -25,7 +25,7 @@ namespace Raul { class Atom; } namespace Ingen { namespace Client { - class NodeModel; + class BlockModel; class PluginUI; class PortModel; } } @@ -47,9 +47,9 @@ class NodeModule : public Ganv::Module { public: static NodeModule* create( - PatchCanvas& canvas, - SharedPtr<const Client::NodeModel> node, - bool human_names); + PatchCanvas& canvas, + SharedPtr<const Client::BlockModel> block, + bool human_names); virtual ~NodeModule(); @@ -63,10 +63,10 @@ public: void show_human_names(bool b); void set_selected(gboolean b); - SharedPtr<const Client::NodeModel> node() const { return _node; } + SharedPtr<const Client::BlockModel> block() const { return _block; } protected: - NodeModule(PatchCanvas& canvas, SharedPtr<const Client::NodeModel> node); + NodeModule(PatchCanvas& canvas, SharedPtr<const Client::BlockModel> block); virtual bool on_double_click(GdkEventButton* ev); @@ -89,11 +89,11 @@ protected: bool show_menu(GdkEventButton* ev); - SharedPtr<const Client::NodeModel> _node; - NodeMenu* _menu; - SharedPtr<Client::PluginUI> _plugin_ui; - Gtk::Widget* _gui_widget; - Gtk::Window* _gui_window; ///< iff popped up + SharedPtr<const Client::BlockModel> _block; + NodeMenu* _menu; + SharedPtr<Client::PluginUI> _plugin_ui; + Gtk::Widget* _gui_widget; + Gtk::Window* _gui_window; ///< iff popped up }; } // namespace GUI diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp index 9150585a..ea3de513 100644 --- a/src/gui/PatchBox.cpp +++ b/src/gui/PatchBox.cpp @@ -257,7 +257,7 @@ PatchBox::set_patch(SharedPtr<const PatchModel> patch, _menu_view_control_window->property_sensitive() = false; - for (NodeModel::Ports::const_iterator p = patch->ports().begin(); + for (BlockModel::Ports::const_iterator p = patch->ports().begin(); p != patch->ports().end(); ++p) { if (_app->can_control(p->get())) { _menu_view_control_window->property_sensitive() = true; @@ -296,7 +296,7 @@ PatchBox::patch_port_removed(SharedPtr<const PortModel> port) if (!(port->is_input() && _app->can_control(port.get()))) return; - for (NodeModel::Ports::const_iterator i = _patch->ports().begin(); + for (BlockModel::Ports::const_iterator i = _patch->ports().begin(); i != _patch->ports().end(); ++i) { if ((*i)->is_input() && _app->can_control(i->get())) { _menu_view_control_window->property_sensitive() = true; @@ -342,14 +342,14 @@ PatchBox::show_status(const ObjectModel* model) std::stringstream msg; msg << model->path(); - const PortModel* port = 0; - const NodeModel* node = 0; + const PortModel* port = 0; + const BlockModel* block = 0; if ((port = dynamic_cast<const PortModel*>(model))) { show_port_status(port, port->value()); - } else if ((node = dynamic_cast<const NodeModel*>(model))) { - const PluginModel* plugin = dynamic_cast<const PluginModel*>(node->plugin()); + } else if ((block = dynamic_cast<const BlockModel*>(model))) { + const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin()); if (plugin) msg << ((boost::format(" (%1%)") % plugin->human_name()).str()); _status_bar->push(msg.str(), STATUS_CONTEXT_HOVER); @@ -362,7 +362,7 @@ PatchBox::show_port_status(const PortModel* port, const Raul::Atom& value) std::stringstream msg; msg << port->path(); - const NodeModel* parent = dynamic_cast<const NodeModel*>(port->parent().get()); + const BlockModel* parent = dynamic_cast<const BlockModel*>(port->parent().get()); if (parent) { const PluginModel* plugin = dynamic_cast<const PluginModel*>(parent->plugin()); if (plugin) { diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index bc103d50..d680a9b8 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -30,7 +30,7 @@ #include "ingen/Log.hpp" #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/serialisation/Serialiser.hpp" @@ -123,10 +123,10 @@ PatchCanvas::PatchCanvas(App& app, sigc::mem_fun(this, &PatchCanvas::disconnect)); // Connect to model signals to track state - _patch->signal_new_node().connect( - sigc::mem_fun(this, &PatchCanvas::add_node)); - _patch->signal_removed_node().connect( - sigc::mem_fun(this, &PatchCanvas::remove_node)); + _patch->signal_new_block().connect( + sigc::mem_fun(this, &PatchCanvas::add_block)); + _patch->signal_removed_block().connect( + sigc::mem_fun(this, &PatchCanvas::remove_block)); _patch->signal_new_port().connect( sigc::mem_fun(this, &PatchCanvas::add_port)); _patch->signal_removed_port().connect( @@ -289,15 +289,15 @@ PatchCanvas::build() { const Store::const_range kids = _app.store()->children_range(_patch); - // Create modules for nodes + // Create modules for blocks for (Store::const_iterator i = kids.first; i != kids.second; ++i) { - SharedPtr<NodeModel> node = PtrCast<NodeModel>(i->second); - if (node && node->parent() == _patch) - add_node(node); + SharedPtr<BlockModel> block = PtrCast<BlockModel>(i->second); + if (block && block->parent() == _patch) + add_block(block); } // Create pseudo modules for ports (ports on this canvas, not on our module) - for (NodeModel::Ports::const_iterator i = _patch->ports().begin(); + for (BlockModel::Ports::const_iterator i = _patch->ports().begin(); i != _patch->ports().end(); ++i) { add_port(*i); } @@ -392,30 +392,30 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) } void -PatchCanvas::add_node(SharedPtr<const NodeModel> nm) +PatchCanvas::add_block(SharedPtr<const BlockModel> bm) { - SharedPtr<const PatchModel> pm = PtrCast<const PatchModel>(nm); + SharedPtr<const PatchModel> pm = PtrCast<const PatchModel>(bm); NodeModule* module; if (pm) { module = SubpatchModule::create(*this, pm, _human_names); } else { - module = NodeModule::create(*this, nm, _human_names); + module = NodeModule::create(*this, bm, _human_names); //const PluginModel* plugm = dynamic_cast<const PluginModel*>(nm->plugin()); //if (plugm && !plugm->icon_path().empty()) // module->set_icon(_app.icon_from_path(plugm->icon_path(), 100).operator->()); } module->show(); - _views.insert(std::make_pair(nm, module)); - if (_pastees.find(nm->path()) != _pastees.end()) { + _views.insert(std::make_pair(bm, module)); + if (_pastees.find(bm->path()) != _pastees.end()) { module->set_selected(true); } } void -PatchCanvas::remove_node(SharedPtr<const NodeModel> nm) +PatchCanvas::remove_block(SharedPtr<const BlockModel> bm) { - Views::iterator i = _views.find(nm); + Views::iterator i = _views.find(bm); if (i != _views.end()) { const guint n_ports = i->second->num_ports(); @@ -617,7 +617,7 @@ destroy_node(GanvNode* node, void* data) NodeModule* node_module = dynamic_cast<NodeModule*>(module); if (node_module) { - app->interface()->del(node_module->node()->uri()); + app->interface()->del(node_module->block()->uri()); } else { PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module); if (port_module) { @@ -656,7 +656,7 @@ serialise_node(GanvNode* node, void* data) NodeModule* node_module = dynamic_cast<NodeModule*>(module); if (node_module) { - serialiser->serialise(node_module->node()); + serialiser->serialise(node_module->block()); } else { PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module); if (port_module) { @@ -828,7 +828,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) if (!plugin) return; - Raul::Symbol symbol = plugin->default_node_symbol(); + Raul::Symbol symbol = plugin->default_block_symbol(); unsigned offset = _app.store()->child_name_offset(_patch->path(), symbol); if (offset != 0) { std::stringstream ss; @@ -841,7 +841,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) // FIXME: polyphony? GraphObject::Properties props = get_initial_data(); - props.insert(make_pair(uris.rdf_type, uris.ingen_Node)); + props.insert(make_pair(uris.rdf_type, uris.ingen_Block)); props.insert(make_pair(uris.ingen_prototype, uris.forge.alloc_uri(plugin->uri()))); _app.interface()->put(GraphObject::path_to_uri(path), props); diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index 47b645d6..04c30ed3 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -64,8 +64,8 @@ public: bool show_port_names() const { return _show_port_names; } void add_plugin(SharedPtr<Client::PluginModel> pm); - void add_node(SharedPtr<const Client::NodeModel> nm); - void remove_node(SharedPtr<const Client::NodeModel> nm); + void add_block(SharedPtr<const Client::BlockModel> bm); + void remove_block(SharedPtr<const Client::BlockModel> bm); void add_port(SharedPtr<const Client::PortModel> pm); void remove_port(SharedPtr<const Client::PortModel> pm); void connection(SharedPtr<const Client::EdgeModel> cm); diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index a260c35e..ec0e6a04 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -19,7 +19,7 @@ #include <utility> #include "ingen/Interface.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "App.hpp" diff --git a/src/gui/PatchPortModule.hpp b/src/gui/PatchPortModule.hpp index 90f9cd6d..b48bbfc4 100644 --- a/src/gui/PatchPortModule.hpp +++ b/src/gui/PatchPortModule.hpp @@ -30,7 +30,6 @@ namespace Raul { class Atom; } namespace Ingen { namespace Client { class PortModel; - class NodeModel; } } namespace Ingen { diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index e81d16f7..efb37d11 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -134,7 +134,7 @@ PatchView::canvas_item_entered(Gnome::Canvas::Item* item) { NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) - signal_object_entered.emit(m->node().get()); + signal_object_entered.emit(m->block().get()); const Port* p = dynamic_cast<const Port*>(item); if (p) @@ -146,7 +146,7 @@ PatchView::canvas_item_left(Gnome::Canvas::Item* item) { NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) { - signal_object_left.emit(m->node().get()); + signal_object_left.emit(m->block().get()); return; } diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 265b4caf..88d81fcd 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -50,7 +50,7 @@ Port::create(App& app, if (name.type() == app.forge().String) { label = name.get_string(); } else { - const SharedPtr<const NodeModel> parent(PtrCast<const NodeModel>(pm->parent())); + const SharedPtr<const BlockModel> parent(PtrCast<const BlockModel>(pm->parent())); if (parent && parent->plugin_model()) label = parent->plugin_model()->port_human_name(pm->index()); } @@ -111,7 +111,7 @@ Port::update_metadata() { SharedPtr<const PortModel> pm = _port_model.lock(); if (_app.can_control(pm.get()) && pm->is_numeric()) { - boost::shared_ptr<const NodeModel> parent = PtrCast<const NodeModel>(pm->parent()); + boost::shared_ptr<const BlockModel> parent = PtrCast<const BlockModel>(pm->parent()); if (parent) { float min = 0.0f; float max = 1.0f; @@ -182,10 +182,10 @@ Port::on_scale_point_activated(float f) Gtk::Menu* Port::build_enum_menu() { - SharedPtr<const NodeModel> node = PtrCast<NodeModel>(model()->parent()); - Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); + SharedPtr<const BlockModel> block = PtrCast<BlockModel>(model()->parent()); + Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); - PluginModel::ScalePoints points = node->plugin_model()->port_scale_points( + PluginModel::ScalePoints points = block->plugin_model()->port_scale_points( model()->index()); for (PluginModel::ScalePoints::iterator i = points.begin(); i != points.end(); ++i) { @@ -354,10 +354,10 @@ Port::set_selected(gboolean b) Ganv::Port::set_selected(b); SharedPtr<const PortModel> pm = _port_model.lock(); if (pm && b) { - SharedPtr<const NodeModel> node = PtrCast<NodeModel>(pm->parent()); - PatchWindow* win = _app.window_factory()->parent_patch_window(node); - if (win && node->plugin_model()) { - const std::string& doc = node->plugin_model()->port_documentation( + SharedPtr<const BlockModel> block = PtrCast<BlockModel>(pm->parent()); + PatchWindow* win = _app.window_factory()->parent_patch_window(block); + if (win && block->plugin_model()) { + const std::string& doc = block->plugin_model()->port_documentation( pm->index()); if (!doc.empty()) { win->show_documentation(doc, false); diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index a5b907c3..a23e3b84 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -121,9 +121,9 @@ PortMenu::on_menu_set_max() void PortMenu::on_menu_reset_range() { - const URIs& uris = _app->uris(); - SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object); - SharedPtr<const NodeModel> parent = PtrCast<const NodeModel>(_object->parent()); + const URIs& uris = _app->uris(); + SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object); + SharedPtr<const BlockModel> parent = PtrCast<const BlockModel>(_object->parent()); float min, max; parent->default_port_value_range(model, min, max); @@ -142,12 +142,12 @@ PortMenu::on_menu_reset_range() void PortMenu::on_menu_expose() { - const URIs& uris = _app->uris(); - SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object); - SharedPtr<const NodeModel> node = PtrCast<const NodeModel>(port->parent()); + const URIs& uris = _app->uris(); + SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object); + SharedPtr<const BlockModel> block = PtrCast<const BlockModel>(port->parent()); - const std::string label = node->label() + " " + node->port_label(port); - const Raul::Path path = Raul::Path(node->path() + Raul::Symbol("_" + port->symbol())); + const std::string label = block->label() + " " + block->port_label(port); + const Raul::Path path = Raul::Path(block->path() + Raul::Symbol("_" + port->symbol())); Ingen::Resource r(*_object.get()); r.remove_property(uris.lv2_index, uris.wildcard); @@ -155,12 +155,12 @@ PortMenu::on_menu_expose() r.set_property(uris.lv2_name, _app->forge().alloc(label.c_str())); // TODO: Pretty kludgey coordinates - const float node_x = node->get_property(uris.ingen_canvasX).get_float(); - const float node_y = node->get_property(uris.ingen_canvasY).get_float(); - const float x_off = (label.length() * 16.0f) * (port->is_input() ? -1 : 1); - const float y_off = port->index() * 32.0f; - r.set_property(uris.ingen_canvasX, _app->forge().make(node_x + x_off)); - r.set_property(uris.ingen_canvasY, _app->forge().make(node_y + y_off)); + const float block_x = block->get_property(uris.ingen_canvasX).get_float(); + const float block_y = block->get_property(uris.ingen_canvasY).get_float(); + const float x_off = (label.length() * 16.0f) * (port->is_input() ? -1 : 1); + const float y_off = port->index() * 32.0f; + r.set_property(uris.ingen_canvasX, _app->forge().make(block_x + x_off)); + r.set_property(uris.ingen_canvasY, _app->forge().make(block_y + y_off)); _app->interface()->put(GraphObject::path_to_uri(path), r.properties()); diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index f6af2563..a4b2d5fc 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -18,7 +18,7 @@ #include <list> #include "ingen/Interface.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginModel.hpp" #include "App.hpp" @@ -66,7 +66,7 @@ PortPropertiesWindow::present(SharedPtr<const PortModel> pm) set_title(pm->path() + " Properties - Ingen"); float min = 0.0f, max = 1.0f; - boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_port_model->parent()); + boost::shared_ptr<BlockModel> parent = PtrCast<BlockModel>(_port_model->parent()); if (parent) parent->port_value_range(_port_model, min, max, _app->sample_rate()); diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index 2acb7ffe..e49e2021 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -24,7 +24,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" #include "ingen/World.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginModel.hpp" #include "App.hpp" diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp index e62fb07f..7ba5e5b6 100644 --- a/src/gui/PropertiesWindow.hpp +++ b/src/gui/PropertiesWindow.hpp @@ -30,7 +30,7 @@ #include "raul/SharedPtr.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "Window.hpp" diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp index 5425677c..efd29805 100644 --- a/src/gui/SubpatchModule.cpp +++ b/src/gui/SubpatchModule.cpp @@ -67,8 +67,8 @@ SubpatchModule::store_location(double ax, double ay) const Raul::Atom x(app().forge().make(static_cast<float>(ax))); const Raul::Atom y(app().forge().make(static_cast<float>(ay))); - if (x != _node->get_property(uris.ingen_canvasX) || - y != _node->get_property(uris.ingen_canvasY)) + if (x != _block->get_property(uris.ingen_canvasX) || + y != _block->get_property(uris.ingen_canvasY)) { Resource::Properties remove; remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard)); @@ -78,7 +78,7 @@ SubpatchModule::store_location(double ax, double ay) Resource::Property(x, Resource::EXTERNAL))); add.insert(make_pair(uris.ingen_canvasY, Resource::Property(y, Resource::EXTERNAL))); - app().interface()->delta(_node->uri(), remove, add); + app().interface()->delta(_block->uri(), remove, add); } } diff --git a/src/gui/SubpatchModule.hpp b/src/gui/SubpatchModule.hpp index 727f681d..8d7dbecc 100644 --- a/src/gui/SubpatchModule.hpp +++ b/src/gui/SubpatchModule.hpp @@ -24,9 +24,8 @@ namespace Ingen { namespace Client { class PatchModel; - class NodeModel; - class PortModel; class PatchWindow; + class PortModel; } } namespace Ingen { diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index 98af4c19..1f0e0310 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -112,12 +112,12 @@ WindowFactory::patch_window(SharedPtr<const PatchModel> patch) } PatchWindow* -WindowFactory::parent_patch_window(SharedPtr<const NodeModel> node) +WindowFactory::parent_patch_window(SharedPtr<const BlockModel> block) { - if (!node) + if (!block) return NULL; - return patch_window(PtrCast<PatchModel>(node->parent())); + return patch_window(PtrCast<PatchModel>(block->parent())); } /** Present a PatchWindow for a Patch. diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 0712c656..465bfa80 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -25,9 +25,9 @@ namespace Ingen { namespace Client { -class PatchModel; -class NodeModel; +class BlockModel; class ObjectModel; +class PatchModel; } namespace GUI { @@ -57,7 +57,7 @@ public: PatchBox* patch_box(SharedPtr<const Client::PatchModel> patch); PatchWindow* patch_window(SharedPtr<const Client::PatchModel> patch); - PatchWindow* parent_patch_window(SharedPtr<const Client::NodeModel> node); + PatchWindow* parent_patch_window(SharedPtr<const Client::BlockModel> block); void present_patch( SharedPtr<const Client::PatchModel> model, diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index bac5e06f..900aba02 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -36,9 +36,6 @@ #include "sord/sordmm.hpp" #include "sratom/sratom.h" -#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" -#define NS_RDFS "http://www.w3.org/2000/01/rdf-schema#" - using namespace std; typedef set<Sord::Node> RDFNodes; @@ -192,7 +189,7 @@ parse_patch( boost::optional<Resource::Properties> data = boost::optional<Resource::Properties>()); static boost::optional<Raul::Path> -parse_node( +parse_block( World* world, Interface* target, Sord::Model& model, @@ -218,21 +215,21 @@ parse_edges( const Raul::Path& patch); static boost::optional<Raul::Path> -parse_node(Ingen::World* world, - Ingen::Interface* target, - Sord::Model& model, - const Sord::Node& subject, - const Raul::Path& path, - boost::optional<GraphObject::Properties> data) +parse_block(Ingen::World* world, + Ingen::Interface* target, + Sord::Model& model, + const Sord::Node& subject, + const Raul::Path& path, + boost::optional<GraphObject::Properties> data) { const URIs& uris = world->uris(); - const Sord::URI ingen_prototype(*world->rdf_world(), NS_INGEN "prototype"); + const Sord::URI ingen_prototype(*world->rdf_world(), uris.ingen_prototype); const Sord::Node nil; Sord::Iter i = model.find(subject, ingen_prototype, nil); if (i.end() || i.get_object().type() != Sord::Node::URI) { - world->log().error("Node missing mandatory ingen:prototype\n"); + world->log().error("BLock missing mandatory ingen:prototype\n"); return boost::optional<Raul::Path>(); } @@ -274,7 +271,7 @@ parse_node(Ingen::World* world, } else { Resource::Properties props = get_properties(world, model, subject); props.insert(make_pair(uris.rdf_type, - uris.forge.alloc_uri(uris.ingen_Node))); + uris.forge.alloc_uri(uris.ingen_Block))); target->put(GraphObject::path_to_uri(path), props); } return path; @@ -289,8 +286,10 @@ parse_patch(Ingen::World* world, boost::optional<Raul::Symbol> a_symbol, boost::optional<GraphObject::Properties> data) { - const Sord::URI ingen_node(*world->rdf_world(), NS_INGEN "node"); - const Sord::URI ingen_polyphony(*world->rdf_world(), NS_INGEN "polyphony"); + URIs& uris = world->uris(); + + const Sord::URI ingen_block(*world->rdf_world(), uris.ingen_block); + const Sord::URI ingen_polyphony(*world->rdf_world(), uris.ingen_polyphony); const Sord::URI lv2_port(*world->rdf_world(), LV2_CORE__port); const Sord::Node& patch = subject_node; @@ -320,24 +319,24 @@ parse_patch(Ingen::World* world, Resource::Properties props = get_properties(world, model, subject_node); target->put(GraphObject::path_to_uri(patch_path), props); - // For each node in this patch - for (Sord::Iter n = model.find(subject_node, ingen_node, nil); !n.end(); ++n) { - Sord::Node node = n.get_object(); - const Raul::Path node_path = patch_path.child( + // For each block in this patch + for (Sord::Iter n = model.find(subject_node, ingen_block, nil); !n.end(); ++n) { + Sord::Node node = n.get_object(); + const Raul::Path block_path = patch_path.child( Raul::Symbol(get_basename(node.to_string()))); - // Parse and create node - parse_node(world, target, model, node, node_path, - boost::optional<GraphObject::Properties>()); + // Parse and create block + parse_block(world, target, model, node, block_path, + boost::optional<GraphObject::Properties>()); - // For each port on this node + // For each port on this block for (Sord::Iter p = model.find(node, lv2_port, nil); !p.end(); ++p) { Sord::Node port = p.get_object(); // Get all properties uint32_t index = 0; boost::optional<PortRecord> port_record = get_port( - world, model, port, node_path, index); + world, model, port, block_path, index); if (!port_record) { world->log().error(Raul::fmt("Invalid port %1%\n") % port); return boost::optional<Raul::Path>(); @@ -386,8 +385,10 @@ parse_edge(Ingen::World* world, const Sord::Node& subject, const Raul::Path& parent) { - const Sord::URI ingen_tail(*world->rdf_world(), NS_INGEN "tail"); - const Sord::URI ingen_head(*world->rdf_world(), NS_INGEN "head"); + URIs& uris = world->uris(); + + const Sord::URI ingen_tail(*world->rdf_world(), uris.ingen_tail); + const Sord::URI ingen_head(*world->rdf_world(), uris.ingen_head); const Sord::Node nil; Sord::Iter t = model.find(subject, ingen_tail, nil); @@ -437,7 +438,7 @@ parse_edges(Ingen::World* world, const Sord::Node& subject, const Raul::Path& parent) { - const Sord::URI ingen_edge(*world->rdf_world(), NS_INGEN "edge"); + const Sord::URI ingen_edge(*world->rdf_world(), world->uris().ingen_edge); const Sord::Node nil; for (Sord::Iter i = model.find(subject, ingen_edge, nil); !i.end(); ++i) { @@ -476,14 +477,16 @@ parse(Ingen::World* world, boost::optional<Raul::Symbol> symbol, boost::optional<GraphObject::Properties> data) { - const Sord::URI patch_class (*world->rdf_world(), NS_INGEN "Patch"); - const Sord::URI node_class (*world->rdf_world(), NS_INGEN "Node"); - const Sord::URI edge_class (*world->rdf_world(), NS_INGEN "Edge"); - const Sord::URI internal_class(*world->rdf_world(), NS_INGEN "Internal"); + URIs& uris = world->uris(); + + const Sord::URI patch_class (*world->rdf_world(), uris.ingen_Patch); + const Sord::URI block_class (*world->rdf_world(), uris.ingen_Block); + const Sord::URI edge_class (*world->rdf_world(), uris.ingen_Edge); + const Sord::URI internal_class(*world->rdf_world(), uris.ingen_Internal); const Sord::URI in_port_class (*world->rdf_world(), LV2_CORE__InputPort); const Sord::URI out_port_class(*world->rdf_world(), LV2_CORE__OutputPort); const Sord::URI lv2_class (*world->rdf_world(), LV2_CORE__Plugin); - const Sord::URI rdf_type (*world->rdf_world(), NS_RDF "type"); + const Sord::URI rdf_type (*world->rdf_world(), uris.rdf_type); const Sord::Node nil; // Parse explicit subject patch @@ -518,8 +521,8 @@ parse(Ingen::World* world, relative_uri( model.base_uri().to_string(), s.to_string(), true)); if (types.find(patch_class) != types.end()) { ret = parse_patch(world, target, model, s, parent, symbol, data); - } else if (types.find(node_class) != types.end()) { - ret = parse_node(world, target, model, s, path, data); + } else if (types.find(block_class) != types.end()) { + ret = parse_block(world, target, model, s, path, data); } else if (types.find(in_port_class) != types.end() || types.find(out_port_class) != types.end()) { parse_properties( diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index b480d531..a9d49fe3 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -69,9 +69,9 @@ struct Serialiser::Impl { void serialise_patch(SharedPtr<const GraphObject> p, const Sord::Node& id); - void serialise_node(SharedPtr<const GraphObject> n, - const Sord::Node& class_id, - const Sord::Node& id); + void serialise_block(SharedPtr<const GraphObject> n, + const Sord::Node& class_id, + const Sord::Node& id); void serialise_port(const GraphObject* p, Resource::Graph context, @@ -133,21 +133,22 @@ Serialiser::Impl::write_manifest(const std::string& bundle_path, start_to_filename(manifest_path); Sord::World& world = _model->world(); + const URIs& uris = _world.uris(); const string filename(patch_symbol + ".ttl"); const Sord::URI subject(world, filename, _base_uri); _model->add_statement(subject, - Sord::Curie(world, "rdf:type"), - Sord::Curie(world, "ingen:Patch")); + Sord::URI(world, uris.rdf_type), + Sord::URI(world, uris.ingen_Patch)); _model->add_statement(subject, - Sord::Curie(world, "rdf:type"), - Sord::Curie(world, "lv2:Plugin")); + Sord::URI(world, uris.rdf_type), + Sord::URI(world, uris.lv2_Plugin)); _model->add_statement(subject, - Sord::Curie(world, "rdfs:seeAlso"), + Sord::URI(world, uris.rdfs_seeAlso), Sord::URI(world, filename, _base_uri)); _model->add_statement(subject, - Sord::Curie(world, "lv2:binary"), + Sord::URI(world, uris.lv2_binary), Sord::URI(world, binary_path, _base_uri)); symlink(Glib::Module::build_path(INGEN_BUNDLE_DIR, "ingen_lv2").c_str(), @@ -285,9 +286,9 @@ Serialiser::serialise(SharedPtr<const GraphObject> object) throw (std::logic_err if (object->graph_type() == GraphObject::PATCH) { me->serialise_patch(object, me->path_rdf_node(object->path())); - } else if (object->graph_type() == GraphObject::NODE) { + } else if (object->graph_type() == GraphObject::BLOCK) { const Sord::URI plugin_id(me->_model->world(), object->plugin()->uri()); - me->serialise_node(object, plugin_id, me->path_rdf_node(object->path())); + me->serialise_block(object, plugin_id, me->path_rdf_node(object->path())); } else if (object->graph_type() == GraphObject::PORT) { me->serialise_port(object.get(), Resource::DEFAULT, @@ -302,27 +303,25 @@ void Serialiser::Impl::serialise_patch(SharedPtr<const GraphObject> patch, const Sord::Node& patch_id) { - assert(_model); Sord::World& world = _model->world(); + const URIs& uris = _world.uris(); _model->add_statement(patch_id, - Sord::Curie(world, "rdf:type"), - Sord::Curie(world, "ingen:Patch")); + Sord::URI(world, uris.rdf_type), + Sord::URI(world, uris.ingen_Patch)); _model->add_statement(patch_id, - Sord::Curie(world, "rdf:type"), - Sord::Curie(world, "lv2:Plugin")); + Sord::URI(world, uris.rdf_type), + Sord::URI(world, uris.lv2_Plugin)); _model->add_statement(patch_id, - Sord::Curie(world, "lv2:extensionData"), + Sord::URI(world, uris.lv2_extensionData), Sord::URI(world, LV2_STATE__interface)); _model->add_statement(patch_id, Sord::URI(world, LV2_UI__ui), Sord::URI(world, "http://drobilla.net/ns/ingen#PatchUIGtk2")); - const URIs& uris = _world.uris(); - // Always write a symbol (required by Ingen) Raul::Symbol symbol("_"); GraphObject::Properties::const_iterator s = patch->properties().find(uris.lv2_symbol); @@ -334,7 +333,7 @@ Serialiser::Impl::serialise_patch(SharedPtr<const GraphObject> patch, symbol = Raul::Symbol::symbolify(base.substr(0, base.find('.'))); _model->add_statement( patch_id, - Sord::Curie(world, "lv2:symbol"), + Sord::URI(world, uris.lv2_symbol), Sord::Literal(world, symbol.c_str())); } else { symbol = Raul::Symbol::symbolify(s->second.get_string()); @@ -381,21 +380,21 @@ Serialiser::Impl::serialise_patch(SharedPtr<const GraphObject> patch, _base_uri = my_base_uri; _model = my_model; - // Serialise reference to patch node - const Sord::Node node_id(path_rdf_node(subpatch->path())); + // Serialise reference to patch block + const Sord::Node block_id(path_rdf_node(subpatch->path())); _model->add_statement(patch_id, - Sord::Curie(world, "ingen:node"), - node_id); - serialise_node(subpatch, subpatch_id, node_id); - } else if (n->second->graph_type() == GraphObject::NODE) { - SharedPtr<const GraphObject> node = n->second; - - const Sord::URI class_id(world, node->plugin()->uri()); - const Sord::Node node_id(path_rdf_node(n->second->path())); + Sord::URI(world, uris.ingen_block), + block_id); + serialise_block(subpatch, subpatch_id, block_id); + } else if (n->second->graph_type() == GraphObject::BLOCK) { + SharedPtr<const GraphObject> block = n->second; + + const Sord::URI class_id(world, block->plugin()->uri()); + const Sord::Node block_id(path_rdf_node(n->second->path())); _model->add_statement(patch_id, - Sord::Curie(world, "ingen:node"), - node_id); - serialise_node(node, class_id, node_id); + Sord::URI(world, uris.ingen_block), + block_id); + serialise_block(block, class_id, block_id); } } @@ -421,29 +420,31 @@ Serialiser::Impl::serialise_patch(SharedPtr<const GraphObject> patch, } void -Serialiser::Impl::serialise_node(SharedPtr<const GraphObject> node, - const Sord::Node& class_id, - const Sord::Node& node_id) +Serialiser::Impl::serialise_block(SharedPtr<const GraphObject> block, + const Sord::Node& class_id, + const Sord::Node& block_id) { - _model->add_statement(node_id, - Sord::Curie(_model->world(), "rdf:type"), - Sord::Curie(_model->world(), "ingen:Node")); - _model->add_statement(node_id, - Sord::Curie(_model->world(), "ingen:prototype"), + const URIs& uris = _world.uris(); + + _model->add_statement(block_id, + Sord::URI(_model->world(), uris.rdf_type), + Sord::URI(_model->world(), uris.ingen_Block)); + _model->add_statement(block_id, + Sord::URI(_model->world(), uris.ingen_prototype), class_id); - _model->add_statement(node_id, - Sord::Curie(_model->world(), "lv2:symbol"), - Sord::Literal(_model->world(), node->path().symbol())); + _model->add_statement(block_id, + Sord::URI(_model->world(), uris.lv2_symbol), + Sord::Literal(_model->world(), block->path().symbol())); - const GraphObject::Properties props = node->properties(Resource::EXTERNAL); - serialise_properties(node_id, props); + const GraphObject::Properties props = block->properties(Resource::EXTERNAL); + serialise_properties(block_id, props); - for (uint32_t i = 0; i < node->num_ports(); ++i) { - GraphObject* const p = node->port(i); + for (uint32_t i = 0; i < block->num_ports(); ++i) { + GraphObject* const p = block->port(i); const Sord::Node port_id = path_rdf_node(p->path()); serialise_port(p, Resource::EXTERNAL, port_id); - _model->add_statement(node_id, - Sord::Curie(_model->world(), "lv2:port"), + _model->add_statement(block_id, + Sord::URI(_model->world(), uris.lv2_port), port_id); } } @@ -457,7 +458,7 @@ Serialiser::Impl::serialise_port(const GraphObject* port, Sord::World& world = _model->world(); _model->add_statement(port_id, - Sord::Curie(world, "lv2:symbol"), + Sord::URI(world, uris.lv2_symbol), Sord::Literal(world, port->path().symbol())); GraphObject::Properties props = port->properties(context); @@ -494,25 +495,26 @@ Serialiser::Impl::serialise_edge(const Sord::Node& parent, "serialise_edge called without serialisation in progress"); Sord::World& world = _model->world(); + const URIs& uris = _world.uris(); - const Sord::Node src = path_rdf_node(edge->tail_path()); - const Sord::Node dst = path_rdf_node(edge->head_path()); + const Sord::Node src = path_rdf_node(edge->tail_path()); + const Sord::Node dst = path_rdf_node(edge->head_path()); const Sord::Node edge_id = Sord::Node::blank_id(*_world.rdf_world()); _model->add_statement(edge_id, - Sord::Curie(world, "ingen:tail"), + Sord::URI(world, uris.ingen_tail), src); _model->add_statement(edge_id, - Sord::Curie(world, "ingen:head"), + Sord::URI(world, uris.ingen_head), dst); if (parent.is_valid()) { _model->add_statement(parent, - Sord::Curie(world, "ingen:edge"), + Sord::URI(world, uris.ingen_edge), edge_id); } else { _model->add_statement(edge_id, - Sord::Curie(world, "rdf:type"), - Sord::Curie(world, "ingen:Edge")); + Sord::URI(world, uris.rdf_type), + Sord::URI(world, uris.ingen_Edge)); } } diff --git a/src/server/NodeFactory.cpp b/src/server/BlockFactory.cpp index 6683658b..3e08aa7f 100644 --- a/src/server/NodeFactory.cpp +++ b/src/server/BlockFactory.cpp @@ -26,7 +26,7 @@ #include "InternalPlugin.hpp" #include "LV2Plugin.hpp" -#include "NodeFactory.hpp" +#include "BlockFactory.hpp" #include "ThreadManager.hpp" using namespace std; @@ -36,7 +36,7 @@ namespace Server { using namespace Internals; -NodeFactory::NodeFactory(Ingen::World* world) +BlockFactory::BlockFactory(Ingen::World* world) : _world(world) , _lv2_info(new LV2Info(world)) , _has_loaded(false) @@ -44,7 +44,7 @@ NodeFactory::NodeFactory(Ingen::World* world) load_internal_plugins(); } -NodeFactory::~NodeFactory() +BlockFactory::~BlockFactory() { for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) delete i->second; @@ -52,8 +52,8 @@ NodeFactory::~NodeFactory() _plugins.clear(); } -const NodeFactory::Plugins& -NodeFactory::plugins() +const BlockFactory::Plugins& +BlockFactory::plugins() { ThreadManager::assert_thread(THREAD_PRE_PROCESS); if (!_has_loaded) { @@ -66,7 +66,7 @@ NodeFactory::plugins() } PluginImpl* -NodeFactory::plugin(const Raul::URI& uri) +BlockFactory::plugin(const Raul::URI& uri) { load_plugin(uri); const Plugins::const_iterator i = _plugins.find(uri); @@ -74,7 +74,7 @@ NodeFactory::plugin(const Raul::URI& uri) } void -NodeFactory::load_internal_plugins() +BlockFactory::load_internal_plugins() { Ingen::URIs& uris = _world->uris(); InternalPlugin* controller_plug = ControllerNode::internal_plugin(uris); @@ -91,7 +91,7 @@ NodeFactory::load_internal_plugins() } void -NodeFactory::load_plugin(const Raul::URI& uri) +BlockFactory::load_plugin(const Raul::URI& uri) { if (_has_loaded || _plugins.find(uri) != _plugins.end()) { return; @@ -111,7 +111,7 @@ NodeFactory::load_plugin(const Raul::URI& uri) /** Loads information about all LV2 plugins into internal plugin database. */ void -NodeFactory::load_lv2_plugins() +BlockFactory::load_lv2_plugins() { const LilvPlugins* plugins = lilv_world_get_all_plugins(_world->lilv_world()); LILV_FOREACH(plugins, i, plugins) { diff --git a/src/server/NodeFactory.hpp b/src/server/BlockFactory.hpp index 502d7757..a66b7913 100644 --- a/src/server/NodeFactory.hpp +++ b/src/server/BlockFactory.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_ENGINE_NODEFACTORY_HPP -#define INGEN_ENGINE_NODEFACTORY_HPP +#ifndef INGEN_ENGINE_BLOCKFACTORY_HPP +#define INGEN_ENGINE_BLOCKFACTORY_HPP #include <map> @@ -27,8 +27,6 @@ namespace Ingen { namespace Server { -class NodeImpl; -class PatchImpl; class PluginImpl; class LV2Info; @@ -36,11 +34,11 @@ class LV2Info; * * \ingroup engine */ -class NodeFactory : public Raul::Noncopyable +class BlockFactory : public Raul::Noncopyable { public: - explicit NodeFactory(Ingen::World* world); - ~NodeFactory(); + explicit BlockFactory(Ingen::World* world); + ~BlockFactory(); void load_plugin(const Raul::URI& uri); @@ -62,4 +60,4 @@ private: } // namespace Server } // namespace Ingen -#endif // INGEN_ENGINE_NODEFACTORY_HPP +#endif // INGEN_ENGINE_BLOCKFACTORY_HPP diff --git a/src/server/NodeImpl.cpp b/src/server/BlockImpl.cpp index f1f6c362..7d99ca28 100644 --- a/src/server/NodeImpl.cpp +++ b/src/server/BlockImpl.cpp @@ -21,7 +21,7 @@ #include "Buffer.hpp" #include "Engine.hpp" -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" #include "PatchImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -33,11 +33,11 @@ using namespace std; namespace Ingen { namespace Server { -NodeImpl::NodeImpl(PluginImpl* plugin, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - SampleRate srate) +BlockImpl::BlockImpl(PluginImpl* plugin, + const Raul::Symbol& symbol, + bool polyphonic, + PatchImpl* parent, + SampleRate srate) : GraphObjectImpl(plugin->uris(), parent, symbol) , _plugin(plugin) , _ports(NULL) @@ -51,33 +51,33 @@ NodeImpl::NodeImpl(PluginImpl* plugin, assert(_polyphony > 0); } -NodeImpl::~NodeImpl() +BlockImpl::~BlockImpl() { if (_activated) { deactivate(); } if (is_linked()) { - parent_patch()->remove_node(*this); + parent_patch()->remove_block(*this); } delete _ports; } GraphObject* -NodeImpl::port(uint32_t index) const +BlockImpl::port(uint32_t index) const { return (*_ports)[index]; } const Plugin* -NodeImpl::plugin() const +BlockImpl::plugin() const { return _plugin; } void -NodeImpl::activate(BufferFactory& bufs) +BlockImpl::activate(BufferFactory& bufs) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -91,7 +91,7 @@ NodeImpl::activate(BufferFactory& bufs) } void -NodeImpl::deactivate() +BlockImpl::deactivate() { _activated = false; for (uint32_t i = 0; i < _polyphony; ++i) { @@ -104,7 +104,7 @@ NodeImpl::deactivate() } bool -NodeImpl::prepare_poly(BufferFactory& bufs, uint32_t poly) +BlockImpl::prepare_poly(BufferFactory& bufs, uint32_t poly) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -119,7 +119,7 @@ NodeImpl::prepare_poly(BufferFactory& bufs, uint32_t poly) } bool -NodeImpl::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) +BlockImpl::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) { if (!_polyphonic) poly = 1; @@ -134,10 +134,10 @@ NodeImpl::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) } void -NodeImpl::set_buffer_size(Context& context, - BufferFactory& bufs, - LV2_URID type, - uint32_t size) +BlockImpl::set_buffer_size(Context& context, + BufferFactory& bufs, + LV2_URID type, + uint32_t size) { if (_ports) { for (uint32_t i = 0; i < _ports->size(); ++i) { @@ -152,7 +152,7 @@ NodeImpl::set_buffer_size(Context& context, /** Prepare to run a cycle (in the audio thread) */ void -NodeImpl::pre_process(ProcessContext& context) +BlockImpl::pre_process(ProcessContext& context) { // Mix down input ports for (uint32_t i = 0; i < num_ports(); ++i) { @@ -165,7 +165,7 @@ NodeImpl::pre_process(ProcessContext& context) /** Prepare to run a cycle (in the audio thread) */ void -NodeImpl::post_process(ProcessContext& context) +BlockImpl::post_process(ProcessContext& context) { // Write output ports for (uint32_t i = 0; _ports && i < _ports->size(); ++i) { @@ -174,9 +174,9 @@ NodeImpl::post_process(ProcessContext& context) } void -NodeImpl::set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf) +BlockImpl::set_port_buffer(uint32_t voice, + uint32_t port_num, + BufferRef buf) { /*std::cout << path() << " set port " << port_num << " voice " << voice << " buffer " << buf << " offset " << offset << std::endl;*/ diff --git a/src/server/NodeImpl.hpp b/src/server/BlockImpl.hpp index 86741156..fd2af927 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -48,43 +48,43 @@ class PluginImpl; class PortImpl; class ProcessContext; -/** A Node (or "module") in a Patch (which is also a Node). +/** A Block in a Patch (which is also a Block). * - * A Node is a unit with input/output ports, a process() method, and some other - * things. + * This is what is often called a "Module" in modular synthesizers. A Block is + * a unit with input/output ports, a process() method, and some other things. * * \ingroup engine */ -class NodeImpl : public GraphObjectImpl - , public boost::intrusive::slist_base_hook<> // In PatchImpl +class BlockImpl : public GraphObjectImpl + , public boost::intrusive::slist_base_hook<> // In PatchImpl { public: - NodeImpl(PluginImpl* plugin, - const Raul::Symbol& symbol, - bool poly, - PatchImpl* parent, - SampleRate rate); + BlockImpl(PluginImpl* plugin, + const Raul::Symbol& symbol, + bool poly, + PatchImpl* parent, + SampleRate rate); - virtual ~NodeImpl(); + virtual ~BlockImpl(); - virtual GraphType graph_type() const { return NODE; } + virtual GraphType graph_type() const { return BLOCK; } - /** Activate this Node. + /** Activate this Block. * * This function must be called in a non-realtime thread before it is * inserted in to a patch. Any non-realtime actions that need to be - * done before the Node is ready for use should be done here. + * done before the Block is ready for use should be done here. */ virtual void activate(BufferFactory& bufs); - /** Deactivate this Node. + /** Deactivate this Block. * * This function must be called in a non-realtime thread after the - * node has been removed from its patch (i.e. processing is finished). + * block has been removed from its patch (i.e. processing is finished). */ virtual void deactivate(); - /** Return true iff this node is activated */ + /** Return true iff this block is activated */ bool activated() { return _activated; } /** Learn the next incoming MIDI event (for internals) */ @@ -93,7 +93,7 @@ public: /** Do whatever needs doing in the process thread before process() is called */ virtual void pre_process(ProcessContext& context); - /** Run the node for @a nframes input/output. + /** Run the block for @a nframes input/output. * * @a start and @a end are transport times: end is not redundant in the case * of varispeed, where end-start != nframes. @@ -111,17 +111,17 @@ public: virtual GraphObject* port(uint32_t index) const; virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } - /** Nodes that are connected to this Node's inputs. */ - std::list<NodeImpl*>& providers() { return _providers; } + /** Blocks that are connected to this Block's inputs. */ + std::list<BlockImpl*>& providers() { return _providers; } - /** Nodes are are connected to this Node's outputs. */ - std::list<NodeImpl*>& dependants() { return _dependants; } + /** Blocks are are connected to this Block's outputs. */ + std::list<BlockImpl*>& dependants() { return _dependants; } - /** Flag node as polyphonic. + /** Flag block as polyphonic. * * Note this will not actually allocate voices etc., prepare_poly * and apply_poly must be called after this function to truly make - * a node polyphonic. + * a block polyphonic. */ virtual void set_polyphonic(bool p) { _polyphonic = p; } @@ -129,13 +129,13 @@ public: virtual bool apply_poly( ProcessContext& context, Raul::Maid& maid, uint32_t poly); - /** Information about the Plugin this Node is an instance of. - * Not the best name - not all nodes come from plugins (e.g. Patch) + /** Information about the Plugin this Block is an instance of. + * Not the best name - not all blocks come from plugins (e.g. Patch) */ virtual PluginImpl* plugin_impl() const { return _plugin; } - /** Information about the Plugin this Node is an instance of. - * Not the best name - not all nodes come from plugins (ie Patch) + /** Information about the Plugin this Block is an instance of. + * Not the best name - not all blocks come from plugins (ie Patch) */ virtual const Plugin* plugin() const; @@ -146,7 +146,7 @@ public: LV2_URID type, uint32_t size); - /** The Patch this Node belongs to. */ + /** The Patch this Block belongs to. */ inline PatchImpl* parent_patch() const { return (PatchImpl*)_parent; } Context::ID context() const { return _context; } @@ -160,10 +160,10 @@ public: protected: PluginImpl* _plugin; Raul::Array<PortImpl*>* _ports; ///< Access in audio thread only - Context::ID _context; ///< Context this node runs in + Context::ID _context; ///< Context this block runs in uint32_t _polyphony; - std::list<NodeImpl*> _providers; ///< Nodes connected to this one's input ports - std::list<NodeImpl*> _dependants; ///< Nodes this one's output ports are connected to + std::list<BlockImpl*> _providers; ///< Blocks connected to this one's input ports + std::list<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to bool _polyphonic; bool _activated; bool _traversed; ///< Flag for process order algorithm @@ -172,4 +172,4 @@ protected: } // namespace Server } // namespace Ingen -#endif // INGEN_ENGINE_NODEIMPL_HPP +#endif // INGEN_ENGINE_BLOCKIMPL_HPP diff --git a/src/server/Broadcaster.cpp b/src/server/Broadcaster.cpp index 33ee5369..ab6b16fb 100644 --- a/src/server/Broadcaster.cpp +++ b/src/server/Broadcaster.cpp @@ -21,7 +21,7 @@ #include "Broadcaster.hpp" #include "PluginImpl.hpp" -#include "NodeFactory.hpp" +#include "BlockFactory.hpp" namespace Ingen { namespace Server { @@ -64,7 +64,7 @@ Broadcaster::client(const Raul::URI& uri) } void -Broadcaster::send_plugins(const NodeFactory::Plugins& plugins) +Broadcaster::send_plugins(const BlockFactory::Plugins& plugins) { Glib::Mutex::Lock lock(_clients_mutex); for (Clients::const_iterator c = _clients.begin(); c != _clients.end(); ++c) { @@ -73,12 +73,12 @@ Broadcaster::send_plugins(const NodeFactory::Plugins& plugins) } void -Broadcaster::send_plugins_to(Interface* client, - const NodeFactory::Plugins& plugins) +Broadcaster::send_plugins_to(Interface* client, + const BlockFactory::Plugins& plugins) { client->bundle_begin(); - for (NodeFactory::Plugins::const_iterator i = plugins.begin(); i != plugins.end(); ++i) { + for (BlockFactory::Plugins::const_iterator i = plugins.begin(); i != plugins.end(); ++i) { const PluginImpl* const plugin = i->second; client->put(plugin->uri(), plugin->properties()); } diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 507e8eec..0bc7576a 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -27,7 +27,7 @@ #include "ingen/Interface.hpp" -#include "NodeFactory.hpp" +#include "BlockFactory.hpp" namespace Ingen { namespace Server { @@ -47,8 +47,8 @@ public: SharedPtr<Interface> client(const Raul::URI& uri); - void send_plugins(const NodeFactory::Plugins& plugin_list); - void send_plugins_to(Interface*, const NodeFactory::Plugins& plugin_list); + void send_plugins(const BlockFactory::Plugins& plugin_list); + void send_plugins_to(Interface*, const BlockFactory::Plugins& plugin_list); #define BROADCAST(msg, ...) \ Glib::Mutex::Lock lock(_clients_mutex); \ diff --git a/src/server/CompiledPatch.hpp b/src/server/CompiledPatch.hpp index 7f973792..15d1137a 100644 --- a/src/server/CompiledPatch.hpp +++ b/src/server/CompiledPatch.hpp @@ -27,42 +27,42 @@ namespace Ingen { namespace Server { class EdgeImpl; -class NodeImpl; +class BlockImpl; -/** All information required about a node to execute it in an audio thread. +/** All information required about a block to execute it in an audio thread. */ -class CompiledNode { +class CompiledBlock { public: - CompiledNode(NodeImpl* n, size_t np, const std::list<NodeImpl*>& d) - : _node(n), _n_providers(np) + CompiledBlock(BlockImpl* b, size_t np, const std::list<BlockImpl*>& d) + : _block(b), _n_providers(np) { // Copy to a vector for maximum iteration speed and cache optimization // (Need to take a copy anyway) _dependants.reserve(d.size()); - for (std::list<NodeImpl*>::const_iterator i = d.begin(); i != d.end(); ++i) + for (std::list<BlockImpl*>::const_iterator i = d.begin(); i != d.end(); ++i) _dependants.push_back(*i); } - NodeImpl* node() const { return _node; } - size_t n_providers() const { return _n_providers; } - const std::vector<NodeImpl*>& dependants() const { return _dependants; } + BlockImpl* block() const { return _block; } + size_t n_providers() const { return _n_providers; } + const std::vector<BlockImpl*>& dependants() const { return _dependants; } private: - NodeImpl* _node; - size_t _n_providers; ///< Number of input ready signals to trigger run - std::vector<NodeImpl*> _dependants; ///< Nodes this one's output ports are connected to + BlockImpl* _block; + size_t _n_providers; ///< Number of input ready signals to trigger run + std::vector<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to }; /** A patch ``compiled'' into a flat structure with the correct order so * the audio thread(s) can execute it without threading problems (since * the preprocessor thread modifies the graph). * - * The nodes contained here are sorted in the order they must be executed. - * The parallel processing algorithm guarantees no node will be executed + * The blocks contained here are sorted in the order they must be executed. + * The parallel processing algorithm guarantees no block will be executed * before its providers, using this order as well as semaphores. */ -class CompiledPatch : public std::vector<CompiledNode> +class CompiledPatch : public std::vector<CompiledBlock> , public Raul::Disposable , public Raul::Noncopyable { diff --git a/src/server/Driver.hpp b/src/server/Driver.hpp index 1d6e7ef0..e038b2bc 100644 --- a/src/server/Driver.hpp +++ b/src/server/Driver.hpp @@ -34,9 +34,10 @@ class EnginePort; /** Engine driver base class. * - * A Driver is, from the perspective of GraphObjects (nodes, patches, ports) an - * interface for managing system ports. An implementation of Driver basically - * needs to manage EnginePorts, and handle writing/reading data to/from them. + * A Driver is, from the perspective of GraphObjects (blocks, patches, ports) + * an interface for managing system ports. An implementation of Driver + * basically needs to manage EnginePorts, and handle writing/reading data + * to/from them. * * \ingroup engine */ diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp index f28831ff..43197844 100644 --- a/src/server/DuplexPort.cpp +++ b/src/server/DuplexPort.cpp @@ -27,7 +27,7 @@ namespace Ingen { namespace Server { DuplexPort::DuplexPort(BufferFactory& bufs, - NodeImpl* parent, + BlockImpl* parent, const Raul::Symbol& symbol, uint32_t index, bool polyphonic, @@ -85,8 +85,8 @@ DuplexPort::pre_process(Context& context) } } else { /* This is a a patch input, which is an output from the internal - perspective. Do whatever a normal node's input port does to prepare - input for reading. */ + perspective. Do whatever a normal block's input port does to + prepare input for reading. */ InputPort::pre_process(context); } } diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp index 90146e40..25d389c5 100644 --- a/src/server/DuplexPort.hpp +++ b/src/server/DuplexPort.hpp @@ -26,14 +26,14 @@ namespace Ingen { namespace Server { -class NodeImpl; +class BlockImpl; /** A duplex Port (both an InputPort and an OutputPort on a Patch) * * This is used for Patch ports, since they need to appear as both an input and * an output port based on context. There are no actual duplex ports in Ingen, * a Port is either an Input or Output. This class only exists to allow Patch - * outputs to appear as inputs to Nodes inside that patch, and vice versa. + * outputs to appear as inputs from within that Patch, and vice versa. * * \ingroup engine */ @@ -43,7 +43,7 @@ class DuplexPort : public InputPort { public: DuplexPort(BufferFactory& bufs, - NodeImpl* parent, + BlockImpl* parent, const Raul::Symbol& symbol, uint32_t index, bool polyphonic, diff --git a/src/server/EdgeImpl.cpp b/src/server/EdgeImpl.cpp index 23b840d4..08096d45 100644 --- a/src/server/EdgeImpl.cpp +++ b/src/server/EdgeImpl.cpp @@ -17,29 +17,27 @@ #include "ingen/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" +#include "BlockImpl.hpp" #include "Buffer.hpp" #include "BufferFactory.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" #include "InputPort.hpp" -#include "NodeImpl.hpp" #include "OutputPort.hpp" #include "PortImpl.hpp" namespace Ingen { namespace Server { -/** Constructor for a edge from a node's output port. +/** Constructor for a edge from a block's output port. * - * This handles both polyphonic and monophonic nodes, transparently to the + * This handles both polyphonic and monophonic blocks, transparently to the * user (InputPort). */ EdgeImpl::EdgeImpl(PortImpl* tail, PortImpl* head) : _tail(tail) , _head(head) { - assert(tail); - assert(head); assert(tail != head); assert(tail->path() != head->path()); } diff --git a/src/server/EdgeImpl.hpp b/src/server/EdgeImpl.hpp index 4a4553b1..0627a7ba 100644 --- a/src/server/EdgeImpl.hpp +++ b/src/server/EdgeImpl.hpp @@ -38,7 +38,7 @@ class InputPort; /** Represents a single inbound connection for an InputPort. * - * This can be a group of ports (ie coming from a polyphonic Node) or + * This can be a group of ports (coming from a polyphonic Block) or * a single Port. This class exists basically as an abstraction of mixing * down polyphonic inputs, so InputPort can just deal with mixing down * multiple connections (oblivious to the polyphonic situation of the diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 4efb9f5e..eada608a 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -25,15 +25,15 @@ #include "raul/Maid.hpp" #include "raul/SharedPtr.hpp" +#include "BlockFactory.hpp" #include "Broadcaster.hpp" #include "BufferFactory.hpp" -#include "DirectDriver.hpp" #include "ControlBindings.hpp" +#include "DirectDriver.hpp" #include "Driver.hpp" #include "Engine.hpp" #include "Event.hpp" #include "EventWriter.hpp" -#include "NodeFactory.hpp" #include "PatchImpl.hpp" #include "PostProcessor.hpp" #include "PreProcessor.hpp" @@ -51,11 +51,11 @@ bool ThreadManager::single_threaded(true); Engine::Engine(Ingen::World* world) : _world(world) + , _block_factory(new BlockFactory(world)) , _broadcaster(new Broadcaster()) , _buffer_factory(new BufferFactory(*this, world->uris())) , _control_bindings(NULL) , _maid(new Raul::Maid()) - , _node_factory(new NodeFactory(world)) , _pre_processor(new PreProcessor()) , _post_processor(new PostProcessor(*this)) , _event_writer(new EventWriter(*this)) @@ -92,7 +92,7 @@ Engine::~Engine() delete _maid; delete _pre_processor; delete _post_processor; - delete _node_factory; + delete _block_factory; delete _control_bindings; delete _broadcaster; delete _event_writer; diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index ca844261..66930938 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -40,7 +40,7 @@ class ControlBindings; class Driver; class Event; class EventWriter; -class NodeFactory; +class BlockFactory; class PostProcessor; class PreProcessor; class ProcessContext; @@ -92,12 +92,12 @@ public: Ingen::World* world() const { return _world; } EventWriter* interface() const { return _event_writer; } + BlockFactory* block_factory() const { return _block_factory; } Broadcaster* broadcaster() const { return _broadcaster; } BufferFactory* buffer_factory() const { return _buffer_factory; } ControlBindings* control_bindings() const { return _control_bindings; } Driver* driver() const { return _driver.get(); } Log& log() const { return _world->log(); } - NodeFactory* node_factory() const { return _node_factory; } PatchImpl* root_patch() const { return _root_patch; } PostProcessor* post_processor() const { return _post_processor; } Raul::Maid* maid() const { return _maid; } @@ -112,12 +112,12 @@ public: private: Ingen::World* _world; + BlockFactory* _block_factory; Broadcaster* _broadcaster; BufferFactory* _buffer_factory; ControlBindings* _control_bindings; SharedPtr<Driver> _driver; Raul::Maid* _maid; - NodeFactory* _node_factory; PreProcessor* _pre_processor; PostProcessor* _post_processor; EventWriter* _event_writer; diff --git a/src/server/GraphObjectImpl.cpp b/src/server/GraphObjectImpl.cpp index 212e5196..d5608b0f 100644 --- a/src/server/GraphObjectImpl.cpp +++ b/src/server/GraphObjectImpl.cpp @@ -45,7 +45,7 @@ GraphObjectImpl::get_property(const Raul::URI& key) const PatchImpl* GraphObjectImpl::parent_patch() const { - return dynamic_cast<PatchImpl*>((NodeImpl*)_parent); + return dynamic_cast<PatchImpl*>((BlockImpl*)_parent); } } // namespace Server diff --git a/src/server/GraphObjectImpl.hpp b/src/server/GraphObjectImpl.hpp index bfc97fb1..5388981f 100644 --- a/src/server/GraphObjectImpl.hpp +++ b/src/server/GraphObjectImpl.hpp @@ -40,7 +40,7 @@ class Context; class ProcessContext; class BufferFactory; -/** An object on the audio graph - Patch, Node, Port, etc. +/** An object on the audio graph (a Patch, Block, or Port). * * Each of these is a Raul::Deletable and so can be deleted in a realtime safe * way from anywhere, and they all have a map of variable for clients to store diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index 0bce5b93..fff29f30 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -20,12 +20,12 @@ #include "ingen/Log.hpp" #include "ingen/URIs.hpp" +#include "BlockImpl.hpp" #include "Buffer.hpp" #include "BufferFactory.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" #include "InputPort.hpp" -#include "NodeImpl.hpp" #include "OutputPort.hpp" #include "PatchImpl.hpp" #include "ProcessContext.hpp" @@ -37,7 +37,7 @@ namespace Ingen { namespace Server { InputPort::InputPort(BufferFactory& bufs, - NodeImpl* parent, + BlockImpl* parent, const Raul::Symbol& symbol, uint32_t index, uint32_t poly, @@ -159,7 +159,7 @@ InputPort::remove_edge(ProcessContext& context, const OutputPort* tail) uint32_t InputPort::max_tail_poly(Context& context) const { - return parent_node()->parent_patch()->internal_poly_process(); + return parent_block()->parent_patch()->internal_poly_process(); } static void diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index d4d565af..40650415 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -32,11 +32,11 @@ namespace Server { class EdgeImpl; class Context; -class NodeImpl; +class BlockImpl; class OutputPort; class ProcessContext; -/** An input port on a Node or Patch. +/** An input port on a Block or Patch. * * All ports have a Buffer, but the actual contents (data) of that buffer may be * set directly to the incoming edge's buffer if there's only one inbound @@ -51,7 +51,7 @@ class InputPort : virtual public PortImpl { public: InputPort(BufferFactory& bufs, - NodeImpl* parent, + BlockImpl* parent, const Raul::Symbol& symbol, uint32_t index, uint32_t poly, diff --git a/src/server/InternalPlugin.cpp b/src/server/InternalPlugin.cpp index 60a5699c..0e15fd9d 100644 --- a/src/server/InternalPlugin.cpp +++ b/src/server/InternalPlugin.cpp @@ -42,7 +42,7 @@ InternalPlugin::InternalPlugin(URIs& uris, set_property(uris.rdf_type, uris.ingen_Internal); } -NodeImpl* +BlockImpl* InternalPlugin::instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, diff --git a/src/server/InternalPlugin.hpp b/src/server/InternalPlugin.hpp index bb90f5e6..29753c69 100644 --- a/src/server/InternalPlugin.hpp +++ b/src/server/InternalPlugin.hpp @@ -29,7 +29,7 @@ namespace Ingen { namespace Server { -class NodeImpl; +class BlockImpl; class BufferFactory; /** Implementation of an Internal plugin. @@ -41,11 +41,11 @@ public: const Raul::URI& uri, const Raul::Symbol& symbol); - NodeImpl* instantiate(BufferFactory& bufs, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - Engine& engine); + BlockImpl* instantiate(BufferFactory& bufs, + const Raul::Symbol& symbol, + bool polyphonic, + PatchImpl* parent, + Engine& engine); const Raul::Symbol symbol() const { return _symbol; } diff --git a/src/server/LV2Node.cpp b/src/server/LV2Block.cpp index 654aeab0..d26f7417 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Block.cpp @@ -33,7 +33,7 @@ #include "Driver.hpp" #include "Engine.hpp" #include "InputPort.hpp" -#include "LV2Node.hpp" +#include "LV2Block.hpp" #include "LV2Plugin.hpp" #include "OutputPort.hpp" #include "PatchImpl.hpp" @@ -44,17 +44,17 @@ using namespace std; namespace Ingen { namespace Server { -/** Partially construct a LV2Node. +/** Partially construct a LV2Block. * * Object is not usable until instantiate() is called with success. * (It _will_ crash!) */ -LV2Node::LV2Node(LV2Plugin* plugin, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - SampleRate srate) - : NodeImpl(plugin, symbol, polyphonic, parent, srate) +LV2Block::LV2Block(LV2Plugin* plugin, + const Raul::Symbol& symbol, + bool polyphonic, + PatchImpl* parent, + SampleRate srate) +: BlockImpl(plugin, symbol, polyphonic, parent, srate) , _lv2_plugin(plugin) , _instances(NULL) , _prepared_instances(NULL) @@ -63,16 +63,16 @@ LV2Node::LV2Node(LV2Plugin* plugin, assert(_lv2_plugin); } -LV2Node::~LV2Node() +LV2Block::~LV2Block() { delete _instances; } SharedPtr<LilvInstance> -LV2Node::make_instance(URIs& uris, - SampleRate rate, - uint32_t voice, - bool preparing) +LV2Block::make_instance(URIs& uris, + SampleRate rate, + uint32_t voice, + bool preparing) { LilvInstance* inst = lilv_plugin_instantiate( _lv2_plugin->lilv_plugin(), rate, _features->array()); @@ -132,12 +132,12 @@ LV2Node::make_instance(URIs& uris, } bool -LV2Node::prepare_poly(BufferFactory& bufs, uint32_t poly) +LV2Block::prepare_poly(BufferFactory& bufs, uint32_t poly) { if (!_polyphonic) poly = 1; - NodeImpl::prepare_poly(bufs, poly); + BlockImpl::prepare_poly(bufs, poly); if (_polyphony == poly) return true; @@ -162,7 +162,7 @@ LV2Node::prepare_poly(BufferFactory& bufs, uint32_t poly) } bool -LV2Node::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) +LV2Block::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) { if (!_polyphonic) poly = 1; @@ -174,7 +174,7 @@ LV2Node::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) } assert(poly <= _instances->size()); - return NodeImpl::apply_poly(context, maid, poly); + return BlockImpl::apply_poly(context, maid, poly); } /** Instantiate self from LV2 plugin descriptor. @@ -186,7 +186,7 @@ LV2Node::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) * value is false, this object may not be used. */ bool -LV2Node::instantiate(BufferFactory& bufs) +LV2Block::instantiate(BufferFactory& bufs) { const Ingen::URIs& uris = bufs.uris(); SharedPtr<LV2Info> info = _lv2_plugin->lv2_info(); @@ -388,36 +388,36 @@ LV2Node::instantiate(BufferFactory& bufs) } void -LV2Node::activate(BufferFactory& bufs) +LV2Block::activate(BufferFactory& bufs) { - NodeImpl::activate(bufs); + BlockImpl::activate(bufs); for (uint32_t i = 0; i < _polyphony; ++i) lilv_instance_activate(instance(i)); } void -LV2Node::deactivate() +LV2Block::deactivate() { - NodeImpl::deactivate(); + BlockImpl::deactivate(); for (uint32_t i = 0; i < _polyphony; ++i) lilv_instance_deactivate(instance(i)); } LV2_Worker_Status -LV2Node::work_respond(LV2_Worker_Respond_Handle handle, - uint32_t size, - const void* data) +LV2Block::work_respond(LV2_Worker_Respond_Handle handle, + uint32_t size, + const void* data) { - LV2Node* node = (LV2Node*)handle; - LV2Node::Response* r = new LV2Node::Response(size, data); - node->_responses.push_back(*r); + LV2Block* block = (LV2Block*)handle; + LV2Block::Response* r = new LV2Block::Response(size, data); + block->_responses.push_back(*r); return LV2_WORKER_SUCCESS; } void -LV2Node::work(uint32_t size, const void* data) +LV2Block::work(uint32_t size, const void* data) { if (_worker_iface) { LV2_Handle inst = lilv_instance_get_handle(instance(0)); @@ -429,9 +429,9 @@ LV2Node::work(uint32_t size, const void* data) } void -LV2Node::process(ProcessContext& context) +LV2Block::process(ProcessContext& context) { - NodeImpl::pre_process(context); + BlockImpl::pre_process(context); for (uint32_t i = 0; i < _polyphony; ++i) lilv_instance_run(instance(i), context.nframes()); @@ -450,18 +450,18 @@ LV2Node::process(ProcessContext& context) } } - NodeImpl::post_process(context); + BlockImpl::post_process(context); } void -LV2Node::set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf) +LV2Block::set_port_buffer(uint32_t voice, + uint32_t port_num, + BufferRef buf) { - NodeImpl::set_port_buffer(voice, port_num, buf); + BlockImpl::set_port_buffer(voice, port_num, buf); lilv_instance_connect_port( instance(voice), port_num, - buf ? buf->port_data(_ports->at(port_num)->type()) : NULL); + buf ? buf->port_data(_ports->at(port_num)->type()) : NULL); } } // namespace Server diff --git a/src/server/LV2Node.hpp b/src/server/LV2Block.hpp index e7f8eae6..3746b201 100644 --- a/src/server/LV2Node.hpp +++ b/src/server/LV2Block.hpp @@ -14,15 +14,15 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_ENGINE_LV2NODE_HPP -#define INGEN_ENGINE_LV2NODE_HPP +#ifndef INGEN_ENGINE_LV2BLOCK_HPP +#define INGEN_ENGINE_LV2BLOCK_HPP #include "lilv/lilv.h" #include "lv2/lv2plug.in/ns/ext/worker/worker.h" #include "raul/Disposable.hpp" #include "BufferRef.hpp" -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" #include "ingen/LV2Features.hpp" #include "types.hpp" @@ -35,16 +35,16 @@ class LV2Plugin; * * \ingroup engine */ -class LV2Node : public NodeImpl +class LV2Block : public BlockImpl { public: - LV2Node(LV2Plugin* plugin, + LV2Block(LV2Plugin* plugin, const Raul::Symbol& symbol, bool polyphonic, PatchImpl* parent, SampleRate srate); - ~LV2Node(); + ~LV2Block(); bool instantiate(BufferFactory& bufs); @@ -112,5 +112,5 @@ protected: } // namespace Server } // namespace Ingen -#endif // INGEN_ENGINE_LV2NODE_HPP +#endif // INGEN_ENGINE_LV2BLOCK_HPP diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index 0e2a16b2..0febfc7d 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -20,7 +20,7 @@ #include "Driver.hpp" #include "Engine.hpp" -#include "LV2Node.hpp" +#include "LV2Block.hpp" #include "LV2Plugin.hpp" using namespace std; @@ -56,21 +56,21 @@ LV2Plugin::symbol() const return Raul::Symbol("lv2_symbol"); } -NodeImpl* +BlockImpl* LV2Plugin::instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, PatchImpl* parent, Engine& engine) { - LV2Node* n = new LV2Node( + LV2Block* b = new LV2Block( this, symbol, polyphonic, parent, engine.driver()->sample_rate()); - if (!n->instantiate(bufs)) { - delete n; + if (!b->instantiate(bufs)) { + delete b; return NULL; } else { - return n; + return b; } } diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp index 226d61ab..ed26b4ae 100644 --- a/src/server/LV2Plugin.hpp +++ b/src/server/LV2Plugin.hpp @@ -30,7 +30,7 @@ namespace Ingen { namespace Server { class PatchImpl; -class NodeImpl; +class BlockImpl; /** Implementation of an LV2 plugin (loaded shared library). */ @@ -39,11 +39,11 @@ class LV2Plugin : public PluginImpl public: LV2Plugin(SharedPtr<LV2Info> lv2_info, const Raul::URI& uri); - NodeImpl* instantiate(BufferFactory& bufs, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - Engine& engine); + BlockImpl* instantiate(BufferFactory& bufs, + const Raul::Symbol& symbol, + bool polyphonic, + PatchImpl* parent, + Engine& engine); const Raul::Symbol symbol() const; diff --git a/src/server/LV2ResizeFeature.hpp b/src/server/LV2ResizeFeature.hpp index eeab3d4a..5b385a2f 100644 --- a/src/server/LV2ResizeFeature.hpp +++ b/src/server/LV2ResizeFeature.hpp @@ -20,9 +20,9 @@ #include "ingen/LV2Features.hpp" #include "lv2/lv2plug.in/ns/ext/resize-port/resize-port.h" -#include "NodeImpl.hpp" -#include "PortImpl.hpp" +#include "BlockImpl.hpp" #include "Buffer.hpp" +#include "PortImpl.hpp" namespace Ingen { namespace Server { @@ -32,9 +32,9 @@ struct ResizeFeature : public Ingen::LV2Features::Feature { LV2_Resize_Port_Feature_Data data, uint32_t index, size_t size) { - NodeImpl* node = (NodeImpl*)data; - PortImpl* port = node->port_impl(index); - if (node->context() == Context::MESSAGE) { + BlockImpl* block = (BlockImpl*)data; + PortImpl* port = block->port_impl(index); + if (block->context() == Context::MESSAGE) { port->buffer(0)->resize(size); port->connect_buffers(); return LV2_RESIZE_PORT_SUCCESS; @@ -48,12 +48,12 @@ struct ResizeFeature : public Ingen::LV2Features::Feature { } SharedPtr<LV2_Feature> feature(World* w, GraphObject* n) { - NodeImpl* node = dynamic_cast<NodeImpl*>(n); - if (!node) + BlockImpl* block = dynamic_cast<BlockImpl*>(n); + if (!block) return SharedPtr<LV2_Feature>(); LV2_Resize_Port_Resize* data = (LV2_Resize_Port_Resize*)malloc(sizeof(LV2_Resize_Port_Resize)); - data->data = node; + data->data = block; data->resize = &resize_port; LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); f->URI = LV2_RESIZE_PORT_URI; diff --git a/src/server/OutputPort.cpp b/src/server/OutputPort.cpp index 7558dda3..1fa53451 100644 --- a/src/server/OutputPort.cpp +++ b/src/server/OutputPort.cpp @@ -19,7 +19,7 @@ #include "Buffer.hpp" #include "BufferFactory.hpp" #include "Engine.hpp" -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" #include "OutputPort.hpp" using namespace std; @@ -28,7 +28,7 @@ namespace Ingen { namespace Server { OutputPort::OutputPort(BufferFactory& bufs, - NodeImpl* parent, + BlockImpl* parent, const Raul::Symbol& symbol, uint32_t index, uint32_t poly, diff --git a/src/server/OutputPort.hpp b/src/server/OutputPort.hpp index 2156c2ab..b117847f 100644 --- a/src/server/OutputPort.hpp +++ b/src/server/OutputPort.hpp @@ -39,7 +39,7 @@ class OutputPort : virtual public PortImpl { public: OutputPort(BufferFactory& bufs, - NodeImpl* parent, + BlockImpl* parent, const Raul::Symbol& symbol, uint32_t index, uint32_t poly, diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index b280886e..ae16c634 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -20,11 +20,11 @@ #include "ingen/URIs.hpp" #include "ingen/World.hpp" +#include "BlockImpl.hpp" #include "BufferFactory.hpp" -#include "EdgeImpl.hpp" #include "DuplexPort.hpp" +#include "EdgeImpl.hpp" #include "Engine.hpp" -#include "NodeImpl.hpp" #include "PatchImpl.hpp" #include "PatchPlugin.hpp" #include "PortImpl.hpp" @@ -41,10 +41,10 @@ PatchImpl::PatchImpl(Engine& engine, PatchImpl* parent, SampleRate srate, uint32_t internal_poly) - : NodeImpl(new PatchPlugin(engine.world()->uris(), - engine.world()->uris().ingen_Patch, - Raul::Symbol("patch"), - "Ingen Patch"), + : BlockImpl(new PatchPlugin(engine.world()->uris(), + engine.world()->uris().ingen_Patch, + Raul::Symbol("patch"), + "Ingen Patch"), symbol, poly, parent, srate) , _engine(engine) , _poly_pre(internal_poly) @@ -65,9 +65,9 @@ PatchImpl::~PatchImpl() void PatchImpl::activate(BufferFactory& bufs) { - NodeImpl::activate(bufs); + BlockImpl::activate(bufs); - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->activate(bufs); } @@ -78,9 +78,9 @@ void PatchImpl::deactivate() { if (_activated) { - NodeImpl::deactivate(); + BlockImpl::deactivate(); - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { if (i->activated()) { i->deactivate(); } @@ -104,7 +104,7 @@ PatchImpl::prepare_internal_poly(BufferFactory& bufs, uint32_t poly) // TODO: Subpatch dynamic polyphony (i.e. changing port polyphony) - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->prepare_poly(bufs, poly); } @@ -120,11 +120,11 @@ PatchImpl::apply_internal_poly(ProcessContext& context, { // TODO: Subpatch dynamic polyphony (i.e. changing port polyphony) - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->apply_poly(context, maid, poly); } - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { for (uint32_t j = 0; j < i->num_ports(); ++j) { PortImpl* const port = i->port_impl(j); if (port->is_input() && dynamic_cast<InputPort*>(port)->direct_connect()) @@ -143,7 +143,7 @@ PatchImpl::apply_internal_poly(ProcessContext& context, /** Run the patch for the specified number of frames. * - * Calls all Nodes in (roughly, if parallel) the order _compiled_patch specifies. + * Calls all Blocks in (roughly, if parallel) the order _compiled_patch specifies. */ void PatchImpl::process(ProcessContext& context) @@ -151,16 +151,16 @@ PatchImpl::process(ProcessContext& context) if (!_process) return; - NodeImpl::pre_process(context); + BlockImpl::pre_process(context); if (_compiled_patch && _compiled_patch->size() > 0) { - // Run all nodes + // Run all blocks for (size_t i = 0; i < _compiled_patch->size(); ++i) { - (*_compiled_patch)[i].node()->process(context); + (*_compiled_patch)[i].block()->process(context); } } - NodeImpl::post_process(context); + BlockImpl::post_process(context); } void @@ -169,31 +169,31 @@ PatchImpl::set_buffer_size(Context& context, LV2_URID type, uint32_t size) { - NodeImpl::set_buffer_size(context, bufs, type, size); + BlockImpl::set_buffer_size(context, bufs, type, size); for (size_t i = 0; i < _compiled_patch->size(); ++i) - (*_compiled_patch)[i].node()->set_buffer_size(context, bufs, type, size); + (*_compiled_patch)[i].block()->set_buffer_size(context, bufs, type, size); } // Patch specific stuff -/** Add a node. +/** Add a block. * Preprocessing thread only. */ void -PatchImpl::add_node(NodeImpl& node) +PatchImpl::add_block(BlockImpl& block) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - _nodes.push_front(node); + _blocks.push_front(block); } -/** Remove a node. +/** Remove a block. * Preprocessing thread only. */ void -PatchImpl::remove_node(NodeImpl& node) +PatchImpl::remove_block(BlockImpl& block) { - _nodes.erase(_nodes.iterator_to(node)); + _blocks.erase(_blocks.iterator_to(block)); } void @@ -317,7 +317,7 @@ PatchImpl::build_ports_array() } static inline void -compile_recursive(NodeImpl* n, CompiledPatch* output) +compile_recursive(BlockImpl* n, CompiledPatch* output) { if (n == NULL || n->traversed()) return; @@ -325,12 +325,12 @@ compile_recursive(NodeImpl* n, CompiledPatch* output) n->traversed(true); assert(output != NULL); - for (std::list<NodeImpl*>::iterator i = n->providers().begin(); + for (std::list<BlockImpl*>::iterator i = n->providers().begin(); i != n->providers().end(); ++i) if (!(*i)->traversed()) compile_recursive(*i, output); - output->push_back(CompiledNode(n, n->providers().size(), n->dependants())); + output->push_back(CompiledBlock(n, n->providers().size(), n->dependants())); } /** Find the process order for this Patch. @@ -350,25 +350,25 @@ PatchImpl::compile() CompiledPatch* const compiled_patch = new CompiledPatch(); - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->traversed(false); } - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { // Either a sink or connected to our output ports: if (!i->traversed() && i->dependants().empty()) { compile_recursive(&*i, compiled_patch); } } - // Traverse any nodes we didn't hit yet - for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { + // Traverse any blocks we didn't hit yet + for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { if (!i->traversed()) { compile_recursive(&*i, compiled_patch); } } - if (compiled_patch->size() != _nodes.size()) { + if (compiled_patch->size() != _blocks.size()) { _engine.log().error(Raul::fmt("Failed to compile patch %1%\n") % _path); delete compiled_patch; return NULL; diff --git a/src/server/PatchImpl.hpp b/src/server/PatchImpl.hpp index badbfb81..fa212b1a 100644 --- a/src/server/PatchImpl.hpp +++ b/src/server/PatchImpl.hpp @@ -19,9 +19,9 @@ #include <cstdlib> +#include "BlockImpl.hpp" #include "CompiledPatch.hpp" #include "DuplexPort.hpp" -#include "NodeImpl.hpp" #include "PluginImpl.hpp" #include "PortType.hpp" #include "ThreadManager.hpp" @@ -38,15 +38,15 @@ class Context; class Engine; class ProcessContext; -/** A group of nodes in a graph, possibly polyphonic. +/** A group of blocks in a graph, possibly polyphonic. * - * Note that this is also a Node, just one which contains Nodes. + * Note that this is also a Block, just one which contains Blocks. * Therefore infinite subpatching is possible, of polyphonic - * patches of polyphonic nodes etc. etc. + * patches of polyphonic blocks etc. etc. * * \ingroup engine */ -class PatchImpl : public NodeImpl +class PatchImpl : public BlockImpl { public: PatchImpl(Engine& engine, @@ -91,16 +91,16 @@ public: Raul::Maid& maid, uint32_t poly); - // Patch specific stuff not inherited from Node + // Patch specific stuff not inherited from Block typedef boost::intrusive::slist< - NodeImpl, boost::intrusive::constant_time_size<true> > Nodes; + BlockImpl, boost::intrusive::constant_time_size<true> > Blocks; - void add_node(NodeImpl& node); - void remove_node(NodeImpl& node); + void add_block(BlockImpl& block); + void remove_block(BlockImpl& block); - Nodes& nodes() { return _nodes; } - const Nodes& nodes() const { return _nodes; } + Blocks& blocks() { return _blocks; } + const Blocks& blocks() const { return _blocks; } uint32_t num_ports_non_rt() const; @@ -161,7 +161,7 @@ private: CompiledPatch* _compiled_patch; ///< Process thread only Ports _inputs; ///< Pre-process thread only Ports _outputs; ///< Pre-process thread only - Nodes _nodes; ///< Pre-process thread only + Blocks _blocks; ///< Pre-process thread only bool _process; }; diff --git a/src/server/PatchPlugin.hpp b/src/server/PatchPlugin.hpp index ba1cfa40..1fd9069f 100644 --- a/src/server/PatchPlugin.hpp +++ b/src/server/PatchPlugin.hpp @@ -23,7 +23,7 @@ namespace Ingen { namespace Server { -class NodeImpl; +class BlockImpl; /** Implementation of a Patch plugin. * @@ -39,11 +39,11 @@ public: : PluginImpl(uris, Plugin::Patch, uri) {} - NodeImpl* instantiate(BufferFactory& bufs, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - Engine& engine) + BlockImpl* instantiate(BufferFactory& bufs, + const Raul::Symbol& symbol, + bool polyphonic, + PatchImpl* parent, + Engine& engine) { return NULL; } diff --git a/src/server/PluginImpl.hpp b/src/server/PluginImpl.hpp index 13e78b1f..624b3f6d 100644 --- a/src/server/PluginImpl.hpp +++ b/src/server/PluginImpl.hpp @@ -32,14 +32,14 @@ class URIs; namespace Server { -class PatchImpl; -class NodeImpl; -class Engine; +class BlockImpl; class BufferFactory; +class Engine; +class PatchImpl; /** Implementation of a plugin (internal code, or a loaded shared library). * - * Conceptually, a Node is an instance of this. + * Conceptually, a Block is an instance of this. */ class PluginImpl : public Plugin , public boost::noncopyable @@ -52,11 +52,11 @@ public: , _type(type) {} - virtual NodeImpl* instantiate(BufferFactory& bufs, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - Engine& engine) = 0; + virtual BlockImpl* instantiate(BufferFactory& bufs, + const Raul::Symbol& symbol, + bool polyphonic, + PatchImpl* parent, + Engine& engine) = 0; virtual const Raul::Symbol symbol() const = 0; diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index 698cd458..bd088913 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -19,10 +19,10 @@ #include "raul/Array.hpp" #include "raul/Maid.hpp" +#include "BlockImpl.hpp" #include "Buffer.hpp" #include "BufferFactory.hpp" #include "Engine.hpp" -#include "NodeImpl.hpp" #include "PortImpl.hpp" #include "PortType.hpp" #include "ThreadManager.hpp" @@ -33,7 +33,7 @@ namespace Ingen { namespace Server { PortImpl::PortImpl(BufferFactory& bufs, - NodeImpl* const node, + BlockImpl* const block, const Raul::Symbol& name, uint32_t index, uint32_t poly, @@ -41,7 +41,7 @@ PortImpl::PortImpl(BufferFactory& bufs, LV2_URID buffer_type, const Raul::Atom& value, size_t buffer_size) - : GraphObjectImpl(bufs.uris(), node, name) + : GraphObjectImpl(bufs.uris(), block, name) , _bufs(bufs) , _index(index) , _poly(poly) @@ -64,7 +64,7 @@ PortImpl::PortImpl(BufferFactory& bufs, , _is_sample_rate(false) , _is_toggled(false) { - assert(node != NULL); + assert(block != NULL); assert(_poly > 0); const Ingen::URIs& uris = bufs.uris(); @@ -163,7 +163,7 @@ PortImpl::set_voice_value(const Context& context, break; case PortType::AUDIO: case PortType::CV: { - // Time may be at end so internal nodes can set triggers + // Time may be at end so internal blocks can set triggers assert(time >= context.start()); assert(time <= context.start() + context.nframes()); @@ -298,7 +298,7 @@ void PortImpl::connect_buffers() { for (uint32_t v = 0; v < _poly; ++v) - PortImpl::parent_node()->set_port_buffer(v, _index, buffer(v)); + PortImpl::parent_block()->set_port_buffer(v, _index, buffer(v)); } void diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index 68787db8..d7aed3ff 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -33,14 +33,10 @@ namespace Raul { class Maid; } namespace Ingen { namespace Server { -class NodeImpl; +class BlockImpl; class BufferFactory; -/** A port on a Node. - * - * This is a non-template abstract base class, which basically exists so - * things can pass around Port pointers and not have to worry about type, - * templates, etc. +/** A port (input or output) on a Block. * * \ingroup engine */ @@ -51,8 +47,8 @@ public: virtual GraphType graph_type() const { return PORT; } - /** A port's parent is always a node, so static cast should be safe */ - NodeImpl* parent_node() const { return (NodeImpl*)_parent; } + /** A port's parent is always a block, so static cast should be safe */ + BlockImpl* parent_block() const { return (BlockImpl*)_parent; } /** Set the buffers array for this port. * @@ -175,7 +171,7 @@ public: protected: PortImpl(BufferFactory& bufs, - NodeImpl* node, + BlockImpl* block, const Raul::Symbol& name, uint32_t index, uint32_t poly, diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp index e8c51335..6a39cba8 100644 --- a/src/server/Worker.cpp +++ b/src/server/Worker.cpp @@ -20,7 +20,7 @@ #include "Driver.hpp" #include "Engine.hpp" -#include "LV2Node.hpp" +#include "LV2Block.hpp" #include "PatchImpl.hpp" #include "Worker.hpp" @@ -29,8 +29,8 @@ namespace Server { /// A message in the Worker::_requests ring struct MessageHeader { - LV2Node* node; ///< Node this message is from - uint32_t size; ///< Size of following data + LV2Block* block; ///< Node this message is from + uint32_t size; ///< Size of following data // `size' bytes of data follow here }; @@ -39,25 +39,25 @@ schedule(LV2_Worker_Schedule_Handle handle, uint32_t size, const void* data) { - LV2Node* node = (LV2Node*)handle; - Engine& engine = node->parent_patch()->engine(); - Worker* worker = engine.worker(); + LV2Block* block = (LV2Block*)handle; + Engine& engine = block->parent_patch()->engine(); + Worker* worker = engine.worker(); - return worker->request(node, size, data); + return worker->request(block, size, data); } LV2_Worker_Status -Worker::request(LV2Node* node, +Worker::request(LV2Block* block, uint32_t size, const void* data) { - Engine& engine = node->parent_patch()->engine(); + Engine& engine = block->parent_patch()->engine(); if (_requests.write_space() < sizeof(MessageHeader) + size) { engine.log().error("Work request ring overflow\n"); return LV2_WORKER_ERR_NO_SPACE; } - const MessageHeader msg = { node, size }; + const MessageHeader msg = { block, size }; if (_requests.write(sizeof(msg), &msg) != sizeof(msg)) { engine.log().error("Error writing header to work request ring\n"); return LV2_WORKER_ERR_UNKNOWN; @@ -82,14 +82,14 @@ delete_feature(LV2_Feature* feature) SharedPtr<LV2_Feature> Worker::Schedule::feature(World* world, GraphObject* n) { - LV2Node* node = dynamic_cast<LV2Node*>(n); - if (!node) { + LV2Block* block = dynamic_cast<LV2Block*>(n); + if (!block) { return SharedPtr<LV2_Feature>(); } LV2_Worker_Schedule* data = (LV2_Worker_Schedule*)malloc( sizeof(LV2_Worker_Schedule)); - data->handle = node; + data->handle = block; data->schedule_work = schedule; LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); @@ -139,7 +139,7 @@ Worker::_run() continue; } - msg.node->work(msg.size, _buffer); + msg.block->work(msg.size, _buffer); } } } diff --git a/src/server/Worker.hpp b/src/server/Worker.hpp index 0310de90..f8c9216e 100644 --- a/src/server/Worker.hpp +++ b/src/server/Worker.hpp @@ -29,7 +29,7 @@ class Log; namespace Server { -class LV2Node; +class LV2Block; class Worker : public Raul::Thread { @@ -41,7 +41,7 @@ public: SharedPtr<LV2_Feature> feature(World* world, GraphObject* n); }; - LV2_Worker_Status request(LV2Node* node, + LV2_Worker_Status request(LV2Block* block, uint32_t size, const void* data); diff --git a/src/server/events.hpp b/src/server/events.hpp index cf764fa9..95f3d35f 100644 --- a/src/server/events.hpp +++ b/src/server/events.hpp @@ -18,7 +18,7 @@ #define INGEN_ENGINE_EVENTS_HPP #include "events/Connect.hpp" -#include "events/CreateNode.hpp" +#include "events/CreateBlock.hpp" #include "events/CreatePatch.hpp" #include "events/CreatePort.hpp" #include "events/Delete.hpp" diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 2403b327..db8e044f 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -70,15 +70,15 @@ Connect::pre_process() return Event::pre_process_done(BAD_REQUEST, _head_path); } - NodeImpl* const tail_node = tail_output->parent_node(); - NodeImpl* const head_node = _head->parent_node(); - if (!tail_node || !head_node) { + BlockImpl* const tail_block = tail_output->parent_block(); + BlockImpl* const head_block = _head->parent_block(); + if (!tail_block || !head_block) { return Event::pre_process_done(PARENT_NOT_FOUND, _head_path); } - if (tail_node->parent() != head_node->parent() - && tail_node != head_node->parent() - && tail_node->parent() != head_node) { + if (tail_block->parent() != head_block->parent() + && tail_block != head_block->parent() + && tail_block->parent() != head_block) { return Event::pre_process_done(PARENT_DIFFERS, _head_path); } @@ -86,20 +86,20 @@ Connect::pre_process() return Event::pre_process_done(TYPE_MISMATCH, _head_path); } - if (tail_node->parent_patch() != head_node->parent_patch()) { + if (tail_block->parent_patch() != head_block->parent_patch()) { // Edge to a patch port from inside the patch - assert(tail_node->parent() == head_node || head_node->parent() == tail_node); - if (tail_node->parent() == head_node) { - _patch = dynamic_cast<PatchImpl*>(head_node); + assert(tail_block->parent() == head_block || head_block->parent() == tail_block); + if (tail_block->parent() == head_block) { + _patch = dynamic_cast<PatchImpl*>(head_block); } else { - _patch = dynamic_cast<PatchImpl*>(tail_node); + _patch = dynamic_cast<PatchImpl*>(tail_block); } - } else if (tail_node == head_node && dynamic_cast<PatchImpl*>(tail_node)) { + } else if (tail_block == head_block && dynamic_cast<PatchImpl*>(tail_block)) { // Edge from a patch input to a patch output (pass through) - _patch = dynamic_cast<PatchImpl*>(tail_node); + _patch = dynamic_cast<PatchImpl*>(tail_block); } else { - // Normal edge between nodes with the same parent - _patch = tail_node->parent_patch(); + // Normal edge between blocks with the same parent + _patch = tail_block->parent_patch(); } if (_patch->has_edge(tail_output, _head)) { @@ -114,12 +114,12 @@ Connect::pre_process() Glib::RWLock::ReaderLock wlock(_engine.store()->lock()); /* Need to be careful about patch port edges here and adding a - node's parent as a dependant/provider, or adding a patch as its own + block's parent as a dependant/provider, or adding a patch as its own provider... */ - if (tail_node != head_node && tail_node->parent() == head_node->parent()) { - head_node->providers().push_back(tail_node); - tail_node->dependants().push_back(head_node); + if (tail_block != head_block && tail_block->parent() == head_block->parent()) { + head_block->providers().push_back(tail_block); + tail_block->dependants().push_back(head_block); } _patch->add_edge(_edge); diff --git a/src/server/events/CreateNode.cpp b/src/server/events/CreateBlock.cpp index ca2be305..73ff7ba2 100644 --- a/src/server/events/CreateNode.cpp +++ b/src/server/events/CreateBlock.cpp @@ -19,11 +19,11 @@ #include "raul/Maid.hpp" #include "raul/Path.hpp" +#include "BlockFactory.hpp" +#include "BlockImpl.hpp" #include "Broadcaster.hpp" -#include "CreateNode.hpp" +#include "CreateBlock.hpp" #include "Engine.hpp" -#include "NodeFactory.hpp" -#include "NodeImpl.hpp" #include "PatchImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -32,22 +32,22 @@ namespace Ingen { namespace Server { namespace Events { -CreateNode::CreateNode(Engine& engine, - SharedPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties) +CreateBlock::CreateBlock(Engine& engine, + SharedPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Resource::Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) , _patch(NULL) - , _node(NULL) + , _block(NULL) , _compiled_patch(NULL) {} bool -CreateNode::pre_process() +CreateBlock::pre_process() { Ingen::URIs& uris = _engine.world()->uris(); @@ -75,7 +75,7 @@ CreateNode::pre_process() } const Raul::URI plugin_uri(plugin_uri_str); - PluginImpl* plugin = _engine.node_factory()->plugin(plugin_uri); + PluginImpl* plugin = _engine.block_factory()->plugin(plugin_uri); if (!plugin) { return Event::pre_process_done(PLUGIN_NOT_FOUND, Raul::URI(plugin_uri)); } @@ -86,7 +86,7 @@ CreateNode::pre_process() p->second.type() == _engine.world()->forge().Bool && p->second.get_bool()); - if (!(_node = plugin->instantiate(*_engine.buffer_factory(), + if (!(_block = plugin->instantiate(*_engine.buffer_factory(), Raul::Symbol(_path.symbol()), polyphonic, _patch, @@ -94,23 +94,23 @@ CreateNode::pre_process() return Event::pre_process_done(CREATION_FAILED, _path); } - _node->properties().insert(_properties.begin(), _properties.end()); - _node->activate(*_engine.buffer_factory()); + _block->properties().insert(_properties.begin(), _properties.end()); + _block->activate(*_engine.buffer_factory()); - // Add node to the store and the patch's pre-processor only node list - _patch->add_node(*_node); - _engine.store()->add(_node); + // Add block to the store and the patch's pre-processor only block list + _patch->add_block(*_block); + _engine.store()->add(_block); - /* Compile patch with new node added for insertion in audio thread - TODO: Since the node is not connected at this point, a full compilation - could be avoided and the node simply appended. */ + /* Compile patch with new block added for insertion in audio thread + TODO: Since the block is not connected at this point, a full compilation + could be avoided and the block simply appended. */ if (_patch->enabled()) { _compiled_patch = _patch->compile(); } - _update.push_back(make_pair(_node->uri(), _node->properties())); - for (uint32_t i = 0; i < _node->num_ports(); ++i) { - const PortImpl* port = _node->port_impl(i); + _update.push_back(make_pair(_block->uri(), _block->properties())); + for (uint32_t i = 0; i < _block->num_ports(); ++i) { + const PortImpl* port = _block->port_impl(i); Resource::Properties pprops = port->properties(); pprops.erase(uris.ingen_value); pprops.insert(std::make_pair(uris.ingen_value, port->value())); @@ -121,16 +121,16 @@ CreateNode::pre_process() } void -CreateNode::execute(ProcessContext& context) +CreateBlock::execute(ProcessContext& context) { - if (_node) { + if (_block) { _engine.maid()->dispose(_patch->compiled_patch()); _patch->compiled_patch(_compiled_patch); } } void -CreateNode::post_process() +CreateBlock::post_process() { if (!respond()) { for (Update::const_iterator i = _update.begin(); i != _update.end(); ++i) { diff --git a/src/server/events/CreateNode.hpp b/src/server/events/CreateBlock.hpp index 32c0f4b9..ea3c4b5c 100644 --- a/src/server/events/CreateNode.hpp +++ b/src/server/events/CreateBlock.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_EVENTS_CREATENODE_HPP -#define INGEN_EVENTS_CREATENODE_HPP +#ifndef INGEN_EVENTS_CREATEBLOCK_HPP +#define INGEN_EVENTS_CREATEBLOCK_HPP #include <list> #include <utility> @@ -27,25 +27,25 @@ namespace Ingen { namespace Server { -class PatchImpl; -class NodeImpl; +class BlockImpl; class CompiledPatch; +class PatchImpl; namespace Events { -/** An event to load a Node and insert it into a Patch. +/** An event to load a Block and insert it into a Patch. * * \ingroup engine */ -class CreateNode : public Event +class CreateBlock : public Event { public: - CreateNode(Engine& engine, - SharedPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& node_path, - const Resource::Properties& properties); + CreateBlock(Engine& engine, + SharedPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& block_path, + const Resource::Properties& properties); bool pre_process(); void execute(ProcessContext& context); @@ -59,7 +59,7 @@ private: Resource::Properties _properties; Update _update; PatchImpl* _patch; - NodeImpl* _node; + BlockImpl* _block; CompiledPatch* _compiled_patch; }; @@ -67,4 +67,4 @@ private: } // namespace Server } // namespace Ingen -#endif // INGEN_EVENTS_CREATENODE_HPP +#endif // INGEN_EVENTS_CREATEBLOCK_HPP diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreatePatch.cpp index 4f14ade5..e9adc547 100644 --- a/src/server/events/CreatePatch.cpp +++ b/src/server/events/CreatePatch.cpp @@ -81,9 +81,9 @@ CreatePatch::pre_process() _patch->properties().insert(_properties.begin(), _properties.end()); _patch->add_property(uris.rdf_type, uris.ingen_Patch); _patch->add_property(uris.rdf_type, - Resource::Property(uris.ingen_Node, Resource::EXTERNAL)); + Resource::Property(uris.ingen_Block, Resource::EXTERNAL)); - _parent->add_node(*_patch); + _parent->add_block(*_patch); if (_parent->enabled()) { _patch->enable(); _compiled_patch = _parent->compile(); diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index d2e3e58e..dbda331c 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -18,6 +18,7 @@ #include "raul/Maid.hpp" #include "raul/Path.hpp" +#include "BlockImpl.hpp" #include "Broadcaster.hpp" #include "ControlBindings.hpp" #include "Delete.hpp" @@ -25,7 +26,6 @@ #include "Driver.hpp" #include "Engine.hpp" #include "EnginePort.hpp" -#include "NodeImpl.hpp" #include "PatchImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -73,24 +73,24 @@ Delete::pre_process() return Event::pre_process_done(NOT_FOUND, _path); } - if (!(_node = PtrCast<NodeImpl>(iter->second))) { + if (!(_block = PtrCast<BlockImpl>(iter->second))) { _port = PtrCast<DuplexPort>(iter->second); } - if (!_node && !_port) { + if (!_block && !_port) { return Event::pre_process_done(NOT_DELETABLE, _path); } - PatchImpl* parent = _node ? _node->parent_patch() : _port->parent_patch(); + PatchImpl* parent = _block ? _block->parent_patch() : _port->parent_patch(); if (!parent) { return Event::pre_process_done(INTERNAL_ERROR, _path); } _engine.store()->remove(iter, _removed_objects); - if (_node) { - parent->remove_node(*_node); - _disconnect_event = new DisconnectAll(_engine, parent, _node.get()); + if (_block) { + parent->remove_block(*_block); + _disconnect_event = new DisconnectAll(_engine, parent, _block.get()); _disconnect_event->pre_process(); if (parent->enabled()) { @@ -122,7 +122,7 @@ Delete::execute(ProcessContext& context) _disconnect_event->execute(context); } - PatchImpl* parent = _node ? _node->parent_patch() : _port->parent_patch(); + PatchImpl* parent = _block ? _block->parent_patch() : _port->parent_patch(); if (_port) { _engine.maid()->dispose(parent->external_ports()); parent->external_ports(_ports_array); @@ -143,9 +143,9 @@ Delete::post_process() { _lock.release(); _removed_bindings.reset(); - if (!respond() && (_node || _port)) { - if (_node) { - _node->deactivate(); + if (!respond() && (_block || _port)) { + if (_block) { + _block->deactivate(); } _engine.broadcaster()->bundle_begin(); diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index f307eba4..c14c5567 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -30,11 +30,11 @@ template<typename T> class Array; namespace Ingen { namespace Server { -class NodeImpl; -class PortImpl; +class BlockImpl; +class CompiledPatch; class DuplexPort; class EnginePort; -class CompiledPatch; +class PortImpl; namespace Events { @@ -72,7 +72,7 @@ public: private: Raul::URI _uri; Raul::Path _path; - SharedPtr<NodeImpl> _node; ///< Non-NULL iff a node + SharedPtr<BlockImpl> _block; ///< Non-NULL iff a block SharedPtr<DuplexPort> _port; ///< Non-NULL iff a port EnginePort* _engine_port; Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Patch diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 1120af92..3b31cedb 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -24,7 +24,7 @@ #include "Broadcaster.hpp" #include "ControlBindings.hpp" -#include "CreateNode.hpp" +#include "CreateBlock.hpp" #include "CreatePatch.hpp" #include "CreatePort.hpp" #include "Delta.hpp" @@ -112,7 +112,7 @@ Delta::pre_process() _object = is_graph_object ? static_cast<Ingen::Resource*>(_engine.store()->get(GraphObject::uri_to_path(_subject))) - : static_cast<Ingen::Resource*>(_engine.node_factory()->plugin(_subject)); + : static_cast<Ingen::Resource*>(_engine.block_factory()->plugin(_subject)); if (!_object && (!is_graph_object || !_create)) { return Event::pre_process_done(NOT_FOUND, _subject); @@ -122,14 +122,14 @@ Delta::pre_process() if (is_graph_object && !_object) { Raul::Path path(GraphObject::uri_to_path(_subject)); - bool is_patch = false, is_node = false, is_port = false, is_output = false; - Ingen::Resource::type(uris, _properties, is_patch, is_node, is_port, is_output); + bool is_patch = false, is_block = false, is_port = false, is_output = false; + Ingen::Resource::type(uris, _properties, is_patch, is_block, is_port, is_output); if (is_patch) { _create_event = new CreatePatch( _engine, _request_client, _request_id, _time, path, _properties); - } else if (is_node) { - _create_event = new CreateNode( + } else if (is_block) { + _create_event = new CreateBlock( _engine, _request_client, _request_id, _time, path, _properties); } else if (is_port) { _create_event = new CreatePort( @@ -223,9 +223,9 @@ Delta::pre_process() if (value.type() == uris.forge.Bool) { op = POLYPHONIC; obj->set_property(key, value, value.context()); - NodeImpl* node = dynamic_cast<NodeImpl*>(obj); - if (node) - node->set_polyphonic(value.get_bool()); + BlockImpl* block = dynamic_cast<BlockImpl*>(obj); + if (block) + block->set_polyphonic(value.get_bool()); if (value.get_bool()) { obj->prepare_poly(*_engine.buffer_factory(), parent->internal_poly()); } else { @@ -271,7 +271,7 @@ Delta::execute(ProcessContext& context) } GraphObjectImpl* const object = dynamic_cast<GraphObjectImpl*>(_object); - NodeImpl* const node = dynamic_cast<NodeImpl*>(_object); + BlockImpl* const block = dynamic_cast<BlockImpl*>(_object); PortImpl* const port = dynamic_cast<PortImpl*>(_object); std::vector<SpecialType>::const_iterator t = _types.begin(); @@ -315,9 +315,9 @@ Delta::execute(ProcessContext& context) case CONTROL_BINDING: if (port) { _engine.control_bindings()->port_binding_changed(context, port, value); - } else if (node) { - if (node->plugin_impl()->type() == Plugin::Internal) { - node->learn(); + } else if (block) { + if (block->plugin_impl()->type() == Plugin::Internal) { + block->learn(); } } break; diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index 9e1e9531..9cf2974a 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -67,21 +67,21 @@ Disconnect::Impl::Impl(Engine& e, { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - NodeImpl* const src_node = _src_output_port->parent_node(); - NodeImpl* const dst_node = _dst_input_port->parent_node(); + BlockImpl* const src_block = _src_output_port->parent_block(); + BlockImpl* const dst_block = _dst_input_port->parent_block(); - for (std::list<NodeImpl*>::iterator i = dst_node->providers().begin(); - i != dst_node->providers().end(); ++i) { - if ((*i) == src_node) { - dst_node->providers().erase(i); + for (std::list<BlockImpl*>::iterator i = dst_block->providers().begin(); + i != dst_block->providers().end(); ++i) { + if ((*i) == src_block) { + dst_block->providers().erase(i); break; } } - for (std::list<NodeImpl*>::iterator i = src_node->dependants().begin(); - i != src_node->dependants().end(); ++i) { - if ((*i) == dst_node) { - src_node->dependants().erase(i); + for (std::list<BlockImpl*>::iterator i = src_block->dependants().begin(); + i != src_block->dependants().end(); ++i) { + if ((*i) == dst_block) { + src_block->dependants().erase(i); break; } } @@ -130,23 +130,23 @@ Disconnect::pre_process() return Event::pre_process_done(PORT_NOT_FOUND, _head_path); } - NodeImpl* const src_node = tail->parent_node(); - NodeImpl* const dst_node = head->parent_node(); + BlockImpl* const src_block = tail->parent_block(); + BlockImpl* const dst_block = head->parent_block(); - if (src_node->parent_patch() != dst_node->parent_patch()) { + if (src_block->parent_patch() != dst_block->parent_patch()) { // Edge to a patch port from inside the patch - assert(src_node->parent() == dst_node || dst_node->parent() == src_node); - if (src_node->parent() == dst_node) { - _patch = dynamic_cast<PatchImpl*>(dst_node); + assert(src_block->parent() == dst_block || dst_block->parent() == src_block); + if (src_block->parent() == dst_block) { + _patch = dynamic_cast<PatchImpl*>(dst_block); } else { - _patch = dynamic_cast<PatchImpl*>(src_node); + _patch = dynamic_cast<PatchImpl*>(src_block); } - } else if (src_node == dst_node && dynamic_cast<PatchImpl*>(src_node)) { + } else if (src_block == dst_block && dynamic_cast<PatchImpl*>(src_block)) { // Edge from a patch input to a patch output (pass through) - _patch = dynamic_cast<PatchImpl*>(src_node); + _patch = dynamic_cast<PatchImpl*>(src_block); } else { - // Normal edge between nodes with the same parent - _patch = src_node->parent_patch(); + // Normal edge between blocks with the same parent + _patch = src_block->parent_patch(); } assert(_patch); @@ -155,7 +155,7 @@ Disconnect::pre_process() return Event::pre_process_done(NOT_FOUND, _head_path); } - if (src_node == NULL || dst_node == NULL) { + if (src_block == NULL || dst_block == NULL) { return Event::pre_process_done(PARENT_NOT_FOUND, _head_path); } diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 693c8784..4169622d 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -24,11 +24,11 @@ #include "raul/Maid.hpp" #include "raul/Path.hpp" +#include "BlockImpl.hpp" #include "Broadcaster.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" #include "InputPort.hpp" -#include "NodeImpl.hpp" #include "OutputPort.hpp" #include "PatchImpl.hpp" #include "PortImpl.hpp" @@ -50,7 +50,7 @@ DisconnectAll::DisconnectAll(Engine& engine, , _parent_path(parent_path) , _path(path) , _parent(NULL) - , _node(NULL) + , _block(NULL) , _port(NULL) , _compiled_patch(NULL) , _deleting(false) @@ -66,7 +66,7 @@ DisconnectAll::DisconnectAll(Engine& engine, , _parent_path(parent->path()) , _path(object->path()) , _parent(parent) - , _node(dynamic_cast<NodeImpl*>(object)) + , _block(dynamic_cast<BlockImpl*>(object)) , _port(dynamic_cast<PortImpl*>(object)) , _compiled_patch(NULL) , _deleting(true) @@ -104,10 +104,10 @@ DisconnectAll::pre_process() } // Only one of these will succeed - _node = dynamic_cast<NodeImpl*>(object); - _port = dynamic_cast<PortImpl*>(object); + _block = dynamic_cast<BlockImpl*>(object); + _port = dynamic_cast<PortImpl*>(object); - assert((_node || _port) && !(_node && _port)); + assert((_block || _port) && !(_block && _port)); } // Find set of edges to remove @@ -115,9 +115,9 @@ DisconnectAll::pre_process() for (GraphObject::Edges::const_iterator i = _parent->edges().begin(); i != _parent->edges().end(); ++i) { EdgeImpl* const c = (EdgeImpl*)i->second.get(); - if (_node) { - if (c->tail()->parent_node() == _node - || c->head()->parent_node() == _node) { + if (_block) { + if (c->tail()->parent_block() == _block + || c->head()->parent_block() == _block) { to_remove.insert(c); } } else { @@ -149,7 +149,7 @@ DisconnectAll::execute(ProcessContext& context) if (_status == SUCCESS) { for (Impls::iterator i = _impls.begin(); i != _impls.end(); ++i) { (*i)->execute(context, - !_deleting || ((*i)->head()->parent_node() != _node)); + !_deleting || ((*i)->head()->parent_block() != _block)); } } diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index 12c04ffa..68ba8ebe 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -27,8 +27,8 @@ namespace Ingen { namespace Server { +class BlockImpl; class CompiledPatch; -class NodeImpl; class PatchImpl; class PortImpl; @@ -36,7 +36,7 @@ namespace Events { class Disconnect; -/** An event to disconnect all connections to a Node. +/** An event to disconnect all connections to a Block. * * \ingroup engine */ @@ -66,7 +66,7 @@ private: Raul::Path _parent_path; Raul::Path _path; PatchImpl* _parent; - NodeImpl* _node; + BlockImpl* _block; PortImpl* _port; Impls _impls; CompiledPatch* _compiled_patch; diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index 294a15b3..24b4daae 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -20,12 +20,12 @@ #include "ingen/Interface.hpp" #include "ingen/Store.hpp" +#include "BlockImpl.hpp" #include "Broadcaster.hpp" #include "BufferFactory.hpp" #include "Driver.hpp" #include "Engine.hpp" #include "Get.hpp" -#include "NodeImpl.hpp" #include "PatchImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -56,7 +56,7 @@ Get::pre_process() _lock.acquire(); if (_uri == "ingen:plugins") { - _plugins = _engine.node_factory()->plugins(); + _plugins = _engine.block_factory()->plugins(); return Event::pre_process_done(SUCCESS); } else if (_uri == "ingen:engine") { return Event::pre_process_done(SUCCESS); @@ -64,7 +64,7 @@ Get::pre_process() _object = _engine.store()->get(GraphObject::uri_to_path(_uri)); return Event::pre_process_done(_object ? SUCCESS : NOT_FOUND, _uri); } else { - _plugin = _engine.node_factory()->plugin(_uri); + _plugin = _engine.block_factory()->plugin(_uri); return Event::pre_process_done(_plugin ? SUCCESS : NOT_FOUND, _uri); } } @@ -84,15 +84,15 @@ send_port(Interface* client, const PortImpl* port) } static void -send_node(Interface* client, const NodeImpl* node) +send_block(Interface* client, const BlockImpl* block) { - PluginImpl* const plugin = node->plugin_impl(); + PluginImpl* const plugin = block->plugin_impl(); if (plugin->type() == Plugin::Patch) { - send_patch(client, (const PatchImpl*)node); + send_patch(client, (const PatchImpl*)block); } else { - client->put(node->uri(), node->properties()); - for (size_t j = 0; j < node->num_ports(); ++j) { - send_port(client, node->port_impl(j)); + client->put(block->uri(), block->properties()); + for (size_t j = 0; j < block->num_ports(); ++j) { + send_port(client, block->port_impl(j)); } } } @@ -108,10 +108,10 @@ send_patch(Interface* client, const PatchImpl* patch) patch->properties(Resource::EXTERNAL), Resource::EXTERNAL); - // Send nodes - for (PatchImpl::Nodes::const_iterator j = patch->nodes().begin(); - j != patch->nodes().end(); ++j) { - send_node(client, &*j); + // Send blocks + for (PatchImpl::Blocks::const_iterator j = patch->blocks().begin(); + j != patch->blocks().end(); ++j) { + send_block(client, &*j); } // Send ports @@ -141,13 +141,13 @@ Get::post_process() uris.forge.make(int32_t(_engine.driver()->sample_rate()))); } else if (_object) { _request_client->bundle_begin(); - const NodeImpl* node = NULL; + const BlockImpl* block = NULL; const PatchImpl* patch = NULL; const PortImpl* port = NULL; if ((patch = dynamic_cast<const PatchImpl*>(_object))) { send_patch(_request_client.get(), patch); - } else if ((node = dynamic_cast<const NodeImpl*>(_object))) { - send_node(_request_client.get(), node); + } else if ((block = dynamic_cast<const BlockImpl*>(_object))) { + send_block(_request_client.get(), block); } else if ((port = dynamic_cast<const PortImpl*>(_object))) { send_port(_request_client.get(), port); } diff --git a/src/server/events/Get.hpp b/src/server/events/Get.hpp index 12cedd4d..7b33304e 100644 --- a/src/server/events/Get.hpp +++ b/src/server/events/Get.hpp @@ -20,7 +20,7 @@ #include <glibmm/thread.h> #include "Event.hpp" -#include "NodeFactory.hpp" +#include "BlockFactory.hpp" #include "types.hpp" namespace Ingen { @@ -51,7 +51,7 @@ private: const Raul::URI _uri; const GraphObject* _object; const PluginImpl* _plugin; - NodeFactory::Plugins _plugins; + BlockFactory::Plugins _plugins; Glib::RWLock::ReaderLock _lock; }; diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index 5fa58825..d5b4d116 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -19,11 +19,11 @@ #include "ingen/Store.hpp" #include "raul/Path.hpp" +#include "BlockImpl.hpp" #include "Broadcaster.hpp" #include "Driver.hpp" #include "Engine.hpp" #include "EnginePort.hpp" -#include "NodeImpl.hpp" #include "PatchImpl.hpp" #include "events/Move.hpp" diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index d81a38f7..7a994caa 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -19,12 +19,12 @@ #include "ingen/URIs.hpp" #include "ingen/World.hpp" +#include "BlockImpl.hpp" #include "Broadcaster.hpp" #include "Buffer.hpp" #include "ControlBindings.hpp" #include "Driver.hpp" #include "Engine.hpp" -#include "NodeImpl.hpp" #include "PortImpl.hpp" #include "ProcessContext.hpp" #include "SetPortValue.hpp" @@ -71,7 +71,7 @@ SetPortValue::execute(ProcessContext& context) { assert(_time >= context.start() && _time <= context.end()); - if (_port->parent_node()->context() == Context::MESSAGE) + if (_port->parent_block()->context() == Context::MESSAGE) return; apply(context); diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 69775873..5158e441 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -432,7 +432,7 @@ find_patches(const Glib::ustring& manifest_uri) const Sord::URI rdf_type (world, NS_RDF "type"); const Sord::URI rdfs_seeAlso(world, NS_RDFS "seeAlso"); - SerdEnv* env = serd_env_new(sord_node_to_serd_node(base.c_obj())); + SerdEnv* env = serd_env_new(sord_node_to_serd_node(base.c_obj())); Sord::Model model(world, manifest_uri); model.load_file(env, SERD_TURTLE, manifest_uri); diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp index 1fb3cf76..0e8d125e 100644 --- a/src/server/internals/Controller.cpp +++ b/src/server/internals/Controller.cpp @@ -47,7 +47,7 @@ ControllerNode::ControllerNode(InternalPlugin* plugin, bool polyphonic, PatchImpl* parent, SampleRate srate) - : NodeImpl(plugin, symbol, false, parent, srate) + : BlockImpl(plugin, symbol, false, parent, srate) , _learning(false) { const Ingen::URIs& uris = bufs.uris(); @@ -91,7 +91,7 @@ ControllerNode::ControllerNode(InternalPlugin* plugin, void ControllerNode::process(ProcessContext& context) { - NodeImpl::pre_process(context); + BlockImpl::pre_process(context); Buffer* const midi_in = _midi_in_port->buffer(0).get(); LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)midi_in->atom(); @@ -104,7 +104,7 @@ ControllerNode::process(ProcessContext& context) } } - NodeImpl::post_process(context); + BlockImpl::post_process(context); } void diff --git a/src/server/internals/Controller.hpp b/src/server/internals/Controller.hpp index 4a366b08..23401826 100644 --- a/src/server/internals/Controller.hpp +++ b/src/server/internals/Controller.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_INTERNALS_CONTROLLER_HPP #define INGEN_INTERNALS_CONTROLLER_HPP -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" namespace Ingen { namespace Server { @@ -28,14 +28,14 @@ class InternalPlugin; namespace Internals { -/** MIDI control input node. +/** MIDI control input block. * * Creating one of these nodes is how a user makes "MIDI Bindings". Note that * this node will always be monophonic, the poly parameter is ignored. * * \ingroup engine */ -class ControllerNode : public NodeImpl +class ControllerNode : public BlockImpl { public: ControllerNode(InternalPlugin* plugin, diff --git a/src/server/internals/Delay.cpp b/src/server/internals/Delay.cpp index 26799260..1e7ed5a5 100644 --- a/src/server/internals/Delay.cpp +++ b/src/server/internals/Delay.cpp @@ -55,7 +55,7 @@ DelayNode::DelayNode(InternalPlugin* plugin, bool polyphonic, PatchImpl* parent, SampleRate srate) - : NodeImpl(plugin, symbol, polyphonic, parent, srate) + : BlockImpl(plugin, symbol, polyphonic, parent, srate) , _buffer(0) , _buffer_length(0) , _buffer_mask(0) @@ -100,7 +100,7 @@ DelayNode::~DelayNode() void DelayNode::activate(BufferFactory& bufs) { - NodeImpl::activate(bufs); + BlockImpl::activate(bufs); const SampleRate rate = bufs.engine().driver()->sample_rate(); const SampleCount min_size = MAX_DELAY_SECONDS * rate; @@ -144,7 +144,7 @@ DelayNode::process(ProcessContext& context) Buffer* const in_buf = _in_port->buffer(0).get(); Buffer* const out_buf = _out_port->buffer(0).get(); - NodeImpl::pre_process(context); + BlockImpl::pre_process(context); DelayNode* plugin_data = this; @@ -201,7 +201,7 @@ DelayNode::process(ProcessContext& context) _write_phase = write_phase; - NodeImpl::post_process(context); + BlockImpl::post_process(context); } } // namespace Internals diff --git a/src/server/internals/Delay.hpp b/src/server/internals/Delay.hpp index 3c512d2c..8f4b758b 100644 --- a/src/server/internals/Delay.hpp +++ b/src/server/internals/Delay.hpp @@ -19,7 +19,7 @@ #include <math.h> -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" #include "types.hpp" namespace Ingen { @@ -32,7 +32,7 @@ class BufferFactory; namespace Internals { -class DelayNode : public NodeImpl +class DelayNode : public BlockImpl { public: DelayNode(InternalPlugin* plugin, diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 25e8aee5..00ab0835 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -52,7 +52,7 @@ NoteNode::NoteNode(InternalPlugin* plugin, bool polyphonic, PatchImpl* parent, SampleRate srate) - : NodeImpl(plugin, symbol, polyphonic, parent, srate) + : BlockImpl(plugin, symbol, polyphonic, parent, srate) , _voices(new Raul::Array<Voice>(_polyphony)) , _prepared_voices(NULL) , _sustain(false) @@ -103,7 +103,7 @@ NoteNode::prepare_poly(BufferFactory& bufs, uint32_t poly) if (!_polyphonic) return true; - NodeImpl::prepare_poly(bufs, poly); + BlockImpl::prepare_poly(bufs, poly); if (_prepared_voices && poly <= _prepared_voices->size()) return true; @@ -116,7 +116,7 @@ NoteNode::prepare_poly(BufferFactory& bufs, uint32_t poly) bool NoteNode::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) { - if (!NodeImpl::apply_poly(context, maid, poly)) + if (!BlockImpl::apply_poly(context, maid, poly)) return false; if (_prepared_voices) { @@ -133,7 +133,7 @@ NoteNode::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) void NoteNode::process(ProcessContext& context) { - NodeImpl::pre_process(context); + BlockImpl::pre_process(context); Buffer* const midi_in = _midi_in_port->buffer(0).get(); LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)midi_in->atom(); @@ -173,7 +173,7 @@ NoteNode::process(ProcessContext& context) } } - NodeImpl::post_process(context); + BlockImpl::post_process(context); } void diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 6c7d9a13..290908e8 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_INTERNALS_NOTE_HPP #define INGEN_INTERNALS_NOTE_HPP -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" #include "types.hpp" namespace Ingen { @@ -29,13 +29,13 @@ class InternalPlugin; namespace Internals { -/** MIDI note input node. +/** MIDI note input block. * * For pitched instruments like keyboard, etc. * * \ingroup engine */ -class NoteNode : public NodeImpl +class NoteNode : public BlockImpl { public: NoteNode(InternalPlugin* plugin, diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp index f7bbd4c5..31943425 100644 --- a/src/server/internals/Trigger.cpp +++ b/src/server/internals/Trigger.cpp @@ -47,7 +47,7 @@ TriggerNode::TriggerNode(InternalPlugin* plugin, bool polyphonic, PatchImpl* parent, SampleRate srate) - : NodeImpl(plugin, symbol, false, parent, srate) + : BlockImpl(plugin, symbol, false, parent, srate) , _learning(false) { const Ingen::URIs& uris = bufs.uris(); @@ -89,7 +89,7 @@ TriggerNode::TriggerNode(InternalPlugin* plugin, void TriggerNode::process(ProcessContext& context) { - NodeImpl::pre_process(context); + BlockImpl::pre_process(context); Buffer* const midi_in = _midi_in_port->buffer(0).get(); LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)midi_in->atom(); @@ -121,7 +121,7 @@ TriggerNode::process(ProcessContext& context) } } - NodeImpl::post_process(context); + BlockImpl::post_process(context); } void diff --git a/src/server/internals/Trigger.hpp b/src/server/internals/Trigger.hpp index 59badc70..750cd287 100644 --- a/src/server/internals/Trigger.hpp +++ b/src/server/internals/Trigger.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_INTERNALS_TRIGGER_HPP #define INGEN_INTERNALS_TRIGGER_HPP -#include "NodeImpl.hpp" +#include "BlockImpl.hpp" namespace Ingen { namespace Server { @@ -28,17 +28,17 @@ class InternalPlugin; namespace Internals { -/** MIDI trigger input node. +/** MIDI trigger input block. * - * Just has a gate, for drums etc. A control port is used to select + * Just has a gate, for drums etc. A control port is used to select * which note number is responded to. * - * Note that this node is always monophonic, the poly parameter is ignored. + * Note that this block is always monophonic, the poly parameter is ignored. * (Should that change?) * * \ingroup engine */ -class TriggerNode : public NodeImpl +class TriggerNode : public BlockImpl { public: TriggerNode(InternalPlugin* plugin, diff --git a/src/server/wscript b/src/server/wscript index 5c98d189..9664545a 100644 --- a/src/server/wscript +++ b/src/server/wscript @@ -3,6 +3,8 @@ from waflib.extras import autowaf as autowaf def build(bld): core_source = ''' + BlockFactory.cpp + BlockImpl.cpp Broadcaster.cpp Buffer.cpp BufferFactory.cpp @@ -15,11 +17,9 @@ def build(bld): GraphObjectImpl.cpp InputPort.cpp InternalPlugin.cpp + LV2Block.cpp LV2Info.cpp - LV2Node.cpp LV2Plugin.cpp - NodeFactory.cpp - NodeImpl.cpp OutputPort.cpp PatchImpl.cpp PortImpl.cpp @@ -27,7 +27,7 @@ def build(bld): PreProcessor.cpp Worker.cpp events/Connect.cpp - events/CreateNode.cpp + events/CreateBlock.cpp events/CreatePatch.cpp events/CreatePort.cpp events/Delete.cpp |