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:
Tobias Doerffel
2010-05-17 23:19:41 +02:00
parent 9c9bca7098
commit 70b80efec1

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