summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/client/PluginModel.cpp5
-rw-r--r--src/libs/gui/LoadPluginWindow.cpp20
2 files changed, 15 insertions, 10 deletions
diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp
index fa39c0e3..99387dcd 100644
--- a/src/libs/client/PluginModel.cpp
+++ b/src/libs/client/PluginModel.cpp
@@ -39,7 +39,8 @@ Redland::World* PluginModel::_rdf_world = NULL;
string
PluginModel::default_node_name(SharedPtr<PatchModel> parent)
{
- string default_name = Raul::Path::nameify(_symbol);
+ return Raul::Path::nameify(_symbol);
+ /*string default_name = Raul::Path::nameify(_symbol);
string name;
char num_buf[3];
@@ -53,7 +54,7 @@ PluginModel::default_node_name(SharedPtr<PatchModel> parent)
break;
}
- return name;
+ return name;*/
}
diff --git a/src/libs/gui/LoadPluginWindow.cpp b/src/libs/gui/LoadPluginWindow.cpp
index 5c357827..76f5cdd4 100644
--- a/src/libs/gui/LoadPluginWindow.cpp
+++ b/src/libs/gui/LoadPluginWindow.cpp
@@ -298,7 +298,11 @@ LoadPluginWindow::generate_module_name(int offset)
if (iter) {
Gtk::TreeModel::Row row = *iter;
SharedPtr<PluginModel> plugin = row.get_value(_plugins_columns._col_plugin_model);
- return plugin->default_node_name(_patch);
+ std::stringstream ss;
+ ss << plugin->default_node_name(_patch);
+ if (offset != 0)
+ ss << "_" << offset + 1;
+ name = ss.str();
}
return name;
@@ -329,13 +333,13 @@ LoadPluginWindow::add_clicked()
App::instance().engine()->create_node(path, plugin->uri(), polyphonic);
for (GraphObject::Variables::const_iterator i = _initial_data.begin(); i != _initial_data.end(); ++i)
App::instance().engine()->set_variable(path, i->first, i->second);
- ++_plugin_name_offset;
- _node_name_entry->set_text(generate_module_name(_plugin_name_offset));
-
- // Set the next module location 20 over, for a cascade effect
- cerr << "FIXME: cascade\n";
- //m_new_module_x += 20;
- //m_new_module_y += 20;
+ _node_name_entry->set_text(generate_module_name(++_plugin_name_offset));
+
+ // Cascade
+ Atom& x = _initial_data["ingenuity:canvas-x"];
+ x = Atom(x.get_float() + 20.0f);
+ Atom& y = _initial_data["ingenuity:canvas-y"];
+ y = Atom(y.get_float() + 20.0f);
}
}
}