comparison layer/SpectrumLayer.cpp @ 585:f4960f8ce798 debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:25 +0100
parents 3b128519773c
children 4806715f7a19
comparison
equal deleted inserted replaced
584:1fe7951a61e8 585:f4960f8ce798
55 } 55 }
56 56
57 void 57 void
58 SpectrumLayer::setModel(DenseTimeValueModel *model) 58 SpectrumLayer::setModel(DenseTimeValueModel *model)
59 { 59 {
60 std::cerr << "SpectrumLayer::setModel(" << model << ") from " << m_originModel << std::endl; 60 DEBUG << "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 std::cerr << "SpectrumLayer::setChannel(" << channel << ") from " << m_channel << std::endl; 82 DEBUG << "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 std::cerr << "SpectrumLayer::paint: no origin model, or origin model not OK or not ready" << std::endl; 657 DEBUG << "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 std::cerr << "SpectrumLayer::paint: new FFT needed, calling setupFFT" << std::endl; 662 DEBUG << "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 // std::cerr << "Showing peaks..." << std::endl; 685 // DEBUG << "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);