From f352c7ecc5576b043679c04de1b262ee8804da44 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 20 Aug 2008 11:27:34 +0000 Subject: [PATCH] only skip GUI-updates when connected to frequently changing controllers git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1449 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/controller.h | 15 ++++++++++++++- src/gui/widgets/knob.cpp | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/controller.h b/include/controller.h index d022c88be..7b13f25b2 100644 --- a/include/controller.h +++ b/include/controller.h @@ -74,11 +74,24 @@ public: m_sampleExact = _exact; } - ControllerTypes type( void ) const + inline ControllerTypes type( void ) const { return( m_type ); } + // return whether this controller updates models frequently - used for + // determining when to update GUI + inline bool frequentUpdates( void ) const + { + switch( m_type ) + { + case LfoController: return( TRUE ); + case PeakController: return( TRUE ); + default: + break; + } + return( FALSE ); + } virtual const QString & name( void ) const { diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index da9307838..653742e92 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -603,6 +603,8 @@ void knob::enterValue( void ) void knob::friendlyUpdate( void ) { if( model()->getControllerConnection() == NULL || + model()->getControllerConnection()->getController()-> + frequentUpdates() == FALSE || controller::runningFrames() % (256*4) == 0 ) { update();