From 2fa588b481e717e823e4b049d0e65b8e99e45628 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 30 Jul 2008 01:19:27 +0000 Subject: Allow loading multiple subpatches at once (in Load Patch dialog from context menu). git-svn-id: http://svn.drobilla.net/lad/ingen@1311 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/LoadSubpatchWindow.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libs/gui/LoadSubpatchWindow.cpp b/src/libs/gui/LoadSubpatchWindow.cpp index 2fdbf094..f637409e 100644 --- a/src/libs/gui/LoadSubpatchWindow.cpp +++ b/src/libs/gui/LoadSubpatchWindow.cpp @@ -60,6 +60,8 @@ LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefP filt.add_pattern("*.ingen.ttl"); filt.set_name("Ingen patch files (RDF, *.ingen.ttl)"); set_filter(filt); + + property_select_multiple() = true; // Add global examples directory to "shortcut folders" (bookmarks) string examples_dir = PKGDATADIR; @@ -158,8 +160,16 @@ LoadSubpatchWindow::ok_clicked() _initial_data.insert(make_pair("ingen:polyphony", (int)_patch->poly())); } - App::instance().loader()->load_patch(false, get_uri(), "/", - _initial_data, _patch->path(), name); + std::list uris = get_uris(); + for (std::list::iterator i = uris.begin(); i != uris.end(); ++i) { + // 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); + + App::instance().loader()->load_patch(false, *i, "/", _initial_data, _patch->path(), name); + } hide(); } -- cgit v1.2.1