summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-12 21:08:20 +0000
committerDavid Robillard <d@drobilla.net>2008-08-12 21:08:20 +0000
commitcf7f168e8630baeace81ffad85fb555389902855 (patch)
tree6bca1cae0b8778513a4c487b9f363a592880e572 /src
parentf8a3c07358cab7947f7d06c947a3bd81afdd9ce0 (diff)
downloadingen-cf7f168e8630baeace81ffad85fb555389902855.tar.gz
ingen-cf7f168e8630baeace81ffad85fb555389902855.tar.bz2
ingen-cf7f168e8630baeace81ffad85fb555389902855.zip
Fix plugin selection window (adding the same plugin twice in a row works, nicer default numbering).
Cascade multiple plugins added from one run of plugin selection window. git-svn-id: http://svn.drobilla.net/lad/ingen@1343 a436a847-0d15-0410-975c-d299462d15a1
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);
}
}
}