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
This commit is contained in:
Tobias Doerffel
2008-08-20 11:27:34 +00:00
parent 120f929047
commit f352c7ecc5
2 changed files with 16 additions and 1 deletions

View File

@@ -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
{

View File

@@ -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();