Mercurial > hg > svgui
comparison layer/SpectrumLayer.cpp @ 587:4806715f7a19
Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 15:27:05 +0100 |
parents | f4960f8ce798 |
children | a13aa5320221 5b72899d692b |
comparison
equal
deleted
inserted
replaced
586:1ae54a29e59e | 587:4806715f7a19 |
---|---|
55 } | 55 } |
56 | 56 |
57 void | 57 void |
58 SpectrumLayer::setModel(DenseTimeValueModel *model) | 58 SpectrumLayer::setModel(DenseTimeValueModel *model) |
59 { | 59 { |
60 DEBUG << "SpectrumLayer::setModel(" << model << ") from " << m_originModel << endl; | 60 SVDEBUG << "SpectrumLayer::setModel(" << model << ") from " << m_originModel << endl; |
61 | 61 |
62 if (m_originModel == model) return; | 62 if (m_originModel == model) return; |
63 | 63 |
64 m_originModel = model; | 64 m_originModel = model; |
65 | 65 |
77 } | 77 } |
78 | 78 |
79 void | 79 void |
80 SpectrumLayer::setChannel(int channel) | 80 SpectrumLayer::setChannel(int channel) |
81 { | 81 { |
82 DEBUG << "SpectrumLayer::setChannel(" << channel << ") from " << m_channel << endl; | 82 SVDEBUG << "SpectrumLayer::setChannel(" << channel << ") from " << m_channel << endl; |
83 | 83 |
84 m_channelSet = true; | 84 m_channelSet = true; |
85 | 85 |
86 if (m_channel == channel) return; | 86 if (m_channel == channel) return; |
87 | 87 |
652 void | 652 void |
653 SpectrumLayer::paint(View *v, QPainter &paint, QRect rect) const | 653 SpectrumLayer::paint(View *v, QPainter &paint, QRect rect) const |
654 { | 654 { |
655 if (!m_originModel || !m_originModel->isOK() || | 655 if (!m_originModel || !m_originModel->isOK() || |
656 !m_originModel->isReady()) { | 656 !m_originModel->isReady()) { |
657 DEBUG << "SpectrumLayer::paint: no origin model, or origin model not OK or not ready" << endl; | 657 SVDEBUG << "SpectrumLayer::paint: no origin model, or origin model not OK or not ready" << endl; |
658 return; | 658 return; |
659 } | 659 } |
660 | 660 |
661 if (m_newFFTNeeded) { | 661 if (m_newFFTNeeded) { |
662 DEBUG << "SpectrumLayer::paint: new FFT needed, calling setupFFT" << endl; | 662 SVDEBUG << "SpectrumLayer::paint: new FFT needed, calling setupFFT" << endl; |
663 const_cast<SpectrumLayer *>(this)->setupFFT(); //ugh | 663 const_cast<SpectrumLayer *>(this)->setupFFT(); //ugh |
664 } | 664 } |
665 | 665 |
666 FFTModel *fft = dynamic_cast<FFTModel *> | 666 FFTModel *fft = dynamic_cast<FFTModel *> |
667 (const_cast<DenseThreeDimensionalModel *>(m_sliceableModel)); | 667 (const_cast<DenseThreeDimensionalModel *>(m_sliceableModel)); |
680 | 680 |
681 if (fft && m_showPeaks) { | 681 if (fft && m_showPeaks) { |
682 | 682 |
683 // draw peak lines | 683 // draw peak lines |
684 | 684 |
685 // DEBUG << "Showing peaks..." << endl; | 685 // SVDEBUG << "Showing peaks..." << endl; |
686 | 686 |
687 size_t col = v->getCentreFrame() / fft->getResolution(); | 687 size_t col = v->getCentreFrame() / fft->getResolution(); |
688 | 688 |
689 paint.save(); | 689 paint.save(); |
690 paint.setRenderHint(QPainter::Antialiasing, false); | 690 paint.setRenderHint(QPainter::Antialiasing, false); |