summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/LoadPatchWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-10-28 04:59:44 +0000
committerDavid Robillard <d@drobilla.net>2006-10-28 04:59:44 +0000
commit90ab0227e7ce1abcb5b0b4eb455aa3c3845065d3 (patch)
treefeea187323d05592e66ad02c772a4d083dbc173a /src/progs/ingenuity/LoadPatchWindow.cpp
parentf8e09808b7a51b474cbee66442cf7a03eed9010a (diff)
downloadingen-90ab0227e7ce1abcb5b0b4eb455aa3c3845065d3.tar.gz
ingen-90ab0227e7ce1abcb5b0b4eb455aa3c3845065d3.tar.bz2
ingen-90ab0227e7ce1abcb5b0b4eb455aa3c3845065d3.zip
Added proper new loading interface to Serializer, updated everything that uses it (no actual implementation yet).
git-svn-id: http://svn.drobilla.net/lad/ingen@194 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/LoadPatchWindow.cpp')
-rw-r--r--src/progs/ingenuity/LoadPatchWindow.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/progs/ingenuity/LoadPatchWindow.cpp b/src/progs/ingenuity/LoadPatchWindow.cpp
index 7605f0f0..b3e3068b 100644
--- a/src/progs/ingenuity/LoadPatchWindow.cpp
+++ b/src/progs/ingenuity/LoadPatchWindow.cpp
@@ -17,12 +17,15 @@
#include "LoadPatchWindow.h"
#include <sys/types.h>
#include <dirent.h>
+#include <boost/optional/optional.hpp>
#include "App.h"
#include "Configuration.h"
#include "PatchModel.h"
#include "ModelEngineInterface.h"
#include "Loader.h"
+using boost::optional;
+
namespace Ingenuity {
@@ -108,9 +111,9 @@ LoadPatchWindow::poly_from_user_selected()
void
LoadPatchWindow::ok_clicked()
{
- // These values are interpreted by load_patch() as "not defined", ie load from file
- string name = "";
- int poly = 0;
+ // If unset load_patch will load values
+ optional<const string&> name;
+ optional<size_t> poly;
if (m_poly_from_user_radio->get_active())
poly = m_poly_spinbutton->get_value_as_int();
@@ -118,14 +121,8 @@ LoadPatchWindow::ok_clicked()
if (m_replace)
App::instance().engine()->clear_patch(m_patch->path());
- cerr << "FIXME: load patch" << endl;
- //SharedPtr<PatchModel> pm(new PatchModel(m_patch->path(), poly));
- //pm->filename(get_filename());
- //pm->set_metadata("filename", Atom(get_filename().c_str()));
- // FIXME: necessary?
- //pm->set_parent(m_patch->parent());
- //App::instance().engine()->push_added_patch(pm);
- //App::instance().loader()->load_patch(pm, true, true);
+ App::instance().loader()->load_patch(true, get_filename(), "/",
+ m_initial_data, m_patch->parent()->path(), name, poly);
hide();
}