Mercurial > hg > svgui
diff layer/SpectrumLayer.cpp @ 805:1d526ba11a24 warnfix_no_size_t
Remove size_t's and fix warnings in layer/
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 15:18:06 +0100 |
parents | 1a0dfcbffaf1 |
children | 4a578a360011 |
line wrap: on
line diff
--- a/layer/SpectrumLayer.cpp Tue Jun 03 11:10:52 2014 +0100 +++ b/layer/SpectrumLayer.cpp Tue Jun 17 15:18:06 2014 +0100 @@ -121,7 +121,7 @@ setSliceableModel(newFFT); m_biasCurve.clear(); - for (size_t i = 0; i < m_windowSize; ++i) { + for (int i = 0; i < m_windowSize; ++i) { m_biasCurve.push_back(1.f / (float(m_windowSize)/2.f)); } @@ -257,7 +257,7 @@ } void -SpectrumLayer::setWindowSize(size_t ws) +SpectrumLayer::setWindowSize(int ws) { if (m_windowSize == ws) return; m_windowSize = ws; @@ -266,7 +266,7 @@ } void -SpectrumLayer::setWindowHopLevel(size_t v) +SpectrumLayer::setWindowHopLevel(int v) { if (m_windowHopLevel == v) return; m_windowHopLevel = v; @@ -566,7 +566,7 @@ if (!m_sliceableModel) return ""; int minbin = 0, maxbin = 0, range = 0; - QString genericDesc = SliceLayer::getFeatureDescription + QString genericDesc = SliceLayer::getFeatureDescriptionAux (v, p, false, minbin, maxbin, range); if (genericDesc == "") return ""; @@ -684,7 +684,7 @@ // SVDEBUG << "Showing peaks..." << endl; - size_t col = v->getCentreFrame() / fft->getResolution(); + int col = v->getCentreFrame() / fft->getResolution(); paint.save(); paint.setRenderHint(QPainter::Antialiasing, false); @@ -702,11 +702,11 @@ BiasCurve curve; getBiasCurve(curve); - size_t cs = curve.size(); + int cs = curve.size(); std::vector<float> values; - for (size_t bin = 0; bin < fft->getHeight(); ++bin) { + for (int bin = 0; bin < fft->getHeight(); ++bin) { float value = m_sliceableModel->getValueAt(col, bin); if (bin < cs) value *= curve[bin]; values.push_back(value); @@ -715,7 +715,7 @@ for (FFTModel::PeakSet::iterator i = peaks.begin(); i != peaks.end(); ++i) { - size_t bin = i->first; + int bin = i->first; // cerr << "bin = " << bin << ", thresh = " << thresh << ", value = " << fft->getMagnitudeAt(col, bin) << endl; @@ -726,7 +726,7 @@ int x = lrintf(getXForFrequency(freq, w)); float norm = 0.f; - float y = getYForValue(values[bin], v, norm); // don't need y, need norm + (void)getYForValue(values[bin], v, norm); // don't need return value, need norm paint.setPen(mapper.map(norm)); paint.drawLine(xorigin + x, 0, xorigin + x, v->height() - pkh - 1); @@ -850,10 +850,10 @@ bool ok = false; - size_t windowSize = attributes.value("windowSize").toUInt(&ok); + int windowSize = attributes.value("windowSize").toUInt(&ok); if (ok) setWindowSize(windowSize); - size_t windowHopLevel = attributes.value("windowHopLevel").toUInt(&ok); + int windowHopLevel = attributes.value("windowHopLevel").toUInt(&ok); if (ok) setWindowHopLevel(windowHopLevel); bool showPeaks = (attributes.value("showPeaks").trimmed() == "true");