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.
(cherry picked from commit 70b80efec1)
This commit is contained in:
Tobias Doerffel
2010-05-17 23:19:41 +02:00
parent 48bbfad53d
commit 9b0925432a

View File

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