summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/LoadSubpatchWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-07 06:04:55 +0000
committerDavid Robillard <d@drobilla.net>2006-09-07 06:04:55 +0000
commitacbe9a26ec3ab689e430225d15e95e73a7378aa9 (patch)
treecd10095833a77f3ab6c87d0e21fbbd9a8d74d66a /src/progs/ingenuity/LoadSubpatchWindow.cpp
parent445b55c6d13db5fffe18113cd6664e7923f8251b (diff)
downloadingen-acbe9a26ec3ab689e430225d15e95e73a7378aa9.tar.gz
ingen-acbe9a26ec3ab689e430225d15e95e73a7378aa9.tar.bz2
ingen-acbe9a26ec3ab689e430225d15e95e73a7378aa9.zip
Patch port fixes.
Port metadata fixes. Compatibility hacks for loading old patches. Internal node fixes, cleanups, minor refactor. Path fixes. git-svn-id: http://svn.drobilla.net/lad/ingen@118 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/LoadSubpatchWindow.cpp')
-rw-r--r--src/progs/ingenuity/LoadSubpatchWindow.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/progs/ingenuity/LoadSubpatchWindow.cpp b/src/progs/ingenuity/LoadSubpatchWindow.cpp
index dbf40c00..0ec98771 100644
--- a/src/progs/ingenuity/LoadSubpatchWindow.cpp
+++ b/src/progs/ingenuity/LoadSubpatchWindow.cpp
@@ -20,6 +20,8 @@
#include <cassert>
#include "App.h"
#include "PatchController.h"
+#include "PatchView.h"
+#include "OmFlowCanvas.h"
#include "NodeModel.h"
#include "Controller.h"
#include "PatchModel.h"
@@ -130,9 +132,11 @@ LoadSubpatchWindow::ok_clicked()
assert(m_patch_controller != NULL);
assert(m_patch_controller->model());
- // These values are interpreted by load_patch() as "not defined", ie load from file
- string name = "";
- int poly = 0;
+ const string filename = get_filename();
+
+ // FIXME
+ string name = filename.substr(filename.find_last_of("/")+1);
+ int poly = 1;
if (m_name_from_user_radio->get_active())
name = m_name_entry->get_text();
@@ -143,21 +147,21 @@ LoadSubpatchWindow::ok_clicked()
poly = m_patch_controller->patch_model()->poly();
if (m_new_module_x == 0 && m_new_module_y == 0) {
- m_patch_controller->get_new_module_location(
+ m_patch_controller->view()->canvas()->get_new_module_location(
m_new_module_x, m_new_module_y);
}
PatchModel* pm = new PatchModel(m_patch_controller->model()->base_path() + name, poly);
- pm->filename(get_filename());
+ pm->filename(filename);
pm->set_parent(m_patch_controller->model().get());
pm->x(m_new_module_x);
pm->y(m_new_module_y);
- if (name == "")
- pm->set_path("");
+ //if (name == "")
+ // pm->set_path("");
char temp_buf[16];
- snprintf(temp_buf, 16, "%d", m_new_module_x);
+ snprintf(temp_buf, 16, "%16f", m_new_module_x);
pm->set_metadata("module-x", temp_buf);
- snprintf(temp_buf, 16, "%d", m_new_module_y);
+ snprintf(temp_buf, 16, "%16f", m_new_module_y);
pm->set_metadata("module-y", temp_buf);
Controller::instance().load_patch(pm);