Index: src/Driver.hpp =================================================================== --- src/Driver.hpp (revision 1161) +++ src/Driver.hpp (working copy) @@ -31,6 +31,14 @@ public: virtual ~Driver() {} + virtual void process_events(Patchage* app) { + while (!events().empty()) { + PatchageEvent& ev = events().front(); + ev.execute(app); + events().pop(); + } + } + virtual void attach(bool launch_daemon) = 0; virtual void detach() = 0; virtual bool is_attached() const = 0; Index: src/LashDriver.hpp =================================================================== --- src/LashDriver.hpp (revision 1161) +++ src/LashDriver.hpp (working copy) @@ -55,7 +55,7 @@ void refresh() {} - void process_events() { _server_interface->process_events(); } + void process_events(Patchage* app) { _server_interface->process_events(); } void restore_project(const std::string& directory); void set_project_directory(const std::string& directory); Index: src/Patchage.cpp =================================================================== --- src/Patchage.cpp (revision 1161) +++ src/Patchage.cpp (working copy) @@ -305,27 +305,19 @@ // Process any JACK events if (_jack_driver) { - while (!_jack_driver->events().empty()) { - PatchageEvent& ev = _jack_driver->events().front(); - ev.execute(this); - _jack_driver->events().pop(); - } + _jack_driver->process_events(this); } // Process any ALSA events #ifdef HAVE_ALSA if (_alsa_driver) { - while (!_alsa_driver->events().empty()) { - PatchageEvent& ev = _alsa_driver->events().front(); - ev.execute(this); - _alsa_driver->events().pop(); - } + _alsa_driver->process_events(this); } #endif #ifdef HAVE_LASH if (_lash_driver->is_attached()) - _lash_driver->process_events(); + _lash_driver->process_events(this); #endif // Do a full refresh (ie user clicked refresh)