comparison layer/SpectrogramLayer.cpp @ 975:b8187c83b93a simple-fft-model

Gut the old code, but don't replace it yet (so nothing will link yet)
author Chris Cannam
date Fri, 12 Jun 2015 14:51:46 +0100
parents 28d05ae8741c
children 64c2b3a4435a 8053c0dfa919
comparison
equal deleted inserted replaced
974:6645b6b8356f 975:b8187c83b93a
1627 FFTModel *model = new FFTModel(m_model, 1627 FFTModel *model = new FFTModel(m_model,
1628 m_channel, 1628 m_channel,
1629 m_windowType, 1629 m_windowType,
1630 m_windowSize, 1630 m_windowSize,
1631 getWindowIncrement(), 1631 getWindowIncrement(),
1632 fftSize, 1632 fftSize);
1633 true, // polar
1634 StorageAdviser::SpeedCritical,
1635 m_candidateFillStartFrame);
1636 1633
1637 if (!model->isOK()) { 1634 if (!model->isOK()) {
1638 QMessageBox::critical 1635 QMessageBox::critical
1639 (0, tr("FFT cache failed"), 1636 (0, tr("FFT cache failed"),
1640 tr("Failed to create the FFT model for this spectrogram.\n" 1637 tr("Failed to create the FFT model for this spectrogram.\n"
1652 m_sliceableModel = model; 1649 m_sliceableModel = model;
1653 } 1650 }
1654 1651
1655 m_fftModels[v] = FFTFillPair(model, 0); 1652 m_fftModels[v] = FFTFillPair(model, 0);
1656 1653
1657 model->resume();
1658
1659 delete m_updateTimer; 1654 delete m_updateTimer;
1660 m_updateTimer = new QTimer((SpectrogramLayer *)this); 1655 m_updateTimer = new QTimer((SpectrogramLayer *)this);
1661 connect(m_updateTimer, SIGNAL(timeout()), 1656 connect(m_updateTimer, SIGNAL(timeout()),
1662 this, SLOT(fillTimerTimedOut())); 1657 this, SLOT(fillTimerTimedOut()));
1663 m_updateTimer->start(200); 1658 m_updateTimer->start(200);
2443 if (!m_synchronous) { 2438 if (!m_synchronous) {
2444 m_lastPaintBlockWidth = paintBlockWidth; 2439 m_lastPaintBlockWidth = paintBlockWidth;
2445 (void)gettimeofday(&tv, 0); 2440 (void)gettimeofday(&tv, 0);
2446 m_lastPaintTime = RealTime::fromTimeval(tv) - mainPaintStart; 2441 m_lastPaintTime = RealTime::fromTimeval(tv) - mainPaintStart;
2447 } 2442 }
2448
2449 //!!! if (fftSuspended) fft->resume();
2450 } 2443 }
2451 2444
2452 bool 2445 bool
2453 SpectrogramLayer::paintDrawBufferPeakFrequencies(View *v, 2446 SpectrogramLayer::paintDrawBufferPeakFrequencies(View *v,
2454 int w, 2447 int w,