summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-09 23:59:01 +0000
committerDavid Robillard <d@drobilla.net>2009-05-09 23:59:01 +0000
commit5465c4af1c7b18cba31fa3d15ab1741f2613e9d4 (patch)
treea7331689f196cef1e979afa313ba60122fa64a97 /src/PatchageEvent.cpp
parent43e673a183844709ecd41e08d97f96d9228a544c (diff)
downloadpatchage-5465c4af1c7b18cba31fa3d15ab1741f2613e9d4.tar.gz
patchage-5465c4af1c7b18cba31fa3d15ab1741f2613e9d4.tar.bz2
patchage-5465c4af1c7b18cba31fa3d15ab1741f2613e9d4.zip
Dramatically reduce resize overhead everywhere.
Make alsa driver create individual ports and do minimal work vs naive full refresh when anything changes. Fixes ticket #355. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@1967 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r--src/PatchageEvent.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp
index 63fa029..4fbefdf 100644
--- a/src/PatchageEvent.cpp
+++ b/src/PatchageEvent.cpp
@@ -68,9 +68,11 @@ PatchageEvent::execute(Patchage* patchage)
#endif
}
-
if (driver) {
- if ( ! driver->create_port_view(patchage, _port_1))
+ SharedPtr<PatchagePort> port = driver->create_port_view(patchage, _port_1);
+ if (port)
+ patchage->enqueue_resize(port->module().lock());
+ else
cerr << "Unable to create port view" << endl;
} else {
cerr << "ERROR: Create port with unknown port type" << endl;
@@ -85,6 +87,7 @@ PatchageEvent::execute(Patchage* patchage)
assert(module);
module->remove_port(port);
+ patchage->enqueue_resize(module);
port.reset();
// No empty modules (for now)
@@ -92,7 +95,7 @@ PatchageEvent::execute(Patchage* patchage)
patchage->canvas()->remove_item(module);
module.reset();
} else {
- module->resize();
+ patchage->enqueue_resize(module);
}
} else {