summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-02 16:58:42 +0000
committerDavid Robillard <d@drobilla.net>2013-02-02 16:58:42 +0000
commit3265e8f01cd4e878661973730349a5ed44329713 (patch)
tree9e62a609edeba00bba462efc242952af7476b41d /src/client
parent05d020a36581fdc9c5038339e52208f7d9f3e60e (diff)
downloadingen-3265e8f01cd4e878661973730349a5ed44329713.tar.gz
ingen-3265e8f01cd4e878661973730349a5ed44329713.tar.bz2
ingen-3265e8f01cd4e878661973730349a5ed44329713.zip
More generic Atom class.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5024 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r--src/client/BlockModel.cpp8
-rw-r--r--src/client/ClientStore.cpp8
-rw-r--r--src/client/GraphModel.cpp6
-rw-r--r--src/client/ObjectModel.cpp2
-rw-r--r--src/client/PluginModel.cpp4
-rw-r--r--src/client/PluginUI.cpp2
-rw-r--r--src/client/PortModel.cpp2
7 files changed, 16 insertions, 16 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp
index 0ed58c7a..a8e74847 100644
--- a/src/client/BlockModel.cpp
+++ b/src/client/BlockModel.cpp
@@ -203,9 +203,9 @@ BlockModel::port_value_range(SPtr<const PortModel> port,
const Raul::Atom& min_atom = port->get_property(_uris.lv2_minimum);
const Raul::Atom& max_atom = port->get_property(_uris.lv2_maximum);
if (min_atom.type() == _uris.forge.Float)
- min = min_atom.get_float();
+ min = min_atom.get<float>();
if (max_atom.type() == _uris.forge.Float)
- max = max_atom.get_float();
+ max = max_atom.get<float>();
if (max <= min)
max = min + 1.0;
@@ -221,7 +221,7 @@ BlockModel::label() const
{
const Raul::Atom& name_property = get_property(_uris.lv2_name);
if (name_property.type() == _uris.forge.String) {
- return name_property.get_string();
+ return name_property.ptr<char>();
} else if (plugin_model()) {
return plugin_model()->human_name();
} else {
@@ -234,7 +234,7 @@ BlockModel::port_label(SPtr<const PortModel> port) const
{
const Raul::Atom& name = port->get_property(Raul::URI(LV2_CORE__name));
if (name.is_valid()) {
- return name.get_string();
+ return name.ptr<char>();
}
if (_plugin && _plugin->type() == PluginModel::LV2) {
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 4e4dd7d8..779ff4ca 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -230,7 +230,7 @@ ClientStore::put(const Raul::URI& uri,
Iterator t = properties.find(_uris.rdf_type);
if (t != properties.end() && t->second.type() == _uris.forge.URI) {
const Raul::Atom& type(t->second);
- const Raul::URI type_uri(type.get_uri());
+ const Raul::URI type_uri(type.ptr<char>());
const Plugin::Type plugin_type(Plugin::type_from_uri(type_uri));
if (plugin_type == Plugin::Graph) {
is_graph = true;
@@ -268,10 +268,10 @@ ClientStore::put(const Raul::URI& uri,
const Iterator p = properties.find(_uris.ingen_prototype);
SPtr<PluginModel> plug;
if (p->second.is_valid() && p->second.type() == _uris.forge.URI) {
- if (!(plug = _plugin(Raul::URI(p->second.get_uri())))) {
+ if (!(plug = _plugin(Raul::URI(p->second.ptr<char>())))) {
plug = SPtr<PluginModel>(
new PluginModel(uris(),
- Raul::URI(p->second.get_uri()),
+ Raul::URI(p->second.ptr<char>()),
_uris.ingen_nil,
Resource::Properties()));
add_plugin(plug);
@@ -290,7 +290,7 @@ ClientStore::put(const Raul::URI& uri,
: PortModel::Direction::INPUT;
const Iterator i = properties.find(_uris.lv2_index);
if (i != properties.end() && i->second.type() == _uris.forge.Int) {
- const uint32_t index = i->second.get_int32();
+ const uint32_t index = i->second.get<int32_t>();
SPtr<PortModel> p(
new PortModel(uris(), path, index, pdir));
p->set_properties(properties);
diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp
index 8586f168..0a6ae027 100644
--- a/src/client/GraphModel.cpp
+++ b/src/client/GraphModel.cpp
@@ -151,21 +151,21 @@ bool
GraphModel::enabled() const
{
const Raul::Atom& enabled = get_property(_uris.ingen_enabled);
- return (enabled.is_valid() && enabled.get_bool());
+ return (enabled.is_valid() && enabled.get<int32_t>());
}
uint32_t
GraphModel::internal_poly() const
{
const Raul::Atom& poly = get_property(_uris.ingen_polyphony);
- return poly.is_valid() ? poly.get_int32() : 1;
+ return poly.is_valid() ? poly.get<int32_t>() : 1;
}
bool
GraphModel::polyphonic() const
{
const Raul::Atom& poly = get_property(_uris.ingen_polyphonic);
- return poly.is_valid() && poly.get_bool();
+ return poly.is_valid() && poly.get<int32_t>();
}
} // namespace Client
diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp
index 9fc22c03..7e6263aa 100644
--- a/src/client/ObjectModel.cpp
+++ b/src/client/ObjectModel.cpp
@@ -64,7 +64,7 @@ bool
ObjectModel::polyphonic() const
{
const Raul::Atom& polyphonic = get_property(_uris.ingen_polyphonic);
- return (polyphonic.is_valid() && polyphonic.get_bool());
+ return (polyphonic.is_valid() && polyphonic.get<int32_t>());
}
/** Merge the data of @a model with self, as much as possible.
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 206aebab..775836b9 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -172,7 +172,7 @@ 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)
- return Raul::Symbol::symbolify(name_atom.get_string());
+ return Raul::Symbol::symbolify(name_atom.ptr<char>());
else
return Raul::Symbol("_");
}
@@ -182,7 +182,7 @@ PluginModel::human_name() const
{
const Raul::Atom& name_atom = get_property(_uris.doap_name);
if (name_atom.type() == _uris.forge.String)
- return name_atom.get_string();
+ return name_atom.ptr<char>();
else
return default_block_symbol().c_str();
}
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 24144b42..01e1cb77 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -54,7 +54,7 @@ lv2_ui_write(SuilController controller,
// float (special case, always 0)
if (format == 0) {
assert(buffer_size == 4);
- if (*(const float*)buffer == port->value().get_float())
+ if (*(const float*)buffer == port->value().get<float>())
return; // do nothing (handle stupid plugin UIs that feed back)
ui->world()->interface()->set_property(
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp
index eb645791..e72c279d 100644
--- a/src/client/PortModel.cpp
+++ b/src/client/PortModel.cpp
@@ -56,7 +56,7 @@ PortModel::is_uri() const
// FIXME: Resource::has_property doesn't work, URI != URID
for (auto p : properties()) {
if (p.second.type() == _uris.atom_URID &&
- static_cast<LV2_URID>(p.second.get_int32()) == _uris.atom_URID) {
+ static_cast<LV2_URID>(p.second.get<int32_t>()) == _uris.atom_URID) {
return true;
}
}