summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-12 03:20:59 +0000
committerDavid Robillard <d@drobilla.net>2007-09-12 03:20:59 +0000
commit599b4833362ca131ed4c4cd186a38de0764b1ec9 (patch)
treeac6d0fc1f3c4faa395e2d0fb7bc899128793e77a /src/libs/gui
parentc13e988094bca2c19b0676f8cfd60f3cff2f4a57 (diff)
downloadingen-599b4833362ca131ed4c4cd186a38de0764b1ec9.tar.gz
ingen-599b4833362ca131ed4c4cd186a38de0764b1ec9.tar.bz2
ingen-599b4833362ca131ed4c4cd186a38de0764b1ec9.zip
Fix manually specifying polyphony in load patch dialog.
git-svn-id: http://svn.drobilla.net/lad/ingen@703 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/LoadPatchWindow.cpp7
-rw-r--r--src/libs/gui/LoadRemotePatchWindow.cpp3
-rw-r--r--src/libs/gui/LoadSubpatchWindow.cpp13
-rw-r--r--src/libs/gui/ThreadedLoader.cpp6
-rw-r--r--src/libs/gui/ThreadedLoader.hpp3
5 files changed, 13 insertions, 19 deletions
diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp
index da557b40..593f2b6d 100644
--- a/src/libs/gui/LoadPatchWindow.cpp
+++ b/src/libs/gui/LoadPatchWindow.cpp
@@ -116,14 +116,13 @@ LoadPatchWindow::poly_from_user_selected()
void
LoadPatchWindow::ok_clicked()
{
- // If unset load_patch will load values
+ // If unset load_patch will load value
optional<const string&> name;
- optional<uint32_t> poly;
optional<Path> parent;
if (_poly_from_user_radio->get_active())
- poly = _poly_spinbutton->get_value_as_int();
+ _initial_data.insert(make_pair("ingen:polyphony", _poly_spinbutton->get_value_as_int()));
if (_replace)
App::instance().engine()->clear_patch(_patch->path());
@@ -132,7 +131,7 @@ LoadPatchWindow::ok_clicked()
parent = _patch->path().parent();
App::instance().loader()->load_patch(true, get_uri(), "/",
- _initial_data, parent, name, poly);
+ _initial_data, parent, name);
hide();
}
diff --git a/src/libs/gui/LoadRemotePatchWindow.cpp b/src/libs/gui/LoadRemotePatchWindow.cpp
index b5caf351..c2d40c5e 100644
--- a/src/libs/gui/LoadRemotePatchWindow.cpp
+++ b/src/libs/gui/LoadRemotePatchWindow.cpp
@@ -136,7 +136,6 @@ LoadRemotePatchWindow::open_clicked()
// If unset load_patch will load values
optional<const string&> name;
- optional<uint32_t> poly;
optional<Path> parent;
@@ -147,7 +146,7 @@ LoadRemotePatchWindow::open_clicked()
parent = _patch->path().parent();
App::instance().loader()->load_patch(true, uri, "/",
- _initial_data, parent, name, poly);
+ _initial_data, parent, name);
hide();
}
diff --git a/src/libs/gui/LoadSubpatchWindow.cpp b/src/libs/gui/LoadSubpatchWindow.cpp
index d3628e64..42058578 100644
--- a/src/libs/gui/LoadSubpatchWindow.cpp
+++ b/src/libs/gui/LoadSubpatchWindow.cpp
@@ -144,7 +144,6 @@ LoadSubpatchWindow::ok_clicked()
// If unset load_patch will load values
optional<const string&> name;
- optional<uint32_t> poly;
string name_str = "";
if (_name_from_user_radio->get_active()) {
@@ -152,13 +151,15 @@ LoadSubpatchWindow::ok_clicked()
name = name_str;
}
- if (_poly_from_user_radio->get_active())
- poly = _poly_spinbutton->get_value_as_int();
- else if (_poly_from_parent_radio->get_active())
- poly = _patch->poly();
+ if (_poly_from_user_radio->get_active()) {
+ cerr << "Overriding poly: " << _poly_spinbutton->get_value_as_int() << endl;
+ _initial_data.insert(make_pair("ingen:polyphony", (int)_poly_spinbutton->get_value_as_int()));
+ } else if (_poly_from_parent_radio->get_active()) {
+ _initial_data.insert(make_pair("ingen:polyphony", (int)_patch->poly()));
+ }
App::instance().loader()->load_patch(false, get_uri(), "/",
- _initial_data, _patch->path(), name, poly);
+ _initial_data, _patch->path(), name);
hide();
}
diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp
index 22b0a8d9..568806a8 100644
--- a/src/libs/gui/ThreadedLoader.cpp
+++ b/src/libs/gui/ThreadedLoader.cpp
@@ -71,15 +71,13 @@ ThreadedLoader::_whipped()
_mutex.unlock();
}
-/** FIXME: use poly parameter */
void
ThreadedLoader::load_patch(bool merge,
const string& data_base_uri,
const Path& data_path,
MetadataMap engine_data,
optional<Path> engine_parent,
- optional<const string&> engine_name,
- optional<uint32_t> engine_poly)
+ optional<const string&> engine_name)
{
_mutex.lock();
@@ -90,7 +88,6 @@ ThreadedLoader::load_patch(bool merge,
data_base_uri,
engine_parent,
(engine_name) ? engine_name.get() : "",
- (engine_poly) ? engine_poly.get() : 1,
engine_data,
false)));
} else {
@@ -101,7 +98,6 @@ ThreadedLoader::load_patch(bool merge,
data_base_uri,
engine_parent,
(engine_name) ? engine_name.get() : "",
- // FIXME: poly here
"",
engine_data )));
}
diff --git a/src/libs/gui/ThreadedLoader.hpp b/src/libs/gui/ThreadedLoader.hpp
index e65470f7..68045598 100644
--- a/src/libs/gui/ThreadedLoader.hpp
+++ b/src/libs/gui/ThreadedLoader.hpp
@@ -66,8 +66,7 @@ public:
const Path& data_path,
MetadataMap engine_data,
optional<Path> engine_parent,
- optional<const string&> engine_name = optional<const string&>(),
- optional<uint32_t> engine_poly = optional<uint32_t>());
+ optional<const string&> engine_name = optional<const string&>());
void save_patch(SharedPtr<PatchModel> model, const string& filename);