]> git.sesse.net Git - kdenlive/blob - src/scopes/audioscopes/audiospectrum.cpp
includemocs
[kdenlive] / src / scopes / audioscopes / audiospectrum.cpp
1 /***************************************************************************
2  *   Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com)      *
3  *   This file is part of kdenlive. See www.kdenlive.org.                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11
12
13 #include "audiospectrum.h"
14 #include "lib/audio/fftTools.h"
15 #include "lib/external/kiss_fft/tools/kiss_fftr.h"
16
17 #include <QMenu>
18 #include <QPainter>
19 #include <QMouseEvent>
20
21 #include <iostream>
22
23 // (defined in the header file)
24 #ifdef DEBUG_AUDIOSPEC
25 #include <QDebug>
26 #endif
27
28 // (defined in the header file)
29 #ifdef DETECT_OVERMODULATION
30 #include <limits>
31 #include <cmath>
32 #endif
33
34 // Draw lines instead of single pixels.
35 // This is about 25 % faster, especially when enlarging the scope to e.g. 1680x1050 px.
36 #define AUDIOSPEC_LINES
37
38 #define MIN_DB_VALUE -120
39 #define MAX_FREQ_VALUE 96000
40 #define MIN_FREQ_VALUE 1000
41 #define ALPHA_MOVING_AVG 0.125
42 #define MAX_OVM_COLOR 0.7
43
44 AudioSpectrum::AudioSpectrum(QWidget *parent) :
45     AbstractAudioScopeWidget(true, parent)
46     , m_fftTools()
47     , m_lastFFT()
48     , m_lastFFTLock(1)
49     , m_peaks()
50   #ifdef DEBUG_AUDIOSPEC
51     , m_timeTotal(0)
52     , m_showTotal(0)
53   #endif
54     , m_dBmin(-70)
55     , m_dBmax(0)
56     , m_freqMax(0)
57     , m_customFreq(false)
58     ,colorizeFactor(0)
59 {
60     ui = new Ui::AudioSpectrum_UI;
61     ui->setupUi(this);
62
63
64     m_aResetHz = new QAction(i18n("Reset maximum frequency to sampling rate"), this);
65     m_aTrackMouse = new QAction(i18n("Track mouse"), this);
66     m_aTrackMouse->setCheckable(true);
67     m_aShowMax = new QAction(i18n("Show maximum"), this);
68     m_aShowMax->setCheckable(true);
69
70
71     m_menu->addSeparator();
72     m_menu->addAction(m_aResetHz);
73     m_menu->addAction(m_aTrackMouse);
74     m_menu->addAction(m_aShowMax);
75     m_menu->removeAction(m_aRealtime);
76
77
78     ui->windowSize->addItem("256", QVariant(256));
79     ui->windowSize->addItem("512", QVariant(512));
80     ui->windowSize->addItem("1024", QVariant(1024));
81     ui->windowSize->addItem("2048", QVariant(2048));
82
83     ui->windowFunction->addItem(i18n("Rectangular window"), FFTTools::Window_Rect);
84     ui->windowFunction->addItem(i18n("Triangular window"), FFTTools::Window_Triangle);
85     ui->windowFunction->addItem(i18n("Hamming window"), FFTTools::Window_Hamming);
86
87
88     bool b = true;
89     b &= connect(m_aResetHz, SIGNAL(triggered()), this, SLOT(slotResetMaxFreq()));
90     b &= connect(ui->windowFunction, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdate()));
91     b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
92     Q_ASSERT(b);
93
94
95     // Note: These strings are used in both Spectogram and AudioSpectrum. Ideally change both (if necessary) to reduce workload on translators
96     ui->labelFFTSize->setToolTip(i18n("The maximum window size is limited by the number of samples per frame."));
97     ui->windowSize->setToolTip(i18n("A bigger window improves the accuracy at the cost of computational power."));
98     ui->windowFunction->setToolTip(i18n("The rectangular window function is good for signals with equal signal strength (narrow peak), but creates more smearing. See Window function on Wikipedia."));
99
100     AbstractScopeWidget::init();
101 }
102 AudioSpectrum::~AudioSpectrum()
103 {
104     writeConfig();
105
106     delete m_aResetHz;
107     delete m_aTrackMouse;
108     delete ui;
109 }
110
111 void AudioSpectrum::readConfig()
112 {
113     AbstractScopeWidget::readConfig();
114
115     KSharedConfigPtr config = KGlobal::config();
116     KConfigGroup scopeConfig(config, AbstractScopeWidget::configName());
117
118     ui->windowSize->setCurrentIndex(scopeConfig.readEntry("windowSize", 0));
119     ui->windowFunction->setCurrentIndex(scopeConfig.readEntry("windowFunction", 0));
120     m_aTrackMouse->setChecked(scopeConfig.readEntry("trackMouse", true));
121     m_aShowMax->setChecked(scopeConfig.readEntry("showMax", true));
122     m_dBmax = scopeConfig.readEntry("dBmax", 0);
123     m_dBmin = scopeConfig.readEntry("dBmin", -70);
124     m_freqMax = scopeConfig.readEntry("freqMax", 0);
125
126     if (m_freqMax == 0) {
127         m_customFreq = false;
128         m_freqMax = 10000;
129     } else {
130         m_customFreq = true;
131     }
132 }
133 void AudioSpectrum::writeConfig()
134 {
135     KSharedConfigPtr config = KGlobal::config();
136     KConfigGroup scopeConfig(config, AbstractScopeWidget::configName());
137
138     scopeConfig.writeEntry("windowSize", ui->windowSize->currentIndex());
139     scopeConfig.writeEntry("windowFunction", ui->windowFunction->currentIndex());
140     scopeConfig.writeEntry("trackMouse", m_aTrackMouse->isChecked());
141     scopeConfig.writeEntry("showMax", m_aShowMax->isChecked());
142     scopeConfig.writeEntry("dBmax", m_dBmax);
143     scopeConfig.writeEntry("dBmin", m_dBmin);
144     if (m_customFreq) {
145         scopeConfig.writeEntry("freqMax", m_freqMax);
146     } else {
147         scopeConfig.writeEntry("freqMax", 0);
148     }
149
150     scopeConfig.sync();
151 }
152
153 QString AudioSpectrum::widgetName() const { return QString("AudioSpectrum"); }
154 bool AudioSpectrum::isBackgroundDependingOnInput() const { return false; }
155 bool AudioSpectrum::isScopeDependingOnInput() const { return true; }
156 bool AudioSpectrum::isHUDDependingOnInput() const { return false; }
157
158 QImage AudioSpectrum::renderBackground(uint) { return QImage(); }
159
160 QImage AudioSpectrum::renderAudioScope(uint, const QVector<int16_t> audioFrame, const int freq, const int num_channels,
161                                        const int num_samples, const int)
162 {
163     if (
164             audioFrame.size() > 63
165             && m_innerScopeRect.width() > 0 && m_innerScopeRect.height() > 0    // <= 0 if widget is too small (resized by user)
166     ) {
167         if (!m_customFreq) {
168             m_freqMax = freq / 2;
169         }
170
171         QTime start = QTime::currentTime();
172
173
174 #ifdef DETECT_OVERMODULATION
175         bool overmodulated = false;
176         int overmodulateCount = 0;
177
178         for (int i = 0; i < audioFrame.size(); ++i) {
179             if (
180                     audioFrame[i] == std::numeric_limits<int16_t>::max()
181                     || audioFrame[i] == std::numeric_limits<int16_t>::min()) {
182                 overmodulateCount++;
183                 if (overmodulateCount > 3) {
184                     overmodulated = true;
185                     break;
186                 }
187             }
188         }
189         if (overmodulated) {
190             colorizeFactor = 1;
191         } else {
192             if (colorizeFactor > 0) {
193                 colorizeFactor -= .08;
194                 if (colorizeFactor < 0) {
195                     colorizeFactor = 0;
196                 }
197             }
198         }
199 #endif
200
201
202         // Determine the window size to use. It should be
203         // * not bigger than the number of samples actually available
204         // * divisible by 2
205         int fftWindow = ui->windowSize->itemData(ui->windowSize->currentIndex()).toInt();
206         if (fftWindow > num_samples) {
207             fftWindow = num_samples;
208         }
209         if ((fftWindow & 1) == 1) {
210             fftWindow--;
211         }
212
213         // Show the window size used, for information
214         ui->labelFFTSizeNumber->setText(QVariant(fftWindow).toString());
215
216
217         // Get the spectral power distribution of the input samples,
218         // using the given window size and function
219         float freqSpectrum[fftWindow/2];
220         FFTTools::WindowType windowType = (FFTTools::WindowType) ui->windowFunction->itemData(ui->windowFunction->currentIndex()).toInt();
221         m_fftTools.fftNormalized(audioFrame, 0, num_channels, freqSpectrum, windowType, fftWindow, 0);
222
223
224         // Store the current FFT window (for the HUD) and run the interpolation
225         // for easy pixel-based dB value access
226         QVector<float> dbMap;
227         m_lastFFTLock.acquire();
228         m_lastFFT = QVector<float>(fftWindow/2);
229         memcpy(m_lastFFT.data(), &(freqSpectrum[0]), fftWindow/2 * sizeof(float));
230
231         uint right = ((float) m_freqMax)/(m_freq/2) * (m_lastFFT.size() - 1);
232         dbMap = FFTTools::interpolatePeakPreserving(m_lastFFT, m_innerScopeRect.width(), 0, right, -180);
233         m_lastFFTLock.release();
234
235
236 #ifdef DEBUG_AUDIOSPEC
237         QTime drawTime = QTime::currentTime();
238 #endif
239
240         // Draw the spectrum
241         QImage spectrum(m_scopeRect.size(), QImage::Format_ARGB32);
242         spectrum.fill(qRgba(0,0,0,0));
243         const uint w = m_innerScopeRect.width();
244         const uint h = m_innerScopeRect.height();
245         const uint leftDist = m_innerScopeRect.left() - m_scopeRect.left();
246         const uint topDist = m_innerScopeRect.top() - m_scopeRect.top();
247         QColor spectrumColor(AbstractScopeWidget::colDarkWhite);
248         int yMax;
249
250 #ifdef DETECT_OVERMODULATION
251         if (colorizeFactor > 0) {
252             QColor col = AbstractScopeWidget::colHighlightDark;
253             QColor spec = spectrumColor;
254             float f = std::sin(M_PI_2 * colorizeFactor);
255             spectrumColor = QColor(
256                         (int) (f * col.red() + (1-f) * spec.red()),
257                         (int) (f * col.green() + (1-f) * spec.green()),
258                         (int) (f * col.blue() + (1-f) * spec.blue()),
259                         spec.alpha()
260                         );
261             // Limit the maximum colorization for non-overmodulated frames to better
262             // recognize consecutively overmodulated frames
263             if (colorizeFactor > MAX_OVM_COLOR) {
264                 colorizeFactor = MAX_OVM_COLOR;
265             }
266         }
267 #endif
268
269 #ifdef AUDIOSPEC_LINES
270         QPainter davinci(&spectrum);
271         davinci.setPen(QPen(QBrush(spectrumColor.rgba()), 1, Qt::SolidLine));
272 #endif
273
274         for (uint i = 0; i < w; ++i) {
275             yMax = (dbMap[i] - m_dBmin) / (m_dBmax-m_dBmin) * (h-1);
276             if (yMax < 0) {
277                 yMax = 0;
278             } else if (yMax >= (int)h) {
279                 yMax = h-1;
280             }
281 #ifdef AUDIOSPEC_LINES
282             davinci.drawLine(leftDist + i, topDist + h-1, leftDist + i, topDist + h-1 - yMax);
283 #else
284             for (int y = 0; y < yMax && y < (int)h; y++) {
285                 spectrum.setPixel(leftDist + i, topDist + h-y-1, spectrumColor.rgba());
286             }
287 #endif
288         }
289
290         // Calculate the peak values. Use the new value if it is bigger, otherwise adapt to lower
291         // values using the Moving Average formula
292         if (m_aShowMax->isChecked()) {
293             davinci.setPen(QPen(QBrush(AbstractScopeWidget::colHighlightLight), 2));
294             if (m_peaks.size() != fftWindow/2) {
295                 m_peaks = QVector<float>(m_lastFFT);
296             } else {
297                 for (int i = 0; i < fftWindow/2; ++i) {
298                     if (m_lastFFT[i] > m_peaks[i]) {
299                         m_peaks[i] = m_lastFFT[i];
300                     } else {
301                         m_peaks[i] = ALPHA_MOVING_AVG * m_lastFFT[i] + (1-ALPHA_MOVING_AVG) * m_peaks[i];
302                     }
303                 }
304             }
305             int prev = 0;
306             m_peakMap = FFTTools::interpolatePeakPreserving(m_peaks, m_innerScopeRect.width(), 0, right, -180);
307             for (uint i = 0; i < w; ++i) {
308                 yMax = (m_peakMap[i] - m_dBmin) / (m_dBmax-m_dBmin) * (h-1);
309                 if (yMax < 0) {
310                     yMax = 0;
311                 } else if (yMax >= (int)h) {
312                     yMax = h-1;
313                 }
314
315                 davinci.drawLine(leftDist + i-1, topDist + h-prev-1, leftDist + i, topDist + h-yMax-1);
316                 spectrum.setPixel(leftDist + i, topDist + h-yMax-1, AbstractScopeWidget::colHighlightLight.rgba());
317                 prev = yMax;
318             }
319         }
320
321 #ifdef DEBUG_AUDIOSPEC
322         m_showTotal++;
323         m_timeTotal += drawTime.elapsed();
324         qDebug() << widgetName() << " took " << drawTime.elapsed() << " ms for drawing. Average: " << ((float)m_timeTotal/m_showTotal) ;
325 #endif
326
327         emit signalScopeRenderingFinished(start.elapsed(), 1);
328
329
330         return spectrum;
331     } else {
332         emit signalScopeRenderingFinished(0, 1);
333         return QImage();
334     }
335 }
336 QImage AudioSpectrum::renderHUD(uint)
337 {
338     QTime start = QTime::currentTime();
339
340     if (m_innerScopeRect.height() > 0 && m_innerScopeRect.width() > 0) { // May be below 0 if widget is too small
341
342         // Minimum distance between two lines
343         const uint minDistY = 30;
344         const uint minDistX = 40;
345         const uint textDistX = 10;
346         const uint textDistY = 25;
347         const uint topDist = m_innerScopeRect.top() - m_scopeRect.top();
348         const uint leftDist = m_innerScopeRect.left() - m_scopeRect.left();
349         const uint dbDiff = ceil((float)minDistY/m_innerScopeRect.height() * (m_dBmax-m_dBmin));
350         const int mouseX = m_mousePos.x() - m_innerScopeRect.left();
351         const int mouseY = m_mousePos.y() - m_innerScopeRect.top();
352
353
354         QImage hud(m_scopeRect.size(), QImage::Format_ARGB32);
355         hud.fill(qRgba(0,0,0,0));
356
357         QPainter davinci(&hud);
358         davinci.setPen(AbstractScopeWidget::penLight);
359
360         int y;
361         for (int db = -dbDiff; db > m_dBmin; db -= dbDiff) {
362             y = topDist + m_innerScopeRect.height() * ((float)db)/(m_dBmin - m_dBmax);
363             if (y-topDist > m_innerScopeRect.height()-minDistY+10) {
364                 // Abort here, there is still a line left for min dB to paint which needs some room.
365                 break;
366             }
367             davinci.drawLine(leftDist, y, leftDist + m_innerScopeRect.width()-1, y);
368             davinci.drawText(leftDist + m_innerScopeRect.width() + textDistX, y + 6, i18n("%1 dB", m_dBmax + db));
369         }
370         davinci.drawLine(leftDist, topDist, leftDist + m_innerScopeRect.width()-1, topDist);
371         davinci.drawText(leftDist + m_innerScopeRect.width() + textDistX, topDist+6, i18n("%1 dB", m_dBmax));
372         davinci.drawLine(leftDist, topDist+m_innerScopeRect.height()-1, leftDist + m_innerScopeRect.width()-1, topDist+m_innerScopeRect.height()-1);
373         davinci.drawText(leftDist + m_innerScopeRect.width() + textDistX, topDist+m_innerScopeRect.height()+6, i18n("%1 dB", m_dBmin));
374
375         const uint hzDiff = ceil( ((float)minDistX)/m_innerScopeRect.width() * m_freqMax / 1000 ) * 1000;
376         int x = 0;
377         const int rightBorder = leftDist + m_innerScopeRect.width()-1;
378         y = topDist + m_innerScopeRect.height() + textDistY;
379         for (int hz = 0; x <= rightBorder; hz += hzDiff) {
380             davinci.setPen(AbstractScopeWidget::penLighter);
381             x = leftDist + m_innerScopeRect.width() * ((float)hz)/m_freqMax;
382
383             if (x <= rightBorder) {
384                 davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()+6);
385             }
386             if (hz < m_freqMax && x+textDistY < leftDist + m_innerScopeRect.width()) {
387                 davinci.drawText(x-4, y, QVariant(hz/1000).toString());
388             } else {
389                 x = leftDist + m_innerScopeRect.width();
390                 davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()+6);
391                 davinci.drawText(x-10, y, i18n("%1 kHz", QString("%1").arg((double)m_freqMax/1000, 0, 'f', 1)));
392             }
393
394             if (hz > 0) {
395                 // Draw finer lines between the main lines
396                 davinci.setPen(AbstractScopeWidget::penLightDots);
397                 for (uint dHz = 3; dHz > 0; dHz--) {
398                     x = leftDist + m_innerScopeRect.width() * ((float)hz - dHz * hzDiff/4.0f)/m_freqMax;
399                     if (x > rightBorder) {
400                         break;
401                     }
402                     davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()-1);
403                 }
404             }
405         }
406
407         if (m_aTrackMouse->isChecked() && m_mouseWithinWidget && mouseX < m_innerScopeRect.width()-1) {
408             davinci.setPen(AbstractScopeWidget::penThin);
409
410             x = leftDist + mouseX;
411
412             float db = 0;
413             float freq = ((float) mouseX)/(m_innerScopeRect.width()-1) * m_freqMax;
414             bool drawDb = false;
415
416             m_lastFFTLock.acquire();
417             // We need to test whether the mouse is inside the widget
418             // because the position could already have changed in the meantime (-> crash)
419             if (m_lastFFT.size() > 0 && mouseX >= 0 && mouseX < m_innerScopeRect.width()) {
420                 uint right = ((float) m_freqMax)/(m_freq/2) * (m_lastFFT.size() - 1);
421                 QVector<float> dbMap = FFTTools::interpolatePeakPreserving(m_lastFFT, m_innerScopeRect.width(), 0, right, -120);
422
423                 db = dbMap[mouseX];
424                 y = topDist + m_innerScopeRect.height()-1 - (dbMap[mouseX] - m_dBmin) / (m_dBmax-m_dBmin) * (m_innerScopeRect.height()-1);
425
426                 if (y < (int)topDist + m_innerScopeRect.height()-1) {
427                     drawDb = true;
428                     davinci.drawLine(x, y, leftDist + m_innerScopeRect.width()-1, y);
429                 }
430             } else {
431                 y = topDist + mouseY;
432             }
433             m_lastFFTLock.release();
434
435             if (y > (int)topDist + mouseY) {
436                 y = topDist+ mouseY;
437             }
438             davinci.drawLine(x, y, x, topDist + m_innerScopeRect.height()-1);
439
440             if (drawDb) {
441                 QPoint dist(20, -20);
442                 QRect rect(
443                             leftDist + mouseX + dist.x(),
444                             topDist + mouseY + dist.y(),
445                             100,
446                             40
447                             );
448                 if (rect.right() > (int)leftDist + m_innerScopeRect.width()-1) {
449                     // Mirror the rectangle at the y axis to keep it inside the widget
450                     rect = QRect(
451                                 rect.topLeft() - QPoint(rect.width() + 2*dist.x(), 0),
452                                 rect.size());
453                 }
454
455                 QRect textRect(
456                             rect.topLeft() + QPoint(12, 4),
457                             rect.size()
458                             );
459
460                 davinci.fillRect(rect, AbstractScopeWidget::penBackground.brush());
461                 davinci.setPen(AbstractScopeWidget::penLighter);
462                 davinci.drawRect(rect);
463                 davinci.drawText(textRect, QString(
464                                      i18n("%1 dB", QString("%1").arg(db, 0, 'f', 2))
465                                      + '\n'
466                                      + i18n("%1 kHz", QString("%1").arg(freq/1000, 0, 'f', 2))));
467             }
468
469         }
470
471         emit signalHUDRenderingFinished(start.elapsed(), 1);
472         return hud;
473
474     } else {
475 #ifdef DEBUG_AUDIOSPEC
476         qDebug() << "Widget is too small for painting inside. Size of inner scope rect is "
477                  << m_innerScopeRect.width() << "x" << m_innerScopeRect.height() <<".";
478 #endif
479         emit signalHUDRenderingFinished(0, 1);
480         return QImage();
481     }
482
483 }
484
485 QRect AudioSpectrum::scopeRect()
486 {
487     m_scopeRect = QRect(
488             QPoint(
489                     10,                                     // Left
490                     ui->verticalSpacer->geometry().top()+6  // Top
491             ),
492             AbstractAudioScopeWidget::rect().bottomRight()
493     );
494     m_innerScopeRect = QRect(
495             QPoint(
496                     m_scopeRect.left()+6,                   // Left
497                     m_scopeRect.top()+6                     // Top
498             ), QPoint(
499                     ui->verticalSpacer->geometry().right()-70,
500                     ui->verticalSpacer->geometry().bottom()-40
501             )
502     );
503     return m_scopeRect;
504 }
505
506 void AudioSpectrum::slotResetMaxFreq()
507 {
508     m_customFreq = false;
509     forceUpdateHUD();
510     forceUpdateScope();
511 }
512
513
514 ///// EVENTS /////
515
516 void AudioSpectrum::handleMouseDrag(const QPoint &movement, const RescaleDirection rescaleDirection, const Qt::KeyboardModifiers rescaleModifiers)
517 {
518     if (rescaleDirection == North) {
519         // Nort-South direction: Adjust the dB scale
520
521         if ((rescaleModifiers & Qt::ShiftModifier) == 0) {
522
523             // By default adjust the min dB value
524             m_dBmin += movement.y();
525
526         } else {
527
528             // Adjust max dB value if Shift is pressed.
529             m_dBmax += movement.y();
530
531         }
532
533         // Ensure the dB values lie in [-100, 0] (or rather [MIN_DB_VALUE, 0])
534         // 0 is the upper bound, everything below -70 dB is most likely noise
535         if (m_dBmax > 0) {
536             m_dBmax = 0;
537         }
538         if (m_dBmin < MIN_DB_VALUE) {
539             m_dBmin = MIN_DB_VALUE;
540         }
541         // Ensure there is at least 6 dB between the minimum and the maximum value;
542         // lower values hardly make sense
543         if (m_dBmax - m_dBmin < 6) {
544             if ((rescaleModifiers & Qt::ShiftModifier) == 0) {
545                 // min was adjusted; Try to adjust the max value to maintain the
546                 // minimum dB difference of 6 dB
547                 m_dBmax = m_dBmin + 6;
548                 if (m_dBmax > 0) {
549                     m_dBmax = 0;
550                     m_dBmin = -6;
551                 }
552             } else {
553                 // max was adjusted, adjust min
554                 m_dBmin = m_dBmax - 6;
555                 if (m_dBmin < MIN_DB_VALUE) {
556                     m_dBmin = MIN_DB_VALUE;
557                     m_dBmax = MIN_DB_VALUE+6;
558                 }
559             }
560         }
561
562         forceUpdateHUD();
563         forceUpdateScope();
564
565     } else if (rescaleDirection == East) {
566         // East-West direction: Adjust the maximum frequency
567         m_freqMax -= 100*movement.x();
568         if (m_freqMax < MIN_FREQ_VALUE) {
569             m_freqMax = MIN_FREQ_VALUE;
570         }
571         if (m_freqMax > MAX_FREQ_VALUE) {
572             m_freqMax = MAX_FREQ_VALUE;
573         }
574         m_customFreq = true;
575
576         forceUpdateHUD();
577         forceUpdateScope();
578     }
579 }
580
581 #include "audiospectrum.moc"