summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-12 23:42:17 +0000
committerDavid Robillard <d@drobilla.net>2012-08-12 23:42:17 +0000
commitefe8e2311ee2fed881f95cc1e72825906d21c7c1 (patch)
tree371c03610f691f0b97137b9e5b2f756b21fc5583 /src/client
parente63caf72f320ab683de6378ff6f2944890054cbf (diff)
downloadingen-efe8e2311ee2fed881f95cc1e72825906d21c7c1.tar.gz
ingen-efe8e2311ee2fed881f95cc1e72825906d21c7c1.tar.bz2
ingen-efe8e2311ee2fed881f95cc1e72825906d21c7c1.zip
Use ingen:root as the path for the root patch, opening up path space for engine/driver/etc.
Strict conversion between Path and URI (Path no longer is-a URI). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4672 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r--src/client/ClientStore.cpp51
-rw-r--r--src/client/ObjectModel.cpp2
-rw-r--r--src/client/PatchModel.cpp2
-rw-r--r--src/client/PluginModel.cpp6
-rw-r--r--src/client/PluginUI.cpp8
5 files changed, 33 insertions, 36 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 8844b320..2c20ec14 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -184,10 +184,11 @@ ClientStore::object(const Raul::Path& path) const
SharedPtr<Resource>
ClientStore::_resource(const Raul::URI& uri)
{
- if (Raul::Path::is_path(uri))
- return _object(uri.str());
- else
+ if (GraphObject::uri_is_path(uri)) {
+ return _object(GraphObject::uri_to_path(uri));
+ } else {
return _plugin(uri);
+ }
}
SharedPtr<const Resource>
@@ -213,8 +214,9 @@ ClientStore::add_plugin(SharedPtr<PluginModel> pm)
void
ClientStore::del(const Raul::URI& uri)
{
- if (!Raul::Path::is_path(uri))
+ if (!GraphObject::uri_is_path(uri)) {
return;
+ }
const Raul::Path path(uri.str());
SharedPtr<ObjectModel> removed = remove_object(path);
@@ -253,7 +255,7 @@ ClientStore::move(const Raul::Path& old_path, const Raul::Path& new_path)
+ child_old_path.substr(old_path.length() + 1);
LOG(Raul::info)(Raul::fmt("Renamed %1% to %2%\n")
- % child_old_path % child_new_path);
+ % child_old_path.c_str() % child_new_path.c_str());
PtrCast<ObjectModel>(i->second)->set_path(child_new_path);
i->first = child_new_path;
}
@@ -295,12 +297,13 @@ ClientStore::put(const Raul::URI& uri,
}
}
- if (!Raul::Path::is_valid(uri.str())) {
- LOG(Raul::error) << "Bad path `" << uri.str() << "'" << endl;
+ if (!GraphObject::uri_is_path(uri)) {
+ LOG(Raul::error)(Raul::fmt("Put for unknown subject <%1%>\n")
+ % uri.c_str());
return;
}
- const Raul::Path path(uri.str());
+ const Raul::Path path(GraphObject::uri_to_path(uri));
SharedPtr<ObjectModel> obj = PtrCast<ObjectModel>(_object(path));
if (obj) {
@@ -335,7 +338,8 @@ ClientStore::put(const Raul::URI& uri,
n->set_properties(properties);
add_object(n);
} else {
- LOG(Raul::warn)(Raul::fmt("Node %1% has no plugin\n") % path);
+ LOG(Raul::warn)(Raul::fmt("Node %1% has no plugin\n")
+ % path.c_str());
}
} else if (is_port) {
PortModel::Direction pdir = (is_output)
@@ -353,7 +357,7 @@ ClientStore::put(const Raul::URI& uri,
}
} else {
LOG(Raul::warn)(Raul::fmt("Ignoring object %1% with unknown type\n")
- % path);
+ % path.c_str());
}
}
@@ -376,19 +380,21 @@ ClientStore::delta(const Raul::URI& uri,
LOG(Raul::info) << "}" << endl;
#endif
- if (!Raul::Path::is_valid(uri.str())) {
- LOG(Raul::error) << "Bad path `" << uri.str() << "'" << endl;
+ if (!GraphObject::uri_is_path(uri)) {
+ LOG(Raul::error)(Raul::fmt("Delta for unknown subject <%1%>\n")
+ % uri.c_str());
return;
}
- const Raul::Path path(uri.str());
+ const Raul::Path path(GraphObject::uri_to_path(uri));
SharedPtr<ObjectModel> obj = _object(path);
if (obj) {
obj->remove_properties(remove);
obj->add_properties(add);
} else {
- LOG(Raul::warn)(Raul::fmt("Failed to find object `%1%'\n") % path);
+ LOG(Raul::warn)(Raul::fmt("Failed to find object `%1%'\n")
+ % path.c_str());
}
}
@@ -399,7 +405,7 @@ ClientStore::set_property(const Raul::URI& subject_uri,
{
if (subject_uri == _uris.ingen_engine) {
LOG(Raul::info)(Raul::fmt("Engine property <%1%> = %2%\n")
- % predicate % _uris.forge.str(value));
+ % predicate.c_str() % _uris.forge.str(value));
return;
}
SharedPtr<Resource> subject = _resource(subject_uri);
@@ -411,7 +417,7 @@ ClientStore::set_property(const Raul::URI& subject_uri,
plugin->set_property(predicate, value);
else
LOG(Raul::warn)(Raul::fmt("Property <%1%> for unknown object %2%\n")
- % predicate % subject_uri);
+ % predicate.c_str() % subject_uri.c_str());
}
}
@@ -471,18 +477,9 @@ ClientStore::connect(const Raul::Path& src_path,
}
void
-ClientStore::disconnect(const Raul::Path& src,
- const Raul::Path& dst)
+ClientStore::disconnect(const Raul::Path& src_path,
+ const Raul::Path& dst_path)
{
- if (!Raul::Path::is_path(src) && !Raul::Path::is_path(dst)) {
- std::cerr << "Bad disconnect notification " << src
- << " => " << dst << std::endl;
- return;
- }
-
- const Raul::Path src_path(src.str());
- const Raul::Path dst_path(dst.str());
-
SharedPtr<PortModel> tail = PtrCast<PortModel>(_object(src_path));
SharedPtr<PortModel> head = PtrCast<PortModel>(_object(dst_path));
diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp
index d6e8d115..6904e1f6 100644
--- a/src/client/ObjectModel.cpp
+++ b/src/client/ObjectModel.cpp
@@ -25,7 +25,7 @@ namespace Client {
ObjectModel::ObjectModel(URIs& uris, const Raul::Path& path)
: GraphObject(uris, path)
, _path(path)
- , _symbol((path == Raul::Path::root()) ? "root" : path.symbol())
+ , _symbol((path == "/") ? "root" : path.symbol())
{
}
diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp
index bd2547b0..e87d8168 100644
--- a/src/client/PatchModel.cpp
+++ b/src/client/PatchModel.cpp
@@ -147,7 +147,7 @@ PatchModel::remove_edge(const GraphObject* tail, const GraphObject* head)
_edges.erase(i);
} else {
Raul::warn(Raul::fmt("Failed to remove patch connection %1% => %2%\n")
- % tail->path() % head->path());
+ % tail->path().c_str() % head->path().c_str());
}
}
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 460051a7..0fb3b859 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -90,10 +90,10 @@ PluginModel::get_property(const Raul::URI& key) const
size_t first_delim = std::min(last_slash, last_hash);
size_t last_delim = std::max(last_slash, last_hash);
if (isalpha(uri.str()[last_delim + 1]))
- symbol = uri.str().substr(last_delim + 1);
+ symbol = uri.substr(last_delim + 1);
else
- symbol = uri.str().substr(first_delim + 1,
- last_delim - first_delim - 1);
+ symbol = uri.substr(first_delim + 1,
+ last_delim - first_delim - 1);
}
set_property(LV2_CORE__symbol, _uris.forge.alloc(symbol));
return get_property(key);
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index c6c3d926..5706c61c 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -42,7 +42,7 @@ lv2_ui_write(SuilController controller,
const NodeModel::Ports& ports = ui->node()->ports();
if (port_index >= ports.size()) {
Raul::error(Raul::fmt("%1% UI tried to write to invalid port %2%\n")
- % ui->node()->plugin()->uri() % port_index);
+ % ui->node()->plugin()->uri().c_str() % port_index);
return;
}
@@ -57,7 +57,7 @@ lv2_ui_write(SuilController controller,
return; // do nothing (handle stupid plugin UIs that feed back)
ui->world()->interface()->set_property(
- port->path(),
+ port->uri(),
uris.ingen_value,
ui->world()->forge().make(*(const float*)buffer));
@@ -65,13 +65,13 @@ lv2_ui_write(SuilController controller,
const LV2_Atom* atom = (const LV2_Atom*)buffer;
Raul::Atom val = ui->world()->forge().alloc(
atom->size, atom->type, LV2_ATOM_BODY_CONST(atom));
- ui->world()->interface()->set_property(port->path(),
+ ui->world()->interface()->set_property(port->uri(),
uris.ingen_value,
val);
} else {
Raul::warn(Raul::fmt("Unknown value format %1% from LV2 UI\n")
- % format % ui->node()->plugin()->uri());
+ % format % ui->node()->plugin()->uri().c_str());
}
}