summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-11 02:57:29 +0000
committerDavid Robillard <d@drobilla.net>2013-01-11 02:57:29 +0000
commit057bee977b95c6ccb4deb35245b598638d920330 (patch)
tree833ee00a08a918dd708b19e5c4fa801500ad9679
parent4b480bf87cd496446491e3880d867d7fa92c6c49 (diff)
downloadingen-057bee977b95c6ccb4deb35245b598638d920330.tar.gz
ingen-057bee977b95c6ccb4deb35245b598638d920330.tar.bz2
ingen-057bee977b95c6ccb4deb35245b598638d920330.zip
C++11-safe conversions.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4914 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/AtomReader.cpp2
-rw-r--r--src/ClashAvoider.cpp3
-rw-r--r--src/Store.cpp2
-rw-r--r--src/gui/GraphCanvas.cpp11
-rw-r--r--src/gui/GraphPortModule.cpp6
-rw-r--r--src/gui/LoadPluginWindow.cpp2
-rw-r--r--src/gui/NewSubgraphWindow.cpp5
-rw-r--r--src/gui/NodeModule.cpp6
-rw-r--r--src/gui/ObjectMenu.cpp2
-rw-r--r--src/gui/PropertiesWindow.cpp3
-rw-r--r--src/gui/SubgraphModule.cpp6
-rw-r--r--src/gui/ingen_gui_lv2.cpp3
-rw-r--r--src/serialisation/Parser.cpp3
-rw-r--r--src/server/Buffer.hpp4
-rw-r--r--src/server/Engine.cpp32
-rw-r--r--src/server/EventWriter.cpp4
16 files changed, 59 insertions, 35 deletions
diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp
index 55e88427..b41d2fd2 100644
--- a/src/AtomReader.cpp
+++ b/src/AtomReader.cpp
@@ -69,7 +69,7 @@ AtomReader::get_props(const LV2_Atom_Object* obj,
LV2_ATOM_OBJECT_FOREACH(obj, p) {
Raul::Atom val;
get_atom(&p->value, val);
- props.insert(std::make_pair(_map.unmap_uri(p->key), val));
+ props.insert(std::make_pair(Raul::URI(_map.unmap_uri(p->key)), val));
}
}
diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp
index 9cafa06a..54ca7eb8 100644
--- a/src/ClashAvoider.cpp
+++ b/src/ClashAvoider.cpp
@@ -104,7 +104,8 @@ ClashAvoider::map_path(const Raul::Path& in)
name = "_";
Raul::Symbol sym(name);
string str = ss.str();
- InsertRecord i = _symbol_map.insert(make_pair(in, str));
+ InsertRecord i = _symbol_map.insert(
+ make_pair(in, Raul::Path(str)));
offset = _store.child_name_offset(in.parent(), sym, false);
_offsets.insert(make_pair(base_path, offset));
return i.first->second;
diff --git a/src/Store.cpp b/src/Store.cpp
index 87a0315e..fda93474 100644
--- a/src/Store.cpp
+++ b/src/Store.cpp
@@ -29,7 +29,7 @@ Store::add(Node* o)
return;
}
- insert(make_pair(o->path(), o));
+ insert(make_pair(o->path(), SharedPtr<Node>(o)));
for (uint32_t i = 0; i < o->num_ports(); ++i) {
add(o->port(i));
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 8f87a2c1..216d0cab 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -741,7 +741,7 @@ GraphCanvas::paste()
string created = "/";
Resource::Properties props;
props.insert(make_pair(uris.rdf_type,
- uris.ingen_Graph));
+ Resource::Property(uris.ingen_Graph)));
props.insert(make_pair(uris.ingen_polyphony,
_app.forge().make(int32_t(_graph->internal_poly()))));
clipboard.put(Node::root_uri(), props);
@@ -830,10 +830,12 @@ GraphCanvas::menu_add_port(const string& sym_base, const string& name_base,
_app.forge().alloc_uri(type)));
if (type == uris.atom_AtomPort) {
props.insert(make_pair(uris.atom_bufferType,
- uris.atom_Sequence));
+ Resource::Property(uris.atom_Sequence)));
}
props.insert(make_pair(uris.rdf_type,
- is_output ? uris.lv2_OutputPort : uris.lv2_InputPort));
+ Resource::Property(is_output
+ ? uris.lv2_OutputPort
+ : uris.lv2_InputPort)));
props.insert(make_pair(uris.lv2_index,
_app.forge().make(int32_t(_graph->num_ports()))));
props.insert(make_pair(uris.lv2_name,
@@ -861,7 +863,8 @@ GraphCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin)
// FIXME: polyphony?
Node::Properties props = get_initial_data();
- props.insert(make_pair(uris.rdf_type, uris.ingen_Block));
+ props.insert(make_pair(uris.rdf_type,
+ Resource::Property(uris.ingen_Block)));
props.insert(make_pair(uris.ingen_prototype,
uris.forge.alloc_uri(plugin->uri())));
_app.interface()->put(Node::path_to_uri(path), props);
diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp
index d000ae36..6c5f91b4 100644
--- a/src/gui/GraphPortModule.cpp
+++ b/src/gui/GraphPortModule.cpp
@@ -106,8 +106,10 @@ GraphPortModule::store_location(double ax, double ay)
y != _model->get_property(uris.ingen_canvasY))
{
Resource::Properties remove;
- remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard));
- remove.insert(make_pair(uris.ingen_canvasY, uris.wildcard));
+ remove.insert(make_pair(uris.ingen_canvasX,
+ Resource::Property(uris.wildcard)));
+ remove.insert(make_pair(uris.ingen_canvasY,
+ Resource::Property(uris.wildcard)));
Resource::Properties add;
add.insert(make_pair(uris.ingen_canvasX,
Resource::Property(x, Resource::INTERNAL)));
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 8ef972c0..b21a33fc 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -399,7 +399,7 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter)
Raul::Path path = _graph->path().child(Raul::Symbol::symbolify(name));
Resource::Properties props = _initial_data;
props.insert(make_pair(uris.rdf_type,
- uris.ingen_Block));
+ Resource::Property(uris.ingen_Block)));
props.insert(make_pair(uris.ingen_prototype,
_app->forge().alloc_uri(plugin->uri())));
props.insert(make_pair(uris.ingen_polyphonic,
diff --git a/src/gui/NewSubgraphWindow.cpp b/src/gui/NewSubgraphWindow.cpp
index ef24be89..a748de8d 100644
--- a/src/gui/NewSubgraphWindow.cpp
+++ b/src/gui/NewSubgraphWindow.cpp
@@ -95,14 +95,15 @@ NewSubgraphWindow::ok_clicked()
// Create graph
Resource::Properties props;
- props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Graph));
+ props.insert(make_pair(_app->uris().rdf_type, Resource::Property(_app->uris().ingen_Graph)));
props.insert(make_pair(_app->uris().ingen_polyphony, _app->forge().make(int32_t(poly))));
props.insert(make_pair(_app->uris().ingen_enabled, _app->forge().make(bool(true))));
_app->interface()->put(Node::path_to_uri(path), props, Resource::INTERNAL);
// Set external (block perspective) properties
props = _initial_data;
- props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Graph));
+ props.insert(make_pair(_app->uris().rdf_type,
+ Resource::Property(_app->uris().ingen_Graph)));
_app->interface()->put(Node::path_to_uri(path), _initial_data, Resource::EXTERNAL);
hide();
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 1409368e..f7333fec 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -394,8 +394,10 @@ NodeModule::store_location(double ax, double ay)
y != _block->get_property(uris.ingen_canvasY))
{
Resource::Properties remove;
- remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard));
- remove.insert(make_pair(uris.ingen_canvasY, uris.wildcard));
+ remove.insert(make_pair(uris.ingen_canvasX,
+ Resource::Property(uris.wildcard)));
+ remove.insert(make_pair(uris.ingen_canvasY,
+ Resource::Property(uris.wildcard)));
Resource::Properties add;
add.insert(make_pair(uris.ingen_canvasX, x));
add.insert(make_pair(uris.ingen_canvasY, y));
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index 5c784d33..46437e2e 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -102,7 +102,7 @@ ObjectMenu::on_menu_unlearn()
Resource::Properties remove;
remove.insert(std::make_pair(
_app->uris().ingen_controlBinding,
- _app->uris().wildcard));
+ Resource::Property(_app->uris().wildcard)));
_app->interface()->delta(_object->uri(), remove, Resource::Properties());
}
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index b357514d..ea4e6683 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -430,7 +430,8 @@ PropertiesWindow::add_clicked()
Raul::Atom value = _app->forge().alloc_uri(value_uri);
Resource::Properties properties;
- properties.insert(make_pair(key_uri.c_str(), value));
+ properties.insert(make_pair(Raul::URI(key_uri.c_str()),
+ Resource::Property(value)));
_app->interface()->put(_model->uri(), properties);
}
diff --git a/src/gui/SubgraphModule.cpp b/src/gui/SubgraphModule.cpp
index 4860098e..215521da 100644
--- a/src/gui/SubgraphModule.cpp
+++ b/src/gui/SubgraphModule.cpp
@@ -71,8 +71,10 @@ SubgraphModule::store_location(double ax, double ay)
y != _block->get_property(uris.ingen_canvasY))
{
Resource::Properties remove;
- remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard));
- remove.insert(make_pair(uris.ingen_canvasY, uris.wildcard));
+ remove.insert(make_pair(uris.ingen_canvasX,
+ Resource::Property(uris.wildcard)));
+ remove.insert(make_pair(uris.ingen_canvasY,
+ Resource::Property(uris.wildcard)));
Resource::Properties add;
add.insert(make_pair(uris.ingen_canvasX,
Resource::Property(x, Resource::EXTERNAL)));
diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp
index 40f37dc7..b8a4443b 100644
--- a/src/gui/ingen_gui_lv2.cpp
+++ b/src/gui/ingen_gui_lv2.cpp
@@ -135,7 +135,8 @@ instantiate(const LV2UI_Descriptor* descriptor,
// Create empty root graph model
Ingen::Resource::Properties props;
props.insert(std::make_pair(ui->app->uris().rdf_type,
- ui->app->uris().ingen_Graph));
+ Ingen::Resource::Property(
+ ui->app->uris().ingen_Graph)));
ui->app->store()->put(Ingen::Node::root_uri(), props);
// Create a GraphBox for the root and set as the UI widget
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index 3a283641..5feb8e06 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -123,7 +123,8 @@ get_properties(Ingen::World* world,
atomm = world->forge().alloc(
atom->size, atom->type, LV2_ATOM_BODY_CONST(atom));
}
- props.insert(make_pair(i.get_predicate().to_string(), atomm));
+ props.insert(make_pair(Raul::URI(i.get_predicate().to_string()),
+ atomm));
}
}
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp
index c710f4df..aefd63da 100644
--- a/src/server/Buffer.hpp
+++ b/src/server/Buffer.hpp
@@ -155,8 +155,8 @@ protected:
private:
void recycle();
- Buffer* _next; ///< Intrusive linked list for BufferFactory
- Raul::AtomicInt _refs; ///< Intrusive reference count
+ Buffer* _next; ///< Intrusive linked list for BufferFactory
+ Raul::AtomicInt _refs; ///< Intrusive reference count
};
} // namespace Server
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index fd96119b..faac9514 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -213,19 +213,24 @@ Engine::activate()
ProcessContext context(*this);
Resource::Properties control_properties;
- control_properties.insert(make_pair(uris.lv2_name,
- forge.alloc("Control")));
- control_properties.insert(make_pair(uris.rdf_type,
- uris.atom_AtomPort));
- control_properties.insert(make_pair(uris.atom_bufferType,
- uris.atom_Sequence));
+ control_properties.insert(
+ make_pair(uris.lv2_name, forge.alloc("Control")));
+ control_properties.insert(
+ make_pair(uris.rdf_type,
+ Resource::Property(uris.atom_AtomPort)));
+ control_properties.insert(
+ make_pair(uris.atom_bufferType,
+ Resource::Property(uris.atom_Sequence)));
// Add control input
Resource::Properties in_properties(control_properties);
- in_properties.insert(make_pair(uris.rdf_type, uris.lv2_InputPort));
+ in_properties.insert(
+ make_pair(uris.rdf_type,
+ Resource::Property(uris.lv2_InputPort)));
in_properties.insert(make_pair(uris.lv2_index, forge.make(0)));
- in_properties.insert(make_pair(uris.lv2_portProperty,
- uris.lv2_connectionOptional));
+ in_properties.insert(
+ make_pair(uris.lv2_portProperty,
+ Resource::Property(uris.lv2_connectionOptional)));
in_properties.insert(
make_pair(uris.ingen_canvasX,
Resource::Property(forge.make(32.0f), Resource::EXTERNAL)));
@@ -241,10 +246,13 @@ Engine::activate()
// Add control out
Resource::Properties out_properties(control_properties);
- out_properties.insert(make_pair(uris.rdf_type, uris.lv2_OutputPort));
+ out_properties.insert(
+ make_pair(uris.rdf_type,
+ Resource::Property(uris.lv2_OutputPort)));
out_properties.insert(make_pair(uris.lv2_index, forge.make(1)));
- in_properties.insert(make_pair(uris.lv2_portProperty,
- uris.lv2_connectionOptional));
+ in_properties.insert(
+ make_pair(uris.lv2_portProperty,
+ Resource::Property(uris.lv2_connectionOptional)));
out_properties.insert(
make_pair(uris.ingen_canvasX,
Resource::Property(forge.make(128.0f), Resource::EXTERNAL)));
diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp
index 2b1b1bf6..a169e389 100644
--- a/src/server/EventWriter.cpp
+++ b/src/server/EventWriter.cpp
@@ -117,7 +117,9 @@ EventWriter::set_property(const Raul::URI& uri,
const Raul::Atom& value)
{
Resource::Properties remove;
- remove.insert(make_pair(predicate, _engine.world()->uris().wildcard));
+ remove.insert(
+ make_pair(predicate,
+ Resource::Property(_engine.world()->uris().wildcard)));
Resource::Properties add;
add.insert(make_pair(predicate, value));
_engine.enqueue_event(