summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/AtomWriter.cpp2
-rw-r--r--src/Forge.cpp12
-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
-rw-r--r--src/gui/App.cpp2
-rw-r--r--src/gui/GraphBox.cpp12
-rw-r--r--src/gui/GraphCanvas.cpp8
-rw-r--r--src/gui/GraphPortModule.cpp16
-rw-r--r--src/gui/GraphTreeWindow.cpp2
-rw-r--r--src/gui/GraphView.cpp4
-rw-r--r--src/gui/LoadGraphWindow.cpp6
-rw-r--r--src/gui/LoadPluginWindow.cpp10
-rw-r--r--src/gui/NodeMenu.cpp2
-rw-r--r--src/gui/NodeModule.cpp22
-rw-r--r--src/gui/ObjectMenu.cpp2
-rw-r--r--src/gui/Port.cpp22
-rw-r--r--src/gui/PortMenu.cpp4
-rw-r--r--src/gui/PortPropertiesWindow.cpp8
-rw-r--r--src/gui/PropertiesWindow.cpp12
-rw-r--r--src/gui/RDFS.cpp4
-rw-r--r--src/gui/RenameWindow.cpp4
-rw-r--r--src/ingen/main.cpp24
-rw-r--r--src/serialisation/Parser.cpp6
-rw-r--r--src/serialisation/Serialiser.cpp4
-rw-r--r--src/server/ControlBindings.cpp8
-rw-r--r--src/server/Engine.cpp2
-rw-r--r--src/server/JackDriver.cpp6
-rw-r--r--src/server/LV2Block.cpp2
-rw-r--r--src/server/PortImpl.cpp6
-rw-r--r--src/server/events/CreateBlock.cpp4
-rw-r--r--src/server/events/CreateGraph.cpp2
-rw-r--r--src/server/events/CreatePort.cpp8
-rw-r--r--src/server/events/Delta.cpp20
-rw-r--r--src/server/events/Disconnect.cpp2
-rw-r--r--src/server/events/SetPortValue.cpp4
-rw-r--r--src/server/ingen_jack.cpp4
-rw-r--r--src/socket/SocketListener.cpp4
42 files changed, 146 insertions, 146 deletions
diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp
index 1b4a1ca5..2c5fd659 100644
--- a/src/AtomWriter.cpp
+++ b/src/AtomWriter.cpp
@@ -98,7 +98,7 @@ AtomWriter::forge_properties(const Resource::Properties& properties)
for (auto p : properties) {
lv2_atom_forge_property_head(&_forge, _map.map_uri(p.first.c_str()), 0);
if (p.second.type() == _forge.URI) {
- forge_uri(Raul::URI(p.second.get_uri()));
+ forge_uri(Raul::URI(p.second.get<const char*>()));
} else {
lv2_atom_forge_atom(&_forge, p.second.size(), p.second.type());
lv2_atom_forge_write(&_forge, p.second.get_body(), p.second.size());
diff --git a/src/Forge.cpp b/src/Forge.cpp
index d74f42ee..ffd87bbc 100644
--- a/src/Forge.cpp
+++ b/src/Forge.cpp
@@ -38,17 +38,17 @@ Forge::str(const Raul::Atom& atom)
{
std::ostringstream ss;
if (atom.type() == Int) {
- ss << atom.get_int32();
+ ss << atom.get<int32_t>();
} else if (atom.type() == Float) {
- ss << atom.get_float();
+ ss << atom.get<float>();
} else if (atom.type() == Bool) {
- ss << (atom.get_bool() ? "true" : "false");
+ ss << (atom.get<int32_t>() ? "true" : "false");
} else if (atom.type() == URI) {
- ss << "<" << atom.get_uri() << ">";
+ ss << "<" << atom.get<const char*>() << ">";
} else if (atom.type() == URID) {
- ss << "<" << _map.unmap_uri(atom.get_int32()) << ">";
+ ss << "<" << _map.unmap_uri(atom.get<int32_t>()) << ">";
} else if (atom.type() == String) {
- ss << "\"" << atom.get_string() << "\"";
+ ss << "\"" << atom.get<const char*>() << "\"";
}
return ss.str();
}
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;
}
}
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 5fcfb57d..1fb40495 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -242,7 +242,7 @@ App::property_change(const Raul::URI& subject,
if (subject == uris().ingen_engine && key == uris().ingen_sampleRate) {
if (value.type() == forge().Int) {
log().info(Raul::fmt("Sample rate: %1%\n") % uris().forge.str(value));
- _sample_rate = value.get_int32();
+ _sample_rate = value.get<int32_t>();
} else {
log().error("Engine sample rate property is not an integer\n");
}
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index c3c89258..53dd085f 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -282,9 +282,9 @@ GraphBox::set_graph(SPtr<const GraphModel> graph,
_alignment->show_all();
_menu_human_names->set_active(
- _app->world()->conf().option("human-names").get_bool());
+ _app->world()->conf().option("human-names").get<int32_t>());
_menu_show_port_names->set_active(
- _app->world()->conf().option("port-labels").get_bool());
+ _app->world()->conf().option("port-labels").get<int32_t>());
_enable_signal = true;
}
@@ -422,10 +422,10 @@ GraphBox::event_save()
if (!document.is_valid() || document.type() != _app->uris().forge.URI) {
event_save_as();
} else {
- _app->loader()->save_graph(_graph, document.get_uri());
+ _app->loader()->save_graph(_graph, document.ptr<char>());
_status_bar->push(
(boost::format("Saved %1% to %2%") % _graph->path().c_str()
- % document.get_uri()).str(),
+ % document.ptr<char>()).str(),
STATUS_CONTEXT_GRAPH);
}
}
@@ -467,9 +467,9 @@ GraphBox::event_save_as()
const Raul::Atom& document = _graph->get_property(uris.ingen_document);
const Raul::Atom& dir = _app->world()->conf().option("graph-directory");
if (document.type() == uris.forge.URI)
- dialog.set_uri(document.get_uri());
+ dialog.set_uri(document.ptr<char>());
else if (dir.is_valid())
- dialog.set_current_folder(dir.get_string());
+ dialog.set_current_folder(dir.ptr<char>());
if (dialog.run() != Gtk::RESPONSE_OK)
break;
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 3d742e1d..6c391d23 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -156,8 +156,8 @@ GraphCanvas::GraphCanvas(App& app,
_menu_properties->signal_activate().connect(
sigc::mem_fun(this, &GraphCanvas::menu_properties));
- show_human_names(app.world()->conf().option("human-names").get_bool());
- show_port_names(app.world()->conf().option("port-labels").get_bool());
+ show_human_names(app.world()->conf().option("human-names").get<int32_t>());
+ show_port_names(app.world()->conf().option("port-labels").get<int32_t>());
}
void
@@ -771,12 +771,12 @@ GraphCanvas::paste()
Node::Properties::iterator x = props.find(uris.ingen_canvasX);
if (x != c.second->properties().end())
x->second = _app.forge().make(
- x->second.get_float() + (20.0f * _paste_count));
+ x->second.get<float>() + (20.0f * _paste_count));
Node::Properties::iterator y = props.find(uris.ingen_canvasY);
if (y != c.second->properties().end())
y->second = _app.forge().make(
- y->second.get_float() + (20.0f * _paste_count));
+ y->second.get<float>() + (20.0f * _paste_count));
builder.build(c.second);
_pastees.insert(c.first);
diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp
index 402da865..bdd4abd8 100644
--- a/src/gui/GraphPortModule.cpp
+++ b/src/gui/GraphPortModule.cpp
@@ -124,7 +124,7 @@ GraphPortModule::show_human_names(bool b)
const URIs& uris = app().uris();
const Raul::Atom& name = _model->get_property(uris.lv2_name);
if (b && name.type() == uris.forge.String) {
- set_name(name.get_string());
+ set_name(name.ptr<char>());
} else {
set_name(_model->symbol().c_str());
}
@@ -142,21 +142,21 @@ GraphPortModule::property_changed(const Raul::URI& key, const Raul::Atom& value)
const URIs& uris = app().uris();
if (value.type() == uris.forge.Float) {
if (key == uris.ingen_canvasX) {
- move_to(value.get_float(), get_y());
+ move_to(value.get<float>(), get_y());
} else if (key == uris.ingen_canvasY) {
- move_to(get_x(), value.get_float());
+ move_to(get_x(), value.get<float>());
}
} else if (value.type() == uris.forge.String) {
if (key == uris.lv2_name &&
- app().world()->conf().option("human-names").get_bool()) {
- set_name(value.get_string());
+ app().world()->conf().option("human-names").get<int32_t>()) {
+ set_name(value.ptr<char>());
} else if (key == uris.lv2_symbol &&
- !app().world()->conf().option("human-names").get_bool()) {
- set_name(value.get_string());
+ !app().world()->conf().option("human-names").get<int32_t>()) {
+ set_name(value.ptr<char>());
}
} else if (value.type() == uris.forge.Bool) {
if (key == uris.ingen_polyphonic) {
- set_stacked(value.get_bool());
+ set_stacked(value.get<int32_t>());
}
}
}
diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp
index ff38e707..9b9cf71c 100644
--- a/src/gui/GraphTreeWindow.cpp
+++ b/src/gui/GraphTreeWindow.cpp
@@ -202,7 +202,7 @@ GraphTreeWindow::graph_property_changed(const Raul::URI& key,
Gtk::TreeModel::iterator i = find_graph(_graph_treestore->children(), graph);
if (i != _graph_treestore->children().end()) {
Gtk::TreeModel::Row row = *i;
- row[_graph_tree_columns.enabled_col] = value.get_bool();
+ row[_graph_tree_columns.enabled_col] = value.get<int32_t>();
} else {
_app->log().error(Raul::fmt("Unable to find graph %1%\n")
% graph->path());
diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp
index 54e42372..a74a11bf 100644
--- a/src/gui/GraphView.cpp
+++ b/src/gui/GraphView.cpp
@@ -155,11 +155,11 @@ GraphView::property_changed(const Raul::URI& predicate, const Raul::Atom& value)
_enable_signal = false;
if (predicate == _app->uris().ingen_enabled) {
if (value.type() == _app->uris().forge.Bool) {
- _process_but->set_active(value.get_bool());
+ _process_but->set_active(value.get<int32_t>());
}
} else if (predicate == _app->uris().ingen_polyphony) {
if (value.type() == _app->uris().forge.Int) {
- _poly_spin->set_value(value.get_int32());
+ _poly_spin->set_value(value.get<int32_t>());
}
}
_enable_signal = true;
diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp
index 1229dd25..40b04aa0 100644
--- a/src/gui/LoadGraphWindow.cpp
+++ b/src/gui/LoadGraphWindow.cpp
@@ -128,7 +128,7 @@ LoadGraphWindow::on_show()
{
const Raul::Atom& dir = _app->world()->conf().option("graph-directory");
if (dir.is_valid()) {
- set_current_folder(dir.get_string());
+ set_current_folder(dir.ptr<char>());
}
Gtk::FileChooserDialog::on_show();
}
@@ -180,9 +180,9 @@ LoadGraphWindow::ok_clicked()
for (auto u : uri_list) {
// Cascade
Raul::Atom& x = _initial_data.find(uris.ingen_canvasX)->second;
- x = _app->forge().make(x.get_float() + 20.0f);
+ x = _app->forge().make(x.get<float>() + 20.0f);
Raul::Atom& y = _initial_data.find(uris.ingen_canvasY)->second;
- y = _app->forge().make(y.get_float() + 20.0f);
+ y = _app->forge().make(y.get<float>() + 20.0f);
Raul::Symbol symbol(symbol_from_filename(u));
if (uri_list.size() == 1 && _symbol_entry->get_text() != "")
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 7b1ac5c7..c13b1882 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -274,7 +274,7 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
const URIs& uris = _app->uris();
const Raul::Atom& name = plugin->get_property(uris.doap_name);
if (name.is_valid() && name.type() == uris.forge.String)
- row[_plugins_columns._col_name] = name.get_string();
+ row[_plugins_columns._col_name] = name.ptr<char>();
switch (plugin->type()) {
case Plugin::NIL:
@@ -413,9 +413,9 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter)
// Cascade next block
Raul::Atom& x = _initial_data.find(uris.ingen_canvasX)->second;
- x = _app->forge().make(x.get_float() + 20.0f);
+ x = _app->forge().make(x.get<float>() + 20.0f);
Raul::Atom& y = _initial_data.find(uris.ingen_canvasY)->second;
- y = _app->forge().make(y.get_float() + 20.0f);
+ y = _app->forge().make(y.get<float>() + 20.0f);
}
}
@@ -452,7 +452,7 @@ LoadPluginWindow::filter_changed()
switch (criteria) {
case CriteriaColumns::Criteria::NAME:
if (name.is_valid() && name.type() == uris.forge.String)
- field = name.get_string();
+ field = name.ptr<char>();
break;
case CriteriaColumns::Criteria::TYPE:
field = plugin->type_uri();
@@ -504,7 +504,7 @@ LoadPluginWindow::plugin_property_changed(const Raul::URI& plugin,
if (predicate == uris.doap_name) {
Rows::const_iterator i = _rows.find(plugin);
if (i != _rows.end() && value.type() == uris.forge.String)
- (*i->second)[_plugins_columns._col_name] = value.get_string();
+ (*i->second)[_plugins_columns._col_name] = value.ptr<char>();
}
}
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 9fe43562..e55cf131 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -69,7 +69,7 @@ NodeMenu::init(App& app, SPtr<const Client::BlockModel> block)
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());
+ ui_embedded.is_valid() && ui_embedded.get<int32_t>());
} else {
_popup_gui_menuitem->hide();
_embed_gui_menuitem->hide();
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 1ddabdec..75e4b7c7 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -150,7 +150,7 @@ NodeModule::show_human_names(bool b)
if (b) {
const Raul::Atom& name_property = port->model()->get_property(uris.lv2_name);
if (name_property.type() == uris.forge.String) {
- label = name_property.get_string();
+ label = name_property.ptr<char>();
} else {
Glib::ustring hn = block()->plugin_model()->port_human_name(
port->model()->index());
@@ -237,8 +237,8 @@ NodeModule::embed_gui(bool embed)
void
NodeModule::rename()
{
- if (app().world()->conf().option("port-labels").get_bool() &&
- !app().world()->conf().option("human-names").get_bool()) {
+ if (app().world()->conf().option("port-labels").get<int32_t>() &&
+ !app().world()->conf().option("human-names").get<int32_t>()) {
set_label(_block->path().symbol());
}
}
@@ -247,7 +247,7 @@ void
NodeModule::new_port_view(SPtr<const PortModel> port)
{
Port::create(app(), *this, port,
- app().world()->conf().option("human-names").get_bool());
+ app().world()->conf().option("human-names").get<int32_t>());
port->signal_value_changed().connect(
sigc::bind<0>(sigc::mem_fun(this, &NodeModule::port_activity),
@@ -403,24 +403,24 @@ NodeModule::property_changed(const Raul::URI& key, const Raul::Atom& value)
const URIs& uris = app().uris();
if (value.type() == uris.forge.Float) {
if (key == uris.ingen_canvasX) {
- move_to(value.get_float(), get_y());
+ move_to(value.get<float>(), get_y());
} else if (key == uris.ingen_canvasY) {
- move_to(get_x(), value.get_float());
+ move_to(get_x(), value.get<float>());
}
} else if (value.type() == uris.forge.Bool) {
if (key == uris.ingen_polyphonic) {
- set_stacked(value.get_bool());
+ set_stacked(value.get<int32_t>());
} else if (key == uris.ingen_uiEmbedded) {
- if (value.get_bool() && !_gui_widget) {
+ if (value.get<int32_t>() && !_gui_widget) {
embed_gui(true);
- } else if (!value.get_bool() && _gui_widget) {
+ } else if (!value.get<int32_t>() && _gui_widget) {
embed_gui(false);
}
}
} else if (value.type() == uris.forge.String) {
if (key == uris.lv2_name
- && app().world()->conf().option("human-names").get_bool()) {
- set_label(value.get_string());
+ && app().world()->conf().option("human-names").get<int32_t>()) {
+ set_label(value.ptr<char>());
}
}
}
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index d963aa90..7ff25b2d 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -122,7 +122,7 @@ ObjectMenu::property_changed(const Raul::URI& predicate, const Raul::Atom& value
const URIs& uris = _app->uris();
_enable_signal = false;
if (predicate == uris.ingen_polyphonic && value.type() == uris.forge.Bool)
- _polyphonic_menuitem->set_active(value.get_bool());
+ _polyphonic_menuitem->set_active(value.get<int32_t>());
_enable_signal = true;
}
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 6a70114e..8ba42484 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -47,11 +47,11 @@ Port::create(App& app,
bool flip)
{
Glib::ustring label;
- if (app.world()->conf().option("port-labels").get_bool()) {
+ if (app.world()->conf().option("port-labels").get<int32_t>()) {
if (human_name) {
const Raul::Atom& name = pm->get_property(app.uris().lv2_name);
if (name.type() == app.forge().String) {
- label = name.get_string();
+ label = name.ptr<char>();
} else {
const SPtr<const BlockModel> parent(dynamic_ptr_cast<const BlockModel>(pm->parent()));
if (parent && parent->plugin_model())
@@ -144,8 +144,8 @@ Port::show_menu(GdkEventButton* ev)
void
Port::moved()
{
- if (_app.world()->conf().option("port-labels").get_bool() &&
- !_app.world()->conf().option("human-names").get_bool()) {
+ if (_app.world()->conf().option("port-labels").get<int32_t>() &&
+ !_app.world()->conf().option("human-names").get<int32_t>()) {
set_label(model()->symbol().c_str());
}
}
@@ -178,7 +178,7 @@ void
Port::value_changed(const Raul::Atom& value)
{
if (!_pressed && value.type() == _app.forge().Float) {
- Ganv::Port::set_control_value(value.get_float());
+ Ganv::Port::set_control_value(value.get<float>());
}
}
@@ -235,7 +235,7 @@ Port::build_uri_menu()
}
LilvNode* designation = lilv_new_uri(
- world->lilv_world(), designation_atom.get_uri());
+ world->lilv_world(), designation_atom.ptr<char>());
LilvNode* rdfs_range = lilv_new_uri(
world->lilv_world(), LILV_NS_RDFS "range");
@@ -366,7 +366,7 @@ void
Port::activity(const Raul::Atom& value)
{
if (model()->is_a(_app.uris().lv2_AudioPort)) {
- set_fill_color(peak_color(value.get_float()));
+ set_fill_color(peak_color(value.get<float>()));
} else {
_app.port_activity(this);
}
@@ -396,7 +396,7 @@ Port::property_changed(const Raul::URI& key, const Raul::Atom& value)
{
const URIs& uris = _app.uris();
if (value.type() == uris.forge.Float) {
- float val = value.get_float();
+ float val = value.get<float>();
if (key == uris.ingen_value && !_pressed) {
Ganv::Port::set_control_value(val);
} else if (key == uris.lv2_minimum) {
@@ -415,9 +415,9 @@ Port::property_changed(const Raul::URI& key, const Raul::Atom& value)
set_control_is_toggle(true);
} else if (key == uris.lv2_name) {
if (value.type() == uris.forge.String &&
- _app.world()->conf().option("port-labels").get_bool() &&
- _app.world()->conf().option("human-names").get_bool()) {
- set_label(value.get_string());
+ _app.world()->conf().option("port-labels").get<int32_t>() &&
+ _app.world()->conf().option("human-names").get<int32_t>()) {
+ set_label(value.ptr<char>());
}
}
}
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index 76dff135..204ffcbc 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -155,8 +155,8 @@ PortMenu::on_menu_expose()
r.set_property(uris.lv2_name, _app->forge().alloc(label.c_str()));
// TODO: Pretty kludgey coordinates
- 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 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));
diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp
index defe8235..10400a00 100644
--- a/src/gui/PortPropertiesWindow.cpp
+++ b/src/gui/PortPropertiesWindow.cpp
@@ -98,16 +98,16 @@ PortPropertiesWindow::property_changed(const Raul::URI& key,
const URIs& uris = _app->uris();
if (value.type() == uris.forge.Float) {
if (key == uris.lv2_minimum)
- _min_spinner->set_value(value.get_float());
+ _min_spinner->set_value(value.get<float>());
else if (key == uris.lv2_maximum)
- _max_spinner->set_value(value.get_float());
+ _max_spinner->set_value(value.get<float>());
}
}
void
PortPropertiesWindow::min_changed()
{
- const float val = _port_model->value().get_float();
+ const float val = _port_model->value().get<float>();
float min = _min_spinner->get_value();
float max = _max_spinner->get_value();
@@ -125,7 +125,7 @@ PortPropertiesWindow::min_changed()
void
PortPropertiesWindow::max_changed()
{
- const float val = _port_model->value().get_float();
+ const float val = _port_model->value().get<float>();
float min = _min_spinner->get_value();
float max = _max_spinner->get_value();
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 50fb0903..30e9649f 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -219,7 +219,7 @@ PropertiesWindow::create_value_widget(const Raul::URI& uri, const Raul::Atom& va
widget->property_numeric() = true;
widget->set_range(INT_MIN, INT_MAX);
widget->set_increments(1, 10);
- widget->set_value(value.get_int32());
+ widget->set_value(value.get<int32_t>());
widget->signal_value_changed().connect(sigc::bind(
sigc::mem_fun(this, &PropertiesWindow::value_edited),
uri));
@@ -229,7 +229,7 @@ PropertiesWindow::create_value_widget(const Raul::URI& uri, const Raul::Atom& va
widget->property_numeric() = true;
widget->set_snap_to_ticks(false);
widget->set_range(DBL_MIN, DBL_MAX);
- widget->set_value(value.get_float());
+ widget->set_value(value.get<float>());
widget->set_increments(0.1, 1.0);
widget->signal_value_changed().connect(sigc::bind(
sigc::mem_fun(this, &PropertiesWindow::value_edited),
@@ -237,20 +237,20 @@ PropertiesWindow::create_value_widget(const Raul::URI& uri, const Raul::Atom& va
return widget;
} else if (value.type() == forge.Bool) {
Gtk::CheckButton* widget = manage(new Gtk::CheckButton());
- widget->set_active(value.get_bool());
+ widget->set_active(value.get<int32_t>());
widget->signal_toggled().connect(sigc::bind(
sigc::mem_fun(this, &PropertiesWindow::value_edited),
uri));
return widget;
} else if (value.type() == forge.URI) {
Gtk::Entry* widget = manage(new Gtk::Entry());
- widget->set_text(value.get_uri());
+ widget->set_text(value.ptr<char>());
widget->signal_changed().connect(sigc::bind(
sigc::mem_fun(this, &PropertiesWindow::value_edited),
uri));
return widget;
} else if (value.type() == forge.URID) {
- const char* val_uri = _app->world()->uri_map().unmap_uri(value.get_int32());
+ const char* val_uri = _app->world()->uri_map().unmap_uri(value.get<int32_t>());
Gtk::Entry* widget = manage(new Gtk::Entry());
if (val_uri) {
widget->set_text(val_uri);
@@ -261,7 +261,7 @@ PropertiesWindow::create_value_widget(const Raul::URI& uri, const Raul::Atom& va
return widget;
} else if (value.type() == forge.String) {
Gtk::Entry* widget = manage(new Gtk::Entry());
- widget->set_text(value.get_string());
+ widget->set_text(value.ptr<char>());
widget->signal_changed().connect(sigc::bind(
sigc::mem_fun(this, &PropertiesWindow::value_edited),
uri));
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp
index 667e51fe..671ef69e 100644
--- a/src/gui/RDFS.cpp
+++ b/src/gui/RDFS.cpp
@@ -87,8 +87,8 @@ types(World* world, SPtr<const Client::ObjectModel> model)
URISet types;
PropRange range = model->properties().equal_range(world->uris().rdf_type);
for (PropIter t = range.first; t != range.second; ++t) {
- types.insert(Raul::URI(t->second.get_uri()));
- if (world->uris().ingen_Graph == t->second.get_uri()) {
+ types.insert(Raul::URI(t->second.ptr<char>()));
+ if (world->uris().ingen_Graph == t->second.ptr<char>()) {
// Add lv2:Plugin as a type for graphs so plugin properties show up
types.insert(world->uris().lv2_Plugin);
}
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp
index c6815fd7..86ca0172 100644
--- a/src/gui/RenameWindow.cpp
+++ b/src/gui/RenameWindow.cpp
@@ -65,7 +65,7 @@ RenameWindow::set_object(SPtr<const ObjectModel> object)
_symbol_entry->set_text(object->path().symbol());
const Raul::Atom& name_atom = object->get_property(_app->uris().lv2_name);
_label_entry->set_text(
- (name_atom.type() == _app->forge().String) ? name_atom.get_string() : "");
+ (name_atom.type() == _app->forge().String) ? name_atom.ptr<char>() : "");
}
void
@@ -124,7 +124,7 @@ RenameWindow::ok_clicked()
}
}
- if (!label.empty() && (!name_atom.is_valid() || label != name_atom.get_string())) {
+ if (!label.empty() && (!name_atom.is_valid() || label != name_atom.ptr<char>())) {
_app->interface()->set_property(Node::path_to_uri(path),
uris.lv2_name,
_app->forge().alloc(label));
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index c194dcde..fb866d0f 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -82,7 +82,7 @@ main(int argc, char** argv)
if (argc <= 1) {
world->conf().print_usage("ingen", cout);
return EXIT_FAILURE;
- } else if (world->conf().option("help").get_bool()) {
+ } else if (world->conf().option("help").get<int32_t>()) {
world->conf().print_usage("ingen", cout);
return EXIT_SUCCESS;
}
@@ -93,12 +93,12 @@ main(int argc, char** argv)
Configuration& conf = world->conf();
if (conf.option("uuid").is_valid()) {
- world->set_jack_uuid(conf.option("uuid").get_string());
+ world->set_jack_uuid(conf.option("uuid").ptr<char>());
}
// Run engine
SPtr<Interface> engine_interface;
- if (conf.option("engine").get_bool()) {
+ if (conf.option("engine").get<int32_t>()) {
ingen_try(world->load_module("server"),
"Unable to load server module");
@@ -120,7 +120,7 @@ main(int argc, char** argv)
ingen_try(world->load_module("socket_client"),
"Unable to load socket client module");
#endif
- const char* const uri = conf.option("connect").get_string();
+ const char* const uri = conf.option("connect").ptr<char>();
ingen_try(Raul::URI::is_valid(uri),
(Raul::fmt("Invalid URI <%1%>") % uri).str().c_str());
SPtr<Interface> client(new Client::ThreadedSigClientInterface(1024));
@@ -138,7 +138,7 @@ main(int argc, char** argv)
"Unable to load serialisation module");
}
- if (conf.option("gui").get_bool()) {
+ if (conf.option("gui").get<int32_t>()) {
ingen_try(world->load_module("gui"),
"Unable to load GUI module");
}
@@ -157,21 +157,21 @@ main(int argc, char** argv)
const Raul::Atom& path_option = conf.option("path");
if (path_option.is_valid()) {
- if (Raul::Path::is_valid(path_option.get_string())) {
- const Raul::Path p(path_option.get_string());
+ if (Raul::Path::is_valid(path_option.ptr<char>())) {
+ const Raul::Path p(path_option.ptr<char>());
if (!p.is_root()) {
parent = p.parent();
symbol = Raul::Symbol(p.symbol());
}
} else {
- cerr << "Invalid path given: '" << path_option.get_string() << endl;
+ cerr << "Invalid path given: '" << path_option.ptr<char>() << endl;
}
}
ingen_try(bool(world->parser()), "Unable to create parser");
const string path = conf.option("load").is_valid() ?
- conf.option("load").get_string() :
+ conf.option("load").ptr<char>() :
conf.files().front();
engine_interface->get(Raul::URI("ingen:/plugins"));
@@ -184,7 +184,7 @@ main(int argc, char** argv)
signal(SIGINT, ingen_interrupt);
signal(SIGTERM, ingen_interrupt);
- if (conf.option("gui").get_bool()) {
+ if (conf.option("gui").get<int32_t>()) {
world->run_module("gui");
} else if (conf.option("run").is_valid()) {
// Run a script
@@ -192,12 +192,12 @@ main(int argc, char** argv)
ingen_try(world->load_module("bindings"),
"Unable to load bindings module");
- world->run("application/x-python", conf.option("run").get_string());
+ world->run("application/x-python", conf.option("run").ptr<char>());
#else
cerr << "This build of ingen does not support scripting." << endl;
#endif
- } else if (world->engine() && !conf.option("gui").get_bool()) {
+ } else if (world->engine() && !conf.option("gui").get<int32_t>()) {
// Run engine main loop until interrupt
while (world->engine()->main_iteration()) {
Glib::usleep(125000); // 1/8 second
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index 1cea22d6..427b0f02 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -151,11 +151,11 @@ get_port(Ingen::World* world,
Resource::Properties::const_iterator i = props.find(uris.lv2_index);
if (i == props.end()
|| i->second.type() != world->forge().Int
- || i->second.get_int32() < 0) {
+ || i->second.get<int32_t>() < 0) {
world->log().warn(Raul::fmt("Port %1% has no valid index\n") % subject);
return boost::optional<PortRecord>();
}
- index = i->second.get_int32();
+ index = i->second.get<int32_t>();
// Get symbol
Resource::Properties::const_iterator s = props.find(uris.lv2_symbol);
@@ -163,7 +163,7 @@ get_port(Ingen::World* world,
world->log().warn(Raul::fmt("Port %1% has no symbol\n") % subject);
return boost::optional<PortRecord>();
}
- const Raul::Symbol port_sym(s->second.get_string());
+ const Raul::Symbol port_sym(s->second.ptr<char>());
const Raul::Path port_path = parent.child(port_sym);
return make_pair(port_path, props);
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 41ae45dc..5ff672e0 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -327,7 +327,7 @@ Serialiser::Impl::serialise_graph(SPtr<const Node> graph,
Node::Properties::const_iterator s = graph->properties().find(uris.lv2_symbol);
if (s == graph->properties().end()
|| !s->second.type() == _world.forge().String
- || !Raul::Symbol::is_valid(s->second.get_string())) {
+ || !Raul::Symbol::is_valid(s->second.ptr<char>())) {
const std::string base = Glib::path_get_basename(
_model->base_uri().to_c_string());
symbol = Raul::Symbol::symbolify(base.substr(0, base.find('.')));
@@ -336,7 +336,7 @@ Serialiser::Impl::serialise_graph(SPtr<const Node> graph,
Sord::URI(world, uris.lv2_symbol),
Sord::Literal(world, symbol.c_str()));
} else {
- symbol = Raul::Symbol::symbolify(s->second.get_string());
+ symbol = Raul::Symbol::symbolify(s->second.ptr<char>());
}
// If the graph has no doap:name (required by LV2), use the symbol
diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp
index 634c568a..12a895f7 100644
--- a/src/server/ControlBindings.cpp
+++ b/src/server/ControlBindings.cpp
@@ -194,8 +194,8 @@ ControlBindings::learn(PortImpl* port)
static void
get_range(ProcessContext& context, const PortImpl* port, float* min, float* max)
{
- *min = port->minimum().get_float();
- *max = port->maximum().get_float();
+ *min = port->minimum().get<float>();
+ *max = port->maximum().get<float>();
if (port->is_sample_rate()) {
*min *= context.engine().driver()->sample_rate();
*max *= context.engine().driver()->sample_rate();
@@ -246,7 +246,7 @@ ControlBindings::port_value_to_control(ProcessContext& context,
float min, max;
get_range(context, port, &min, &max);
- const float value = value_atom.get_float();
+ const float value = value_atom.get<float>();
float normal = (value - min) / (max - min);
if (normal < 0.0f) {
@@ -318,7 +318,7 @@ ControlBindings::set_port_value(ProcessContext& context,
assert(port_value.type() == port->bufs().forge().Float);
port->set_value(port_value); // FIXME: not thread safe
- port->set_control_value(context, context.start(), port_value.get_float());
+ port->set_control_value(context, context.start(), port_value.get<float>());
URIs& uris = context.engine().world()->uris();
context.notify(uris.ingen_value, context.start(), port,
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 165f6412..1af7be1b 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -118,7 +118,7 @@ Engine::store() const
size_t
Engine::event_queue_size() const
{
- return world()->conf().option("queue-size").get_int32();
+ return world()->conf().option("queue-size").get<int32_t>();
}
void
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 20abb787..6a7d7ae9 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -152,8 +152,8 @@ JackDriver::activate()
}
if (!_client)
- attach(world->conf().option("jack-server").get_string(),
- world->conf().option("jack-name").get_string(), NULL);
+ attach(world->conf().option("jack-server").ptr<char>(),
+ world->conf().option("jack-name").ptr<char>(), NULL);
jack_set_process_callback(_client, process_cb, this);
@@ -164,7 +164,7 @@ JackDriver::activate()
exit(EXIT_FAILURE);
} else {
_engine.log().info(Raul::fmt("Activated Jack client `%1%'\n") %
- world->conf().option("jack-name").get_string());
+ world->conf().option("jack-name").ptr<char>());
}
}
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index 1d05137b..fba06b19 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -107,7 +107,7 @@ LV2Block::make_instance(URIs& uris,
if (buffer) {
if (port->is_a(PortType::CV) || port->is_a(PortType::CONTROL)) {
- buffer->set_block(port->value().get_float(), 0, buffer->nframes());
+ buffer->set_block(port->value().get<float>(), 0, buffer->nframes());
} else {
buffer->clear();
}
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index 59d28f15..01280e73 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -319,7 +319,7 @@ PortImpl::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly)
_prepared_set_states = NULL;
if (is_a(PortType::CONTROL) || is_a(PortType::CV)) {
- set_control_value(context, context.start(), _value.get_float());
+ set_control_value(context, context.start(), _value.get<float>());
}
assert(_buffers->size() >= poly);
@@ -365,10 +365,10 @@ PortImpl::clear_buffers()
case PortType::CV:
for (uint32_t v = 0; v < _poly; ++v) {
Buffer* buf = buffer(v).get();
- buf->set_block(_value.get_float(), 0, buf->nframes());
+ buf->set_block(_value.get<float>(), 0, buf->nframes());
SetState& state = _set_states->at(v);
state.state = SetState::State::SET;
- state.value = _value.get_float();
+ state.value = _value.get<float>();
state.time = 0;
}
break;
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index 63b05b58..8caa3bf6 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -65,7 +65,7 @@ CreateBlock::pre_process()
std::string plugin_uri_str;
const iterator t = _properties.find(uris.ingen_prototype);
if (t != _properties.end() && t->second.type() == uris.forge.URI) {
- plugin_uri_str = t->second.get_uri();
+ plugin_uri_str = t->second.ptr<char>();
} else {
return Event::pre_process_done(Status::BAD_REQUEST);
}
@@ -90,7 +90,7 @@ CreateBlock::pre_process()
const bool polyphonic = (
p != _properties.end() &&
p->second.type() == _engine.world()->forge().Bool &&
- p->second.get_bool());
+ p->second.get<int32_t>());
if (!(_block = plugin->instantiate(*_engine.buffer_factory(),
Raul::Symbol(_path.symbol()),
diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp
index 8ab05a2e..0355b0bb 100644
--- a/src/server/events/CreateGraph.cpp
+++ b/src/server/events/CreateGraph.cpp
@@ -64,7 +64,7 @@ CreateGraph::pre_process()
uint32_t int_poly = 1;
iterator p = _properties.find(uris.ingen_polyphony);
if (p != _properties.end() && p->second.type() == uris.forge.Int) {
- int_poly = p->second.get_int32();
+ int_poly = p->second.get<int32_t>();
}
if (int_poly < 1 || int_poly > 128) {
diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp
index 2e3e4d42..4687e44e 100644
--- a/src/server/events/CreatePort.cpp
+++ b/src/server/events/CreatePort.cpp
@@ -77,7 +77,7 @@ CreatePort::CreatePort(Engine& engine,
const Range buffer_types = properties.equal_range(uris.atom_bufferType);
for (Iterator i = buffer_types.first; i != buffer_types.second; ++i) {
if (i->second.type() == _engine.world()->forge().URI) {
- _buf_type = _engine.world()->uri_map().map_uri(i->second.get_uri());
+ _buf_type = _engine.world()->uri_map().map_uri(i->second.ptr<char>());
}
}
}
@@ -123,14 +123,14 @@ CreatePort::pre_process()
std::make_pair(uris.lv2_index,
_engine.world()->forge().make(old_n_ports)));
} else if (index_i->second.type() != uris.forge.Int ||
- index_i->second.get_int32() != old_n_ports) {
+ index_i->second.get<int32_t>() != old_n_ports) {
return Event::pre_process_done(Status::BAD_INDEX, _path);
}
const PropIter poly_i = _properties.find(uris.ingen_polyphonic);
const bool polyphonic = (poly_i != _properties.end() &&
poly_i->second.type() == uris.forge.Bool &&
- poly_i->second.get_bool());
+ poly_i->second.get<int32_t>());
if (!(_graph_port = _graph->create_port(
*_engine.buffer_factory(), Raul::Symbol(_path.symbol()),
@@ -155,7 +155,7 @@ CreatePort::pre_process()
_ports_array = new Raul::Array<PortImpl*>(old_n_ports + 1, NULL);
_update = _graph_port->properties();
- assert(_graph_port->index() == (uint32_t)index_i->second.get_int32());
+ assert(_graph_port->index() == (uint32_t)index_i->second.get<int32_t>());
assert(_graph->num_ports_non_rt() == (uint32_t)old_n_ports + 1);
assert(_graph_port->index() == (uint32_t)old_n_ports);
assert(_ports_array->size() == _graph->num_ports_non_rt());
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 2b851b16..28eccc71 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -207,19 +207,19 @@ Delta::pre_process()
if (value.type() == uris.forge.Bool) {
op = SpecialType::ENABLE;
// FIXME: defer this until all other metadata has been processed
- if (value.get_bool() && !_graph->enabled())
+ if (value.get<int32_t>() && !_graph->enabled())
_compiled_graph = _graph->compile();
} else {
_status = Status::BAD_VALUE_TYPE;
}
} else if (key == uris.ingen_polyphony) {
if (value.type() == uris.forge.Int) {
- if (value.get_int32() < 1 || value.get_int32() > 128) {
+ if (value.get<int32_t>() < 1 || value.get<int32_t>() > 128) {
_status = Status::INVALID_POLY;
} else {
op = SpecialType::POLYPHONY;
_graph->prepare_internal_poly(
- *_engine.buffer_factory(), value.get_int32());
+ *_engine.buffer_factory(), value.get<int32_t>());
}
} else {
_status = Status::BAD_VALUE_TYPE;
@@ -233,8 +233,8 @@ Delta::pre_process()
obj->set_property(key, value, value.context());
BlockImpl* block = dynamic_cast<BlockImpl*>(obj);
if (block)
- block->set_polyphonic(value.get_bool());
- if (value.get_bool()) {
+ block->set_polyphonic(value.get<int32_t>());
+ if (value.get<int32_t>()) {
obj->prepare_poly(*_engine.buffer_factory(), parent->internal_poly());
} else {
obj->prepare_poly(*_engine.buffer_factory(), 1);
@@ -248,7 +248,7 @@ Delta::pre_process()
}
} else if (is_client && key == uris.ingen_broadcast) {
_engine.broadcaster()->set_broadcast(
- _request_client->uri(), value.get_bool());
+ _request_client->uri(), value.get<int32_t>());
}
if (_status != Status::NOT_PREPARED) {
@@ -293,11 +293,11 @@ Delta::execute(ProcessContext& context)
switch (*t) {
case SpecialType::ENABLE_BROADCAST:
if (port) {
- port->enable_monitoring(value.get_bool());
+ port->enable_monitoring(value.get<int32_t>());
}
break;
case SpecialType::ENABLE:
- if (value.get_bool()) {
+ if (value.get<int32_t>()) {
if (_compiled_graph) {
_graph->set_compiled_graph(_compiled_graph);
}
@@ -308,7 +308,7 @@ Delta::execute(ProcessContext& context)
break;
case SpecialType::POLYPHONIC: {
GraphImpl* parent = reinterpret_cast<GraphImpl*>(object->parent());
- if (value.get_bool()) {
+ if (value.get<int32_t>()) {
object->apply_poly(
context, *_engine.maid(), parent->internal_poly_process());
} else {
@@ -319,7 +319,7 @@ Delta::execute(ProcessContext& context)
if (!_graph->apply_internal_poly(context,
*_engine.buffer_factory(),
*_engine.maid(),
- value.get_int32())) {
+ value.get<int32_t>())) {
_status = Status::INTERNAL_ERROR;
}
break;
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index a7f31316..8f1c5032 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -97,7 +97,7 @@ Disconnect::Impl::Impl(Engine& e,
const bool is_control = _dst_input_port->is_a(PortType::CONTROL) ||
_dst_input_port->is_a(PortType::CV);
- const float value = is_control ? _dst_input_port->value().get_float() : 0;
+ const float value = is_control ? _dst_input_port->value().get<float>() : 0;
for (uint32_t i = 0; i < _buffers->size(); ++i) {
if (is_control) {
Buffer* buf = _buffers->at(i).get();
diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp
index edef9e8c..0d68b1af 100644
--- a/src/server/events/SetPortValue.cpp
+++ b/src/server/events/SetPortValue.cpp
@@ -90,7 +90,7 @@ SetPortValue::apply(Context& context)
if (buf->type() == uris.atom_Sound || buf->type() == uris.atom_Float) {
if (_value.type() == uris.forge.Float) {
- _port->set_control_value(context, _time, _value.get_float());
+ _port->set_control_value(context, _time, _value.get<float>());
} else {
_status = Status::TYPE_MISMATCH;
}
@@ -105,7 +105,7 @@ SetPortValue::apply(Context& context)
_status = Status::NO_SPACE;
}
} else if (buf->type() == uris.atom_URID) {
- ((LV2_Atom_URID*)buf->atom())->body = _value.get_int32();
+ ((LV2_Atom_URID*)buf->atom())->body = _value.get<int32_t>();
} else {
_status = Status::BAD_VALUE_TYPE;
}
diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp
index 9ebb0481..07b80876 100644
--- a/src/server/ingen_jack.cpp
+++ b/src/server/ingen_jack.cpp
@@ -39,9 +39,9 @@ struct IngenJackModule : public Ingen::Module {
Server::JackDriver* driver = new Server::JackDriver(
*(Server::Engine*)world->engine().get());
const Raul::Atom& s = world->conf().option("jack-server");
- const std::string server_name = s.is_valid() ? s.get_string() : "";
+ const std::string server_name = s.is_valid() ? s.ptr<char>() : "";
driver->attach(server_name,
- world->conf().option("jack-name").get_string(),
+ world->conf().option("jack-name").ptr<char>(),
NULL);
((Server::Engine*)world->engine().get())->set_driver(
SPtr<Server::Driver>(driver));
diff --git a/src/socket/SocketListener.cpp b/src/socket/SocketListener.cpp
index 55c2de37..c2c1d0ee 100644
--- a/src/socket/SocketListener.cpp
+++ b/src/socket/SocketListener.cpp
@@ -42,7 +42,7 @@ SocketListener::SocketListener(Ingen::World& world)
, _net_sock(Socket::Type::TCP)
{
// Create UNIX socket
- _unix_path = world.conf().option("socket").get_string();
+ _unix_path = world.conf().option("socket").ptr<char>();
const Raul::URI unix_uri("unix://" + _unix_path);
if (!_unix_sock.bind(unix_uri) || !_unix_sock.listen()) {
_world.log().error("Failed to create UNIX socket\n");
@@ -51,7 +51,7 @@ SocketListener::SocketListener(Ingen::World& world)
_world.log().info(Raul::fmt("Listening on socket %1%\n") % unix_uri);
// Create TCP socket
- int port = world.conf().option("engine-port").get_int32();
+ int port = world.conf().option("engine-port").get<int32_t>();
std::ostringstream ss;
ss << "tcp://localhost:";
ss << port;