SpectrumAnalyzer: skip processing if UI is not visible
There's currently no need for analyzing the sound data if SpectrumAnalyzer's view is not visible. This saves some CPU time if SpectrumAnalyzer's view is not shown.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* spectrum_analyzer.cpp - spectrum analyzer plugin
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -82,6 +82,11 @@ bool spectrumAnalyzer::processAudioBuffer( sampleFrame * _buf,
|
||||
return( false );
|
||||
}
|
||||
|
||||
if( !m_saControls.isViewVisible() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
fpp_t f = 0;
|
||||
if( _frames > FFT_BUFFER_SIZE )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user