summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/BlockModel.cpp (renamed from src/client/NodeModel.cpp)62
-rw-r--r--src/client/ClientStore.cpp16
-rw-r--r--src/client/PatchModel.cpp18
-rw-r--r--src/client/PluginModel.cpp10
-rw-r--r--src/client/PluginUI.cpp26
-rw-r--r--src/client/PortModel.cpp2
-rw-r--r--src/client/wscript2
7 files changed, 69 insertions, 67 deletions
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