[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src plugins/native/SpectralMeter.cpp t...
From: |
Nicola Doebelin |
Subject: |
[Traverso-commit] traverso/src plugins/native/SpectralMeter.cpp t... |
Date: |
Fri, 15 Feb 2008 15:58:57 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Nicola Doebelin <n_doebelin> 08/02/15 15:58:57
Modified files:
src/plugins/native: SpectralMeter.cpp
src/traverso : SpectralMeterWidget.cpp
Log message:
* fixes a bug when one channel is muted (meter stopped working)
* increase the falloff time to 10 sec to let it fall to -140 dB
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/native/SpectralMeter.cpp?cvsroot=traverso&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/SpectralMeterWidget.cpp?cvsroot=traverso&r1=1.52&r2=1.53
Patches:
Index: plugins/native/SpectralMeter.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/native/SpectralMeter.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- plugins/native/SpectralMeter.cpp 7 Feb 2008 15:32:48 -0000 1.8
+++ plugins/native/SpectralMeter.cpp 15 Feb 2008 15:58:57 -0000 1.9
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: SpectralMeter.cpp,v 1.8 2008/02/07 15:32:48 n_doebelin Exp $
+$Id: SpectralMeter.cpp,v 1.9 2008/02/15 15:58:57 n_doebelin Exp $
*/
@@ -214,13 +214,34 @@
fftw_execute(pfegr);
float tmp;
+ bool isNullL = true,
+ isNullR = true;
// send the fft spectrum to the caller
for (int i = 1; i < m_frlen/2 + 1; ++i) {
tmp = pow((float)fftspecl[i][0],2.0f) +
pow((float)fftspecl[i][1],2.0f);
specl.push_back(tmp);
+ if (tmp != 0.0) {
+ isNullL = false;
+ }
tmp = pow((float)fftspecr[i][0],2.0f) +
pow((float)fftspecr[i][1],2.0f);
specr.push_back(tmp);
+ if (tmp != 0.0) {
+ isNullR = false;
+ }
+ }
+
+ if (isNullL && isNullR) {
+ return 1;
+ }
+
+
+ // if one of the spectra only contains 0.0, we switch to mono by
copying the other one
+ if (isNullL) {
+ specl = specr;
+ }
+ if (isNullR) {
+ specr = specl;
}
return 1;
Index: traverso/SpectralMeterWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/SpectralMeterWidget.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- traverso/SpectralMeterWidget.cpp 15 Feb 2008 14:23:34 -0000 1.52
+++ traverso/SpectralMeterWidget.cpp 15 Feb 2008 15:58:57 -0000 1.53
@@ -50,7 +50,7 @@
static const float DEFAULT_VAL = -999.0f;
static const int UPDATE_INTERVAL = 40;
static const uint MAX_SAMPLES = UINT_MAX;
-static const int STOP_DELAY = 3000; // in ms
+static const int STOP_DELAY = 10000; // in ms
SpectralMeterWidget::SpectralMeterWidget(QWidget* parent)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src plugins/native/SpectralMeter.cpp t...,
Nicola Doebelin <=