diff options
author | David Robillard <d@drobilla.net> | 2013-02-23 19:55:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-02-23 19:55:13 +0000 |
commit | 6b6cb56b2ceab509569bfca247f108f2be5e25c0 (patch) | |
tree | 5a46eee0c3f518fa7bb20e6a8784e5bd3ba04598 /src/client | |
parent | 5a6aafff8dda9dddce479a2ad86edb933c9688c3 (diff) | |
download | ingen-6b6cb56b2ceab509569bfca247f108f2be5e25c0.tar.gz ingen-6b6cb56b2ceab509569bfca247f108f2be5e25c0.tar.bz2 ingen-6b6cb56b2ceab509569bfca247f108f2be5e25c0.zip |
Move Atom implementation out of Raul so it can depend on LV2.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5076 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/BlockModel.cpp | 8 | ||||
-rw-r--r-- | src/client/ClientStore.cpp | 8 | ||||
-rw-r--r-- | src/client/GraphModel.cpp | 6 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 8 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 14 | ||||
-rw-r--r-- | src/client/PluginUI.cpp | 4 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 2 |
7 files changed, 25 insertions, 25 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index a8e74847..2c389f90 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -200,8 +200,8 @@ BlockModel::port_value_range(SPtr<const PortModel> port, default_port_value_range(port, min, max); // Possibly overriden - const Raul::Atom& min_atom = port->get_property(_uris.lv2_minimum); - const Raul::Atom& max_atom = port->get_property(_uris.lv2_maximum); + const Atom& min_atom = port->get_property(_uris.lv2_minimum); + const Atom& max_atom = port->get_property(_uris.lv2_maximum); if (min_atom.type() == _uris.forge.Float) min = min_atom.get<float>(); if (max_atom.type() == _uris.forge.Float) @@ -219,7 +219,7 @@ BlockModel::port_value_range(SPtr<const PortModel> port, std::string BlockModel::label() const { - const Raul::Atom& name_property = get_property(_uris.lv2_name); + const Atom& name_property = get_property(_uris.lv2_name); if (name_property.type() == _uris.forge.String) { return name_property.ptr<char>(); } else if (plugin_model()) { @@ -232,7 +232,7 @@ BlockModel::label() const std::string BlockModel::port_label(SPtr<const PortModel> port) const { - const Raul::Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); + const Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); if (name.is_valid()) { return name.ptr<char>(); } diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 779ff4ca..b7b38df3 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -229,7 +229,7 @@ ClientStore::put(const Raul::URI& uri, // Check if uri is a plugin Iterator t = properties.find(_uris.rdf_type); if (t != properties.end() && t->second.type() == _uris.forge.URI) { - const Raul::Atom& type(t->second); + const Atom& type(t->second); const Raul::URI type_uri(type.ptr<char>()); const Plugin::Type plugin_type(Plugin::type_from_uri(type_uri)); if (plugin_type == Plugin::Graph) { @@ -347,9 +347,9 @@ ClientStore::delta(const Raul::URI& uri, } void -ClientStore::set_property(const Raul::URI& subject_uri, - const Raul::URI& predicate, - const Raul::Atom& value) +ClientStore::set_property(const Raul::URI& subject_uri, + const Raul::URI& predicate, + const Atom& value) { if (subject_uri == _uris.ingen_engine) { _log.info(Raul::fmt("Engine property <%1%> = %2%\n") diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp index 0a6ae027..493293a5 100644 --- a/src/client/GraphModel.cpp +++ b/src/client/GraphModel.cpp @@ -150,21 +150,21 @@ GraphModel::remove_arc(const Node* tail, const Node* head) bool GraphModel::enabled() const { - const Raul::Atom& enabled = get_property(_uris.ingen_enabled); + const Atom& enabled = get_property(_uris.ingen_enabled); return (enabled.is_valid() && enabled.get<int32_t>()); } uint32_t GraphModel::internal_poly() const { - const Raul::Atom& poly = get_property(_uris.ingen_polyphony); + const Atom& poly = get_property(_uris.ingen_polyphony); return poly.is_valid() ? poly.get<int32_t>() : 1; } bool GraphModel::polyphonic() const { - const Raul::Atom& poly = get_property(_uris.ingen_polyphonic); + const Atom& poly = get_property(_uris.ingen_polyphonic); return poly.is_valid() && poly.get<int32_t>(); } diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 7e6263aa..4cef3188 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -47,15 +47,15 @@ ObjectModel::is_a(const Raul::URI& type) const } void -ObjectModel::on_property(const Raul::URI& uri, const Raul::Atom& value) +ObjectModel::on_property(const Raul::URI& uri, const Atom& value) { _signal_property.emit(uri, value); } -const Raul::Atom& +const Atom& ObjectModel::get_property(const Raul::URI& key) const { - static const Raul::Atom null_atom; + static const Atom null_atom; Resource::Properties::const_iterator i = properties().find(key); return (i != properties().end()) ? i->second : null_atom; } @@ -63,7 +63,7 @@ ObjectModel::get_property(const Raul::URI& key) const bool ObjectModel::polyphonic() const { - const Raul::Atom& polyphonic = get_property(_uris.ingen_polyphonic); + const Atom& polyphonic = get_property(_uris.ingen_polyphonic); return (polyphonic.is_valid() && polyphonic.get<int32_t>()); } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 775836b9..1025a7dc 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -21,9 +21,9 @@ #include <boost/optional.hpp> -#include "raul/Atom.hpp" #include "raul/Path.hpp" +#include "ingen/Atom.hpp" #include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" @@ -92,11 +92,11 @@ contains_alpha_after(const std::string& str, size_t begin) return false; } -const Raul::Atom& +const Atom& PluginModel::get_property(const Raul::URI& key) const { - static const Raul::Atom nil; - const Raul::Atom& val = Resource::get_property(key); + static const Atom nil; + const Atom& val = Resource::get_property(key); if (val.is_valid()) return val; @@ -117,7 +117,7 @@ PluginModel::get_property(const Raul::URI& key) const } if (_lilv_plugin) { - boost::optional<const Raul::Atom&> ret; + boost::optional<const Atom&> ret; LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.c_str()); LilvNodes* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred); lilv_node_free(lv2_pred); @@ -170,7 +170,7 @@ PluginModel::set(SPtr<PluginModel> p) Raul::Symbol PluginModel::default_block_symbol() const { - const Raul::Atom& name_atom = get_property(_uris.lv2_symbol); + const 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.ptr<char>()); else @@ -180,7 +180,7 @@ PluginModel::default_block_symbol() const string PluginModel::human_name() const { - const Raul::Atom& name_atom = get_property(_uris.doap_name); + const Atom& name_atom = get_property(_uris.doap_name); if (name_atom.type() == _uris.forge.String) return name_atom.ptr<char>(); else diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 9bd3a195..2bee4249 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -70,8 +70,8 @@ lv2_ui_write(SuilController controller, ui->world()->forge().make(value)); } else if (format == uris.atom_eventTransfer.id) { - const LV2_Atom* atom = (const LV2_Atom*)buffer; - Raul::Atom val = ui->world()->forge().alloc( + const LV2_Atom* atom = (const LV2_Atom*)buffer; + Atom val = ui->world()->forge().alloc( atom->size, atom->type, LV2_ATOM_BODY_CONST(atom)); ui->world()->interface()->set_property(port->uri(), uris.ingen_value, diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index e72c279d..2c7359f9 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -21,7 +21,7 @@ namespace Ingen { namespace Client { void -PortModel::on_property(const Raul::URI& uri, const Raul::Atom& value) +PortModel::on_property(const Raul::URI& uri, const Atom& value) { if (uri == _uris.ingen_activity) { // Don't store activity, it is transient |