summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/PatchController.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/PatchController.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/PatchController.cpp')
-rw-r--r--src/progs/ingenuity/PatchController.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/progs/ingenuity/PatchController.cpp b/src/progs/ingenuity/PatchController.cpp
index 79084cdc..49c7491c 100644
--- a/src/progs/ingenuity/PatchController.cpp
+++ b/src/progs/ingenuity/PatchController.cpp
@@ -313,8 +313,8 @@ PatchController::create_view()
/* Set sane default coordinates if not set already yet */
if (nm->x() == 0.0f && nm->y() == 0.0f) {
- int x, y;
- get_new_module_location(x, y);
+ double x, y;
+ m_patch_view->canvas()->get_new_module_location(x, y);
nm->x(x);
nm->y(y);
}
@@ -338,7 +338,7 @@ PatchController::create_view()
PortController* const pc = dynamic_cast<PortController*>((*i)->controller());
assert(pc);
if (pc->module() == NULL)
- pc->create_module(m_patch_view->canvas(), 1600, 1200);
+ pc->create_module(m_patch_view->canvas());
assert(pc->module() != NULL);
m_patch_view->canvas()->add_module(pc->module());
pc->module()->resize();
@@ -471,8 +471,8 @@ PatchController::add_node(CountedPtr<NodeModel> object)
assert(node->controller() == nc);
if (m_patch_view != NULL) {
- int x, y;
- get_new_module_location(x, y);
+ double x, y;
+ m_patch_view->canvas()->get_new_module_location(x, y);
node->x(x);
node->y(y);
@@ -557,8 +557,6 @@ PatchController::add_port(CountedPtr<PortModel> pm)
// Create port's (pseudo) module on this patch's canvas (if there is one)
if (m_patch_view != NULL) {
- int x, y;
- get_new_module_location(x, y);
// Set zoom to 1.0 so module isn't messed up (Death to GnomeCanvas)
float old_zoom = m_patch_view->canvas()->zoom();
@@ -566,7 +564,7 @@ PatchController::add_port(CountedPtr<PortModel> pm)
m_patch_view->canvas()->zoom(1.0);
if (pc->module() == NULL)
- pc->create_module(m_patch_view->canvas(), x, y);
+ pc->create_module(m_patch_view->canvas());
assert(pc->module() != NULL);
m_patch_view->canvas()->add_module(pc->module());
pc->module()->resize();
@@ -662,20 +660,6 @@ PatchController::disconnection(const Path& src_port_path, const Path& dst_port_p
*/
}
-
-/** Try to guess a suitable location for a new module.
- */
-void
-PatchController::get_new_module_location(int& x, int& y)
-{
- assert(m_patch_view != NULL);
- assert(m_patch_view->canvas() != NULL);
- m_patch_view->canvas()->get_scroll_offsets(x, y);
- x += 20;
- y += 20;
-}
-
-
void
PatchController::show_patch_window()
{