Mercurial > hg > svgui
changeset 248:28c8e8e3c537
* Fix many compile warnings, remove some debug output
author | Chris Cannam |
---|---|
date | Mon, 30 Apr 2007 13:36:23 +0000 |
parents | 0e9f59f991aa |
children | e6d0b097d102 |
files | layer/Colour3DPlotLayer.cpp layer/ColourMapper.cpp layer/Layer.h layer/NoteLayer.cpp layer/SliceLayer.cpp layer/SliceLayer.h layer/SpectrogramLayer.cpp layer/SpectrogramLayer.h layer/SpectrumLayer.cpp layer/SpectrumLayer.h layer/TextLayer.cpp layer/TimeInstantLayer.cpp layer/TimeRulerLayer.cpp layer/TimeValueLayer.cpp layer/WaveformLayer.cpp view/Overview.cpp view/Pane.cpp view/View.cpp view/ViewManager.cpp |
diffstat | 19 files changed, 93 insertions(+), 106 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/Colour3DPlotLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -280,7 +280,7 @@ int f1 = f0 + modelResolution; float binHeight = float(v->height()) / m_model->getHeight(); - int sy = (v->height() - y) / binHeight; + int sy = int((v->height() - y) / binHeight); float value = m_model->getValueAt(sx0, sy); @@ -302,14 +302,14 @@ } int -Colour3DPlotLayer::getColourScaleWidth(QPainter &paint) const +Colour3DPlotLayer::getColourScaleWidth(QPainter &) const { int cw = 20; return cw; } int -Colour3DPlotLayer::getVerticalScaleWidth(View *v, QPainter &paint) const +Colour3DPlotLayer::getVerticalScaleWidth(View *, QPainter &paint) const { if (!m_model) return 0; @@ -364,14 +364,14 @@ if ((i % step) != 0) continue; - int y0 = v->height() - (i * binHeight) - 1; + int y0 = int(v->height() - (i * binHeight) - 1); QString text = m_model->getBinName(i); if (text == "") text = QString("[%1]").arg(i + 1); paint.drawLine(cw, y0, w, y0); - int cy = y0 - (step * binHeight)/2; + int cy = int(y0 - (step * binHeight)/2); int ty = cy + paint.fontMetrics().ascent()/2; paint.drawText(cw + 5, ty, text); @@ -434,8 +434,8 @@ if (m_cache && (m_cacheStart != firstBin || - m_cache->width() != cacheWidth || - m_cache->height() != cacheHeight)) { + m_cache->width() != int(cacheWidth) || + m_cache->height() != int(cacheHeight))) { delete m_cache; m_cache = 0; @@ -578,8 +578,8 @@ fillCache(sx0 < 0 ? 0 : sx0, sx1 < 0 ? 0 : sx1); - if (m_model->getHeight() >= v->height() || - modelResolution < v->getZoomLevel() / 2) { + if (int(m_model->getHeight()) >= v->height() || + int(modelResolution) < v->getZoomLevel() / 2) { paintDense(v, paint, rect); return; } @@ -596,15 +596,15 @@ for (int sx = sx0; sx <= sx1; ++sx) { int scx = 0; - if (sx > m_cacheStart) scx = sx - m_cacheStart; + if (sx > int(m_cacheStart)) scx = sx - m_cacheStart; int fx = sx * int(modelResolution); - if (fx + modelResolution < int(modelStart) || + if (fx + int(modelResolution) < int(modelStart) || fx > int(modelEnd)) continue; - int rx0 = v->getXForFrame((fx + int(modelStart)) * srRatio); - int rx1 = v->getXForFrame((fx + int(modelStart) + int(modelResolution) + 1) * srRatio); + int rx0 = v->getXForFrame(int((fx + int(modelStart)) * srRatio)); + int rx1 = v->getXForFrame(int((fx + int(modelStart) + int(modelResolution) + 1) * srRatio)); int rw = rx1 - rx0; if (rw < 1) rw = 1; @@ -673,11 +673,7 @@ void Colour3DPlotLayer::paintDense(View *v, QPainter &paint, QRect rect) const { - long startFrame = v->getStartFrame(); - int zoomLevel = v->getZoomLevel(); - size_t modelStart = m_model->getStartFrame(); - size_t modelEnd = m_model->getEndFrame(); size_t modelResolution = m_model->getResolution(); float srRatio = @@ -695,7 +691,7 @@ for (int x = x0; x < x1; ++x) { - long xf = v->getFrameForX(x) / srRatio; + long xf = long(v->getFrameForX(x) / srRatio); if (xf < 0) { for (int y = 0; y < h; ++y) { img.setPixel(x - x0, y, m_cache->color(0)); @@ -723,7 +719,7 @@ for (int sx = sx0i; sx <= sx1i; ++sx) { int scx = 0; - if (sx > m_cacheStart) scx = sx - m_cacheStart; + if (sx > int(m_cacheStart)) scx = sx - int(m_cacheStart); if (scx < 0 || scx >= m_cache->width()) continue;
--- a/layer/ColourMapper.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/ColourMapper.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -74,7 +74,8 @@ float h = 0.f, s = 0.f, v = 0.f, r = 0.f, g = 0.f, b = 0.f; bool hsv = true; - float red = 0.f, green = 0.3333f, blue = 0.6666f, pieslice = 0.3333f; +// float red = 0.f, green = 0.3333f; + float blue = 0.6666f, pieslice = 0.3333f; if (m_map >= getColourMapCount()) return Qt::black; StandardMap map = (StandardMap)m_map;
--- a/layer/Layer.h Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/Layer.h Mon Apr 30 13:36:23 2007 +0000 @@ -326,7 +326,7 @@ * verticalZoomChanged signal if their vertical zoom changes * due to factors other than setVerticalZoomStep being called. */ - virtual int getVerticalZoomSteps(int &defaultStep) const { return 0; } + virtual int getVerticalZoomSteps(int & /* defaultStep */) const { return 0; } /** * Get the current vertical zoom step. A layer may support finer
--- a/layer/NoteLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/NoteLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -295,11 +295,11 @@ if (prevPoints.empty()) { usePoints = nextPoints; - } else if (prevPoints.begin()->frame < v->getStartFrame() && + } else if (long(prevPoints.begin()->frame) < v->getStartFrame() && !(nextPoints.begin()->frame > v->getEndFrame())) { usePoints = nextPoints; - } else if (nextPoints.begin()->frame - frame < - frame - prevPoints.begin()->frame) { + } else if (long(nextPoints.begin()->frame) - frame < + frame - long(prevPoints.begin()->frame)) { usePoints = nextPoints; } @@ -604,9 +604,6 @@ float max = m_model->getValueMaximum(); if (max == min) max = min + 1.0; - int origin = int(nearbyint(v->height() - - (-min * v->height()) / (max - min))); - QPoint localPos; long illuminateFrame = -1; @@ -709,7 +706,7 @@ } void -NoteLayer::drawEnd(View *v, QMouseEvent *e) +NoteLayer::drawEnd(View *, QMouseEvent *) { // std::cerr << "NoteLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -764,7 +761,7 @@ } void -NoteLayer::editEnd(View *v, QMouseEvent *e) +NoteLayer::editEnd(View *, QMouseEvent *) { // std::cerr << "NoteLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -936,7 +933,7 @@ } bool -NoteLayer::paste(const Clipboard &from, int frameOffset, bool interactive) +NoteLayer::paste(const Clipboard &from, int frameOffset, bool /* interactive */) { if (!m_model) return false;
--- a/layer/SliceLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/SliceLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -137,10 +137,10 @@ if (includeBinDescription) { float minvalue = 0.f; - if (minbin < m_values.size()) minvalue = m_values[minbin]; + if (minbin < int(m_values.size())) minvalue = m_values[minbin]; float maxvalue = minvalue; - if (maxbin < m_values.size()) maxvalue = m_values[maxbin]; + if (maxbin < int(m_values.size())) maxvalue = m_values[maxbin]; if (minvalue > maxvalue) std::swap(minvalue, maxvalue); @@ -261,7 +261,7 @@ QPainterPath path; float thresh = -80.f; - int mh = m_sliceableModel->getHeight(); + size_t mh = m_sliceableModel->getHeight(); int divisor = 0; @@ -433,7 +433,7 @@ } int -SliceLayer::getVerticalScaleWidth(View *v, QPainter &paint) const +SliceLayer::getVerticalScaleWidth(View *, QPainter &paint) const { if (m_energyScale == LinearScale) { return std::max(paint.fontMetrics().width("0.0") + 13, @@ -536,7 +536,7 @@ int garbage0, garbage1, garbage2; if (!min) min = &garbage0; if (!max) max = &garbage1; - if (!deflt) deflt = &garbage1; + if (!deflt) deflt = &garbage2; if (name == "Gain") { @@ -852,8 +852,7 @@ } bool -SliceLayer::getValueExtents(float &min, float &max, bool &logarithmic, - QString &units) const +SliceLayer::getValueExtents(float &, float &, bool &, QString &) const { return false; }
--- a/layer/SliceLayer.h Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/SliceLayer.h Mon Apr 30 13:36:23 2007 +0000 @@ -63,7 +63,7 @@ virtual bool hasTimeXAxis() const { return false; } - virtual bool isLayerScrollable(const View *v) const { return false; } + virtual bool isLayerScrollable(const View *) const { return false; } enum EnergyScale { LinearScale, MeterScale, dBScale };
--- a/layer/SpectrogramLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/SpectrogramLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -732,7 +732,7 @@ { if (m_minFrequency == mf) return; - std::cerr << "SpectrogramLayer::setMinFrequency: " << mf << std::endl; +// std::cerr << "SpectrogramLayer::setMinFrequency: " << mf << std::endl; invalidatePixmapCaches(); invalidateMagnitudes(); @@ -753,7 +753,7 @@ { if (m_maxFrequency == mf) return; - std::cerr << "SpectrogramLayer::setMaxFrequency: " << mf << std::endl; +// std::cerr << "SpectrogramLayer::setMaxFrequency: " << mf << std::endl; invalidatePixmapCaches(); invalidateMagnitudes(); @@ -960,7 +960,6 @@ for (ViewFFTMap::iterator i = m_fftModels.begin(); i != m_fftModels.end(); ++i) { - const View *v = i->first; const FFTModel *model = i->second.first; size_t lastFill = i->second.second; @@ -1594,7 +1593,9 @@ } if (!m_sliceableModel) { +#ifdef DEBUG_SPECTROGRAM std::cerr << "SpectrogramLayer: emitting sliceableModelReplaced(0, " << model << ")" << std::endl; +#endif ((SpectrogramLayer *)this)->sliceableModelReplaced(0, model); m_sliceableModel = model; } @@ -1670,7 +1671,7 @@ // std::cerr << "SpectrogramLayer::updateViewMagnitudes: x0 = " << x0 << ", x1 = " << x1 << ", s00 = " << s00 << ", s11 = " << s11 << " s0 = " << s0 << ", s1 = " << s1 << std::endl; - if (m_columnMags.size() <= s1) { + if (int(m_columnMags.size()) <= s1) { m_columnMags.resize(s1 + 1); } @@ -1733,9 +1734,8 @@ std::cerr << "SpectrogramLayer::paint(): pixmap cache valid area " << cache.validArea.x() << ", " << cache.validArea.y() << ", " << cache.validArea.width() << "x" << cache.validArea.height() << std::endl; #endif +#ifdef DEBUG_SPECTROGRAM_REPAINT bool stillCacheing = (m_updateTimer != 0); - -#ifdef DEBUG_SPECTROGRAM_REPAINT std::cerr << "SpectrogramLayer::paint(): Still cacheing = " << stillCacheing << std::endl; #endif @@ -2067,8 +2067,8 @@ int s0i = int(s0 + 0.001); int s1i = int(s1); - if (s1i >= fft->getWidth()) { - if (s0i >= fft->getWidth()) { + if (s1i >= int(fft->getWidth())) { + if (s0i >= int(fft->getWidth())) { continue; } else { s1i = s0i; @@ -2208,7 +2208,7 @@ if (mag.isSet()) { - if (s >= m_columnMags.size()) { + if (s >= int(m_columnMags.size())) { std::cerr << "INTERNAL ERROR: " << s << " >= " << m_columnMags.size() << " at SpectrogramLayer.cpp:2087" << std::endl; } @@ -2348,8 +2348,8 @@ int x0 = v->getXForFrame(s0i * getWindowIncrement()); int x1 = v->getXForFrame((s1i + 1) * getWindowIncrement()); - int y1 = getYForFrequency(v, f1); - int y0 = getYForFrequency(v, f0); + int y1 = int(getYForFrequency(v, f1)); + int y0 = int(getYForFrequency(v, f0)); // std::cerr << "SpectrogramLayer: illuminate " // << x0 << "," << y1 << " -> " << x1 << "," << y0 << std::endl; @@ -2413,7 +2413,7 @@ { min = getEffectiveMinFrequency(); max = getEffectiveMaxFrequency(); - std::cerr << "SpectrogramLayer::getDisplayExtents: " << min << "->" << max << std::endl; +// std::cerr << "SpectrogramLayer::getDisplayExtents: " << min << "->" << max << std::endl; return true; } @@ -2450,7 +2450,7 @@ } bool -SpectrogramLayer::snapToFeatureFrame(View *v, int &frame, +SpectrogramLayer::snapToFeatureFrame(View *, int &frame, size_t &resolution, SnapType snap) const { @@ -2472,7 +2472,7 @@ } bool -SpectrogramLayer::getCrosshairExtents(View *v, QPainter &paint, +SpectrogramLayer::getCrosshairExtents(View *v, QPainter &, QPoint cursorPos, std::vector<QRect> &extents) const { @@ -2515,9 +2515,9 @@ } paint.drawLine(cursorPos.x() - len, - hy, + int(hy), cursorPos.x(), - hy); + int(hy)); ++harmonic; } @@ -2648,7 +2648,7 @@ } int -SpectrogramLayer::getVerticalScaleWidth(View *v, QPainter &paint) const +SpectrogramLayer::getVerticalScaleWidth(View *, QPainter &paint) const { if (!m_model || !m_model->isOK()) return 0; @@ -2819,7 +2819,6 @@ paint.drawLine(w - pkw - 1, 0, w - pkw - 1, h); - int sr = m_model->getSampleRate(); float minf = getEffectiveMinFrequency(); float maxf = getEffectiveMaxFrequency(); @@ -2873,7 +2872,7 @@ class SpectrogramRangeMapper : public RangeMapper { public: - SpectrogramRangeMapper(int sr, int fftsize) : + SpectrogramRangeMapper(int sr, int /* fftsize */) : m_dist(float(sr) / 2), m_s2(sqrtf(sqrtf(2))) { } ~SpectrogramRangeMapper() { } @@ -2883,7 +2882,6 @@ float dist = m_dist; int n = 0; - int discard = 0; while (dist > (value + 0.00001) && dist > 0.1f) { dist /= m_s2; @@ -2933,7 +2931,7 @@ defaultStep = mapper.getPositionForValue(m_initialMaxFrequency) - minStep; - std::cerr << "SpectrogramLayer::getVerticalZoomSteps: " << maxStep - minStep << " (" << maxStep <<"-" << minStep << "), default is " << defaultStep << " (from initial max freq " << m_initialMaxFrequency << ")" << std::endl; +// std::cerr << "SpectrogramLayer::getVerticalZoomSteps: " << maxStep - minStep << " (" << maxStep <<"-" << minStep << "), default is " << defaultStep << " (from initial max freq " << m_initialMaxFrequency << ")" << std::endl; return maxStep - minStep; } @@ -2948,7 +2946,7 @@ SpectrogramRangeMapper mapper(m_model->getSampleRate(), m_fftSize); int n = mapper.getPositionForValue(dmax - dmin); - std::cerr << "SpectrogramLayer::getCurrentVerticalZoomStep: " << n << std::endl; +// std::cerr << "SpectrogramLayer::getCurrentVerticalZoomStep: " << n << std::endl; return n; } @@ -2982,7 +2980,7 @@ newmax = mmax; } - std::cerr << "SpectrogramLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << ddist << ")" << std::endl; +// std::cerr << "SpectrogramLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << ddist << ")" << std::endl; setMinFrequency(int(newmin)); setMaxFrequency(int(newmax));
--- a/layer/SpectrogramLayer.h Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/SpectrogramLayer.h Mon Apr 30 13:36:23 2007 +0000 @@ -207,7 +207,7 @@ virtual void setLayerDormant(const View *v, bool dormant); - virtual bool isLayerScrollable(const View *v) const { return false; } + virtual bool isLayerScrollable(const View *) const { return false; } virtual int getVerticalZoomSteps(int &defaultStep) const; virtual int getCurrentVerticalZoomStep() const;
--- a/layer/SpectrumLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/SpectrumLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -242,8 +242,7 @@ } bool -SpectrumLayer::getValueExtents(float &min, float &max, bool &logarithmic, - QString &units) const +SpectrumLayer::getValueExtents(float &, float &, bool &, QString &) const { return false; } @@ -260,10 +259,10 @@ if (genericDesc == "") return ""; float minvalue = 0.f; - if (minbin < m_values.size()) minvalue = m_values[minbin]; + if (minbin < int(m_values.size())) minvalue = m_values[minbin]; float maxvalue = minvalue; - if (maxbin < m_values.size()) maxvalue = m_values[maxbin]; + if (maxbin < int(m_values.size())) maxvalue = m_values[maxbin]; if (minvalue > maxvalue) std::swap(minvalue, maxvalue); @@ -316,7 +315,7 @@ QString description; - if (range > m_sliceableModel->getResolution()) { + if (range > int(m_sliceableModel->getResolution())) { description = tr("%1\nBin:\t%2 (%3)\n%4 value:\t%5\ndB:\t%6") .arg(genericDesc) .arg(binstr)
--- a/layer/SpectrumLayer.h Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/SpectrumLayer.h Mon Apr 30 13:36:23 2007 +0000 @@ -55,7 +55,7 @@ virtual bool getValueExtents(float &min, float &max, bool &logarithmic, QString &unit) const; - virtual bool isLayerScrollable(const View *v) const { return false; } + virtual bool isLayerScrollable(const View *) const { return false; } void setChannel(int); int getChannel() const { return m_channel; }
--- a/layer/TextLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/TextLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -75,7 +75,7 @@ } Layer::PropertyType -TextLayer::getPropertyType(const PropertyName &name) const +TextLayer::getPropertyType(const PropertyName &) const { return ValueProperty; } @@ -144,8 +144,7 @@ } bool -TextLayer::getValueExtents(float &min, float &max, - bool &logarithmic, QString &unit) const +TextLayer::getValueExtents(float &, float &, bool &, QString &) const { return false; } @@ -490,7 +489,7 @@ } void -TextLayer::drawEnd(View *v, QMouseEvent *e) +TextLayer::drawEnd(View *v, QMouseEvent *) { // std::cerr << "TextLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -561,7 +560,7 @@ } void -TextLayer::editEnd(View *v, QMouseEvent *e) +TextLayer::editEnd(View *, QMouseEvent *) { // std::cerr << "TextLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -707,7 +706,7 @@ } bool -TextLayer::paste(const Clipboard &from, int frameOffset, bool interactive) +TextLayer::paste(const Clipboard &from, int frameOffset, bool /* interactive */) { if (!m_model) return false;
--- a/layer/TimeInstantLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/TimeInstantLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -211,7 +211,7 @@ if (prevPoints.empty()) { usePoints = nextPoints; - } else if (prevPoints.begin()->frame < v->getStartFrame() && + } else if (long(prevPoints.begin()->frame) < v->getStartFrame() && !(nextPoints.begin()->frame > v->getEndFrame())) { usePoints = nextPoints; } else if (nextPoints.begin()->frame - frame < @@ -519,7 +519,7 @@ } void -TimeInstantLayer::drawEnd(View *v, QMouseEvent *e) +TimeInstantLayer::drawEnd(View *, QMouseEvent *e) { std::cerr << "TimeInstantLayer::drawEnd(" << e->x() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -575,7 +575,7 @@ } void -TimeInstantLayer::editEnd(View *v, QMouseEvent *e) +TimeInstantLayer::editEnd(View *, QMouseEvent *e) { std::cerr << "TimeInstantLayer::editEnd(" << e->x() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -724,7 +724,7 @@ } bool -TimeInstantLayer::paste(const Clipboard &from, int frameOffset, bool interactive) +TimeInstantLayer::paste(const Clipboard &from, int frameOffset, bool) { if (!m_model) return false;
--- a/layer/TimeRulerLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/TimeRulerLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -67,7 +67,7 @@ } Layer::PropertyType -TimeRulerLayer::getPropertyType(const PropertyName &name) const +TimeRulerLayer::getPropertyType(const PropertyName &) const { return ValueProperty; }
--- a/layer/TimeValueLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/TimeValueLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -336,7 +336,7 @@ if (prevPoints.empty()) { usePoints = nextPoints; - } else if (prevPoints.begin()->frame < v->getStartFrame() && + } else if (long(prevPoints.begin()->frame) < v->getStartFrame() && !(nextPoints.begin()->frame > v->getEndFrame())) { usePoints = nextPoints; } else if (nextPoints.begin()->frame - frame < @@ -550,8 +550,6 @@ bool log; getScaleExtents(v, min, max, log); - float logthresh = -80; - if (min > max) std::swap(min, max); if (max == min) max = min + 1; @@ -783,7 +781,7 @@ } int -TimeValueLayer::getVerticalScaleWidth(View *v, QPainter &paint) const +TimeValueLayer::getVerticalScaleWidth(View *, QPainter &paint) const { int w = paint.fontMetrics().width("-000.000"); if (m_plotStyle == PlotSegmentation) return w + 20; @@ -791,7 +789,7 @@ } void -TimeValueLayer::paintVerticalScale(View *v, QPainter &paint, QRect rect) const +TimeValueLayer::paintVerticalScale(View *v, QPainter &paint, QRect) const { if (!m_model) return; @@ -966,7 +964,7 @@ } void -TimeValueLayer::drawEnd(View *v, QMouseEvent *e) +TimeValueLayer::drawEnd(View *, QMouseEvent *) { // std::cerr << "TimeValueLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -1021,7 +1019,7 @@ } void -TimeValueLayer::editEnd(View *v, QMouseEvent *e) +TimeValueLayer::editEnd(View *, QMouseEvent *) { // std::cerr << "TimeValueLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return;
--- a/layer/WaveformLayer.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/layer/WaveformLayer.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -369,7 +369,7 @@ bool WaveformLayer::getValueExtents(float &min, float &max, - bool &log, QString &unit) const + bool &, QString &unit) const { if (m_scale == LinearScale) { min = 0.0; @@ -1001,7 +1001,6 @@ { if (maxChannel < minChannel || channel < minChannel) return 0; - int w = v->width(); int h = v->height(); int channels = maxChannel - minChannel + 1; @@ -1035,7 +1034,7 @@ } int -WaveformLayer::getVerticalScaleWidth(View *v, QPainter &paint) const +WaveformLayer::getVerticalScaleWidth(View *, QPainter &paint) const { if (m_scale == LinearScale) { return paint.fontMetrics().width("0.0") + 13;
--- a/view/Overview.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/view/Overview.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -62,13 +62,13 @@ } void -Overview::globalCentreFrameChanged(unsigned long f) +Overview::globalCentreFrameChanged(unsigned long) { update(); } void -Overview::viewCentreFrameChanged(View *v, unsigned long f) +Overview::viewCentreFrameChanged(View *v, unsigned long) { if (m_views.find(v) != m_views.end()) { update(); @@ -76,7 +76,7 @@ } void -Overview::viewZoomLevelChanged(View *v, unsigned long z, bool) +Overview::viewZoomLevelChanged(View *v, unsigned long, bool) { if (v == this) return; if (m_views.find(v) != m_views.end()) {
--- a/view/Pane.cpp Mon Apr 30 09:07:08 2007 +0000 +++ b/view/Pane.cpp Mon Apr 30 13:36:23 2007 +0000 @@ -552,7 +552,6 @@ QString text = QString("%1").arg(m_centreFrame); - int tw = paint.fontMetrics().width(text); int x = width()/2 + 4; drawVisibleText(paint, x, y, text, OutlinedText); @@ -604,7 +603,7 @@ if (m_manager && m_manager->shouldShowLayerNames() && - r.y() + r.height() >= height() - m_layers.size() * fontHeight - 6) { + r.y() + r.height() >= height() - int(m_layers.size()) * fontHeight - 6) { std::vector<QString> texts; int maxTextWidth = 0; @@ -641,9 +640,9 @@ if (r.x() + r.width() >= llx) { - for (int i = 0; i < texts.size(); ++i) { + for (size_t i = 0; i < texts.size(); ++i) { - if (i == texts.size() - 1) { + if (i + 1 == texts.size()) { paint.setPen(Qt::black); } @@ -1295,11 +1294,11 @@ if (getTopLayerDisplayExtents(vmin, vmax, dmin, dmax)) { - std::cerr << "ydiff = " << ydiff << std::endl; +// std::cerr << "ydiff = " << ydiff << std::endl; float perpix = (dmax - dmin) / height(); float valdiff = ydiff * perpix; - std::cerr << "valdiff = " << valdiff << std::endl; +// std::cerr << "valdiff = " << valdiff << std::endl; float newmin = m_dragStartMinValue + valdiff; float newmax = m_dragStartMinValue + (dmax - dmin) + valdiff; @@ -1311,8 +1310,8 @@ newmin -= newmax - vmax; newmax -= newmax - vmax; } - std::cerr << "(" << dmin << ", " << dmax << ") -> (" - << newmin << ", " << newmax << ") (drag start " << m_dragStartMinValue << ")" << std::endl; +// std::cerr << "(" << dmin << ", " << dmax << ") -> (" +// << newmin << ", " << newmax << ") (drag start " << m_dragStartMinValue << ")" << std::endl; setTopLayerDisplayExtents(newmin, newmax); updateVerticalPanner(); @@ -1343,10 +1342,10 @@ size_t min, max; - if (m_selectionStartFrame > snapFrameLeft) { + if (m_selectionStartFrame > size_t(snapFrameLeft)) { min = snapFrameLeft; max = m_selectionStartFrame; - } else if (snapFrameRight > m_selectionStartFrame) { + } else if (size_t(snapFrameRight) > m_selectionStartFrame) { min = m_selectionStartFrame; max = snapFrameRight; } else { @@ -1372,7 +1371,9 @@ setCentreFrame(m_centreFrame + move); } else if (offset <= available * 0.10) { int move = int(available * 0.10 - offset) + 1; - if (m_centreFrame > move) { + if (move < 0) { + setCentreFrame(m_centreFrame + (-move)); + } else if (m_centreFrame > move) { setCentreFrame(m_centreFrame - move); } else { setCentreFrame(0); @@ -1627,7 +1628,7 @@ } bool -Pane::editSelectionEnd(QMouseEvent *e) +Pane::editSelectionEnd(QMouseEvent *) { if (m_editingSelection.isEmpty()) return false;