From fc57e53e2554aa1a654d66bb7b97a8738bb77fb5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 9 Jun 2011 03:41:17 +0000 Subject: Automatically resize modules at update time as necessary. This avoids the huge multiple resize performance problems of the past without requiring the user to manually resize modules. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3375 a436a847-0d15-0410-975c-d299462d15a1 --- src/AlsaDriver.cpp | 4 ---- src/JackDriver.cpp | 3 --- src/Patchage.cpp | 23 ----------------------- src/Patchage.hpp | 5 ----- src/PatchageEvent.cpp | 4 +--- 5 files changed, 1 insertion(+), 38 deletions(-) (limited to 'src') diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index b2ceed7..2ddb2b6 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -134,9 +134,6 @@ AlsaDriver::refresh() } create_port_view_internal(_app, addr, parent, port); - if (parent) { - _app->enqueue_resize(parent); - } } } @@ -223,7 +220,6 @@ AlsaDriver::find_or_create_module( m = new PatchageModule(patchage, client_name, type); m->load_location(); _app->canvas()->add_module(client_name, m); - _app->enqueue_resize(m); _modules.insert(std::make_pair(client_id, m)); } return m; diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 27cab50..9624692 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -161,7 +161,6 @@ JackDriver::create_port_view(Patchage* patchage, PatchagePort* port = create_port(*parent, jack_port, id); port->show(); - _app->enqueue_resize(parent); return port; } @@ -271,8 +270,6 @@ JackDriver::refresh() if (!m->get_port(jack_port_short_name(port))) create_port(*m, port, PortID()); - - _app->enqueue_resize(m); } // Add all connections diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 441247a..016fbbe 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -366,8 +366,6 @@ Patchage::idle_callback() _refresh = false; _driver_detached = false; - flush_resize(); - // Update load every 10 idle callbacks static int count = 0; if (++count == 10) { @@ -456,8 +454,6 @@ Patchage::refresh() if (_alsa_driver) _alsa_driver->refresh(); #endif - - flush_resize(); } } @@ -813,22 +809,3 @@ Patchage::on_scroll(GdkEventScroll* ev) { return false; } - -void -Patchage::enqueue_resize(FlowCanvas::Module* module) -{ - if (module) - _pending_resize.insert(module); -} - -void -Patchage::flush_resize() -{ - for (std::set::iterator i = _pending_resize.begin(); - i != _pending_resize.end(); ++i) { - (*i)->resize(); - } - - _pending_resize.clear(); -} - diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 4d6a11d..1c4f609 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -99,9 +99,6 @@ public: void update_state(); void store_window_location(); - void enqueue_resize(FlowCanvas::Module* module); - void flush_resize(); - protected: void connect_widgets(); @@ -150,8 +147,6 @@ protected: boost::shared_ptr _canvas; - std::set _pending_resize; - JackDriver* _jack_driver; StateManager* _state_manager; diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index 32136e3..cf53c03 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -72,9 +72,7 @@ PatchageEvent::execute(Patchage* patchage) if (driver) { PatchagePort* port = driver->create_port_view(patchage, _port_1); - if (port) - patchage->enqueue_resize(port->module()); - else + if (!port) Raul::error << "Unable to create port view: " << _port_1 << endl; } else { Raul::error << "Attempt to create port with unknown type: " << _port_1 << endl; -- cgit v1.2.1