Mercurial > hg > svgui
changeset 806:4c8ca536b54f warnfix_no_size_t
Some more unsigned/long removal
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 15:36:56 +0100 |
parents | 1d526ba11a24 |
children | e4773943c9c1 |
files | layer/FlexiNoteLayer.cpp layer/FlexiNoteLayer.h layer/ImageLayer.cpp layer/ImageLayer.h layer/Layer.cpp layer/Layer.h layer/NoteLayer.cpp layer/NoteLayer.h layer/SpectrogramLayer.cpp layer/SpectrogramLayer.h layer/WaveformLayer.cpp view/Overview.cpp view/Overview.h view/Pane.cpp view/Pane.h view/PaneStack.cpp view/PaneStack.h view/View.cpp view/View.h view/ViewManager.cpp view/ViewManager.h |
diffstat | 21 files changed, 356 insertions(+), 355 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -403,7 +403,7 @@ { if (!m_model) return FlexiNoteModel::PointList(); - long frame = v->getFrameForX(x); + int frame = v->getFrameForX(x); FlexiNoteModel::PointList onPoints = m_model->getPoints(frame); @@ -446,7 +446,7 @@ { if (!m_model) return false; - long frame = v->getFrameForX(x); + int frame = v->getFrameForX(x); FlexiNoteModel::PointList onPoints = m_model->getPoints(frame); if (onPoints.empty()) return false; @@ -475,7 +475,7 @@ // GF: find the note that is closest to the cursor if (!m_model) return false; - long frame = v->getFrameForX(x); + int frame = v->getFrameForX(x); FlexiNoteModel::PointList onPoints = m_model->getPoints(frame); if (onPoints.empty()) return false; @@ -798,8 +798,8 @@ // Profiler profiler("FlexiNoteLayer::paint", true); int x0 = rect.left(), x1 = rect.right(); - long frame0 = v->getFrameForX(x0); - long frame1 = v->getFrameForX(x1); + int frame0 = v->getFrameForX(x0); + int frame1 = v->getFrameForX(x1); FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1)); if (points.empty()) return; @@ -935,7 +935,7 @@ if (!m_model) return; - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); @@ -959,14 +959,14 @@ if (!m_model || !m_editing) return; - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); float newValue = getValueForY(v, e->y()); - long newFrame = m_editingPoint.frame; - long newDuration = frame - newFrame; + int newFrame = m_editingPoint.frame; + int newDuration = frame - newFrame; if (newDuration < 0) { newFrame = frame; newDuration = -newDuration; @@ -1058,11 +1058,11 @@ m_dragStartX = e->x(); m_dragStartY = e->y(); - long onset = m_originalPoint.frame; - long offset = m_originalPoint.frame + m_originalPoint.duration - 1; + int onset = m_originalPoint.frame; + int offset = m_originalPoint.frame + m_originalPoint.duration - 1; m_greatestLeftNeighbourFrame = -1; - m_smallestRightNeighbourFrame = std::numeric_limits<long>::max(); + m_smallestRightNeighbourFrame = std::numeric_limits<int>::max(); for (FlexiNoteModel::PointList::const_iterator i = m_model->getPoints().begin(); i != m_model->getPoints().end(); ++i) { @@ -1095,7 +1095,7 @@ int newx = m_dragPointX + xdist; int newy = m_dragPointY + ydist; - long dragFrame = v->getFrameForX(newx); + int dragFrame = v->getFrameForX(newx); if (dragFrame < 0) dragFrame = 0; dragFrame = dragFrame / m_model->getResolution() * m_model->getResolution(); @@ -1217,7 +1217,7 @@ return; } - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); splitNotesAt(v, frame, e); } @@ -1274,13 +1274,13 @@ std::cerr << "addNote" << std::endl; if (!m_model) return; - long duration = 10000; + int duration = 10000; - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); float value = getValueForY(v, e->y()); if (m_intelligentActions) { - long smallestRightNeighbourFrame = 0; + int smallestRightNeighbourFrame = 0; for (FlexiNoteModel::PointList::const_iterator i = m_model->getPoints().begin(); i != m_model->getPoints().end(); ++i) { FlexiNote currentNote = *i; @@ -1737,13 +1737,13 @@ } void -FlexiNoteLayer::addNoteOn(long frame, int pitch, int velocity) +FlexiNoteLayer::addNoteOn(int frame, int pitch, int velocity) { m_pendingNoteOns.insert(FlexiNote(frame, pitch, 0, float(velocity) / 127.0, "")); } void -FlexiNoteLayer::addNoteOff(long frame, int pitch) +FlexiNoteLayer::addNoteOff(int frame, int pitch) { for (FlexiNoteSet::iterator i = m_pendingNoteOns.begin(); i != m_pendingNoteOns.end(); ++i) {
--- a/layer/FlexiNoteLayer.h Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/FlexiNoteLayer.h Tue Jun 17 15:36:56 2014 +0100 @@ -137,13 +137,13 @@ * not be finally added to the layer until the corresponding * note-off. */ - void addNoteOn(long frame, int pitch, int velocity); + void addNoteOn(int frame, int pitch, int velocity); /** * Add a note-off. This will cause a note to appear, if and only * if there is a matching pending note-on. */ - void addNoteOff(long frame, int pitch); + void addNoteOff(int frame, int pitch); /** * Abandon all pending note-on events. @@ -186,8 +186,8 @@ int m_dragStartY; FlexiNoteModel::Point m_originalPoint; FlexiNoteModel::Point m_editingPoint; - long m_greatestLeftNeighbourFrame; - long m_smallestRightNeighbourFrame; + int m_greatestLeftNeighbourFrame; + int m_smallestRightNeighbourFrame; FlexiNoteModel::EditCommand *m_editingCommand; VerticalScale m_verticalScale; EditMode m_editMode;
--- a/layer/ImageLayer.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/ImageLayer.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -185,7 +185,7 @@ } } -// long useFrame = points.begin()->frame; +// int useFrame = points.begin()->frame; // RealTime rt = RealTime::frame2RealTime(useFrame, m_model->getSampleRate()); @@ -292,8 +292,8 @@ // int x0 = rect.left(), x1 = rect.right(); int x0 = 0, x1 = v->width(); - long frame0 = v->getFrameForX(x0); - long frame1 = v->getFrameForX(x1); + int frame0 = v->getFrameForX(x0); + int frame1 = v->getFrameForX(x1); ImageModel::PointList points(m_model->getPoints(frame0, frame1)); if (points.empty()) return; @@ -563,7 +563,7 @@ return; } - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); @@ -584,7 +584,7 @@ if (!m_model || !m_editing) return; - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); @@ -619,7 +619,7 @@ } bool -ImageLayer::addImage(long frame, QString url) +ImageLayer::addImage(int frame, QString url) { QImage image(getLocalFilename(url)); if (image.isNull()) { @@ -664,8 +664,8 @@ { if (!m_model || !m_editing) return; - long frameDiff = v->getFrameForX(e->x()) - v->getFrameForX(m_editOrigin.x()); - long frame = m_originalPoint.frame + frameDiff; + int frameDiff = v->getFrameForX(e->x()) - v->getFrameForX(m_editOrigin.x()); + int frame = m_originalPoint.frame + frameDiff; if (frame < 0) frame = 0; frame = (frame / m_model->getResolution()) * m_model->getResolution();
--- a/layer/ImageLayer.h Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/ImageLayer.h Tue Jun 17 15:36:56 2014 +0100 @@ -98,7 +98,7 @@ void setProperties(const QXmlAttributes &attributes); - virtual bool addImage(long frame, QString url); // using a command + virtual bool addImage(int frame, QString url); // using a command protected slots: void checkAddSources();
--- a/layer/Layer.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/Layer.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -51,8 +51,8 @@ connect(model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); - connect(model, SIGNAL(modelChanged(int, int)), - this, SIGNAL(modelChanged(int, int))); + connect(model, SIGNAL(modelChangedWithin(int, int)), + this, SIGNAL(modelChangedWithin(int, int))); connect(model, SIGNAL(completionChanged()), this, SIGNAL(modelCompletionChanged())); @@ -250,12 +250,12 @@ // reference (i.e. having been copied from the reference // model). - long sourceFrame = i->getFrame(); - long referenceFrame = sourceFrame; + int sourceFrame = i->getFrame(); + int referenceFrame = sourceFrame; if (i->haveReferenceFrame()) { referenceFrame = i->getReferenceFrame(); } - long myMappedFrame = alignToReference(v, sourceFrame); + int myMappedFrame = alignToReference(v, sourceFrame); // cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->haveReferenceFrame() << "), myMappedFrame = " << myMappedFrame << endl; @@ -320,8 +320,8 @@ QString fs = attributes.value("startFrame"); int x0 = 0, x1 = 0; if (fs != "") { - rect.startFrame = fs.toLong(); - rect.endFrame = attributes.value("endFrame").toLong(); + rect.startFrame = fs.toInt(); + rect.endFrame = attributes.value("endFrame").toInt(); rect.haveFrames = true; } else { x0 = attributes.value("startX").toInt(); @@ -470,8 +470,8 @@ void Layer::updateMeasurePixrects(View *v) const { - long sf = v->getStartFrame(); - long ef = v->getEndFrame(); + int sf = v->getStartFrame(); + int ef = v->getEndFrame(); for (MeasureRectSet::const_iterator i = m_measureRects.begin(); i != m_measureRects.end(); ++i) { @@ -495,7 +495,7 @@ if (i->startFrame >= v->getStartFrame()) { x0 = v->getXForFrame(i->startFrame); } - if (i->endFrame <= long(v->getEndFrame())) { + if (i->endFrame <= int(v->getEndFrame())) { x1 = v->getXForFrame(i->endFrame); } } @@ -577,7 +577,7 @@ if (r.startFrame >= v->getStartFrame()) { x0 = v->getXForFrame(r.startFrame); } - if (r.endFrame <= long(v->getEndFrame())) { + if (r.endFrame <= v->getEndFrame()) { x1 = v->getXForFrame(r.endFrame); }
--- a/layer/Layer.h Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/Layer.h Tue Jun 17 15:36:56 2014 +0100 @@ -525,7 +525,7 @@ void modelChanged(); void modelCompletionChanged(); void modelAlignmentCompletionChanged(); - void modelChanged(int startFrame, int endFrame); + void modelChangedWithin(int startFrame, int endFrame); void modelReplaced(); void layerParametersChanged(); @@ -546,8 +546,8 @@ mutable QRect pixrect; bool haveFrames; - long startFrame; // only valid if haveFrames - long endFrame; // ditto + int startFrame; // only valid if haveFrames + int endFrame; // ditto double startY; double endY;
--- a/layer/NoteLayer.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/NoteLayer.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -389,7 +389,7 @@ { if (!m_model) return NoteModel::PointList(); - long frame = v->getFrameForX(x); + int frame = v->getFrameForX(x); NoteModel::PointList onPoints = m_model->getPoints(frame); @@ -407,11 +407,11 @@ if (prevPoints.empty()) { usePoints = nextPoints; - } else if (long(prevPoints.begin()->frame) < v->getStartFrame() && + } else if (int(prevPoints.begin()->frame) < v->getStartFrame() && !(nextPoints.begin()->frame > v->getEndFrame())) { usePoints = nextPoints; - } else if (long(nextPoints.begin()->frame) - frame < - frame - long(prevPoints.begin()->frame)) { + } else if (int(nextPoints.begin()->frame) - frame < + frame - int(prevPoints.begin()->frame)) { usePoints = nextPoints; } @@ -432,7 +432,7 @@ { if (!m_model) return false; - long frame = v->getFrameForX(x); + int frame = v->getFrameForX(x); NoteModel::PointList onPoints = m_model->getPoints(frame); if (onPoints.empty()) return false; @@ -747,8 +747,8 @@ // Profiler profiler("NoteLayer::paint", true); int x0 = rect.left(), x1 = rect.right(); - long frame0 = v->getFrameForX(x0); - long frame1 = v->getFrameForX(x1); + int frame0 = v->getFrameForX(x0); + int frame1 = v->getFrameForX(x1); NoteModel::PointList points(m_model->getPoints(frame0, frame1)); if (points.empty()) return; @@ -884,7 +884,7 @@ if (!m_model) return; - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); @@ -908,14 +908,14 @@ if (!m_model || !m_editing) return; - long frame = v->getFrameForX(e->x()); + int frame = v->getFrameForX(e->x()); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); float newValue = getValueForY(v, e->y()); - long newFrame = m_editingPoint.frame; - long newDuration = frame - newFrame; + int newFrame = m_editingPoint.frame; + int newDuration = frame - newFrame; if (newDuration < 0) { newFrame = frame; newDuration = -newDuration; @@ -1015,7 +1015,7 @@ int newx = m_dragPointX + xdist; int newy = m_dragPointY + ydist; - long frame = v->getFrameForX(newx); + int frame = v->getFrameForX(newx); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); @@ -1288,13 +1288,13 @@ } void -NoteLayer::addNoteOn(long frame, int pitch, int velocity) +NoteLayer::addNoteOn(int frame, int pitch, int velocity) { m_pendingNoteOns.insert(Note(frame, pitch, 0, float(velocity) / 127.0, "")); } void -NoteLayer::addNoteOff(long frame, int pitch) +NoteLayer::addNoteOff(int frame, int pitch) { for (NoteSet::iterator i = m_pendingNoteOns.begin(); i != m_pendingNoteOns.end(); ++i) {
--- a/layer/NoteLayer.h Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/NoteLayer.h Tue Jun 17 15:36:56 2014 +0100 @@ -113,13 +113,13 @@ * not be finally added to the layer until the corresponding * note-off. */ - void addNoteOn(long frame, int pitch, int velocity); + void addNoteOn(int frame, int pitch, int velocity); /** * Add a note-off. This will cause a note to appear, if and only * if there is a matching pending note-on. */ - void addNoteOff(long frame, int pitch); + void addNoteOff(int frame, int pitch); /** * Abandon all pending note-on events.
--- a/layer/SpectrogramLayer.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/SpectrogramLayer.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -141,7 +141,7 @@ connectSignals(m_model); connect(m_model, SIGNAL(modelChanged()), this, SLOT(cacheInvalid())); - connect(m_model, SIGNAL(modelChanged(int, int)), + connect(m_model, SIGNAL(modelChangedWithin(int, int)), this, SLOT(cacheInvalid(int, int))); emit modelReplaced(); @@ -592,7 +592,7 @@ << i->second.validArea.height() << endl; #endif - if (long(startFrame) > v->getStartFrame()) { + if (int(startFrame) > v->getStartFrame()) { if (startFrame >= v->getEndFrame()) { #ifdef DEBUG_SPECTROGRAM_REPAINT cerr << "Modified start frame is off right of view" << endl; @@ -610,7 +610,7 @@ i->second.validArea = QRect(); } } else { - if (long(endFrame) < v->getStartFrame()) { + if (int(endFrame) < v->getStartFrame()) { #ifdef DEBUG_SPECTROGRAM_REPAINT cerr << "Modified end frame is off left of view" << endl; #endif @@ -1100,7 +1100,7 @@ #endif invalidateImageCaches(lastFill, fill); i->second.second = fill; - emit modelChanged(lastFill, fill); + emit modelChangedWithin(lastFill, fill); } } else { #ifdef DEBUG_SPECTROGRAM_REPAINT @@ -1109,7 +1109,7 @@ #endif invalidateImageCaches(); i->second.second = fill; - emit modelChanged(m_model->getStartFrame(), m_model->getEndFrame()); + emit modelChangedWithin(m_model->getStartFrame(), m_model->getEndFrame()); } if (i->second.second >= 0) { @@ -1780,7 +1780,7 @@ cerr << "rect is " << rect.x() << "," << rect.y() << " " << rect.width() << "x" << rect.height() << endl; #endif - long startFrame = v->getStartFrame(); + int startFrame = v->getStartFrame(); if (startFrame < 0) m_candidateFillStartFrame = 0; else m_candidateFillStartFrame = startFrame; @@ -1796,7 +1796,7 @@ // is not in the dormancy map at all -- we need it to be present // and accountable for when determining whether we need the cache // in the cache-fill thread above. - //!!! no longer use cache-fill thread + //!!! no inter use cache-fill thread const_cast<SpectrogramLayer *>(this)->Layer::setLayerDormant(v, false); int fftSize = getFFTSize(v); @@ -2196,22 +2196,22 @@ bool bufferBinResolution = false; if (increment > zoomLevel) bufferBinResolution = true; - long leftBoundaryFrame = -1, leftCropFrame = -1; - long rightBoundaryFrame = -1, rightCropFrame = -1; + int leftBoundaryFrame = -1, leftCropFrame = -1; + int rightBoundaryFrame = -1, rightCropFrame = -1; int bufwid; if (bufferBinResolution) { for (int x = x0; ; --x) { - long f = v->getFrameForX(x); + int f = v->getFrameForX(x); if ((f / increment) * increment == f) { if (leftCropFrame == -1) leftCropFrame = f; else if (x < x0 - 2) { leftBoundaryFrame = f; break; } } } for (int x = x0 + w; ; ++x) { - long f = v->getFrameForX(x); + int f = v->getFrameForX(x); if ((f / increment) * increment == f) { if (rightCropFrame == -1) rightCropFrame = f; else if (x > x0 + w + 2) { rightBoundaryFrame = f; break; } @@ -3080,7 +3080,7 @@ View::OutlinedText); } - long frame = v->getFrameForX(cursorPos.x()); + int frame = v->getFrameForX(cursorPos.x()); RealTime rt = RealTime::frame2RealTime(frame, m_model->getSampleRate()); QString rtLabel = QString("%1 s").arg(rt.toText(true).c_str()); QString frameLabel = QString("%1").arg(frame);
--- a/layer/SpectrogramLayer.h Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/SpectrogramLayer.h Tue Jun 17 15:36:56 2014 +0100 @@ -310,7 +310,7 @@ { QImage image; QRect validArea; - long startFrame; + int startFrame; int zoomLevel; }; typedef std::map<const View *, ImageCache> ViewImageCache; @@ -344,7 +344,7 @@ float getEffectiveMaxFrequency() const; struct LayerRange { - long startFrame; + int startFrame; int zoomLevel; int modelStart; int modelEnd;
--- a/layer/WaveformLayer.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/layer/WaveformLayer.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -410,7 +410,7 @@ WaveformLayer::getSourceFramesForX(View *v, int x, int modelZoomLevel, int &f0, int &f1) const { - long viewFrame = v->getFrameForX(x); + int viewFrame = v->getFrameForX(x); if (viewFrame < 0) { f0 = 0; f1 = 0; @@ -434,13 +434,11 @@ float WaveformLayer::getNormalizeGain(View *v, int channel) const { - long startFrame = v->getStartFrame(); - long endFrame = v->getEndFrame(); + int startFrame = v->getStartFrame(); + int endFrame = v->getEndFrame(); - // Although a long for purposes of comparison against the view - // start and end frames, these are known to be non-negative - long modelStart = long(m_model->getStartFrame()); - long modelEnd = long(m_model->getEndFrame()); + int modelStart = m_model->getStartFrame(); + int modelEnd = m_model->getEndFrame(); int rangeStart, rangeEnd;
--- a/view/Overview.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/view/Overview.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -39,11 +39,11 @@ } void -Overview::modelChanged(size_t startFrame, size_t endFrame) +Overview::modelChangedWithin(int startFrame, int endFrame) { bool zoomChanged = false; - size_t frameCount = getModelsEndFrame() - getModelsStartFrame(); + int frameCount = getModelsEndFrame() - getModelsStartFrame(); int zoomLevel = frameCount / width(); if (zoomLevel < 1) zoomLevel = 1; zoomLevel = getZoomConstraintBlockSize(zoomLevel, @@ -67,7 +67,7 @@ } } - View::modelChanged(startFrame, endFrame); + View::modelChangedWithin(startFrame, endFrame); } void @@ -92,7 +92,11 @@ } void -Overview::globalCentreFrameChanged(unsigned long f) +Overview::globalCentreFrameChanged(int +#ifdef DEBUG_OVERVIEW + f +#endif + ) { #ifdef DEBUG_OVERVIEW cerr << "Overview::globalCentreFrameChanged: " << f << endl; @@ -101,7 +105,11 @@ } void -Overview::viewCentreFrameChanged(View *v, unsigned long f) +Overview::viewCentreFrameChanged(View *v, int +#ifdef DEBUG_OVERVIEW + f +#endif + ) { #ifdef DEBUG_OVERVIEW cerr << "Overview[" << this << "]::viewCentreFrameChanged(" << v << "): " << f << endl; @@ -112,7 +120,7 @@ } void -Overview::viewZoomLevelChanged(View *v, unsigned long, bool) +Overview::viewZoomLevelChanged(View *v, int, bool) { if (v == this) return; if (m_views.find(v) != m_views.end()) { @@ -121,7 +129,7 @@ } void -Overview::viewManagerPlaybackFrameChanged(unsigned long f) +Overview::viewManagerPlaybackFrameChanged(int f) { #ifdef DEBUG_OVERVIEW cerr << "Overview[" << this << "]::viewManagerPlaybackFrameChanged(" << f << "): " << f << endl; @@ -146,8 +154,8 @@ cerr << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << endl; #endif - size_t startFrame = getModelsStartFrame(); - size_t frameCount = getModelsEndFrame() - getModelsStartFrame(); + int startFrame = getModelsStartFrame(); + int frameCount = getModelsEndFrame() - getModelsStartFrame(); int zoomLevel = frameCount / width(); if (zoomLevel < 1) zoomLevel = 1; zoomLevel = getZoomConstraintBlockSize(zoomLevel, @@ -157,7 +165,7 @@ emit zoomLevelChanged(m_zoomLevel, m_followZoom); } - size_t centreFrame = startFrame + m_zoomLevel * (width() / 2); + int centreFrame = startFrame + m_zoomLevel * (width() / 2); if (centreFrame > (startFrame + getModelsEndFrame())/2) { centreFrame = (startFrame + getModelsEndFrame())/2; } @@ -197,15 +205,15 @@ View *w = (View *)*i; - long f0 = w->getFrameForX(0); - long f1 = w->getFrameForX(w->width()); + int f0 = w->getFrameForX(0); + int f1 = w->getFrameForX(w->width()); if (f0 >= 0) { - size_t rf0 = w->alignToReference(f0); + int rf0 = w->alignToReference(f0); f0 = alignFromReference(rf0); } if (f1 >= 0) { - size_t rf1 = w->alignToReference(f1); + int rf1 = w->alignToReference(f1); f1 = alignFromReference(rf1); } @@ -230,7 +238,7 @@ Overview::mousePressEvent(QMouseEvent *e) { m_clickPos = e->pos(); - long clickFrame = getFrameForX(m_clickPos.x()); + int clickFrame = getFrameForX(m_clickPos.x()); if (clickFrame > 0) m_dragCentreFrame = clickFrame; else m_dragCentreFrame = 0; m_clickedInRange = true; @@ -257,13 +265,13 @@ { if (!m_clickedInRange) return; - long xoff = int(e->x()) - int(m_clickPos.x()); - long frameOff = xoff * m_zoomLevel; + int xoff = int(e->x()) - int(m_clickPos.x()); + int frameOff = xoff * m_zoomLevel; - size_t newCentreFrame = m_dragCentreFrame; + int newCentreFrame = m_dragCentreFrame; if (frameOff > 0) { newCentreFrame += frameOff; - } else if (newCentreFrame >= size_t(-frameOff)) { + } else if (newCentreFrame >= int(-frameOff)) { newCentreFrame += frameOff; } else { newCentreFrame = 0; @@ -275,8 +283,8 @@ } if (std::max(m_centreFrame, newCentreFrame) - - std::min(m_centreFrame, newCentreFrame) > size_t(m_zoomLevel)) { - size_t rf = alignToReference(newCentreFrame); + std::min(m_centreFrame, newCentreFrame) > int(m_zoomLevel)) { + int rf = alignToReference(newCentreFrame); #ifdef DEBUG_OVERVIEW cerr << "Overview::mouseMoveEvent: x " << e->x() << " and click x " << m_clickPos.x() << " -> frame " << newCentreFrame << " -> rf " << rf << endl; #endif @@ -287,8 +295,8 @@ void Overview::mouseDoubleClickEvent(QMouseEvent *e) { - long frame = getFrameForX(e->x()); - size_t rf = 0; + int frame = getFrameForX(e->x()); + int rf = 0; if (frame > 0) rf = alignToReference(frame); #ifdef DEBUG_OVERVIEW cerr << "Overview::mouseDoubleClickEvent: frame " << frame << " -> rf " << rf << endl;
--- a/view/Overview.h Tue Jun 17 15:18:06 2014 +0100 +++ b/view/Overview.h Tue Jun 17 15:36:56 2014 +0100 @@ -41,13 +41,13 @@ virtual QString getPropertyContainerIconName() const { return "panner"; } public slots: - virtual void modelChanged(size_t startFrame, size_t endFrame); + virtual void modelChangedWithin(int startFrame, int endFrame); virtual void modelReplaced(); - virtual void globalCentreFrameChanged(unsigned long); - virtual void viewCentreFrameChanged(View *, unsigned long); - virtual void viewZoomLevelChanged(View *, unsigned long, bool); - virtual void viewManagerPlaybackFrameChanged(unsigned long); + virtual void globalCentreFrameChanged(int); + virtual void viewCentreFrameChanged(View *, int); + virtual void viewZoomLevelChanged(View *, int, bool); + virtual void viewManagerPlaybackFrameChanged(int); protected: virtual void paintEvent(QPaintEvent *e); @@ -62,7 +62,7 @@ QPoint m_clickPos; QPoint m_mousePos; bool m_clickedInRange; - size_t m_dragCentreFrame; + int m_dragCentreFrame; QTime m_modelTestTime; typedef std::set<View *> ViewSet;
--- a/view/Pane.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/view/Pane.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -543,7 +543,7 @@ paint.end(); } -size_t +int Pane::getVerticalScaleWidth() const { if (m_scaleWidth > 0) return m_scaleWidth; @@ -784,8 +784,6 @@ int x0 = getXForFrame(model->getStartFrame()); int x1 = getXForFrame(model->getEndFrame()); - int lw = 10; - paint.save(); QBrush brush; @@ -938,7 +936,7 @@ if (r.x() + r.width() >= llx - fontAscent - 3) { - for (size_t i = 0; i < texts.size(); ++i) { + for (int i = 0; i < texts.size(); ++i) { // cerr << "Pane "<< this << ": text " << i << ": " << texts[i] << endl; @@ -966,7 +964,7 @@ { int offset = m_mousePos.x() - m_clickPos.x(); - long origStart = m_editingSelection.getStartFrame(); + int origStart = m_editingSelection.getStartFrame(); int p0 = getXForFrame(origStart) + offset; int p1 = getXForFrame(m_editingSelection.getEndFrame()) + offset; @@ -977,8 +975,8 @@ p0 = getXForFrame(m_editingSelection.getStartFrame()); } - long newStart = getFrameForX(p0); - long newEnd = getFrameForX(p1); + int newStart = getFrameForX(p0); + int newEnd = getFrameForX(p1); paint.save(); paint.setPen(QPen(getForeground(), 2)); @@ -1041,10 +1039,10 @@ if (r.y() + r.height() < height() - fontHeight - 6) return; - size_t modelRate = waveformModel->getSampleRate(); - size_t nativeRate = waveformModel->getNativeRate(); - size_t playbackRate = m_manager->getPlaybackSampleRate(); - size_t outputRate = m_manager->getOutputSampleRate(); + int modelRate = waveformModel->getSampleRate(); + int nativeRate = waveformModel->getNativeRate(); + int playbackRate = m_manager->getPlaybackSampleRate(); + int outputRate = m_manager->getOutputSampleRate(); QString srNote = ""; @@ -1083,7 +1081,7 @@ } bool -Pane::render(QPainter &paint, int xorigin, size_t f0, size_t f1) +Pane::render(QPainter &paint, int xorigin, int f0, int f1) { if (!View::render(paint, xorigin + m_scaleWidth, f0, f1)) { return false; @@ -1114,10 +1112,10 @@ } QImage * -Pane::toNewImage(size_t f0, size_t f1) +Pane::toNewImage(int f0, int f1) { - size_t x0 = f0 / getZoomLevel(); - size_t x1 = f1 / getZoomLevel(); + int x0 = f0 / getZoomLevel(); + int x1 = f1 / getZoomLevel(); QImage *image = new QImage(x1 - x0 + m_scaleWidth, height(), QImage::Format_RGB32); @@ -1154,7 +1152,7 @@ } QSize -Pane::getImageSize(size_t f0, size_t f1) +Pane::getImageSize(int f0, int f1) { QSize s = View::getImageSize(f0, f1); QImage *image = new QImage(100, 100, QImage::Format_RGB32); @@ -1173,11 +1171,11 @@ return QSize(sw + s.width(), s.height()); } -size_t +int Pane::getFirstVisibleFrame() const { - long f0 = getFrameForX(m_scaleWidth); - size_t f = View::getFirstVisibleFrame(); + int f0 = getFrameForX(m_scaleWidth); + int f = View::getFirstVisibleFrame(); if (f0 < 0 || f0 < long(f)) return f; return f0; } @@ -1189,7 +1187,7 @@ if (!m_manager) return Selection(); - long testFrame = getFrameForX(x - 5); + int testFrame = getFrameForX(x - 5); if (testFrame < 0) { testFrame = getFrameForX(x); if (testFrame < 0) return Selection(); @@ -1354,7 +1352,7 @@ } else { int mouseFrame = getFrameForX(e->x()); - size_t resolution = 1; + int resolution = 1; int snapFrame = mouseFrame; Layer *layer = getSelectedLayer(); @@ -1822,9 +1820,9 @@ int w = x1 - x0; - long newStartFrame = getFrameForX(x0); + int newStartFrame = getFrameForX(x0); - long visibleFrames = getEndFrame() - getStartFrame(); + int visibleFrames = getEndFrame() - getStartFrame(); if (newStartFrame <= -visibleFrames) { newStartFrame = -visibleFrames + 1; } @@ -1835,7 +1833,7 @@ float ratio = float(w) / float(width()); // cerr << "ratio: " << ratio << endl; - size_t newZoomLevel = (size_t)nearbyint(m_zoomLevel * ratio); + int newZoomLevel = (int)nearbyint(m_zoomLevel * ratio); if (newZoomLevel < 1) newZoomLevel = 1; // cerr << "start: " << m_startFrame << ", level " << m_zoomLevel << endl; @@ -1914,13 +1912,12 @@ if (m_dragMode == HorizontalDrag || m_dragMode == FreeDrag) { - long frameOff = getFrameForX(e->x()) - getFrameForX(m_clickPos.x()); - - size_t newCentreFrame = m_dragCentreFrame; + int frameOff = getFrameForX(e->x()) - getFrameForX(m_clickPos.x()); + int newCentreFrame = m_dragCentreFrame; if (frameOff < 0) { newCentreFrame -= frameOff; - } else if (newCentreFrame >= size_t(frameOff)) { + } else if (newCentreFrame >= frameOff) { newCentreFrame -= frameOff; } else { newCentreFrame = 0; @@ -2042,7 +2039,7 @@ Pane::dragExtendSelection(QMouseEvent *e) { int mouseFrame = getFrameForX(e->x()); - size_t resolution = 1; + int resolution = 1; int snapFrameLeft = mouseFrame; int snapFrameRight = mouseFrame; @@ -2059,12 +2056,12 @@ if (snapFrameLeft < 0) snapFrameLeft = 0; if (snapFrameRight < 0) snapFrameRight = 0; - size_t min, max; + int min, max; - if (m_selectionStartFrame > size_t(snapFrameLeft)) { + if (m_selectionStartFrame > snapFrameLeft) { min = snapFrameLeft; max = m_selectionStartFrame; - } else if (size_t(snapFrameRight) > m_selectionStartFrame) { + } else if (snapFrameRight > m_selectionStartFrame) { min = m_selectionStartFrame; max = snapFrameRight; } else { @@ -2155,7 +2152,7 @@ if (relocate) { - long f = getFrameForX(e->x()); + int f = getFrameForX(e->x()); setCentreFrame(f); @@ -2226,11 +2223,11 @@ if (getStartFrame() < 0 && getEndFrame() >= getModelsEndFrame()) return; - long delta = ((width() / 2) * count * m_zoomLevel); - - if (int(m_centreFrame) < delta) { + int delta = ((width() / 2) * count * m_zoomLevel); + + if (m_centreFrame < delta) { setCentreFrame(0); - } else if (int(m_centreFrame) - delta >= int(getModelsEndFrame())) { + } else if (m_centreFrame - delta >= getModelsEndFrame()) { setCentreFrame(getModelsEndFrame()); } else { setCentreFrame(m_centreFrame - delta); @@ -2355,7 +2352,7 @@ } void -Pane::verticalPannerMoved(float x0, float y0, float w, float h) +Pane::verticalPannerMoved(float , float y0, float , float h) { float vmin, vmax, dmin, dmax; if (!getTopLayerDisplayExtents(vmin, vmax, dmin, dmax)) return; @@ -2493,8 +2490,8 @@ int p0 = getXForFrame(m_editingSelection.getStartFrame()) + offset; int p1 = getXForFrame(m_editingSelection.getEndFrame()) + offset; - long f0 = getFrameForX(p0); - long f1 = getFrameForX(p1); + int f0 = getFrameForX(p0); + int f1 = getFrameForX(p1); Selection newSelection(f0, f1); @@ -2591,7 +2588,7 @@ } void -Pane::viewZoomLevelChanged(View *v, unsigned long z, bool locked) +Pane::viewZoomLevelChanged(View *v, int z, bool locked) { // cerr << "Pane[" << this << "]::zoomLevelChanged (global now " // << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << endl;
--- a/view/Pane.h Tue Jun 17 15:18:06 2014 +0100 +++ b/view/Pane.h Tue Jun 17 15:36:56 2014 +0100 @@ -48,13 +48,13 @@ void setCentreLineVisible(bool visible); bool getCentreLineVisible() const { return m_centreLineVisible; } - virtual size_t getFirstVisibleFrame() const; + virtual int getFirstVisibleFrame() const; - virtual size_t getVerticalScaleWidth() const; + virtual int getVerticalScaleWidth() const; - virtual QImage *toNewImage(size_t f0, size_t f1); + virtual QImage *toNewImage(int f0, int f1); virtual QImage *toNewImage() { return View::toNewImage(); } - virtual QSize getImageSize(size_t f0, size_t f1); + virtual QSize getImageSize(int f0, int f1); virtual QSize getImageSize() { return View::getImageSize(); } virtual void toXml(QTextStream &stream, QString indent = "", @@ -67,13 +67,13 @@ void rightButtonMenuRequested(QPoint position); void dropAccepted(QStringList uriList); void dropAccepted(QString text); - void doubleClickSelectInvoked(size_t frame); + void doubleClickSelectInvoked(int frame); void regionOutlined(QRect rect); public slots: virtual void toolModeChanged(); virtual void zoomWheelsEnabledChanged(); - virtual void viewZoomLevelChanged(View *v, unsigned long z, bool locked); + virtual void viewZoomLevelChanged(View *v, int z, bool locked); virtual void modelAlignmentCompletionChanged(); virtual void horizontalThumbwheelMoved(int value); @@ -114,7 +114,7 @@ void drawEditingSelection(QPainter &); void drawAlignmentStatus(QRect, QPainter &, const Model *, bool down); - virtual bool render(QPainter &paint, int x0, size_t f0, size_t f1); + virtual bool render(QPainter &paint, int x0, int f0, int f1); Selection getSelectionAt(int x, bool &closeToLeft, bool &closeToRight) const; @@ -152,10 +152,10 @@ bool m_resizing; bool m_editing; bool m_releasing; - size_t m_dragCentreFrame; + int m_dragCentreFrame; float m_dragStartMinValue; bool m_centreLineVisible; - size_t m_selectionStartFrame; + int m_selectionStartFrame; Selection m_editingSelection; int m_editingSelectionEdge; mutable int m_scaleWidth;
--- a/view/PaneStack.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/view/PaneStack.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -98,9 +98,9 @@ currentIndicator->setScaledContents(true); currentIndicator->setVisible(m_showAccessories); - long initialCentreFrame = -1; - for (int i = 0; i < m_panes.size(); ++i) { - long f = m_panes[i].pane->getCentreFrame(); + int initialCentreFrame = -1; + for (int i = 0; i < (int)m_panes.size(); ++i) { + int f = m_panes[i].pane->getCentreFrame(); initialCentreFrame = f; break; } @@ -158,8 +158,8 @@ this, SLOT(paneDropAccepted(QStringList))); connect(pane, SIGNAL(dropAccepted(QString)), this, SLOT(paneDropAccepted(QString))); - connect(pane, SIGNAL(doubleClickSelectInvoked(size_t)), - this, SIGNAL(doubleClickSelectInvoked(size_t))); + connect(pane, SIGNAL(doubleClickSelectInvoked(int)), + this, SIGNAL(doubleClickSelectInvoked(int))); emit paneAdded(pane); emit paneAdded(); @@ -220,7 +220,7 @@ Pane * PaneStack::getPane(int n) { - if (n < m_panes.size()) { + if (n < (int)m_panes.size()) { return m_panes[n].pane; } else { return 0; @@ -532,7 +532,7 @@ if (m_propertyStackMinWidth > 0) maxMinWidth = m_propertyStackMinWidth; - for (size_t i = 0; i < m_panes.size(); ++i) { + for (int i = 0; i < (int)m_panes.size(); ++i) { if (!m_panes[i].propertyStack) continue; #ifdef DEBUG_PANE_STACK SVDEBUG << "PaneStack::sizePropertyStacks: " << i << ": min " @@ -554,7 +554,7 @@ m_propertyStackStack->setMaximumWidth(setWidth + 10); - for (size_t i = 0; i < m_panes.size(); ++i) { + for (int i = 0; i < (int)m_panes.size(); ++i) { if (!m_panes[i].propertyStack) continue; m_panes[i].propertyStack->setMinimumWidth(setWidth); } @@ -581,7 +581,7 @@ PaneStack::paneDeleteButtonClicked() { QObject *s = sender(); - for (size_t i = 0; i < m_panes.size(); ++i) { + for (int i = 0; i < (int)m_panes.size(); ++i) { if (m_panes[i].xButton == s) { emit paneDeleteButtonClicked(m_panes[i].pane); } @@ -593,7 +593,7 @@ { QObject *s = sender(); - for (size_t i = 0; i < m_panes.size(); ++i) { + for (int i = 0; i < (int)m_panes.size(); ++i) { if (m_panes[i].currentIndicator == s) { setCurrentPane(m_panes[i].pane); return;
--- a/view/PaneStack.h Tue Jun 17 15:18:06 2014 +0100 +++ b/view/PaneStack.h Tue Jun 17 15:36:56 2014 +0100 @@ -93,7 +93,7 @@ void paneDeleteButtonClicked(Pane *pane); - void doubleClickSelectInvoked(size_t frame); + void doubleClickSelectInvoked(int frame); public slots: void propertyContainerAdded(PropertyContainer *);
--- a/view/View.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/view/View.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -154,21 +154,21 @@ } } -size_t +int View::getPropertyContainerCount() const { return m_layers.size() + 1; // the 1 is for me } const PropertyContainer * -View::getPropertyContainer(size_t i) const +View::getPropertyContainer(int i) const { return (const PropertyContainer *)(((View *)this)-> getPropertyContainer(i)); } PropertyContainer * -View::getPropertyContainer(size_t i) +View::getPropertyContainer(int i) { if (i == 0) return m_propertyContainer; return m_layers[i-1]; @@ -291,26 +291,26 @@ // subclass might override this } -long +int View::getStartFrame() const { return getFrameForX(0); } -size_t +int View::getEndFrame() const { return getFrameForX(width()) - 1; } void -View::setStartFrame(long f) +View::setStartFrame(int f) { setCentreFrame(f + m_zoomLevel * (width() / 2)); } bool -View::setCentreFrame(size_t f, bool e) +View::setCentreFrame(int f, bool e) { bool changeVisible = false; @@ -333,7 +333,7 @@ } if (e) { - size_t rf = alignToReference(f); + int rf = alignToReference(f); #ifdef DEBUG_VIEW_WIDGET_PAINT cerr << "View[" << this << "]::setCentreFrame(" << f << "): emitting centreFrameChanged(" @@ -347,16 +347,16 @@ } int -View::getXForFrame(long frame) const +View::getXForFrame(int frame) const { return (frame - getStartFrame()) / m_zoomLevel; } -long +int View::getFrameForX(int x) const { - long z = (long)m_zoomLevel; - long frame = m_centreFrame - (width()/2) * z; + int z = m_zoomLevel; + int frame = m_centreFrame - (width()/2) * z; #ifdef DEBUG_VIEW_WIDGET_PAINT SVDEBUG << "View::getFrameForX(" << x << "): z = " << z << ", m_centreFrame = " << m_centreFrame << ", width() = " << width() << ", frame = " << frame << endl; @@ -442,7 +442,7 @@ } void -View::setZoomLevel(size_t z) +View::setZoomLevel(int z) { if (z < 1) z = 1; if (m_zoomLevel != int(z)) { @@ -568,8 +568,8 @@ this, SLOT(modelCompletionChanged())); connect(layer, SIGNAL(modelAlignmentCompletionChanged()), this, SLOT(modelAlignmentCompletionChanged())); - connect(layer, SIGNAL(modelChanged(size_t, size_t)), - this, SLOT(modelChanged(size_t, size_t))); + connect(layer, SIGNAL(modelChangedWithin(int, int)), + this, SLOT(modelChangedWithin(int, int))); connect(layer, SIGNAL(modelReplaced()), this, SLOT(modelReplaced())); @@ -612,8 +612,8 @@ this, SLOT(modelCompletionChanged())); disconnect(layer, SIGNAL(modelAlignmentCompletionChanged()), this, SLOT(modelAlignmentCompletionChanged())); - disconnect(layer, SIGNAL(modelChanged(size_t, size_t)), - this, SLOT(modelChanged(size_t, size_t))); + disconnect(layer, SIGNAL(modelChangedWithin(int, int)), + this, SLOT(modelChangedWithin(int, int))); disconnect(layer, SIGNAL(modelReplaced()), this, SLOT(modelReplaced())); @@ -650,29 +650,29 @@ View::setViewManager(ViewManager *manager) { if (m_manager) { - m_manager->disconnect(this, SLOT(globalCentreFrameChanged(unsigned long))); - m_manager->disconnect(this, SLOT(viewCentreFrameChanged(View *, unsigned long))); - m_manager->disconnect(this, SLOT(viewManagerPlaybackFrameChanged(unsigned long))); - m_manager->disconnect(this, SLOT(viewZoomLevelChanged(View *, unsigned long, bool))); + m_manager->disconnect(this, SLOT(globalCentreFrameChanged(int))); + m_manager->disconnect(this, SLOT(viewCentreFrameChanged(View *, int))); + m_manager->disconnect(this, SLOT(viewManagerPlaybackFrameChanged(int))); + m_manager->disconnect(this, SLOT(viewZoomLevelChanged(View *, int, bool))); m_manager->disconnect(this, SLOT(toolModeChanged())); m_manager->disconnect(this, SLOT(selectionChanged())); m_manager->disconnect(this, SLOT(overlayModeChanged())); m_manager->disconnect(this, SLOT(zoomWheelsEnabledChanged())); - disconnect(m_manager, SLOT(viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode))); - disconnect(m_manager, SLOT(zoomLevelChanged(unsigned long, bool))); + disconnect(m_manager, SLOT(viewCentreFrameChanged(int, bool, PlaybackFollowMode))); + disconnect(m_manager, SLOT(zoomLevelChanged(int, bool))); } m_manager = manager; - connect(m_manager, SIGNAL(globalCentreFrameChanged(unsigned long)), - this, SLOT(globalCentreFrameChanged(unsigned long))); - connect(m_manager, SIGNAL(viewCentreFrameChanged(View *, unsigned long)), - this, SLOT(viewCentreFrameChanged(View *, unsigned long))); - connect(m_manager, SIGNAL(playbackFrameChanged(unsigned long)), - this, SLOT(viewManagerPlaybackFrameChanged(unsigned long))); - - connect(m_manager, SIGNAL(viewZoomLevelChanged(View *, unsigned long, bool)), - this, SLOT(viewZoomLevelChanged(View *, unsigned long, bool))); + connect(m_manager, SIGNAL(globalCentreFrameChanged(int)), + this, SLOT(globalCentreFrameChanged(int))); + connect(m_manager, SIGNAL(viewCentreFrameChanged(View *, int)), + this, SLOT(viewCentreFrameChanged(View *, int))); + connect(m_manager, SIGNAL(playbackFrameChanged(int)), + this, SLOT(viewManagerPlaybackFrameChanged(int))); + + connect(m_manager, SIGNAL(viewZoomLevelChanged(View *, int, bool)), + this, SLOT(viewZoomLevelChanged(View *, int, bool))); connect(m_manager, SIGNAL(toolModeChanged()), this, SLOT(toolModeChanged())); @@ -687,13 +687,13 @@ connect(m_manager, SIGNAL(zoomWheelsEnabledChanged()), this, SLOT(zoomWheelsEnabledChanged())); - connect(this, SIGNAL(centreFrameChanged(unsigned long, bool, + connect(this, SIGNAL(centreFrameChanged(int, bool, PlaybackFollowMode)), - m_manager, SLOT(viewCentreFrameChanged(unsigned long, bool, + m_manager, SLOT(viewCentreFrameChanged(int, bool, PlaybackFollowMode))); - connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)), - m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool))); + connect(this, SIGNAL(zoomLevelChanged(int, bool)), + m_manager, SLOT(viewZoomLevelChanged(int, bool))); // setCentreFrame(m_manager->getViewInitialCentreFrame()); @@ -716,7 +716,7 @@ } void -View::setViewManager(ViewManager *vm, long initialCentreFrame) +View::setViewManager(ViewManager *vm, int initialCentreFrame) { setViewManager(vm); setCentreFrame(initialCentreFrame, false); @@ -830,18 +830,18 @@ } void -View::modelChanged(size_t startFrame, size_t endFrame) +View::modelChangedWithin(int startFrame, int endFrame) { QObject *obj = sender(); - long myStartFrame = getStartFrame(); - size_t myEndFrame = getEndFrame(); + int myStartFrame = getStartFrame(); + int myEndFrame = getEndFrame(); #ifdef DEBUG_VIEW_WIDGET_PAINT - cerr << "View(" << this << ")::modelChanged(" << startFrame << "," << endFrame << ") [me " << myStartFrame << "," << myEndFrame << "]" << endl; + cerr << "View(" << this << ")::modelChangedWithin(" << startFrame << "," << endFrame << ") [me " << myStartFrame << "," << myEndFrame << "]" << endl; #endif - if (myStartFrame > 0 && endFrame < size_t(myStartFrame)) { + if (myStartFrame > 0 && endFrame < int(myStartFrame)) { checkProgress(obj); return; } @@ -870,7 +870,7 @@ m_cache = 0; } - if (long(startFrame) < myStartFrame) startFrame = myStartFrame; + if (startFrame < myStartFrame) startFrame = myStartFrame; if (endFrame > myEndFrame) endFrame = myEndFrame; checkProgress(obj); @@ -948,10 +948,10 @@ } void -View::globalCentreFrameChanged(unsigned long rf) +View::globalCentreFrameChanged(int rf) { if (m_followPan) { - size_t f = alignFromReference(rf); + int f = alignFromReference(rf); #ifdef DEBUG_VIEW_WIDGET_PAINT cerr << "View[" << this << "]::globalCentreFrameChanged(" << rf << "): setting centre frame to " << f << endl; @@ -961,13 +961,13 @@ } void -View::viewCentreFrameChanged(View *, unsigned long ) +View::viewCentreFrameChanged(View *, int ) { // We do nothing with this, but a subclass might } void -View::viewManagerPlaybackFrameChanged(unsigned long f) +View::viewManagerPlaybackFrameChanged(int f) { if (m_manager) { if (sender() != m_manager) return; @@ -979,12 +979,12 @@ } void -View::movePlayPointer(unsigned long newFrame) +View::movePlayPointer(int newFrame) { if (m_playPointerFrame == newFrame) return; bool visibleChange = (getXForFrame(m_playPointerFrame) != getXForFrame(newFrame)); - size_t oldPlayPointerFrame = m_playPointerFrame; + int oldPlayPointerFrame = m_playPointerFrame; m_playPointerFrame = newFrame; if (!visibleChange) return; @@ -1005,18 +1005,18 @@ int xold = getXForFrame(oldPlayPointerFrame); update(xold - 4, 0, 9, height()); - long w = getEndFrame() - getStartFrame(); + int w = getEndFrame() - getStartFrame(); w -= w/5; - long sf = (m_playPointerFrame / w) * w - w/8; + int sf = (m_playPointerFrame / w) * w - w/8; if (m_manager && m_manager->isPlaying() && m_manager->getPlaySelectionMode()) { MultiSelection::SelectionList selections = m_manager->getSelections(); if (!selections.empty()) { - size_t selectionStart = selections.begin()->getStartFrame(); - if (sf < long(selectionStart) - w / 10) { - sf = long(selectionStart) - w / 10; + int selectionStart = selections.begin()->getStartFrame(); + if (sf < selectionStart - w / 10) { + sf = selectionStart - w / 10; } } } @@ -1037,8 +1037,8 @@ if (xnew < width()/8 || xnew > (width()*7)/8) { if (!somethingGoingOn) { - long offset = getFrameForX(width()/2) - getStartFrame(); - long newCentre = sf + offset; + int offset = getFrameForX(width()/2) - getStartFrame(); + int newCentre = sf + offset; bool changed = setCentreFrame(newCentre, false); if (changed) { xold = getXForFrame(oldPlayPointerFrame); @@ -1053,7 +1053,7 @@ } case PlaybackIgnore: - if (long(m_playPointerFrame) >= getStartFrame() && + if (m_playPointerFrame >= getStartFrame() && m_playPointerFrame < getEndFrame()) { update(); } @@ -1062,7 +1062,7 @@ } void -View::viewZoomLevelChanged(View *p, unsigned long z, bool locked) +View::viewZoomLevelChanged(View *p, int z, bool locked) { #ifdef DEBUG_VIEW_WIDGET_PAINT cerr << "View[" << this << "]: viewZoomLevelChanged(" << p << ", " << z << ", " << locked << ")" << endl; @@ -1083,35 +1083,35 @@ update(); } -size_t +int View::getFirstVisibleFrame() const { - long f0 = getStartFrame(); - size_t f = getModelsStartFrame(); - if (f0 < 0 || f0 < long(f)) return f; + int f0 = getStartFrame(); + int f = getModelsStartFrame(); + if (f0 < 0 || f0 < f) return f; return f0; } -size_t +int View::getLastVisibleFrame() const { - size_t f0 = getEndFrame(); - size_t f = getModelsEndFrame(); + int f0 = getEndFrame(); + int f = getModelsEndFrame(); if (f0 > f) return f; return f0; } -size_t +int View::getModelsStartFrame() const { bool first = true; - size_t startFrame = 0; + int startFrame = 0; for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { if ((*i)->getModel() && (*i)->getModel()->isOK()) { - size_t thisStartFrame = (*i)->getModel()->getStartFrame(); + int thisStartFrame = (*i)->getModel()->getStartFrame(); if (first || thisStartFrame < startFrame) { startFrame = thisStartFrame; @@ -1122,17 +1122,17 @@ return startFrame; } -size_t +int View::getModelsEndFrame() const { bool first = true; - size_t endFrame = 0; + int endFrame = 0; for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { if ((*i)->getModel() && (*i)->getModel()->isOK()) { - size_t thisEndFrame = (*i)->getModel()->getEndFrame(); + int thisEndFrame = (*i)->getModel()->getEndFrame(); if (first || thisEndFrame > endFrame) { endFrame = thisEndFrame; @@ -1224,8 +1224,8 @@ else return anyModel; } -size_t -View::alignFromReference(size_t f) const +int +View::alignFromReference(int f) const { if (!m_manager->getAlignMode()) return f; Model *aligningModel = getAligningModel(); @@ -1233,8 +1233,8 @@ return aligningModel->alignFromReference(f); } -size_t -View::alignToReference(size_t f) const +int +View::alignToReference(int f) const { if (!m_manager->getAlignMode()) return f; Model *aligningModel = getAligningModel(); @@ -1344,12 +1344,12 @@ return nonScrollables; } -size_t -View::getZoomConstraintBlockSize(size_t blockSize, +int +View::getZoomConstraintBlockSize(int blockSize, ZoomConstraint::RoundingDirection dir) const { - size_t candidate = blockSize; + int candidate = blockSize; bool haveCandidate = false; PowerOfSqrtTwoZoomConstraint defaultZoomConstraint; @@ -1359,7 +1359,7 @@ const ZoomConstraint *zoomConstraint = (*i)->getZoomConstraint(); if (!zoomConstraint) zoomConstraint = &defaultZoomConstraint; - size_t thisBlockSize = + int thisBlockSize = zoomConstraint->getNearestBlockSize(blockSize, dir); // Go for the block size that's furthest from the one @@ -1416,7 +1416,7 @@ void View::scroll(bool right, bool lots, bool e) { - long delta; + int delta; if (lots) { delta = (getEndFrame() - getStartFrame()) / 2; } else { @@ -1602,7 +1602,6 @@ LayerList nonScrollables = getNonScrollableFrontLayers(true, layersChanged); bool selectionCacheable = nonScrollables.empty(); bool haveSelections = m_manager && !m_manager->getSelections().empty(); - bool selectionDrawn = false; // If all the non-scrollable layers are non-opaque, then we draw // the selection rectangle behind them and cache it. If any are @@ -1674,7 +1673,7 @@ } else if (m_cacheCentreFrame != m_centreFrame) { - long dx = + int dx = getXForFrame(m_cacheCentreFrame) - getXForFrame(m_centreFrame); @@ -1766,7 +1765,6 @@ if (haveSelections && selectionCacheable) { drawSelections(paint); m_selectionCached = repaintCache; - selectionDrawn = true; } paint.end(); @@ -1815,7 +1813,7 @@ bool showPlayPointer = true; if (m_followPlay == PlaybackScrollContinuous) { showPlayPointer = false; - } else if (long(m_playPointerFrame) <= getStartFrame() || + } else if (m_playPointerFrame <= getStartFrame() || m_playPointerFrame >= getEndFrame()) { showPlayPointer = false; } else if (m_manager && !m_manager->isPlaying()) { @@ -1876,7 +1874,7 @@ int sampleRate = getModelsSampleRate(); QPoint localPos; - long illuminateFrame = -1; + int illuminateFrame = -1; bool closeToLeft, closeToRight; if (shouldIlluminateLocalSelection(localPos, closeToLeft, closeToRight)) { @@ -2232,14 +2230,14 @@ } bool -View::render(QPainter &paint, int xorigin, size_t f0, size_t f1) +View::render(QPainter &paint, int xorigin, int f0, int f1) { - size_t x0 = f0 / m_zoomLevel; - size_t x1 = f1 / m_zoomLevel; - - size_t w = x1 - x0; - - size_t origCentreFrame = m_centreFrame; + int x0 = f0 / m_zoomLevel; + int x1 = f1 / m_zoomLevel; + + int w = x1 - x0; + + int origCentreFrame = m_centreFrame; bool someLayersIncomplete = false; @@ -2287,7 +2285,7 @@ QProgressDialog progress(tr("Rendering image..."), tr("Cancel"), 0, w / width(), this); - for (size_t x = 0; x < w; x += width()) { + for (int x = 0; x < w; x += width()) { progress.setValue(x / width()); qApp->processEvents(); @@ -2339,17 +2337,17 @@ QImage * View::toNewImage() { - size_t f0 = getModelsStartFrame(); - size_t f1 = getModelsEndFrame(); + int f0 = getModelsStartFrame(); + int f1 = getModelsEndFrame(); return toNewImage(f0, f1); } QImage * -View::toNewImage(size_t f0, size_t f1) +View::toNewImage(int f0, int f1) { - size_t x0 = f0 / getZoomLevel(); - size_t x1 = f1 / getZoomLevel(); + int x0 = f0 / getZoomLevel(); + int x1 = f1 / getZoomLevel(); QImage *image = new QImage(x1 - x0, height(), QImage::Format_RGB32); @@ -2367,17 +2365,17 @@ QSize View::getImageSize() { - size_t f0 = getModelsStartFrame(); - size_t f1 = getModelsEndFrame(); + int f0 = getModelsStartFrame(); + int f1 = getModelsEndFrame(); return getImageSize(f0, f1); } QSize -View::getImageSize(size_t f0, size_t f1) +View::getImageSize(int f0, int f1) { - size_t x0 = f0 / getZoomLevel(); - size_t x1 = f1 / getZoomLevel(); + int x0 = f0 / getZoomLevel(); + int x1 = f1 / getZoomLevel(); return QSize(x1 - x0, height()); } @@ -2403,7 +2401,7 @@ m_followPlay == PlaybackScrollPage ? "page" : "ignore") .arg(extraAttributes); - for (size_t i = 0; i < m_layers.size(); ++i) { + for (int i = 0; i < (int)m_layers.size(); ++i) { bool visible = !m_layers[i]->isLayerDormant(this); m_layers[i]->toBriefXml(stream, indent + " ", QString("visible=\"%1\"")
--- a/view/View.h Tue Jun 17 15:18:06 2014 +0100 +++ b/view/View.h Tue Jun 17 15:36:56 2014 +0100 @@ -62,13 +62,13 @@ * This is a calculated value based on the centre-frame, widget * width and zoom level. The result may be negative. */ - long getStartFrame() const; + int getStartFrame() const; /** * Set the widget pan based on the given first visible frame. The * frame value may be negative. */ - void setStartFrame(long); + void setStartFrame(int); /** * Return the centre frame of the visible widget. This is an @@ -76,30 +76,30 @@ * frame values (start, end) are calculated from this based on the * zoom and other factors. */ - size_t getCentreFrame() const { return m_centreFrame; } + int getCentreFrame() const { return m_centreFrame; } /** * Set the centre frame of the visible widget. */ - void setCentreFrame(size_t f) { setCentreFrame(f, true); } + void setCentreFrame(int f) { setCentreFrame(f, true); } /** * Retrieve the last visible sample frame on the widget. * This is a calculated value based on the centre-frame, widget * width and zoom level. */ - size_t getEndFrame() const; + int getEndFrame() const; /** * Return the pixel x-coordinate corresponding to a given sample * frame (which may be negative). */ - int getXForFrame(long frame) const; + int getXForFrame(int frame) const; /** * Return the closest frame to the given pixel x-coordinate. */ - long getFrameForX(int x) const; + int getFrameForX(int x) const; /** * Return the pixel y-coordinate corresponding to a given @@ -131,7 +131,7 @@ * centre frame will be unchanged; the start and end frames will * change. */ - virtual void setZoomLevel(size_t z); + virtual void setZoomLevel(int z); /** * Zoom in or out. @@ -175,7 +175,7 @@ virtual const Layer *getSelectedLayer() const; virtual void setViewManager(ViewManager *m); - virtual void setViewManager(ViewManager *m, long initialFrame); + virtual void setViewManager(ViewManager *m, int initialFrame); virtual ViewManager *getViewManager() const { return m_manager; } virtual void setFollowGlobalPan(bool f); @@ -232,15 +232,15 @@ } virtual QString getPropertyContainerIconName() const = 0; - virtual size_t getPropertyContainerCount() const; + virtual int getPropertyContainerCount() const; - virtual const PropertyContainer *getPropertyContainer(size_t i) const; - virtual PropertyContainer *getPropertyContainer(size_t i); + virtual const PropertyContainer *getPropertyContainer(int i) const; + virtual PropertyContainer *getPropertyContainer(int i); // Render the contents on a wide canvas - virtual QImage *toNewImage(size_t f0, size_t f1); + virtual QImage *toNewImage(int f0, int f1); virtual QImage *toNewImage(); - virtual QSize getImageSize(size_t f0, size_t f1); + virtual QSize getImageSize(int f0, int f1); virtual QSize getImageSize(); virtual int getTextLabelHeight(const Layer *layer, QPainter &) const; @@ -252,19 +252,19 @@ QString extraAttributes = "") const; // First frame actually in model, to right of scale, if present - virtual size_t getFirstVisibleFrame() const; - virtual size_t getLastVisibleFrame() const; + virtual int getFirstVisibleFrame() const; + virtual int getLastVisibleFrame() const; - size_t getModelsStartFrame() const; - size_t getModelsEndFrame() const; + int getModelsStartFrame() const; + int getModelsEndFrame() const; typedef std::set<Model *> ModelSet; ModelSet getModels(); //!!! Model *getAligningModel() const; - size_t alignFromReference(size_t) const; - size_t alignToReference(size_t) const; + int alignFromReference(int) const; + int alignToReference(int) const; int getAlignedPlaybackFrame() const; signals: @@ -278,17 +278,17 @@ void layerModelChanged(); - void centreFrameChanged(unsigned long frame, + void centreFrameChanged(int frame, bool globalScroll, PlaybackFollowMode followMode); - void zoomLevelChanged(unsigned long, bool); + void zoomLevelChanged(int, bool); void contextHelpChanged(const QString &); public slots: virtual void modelChanged(); - virtual void modelChanged(size_t startFrame, size_t endFrame); + virtual void modelChangedWithin(int startFrame, int endFrame); virtual void modelCompletionChanged(); virtual void modelAlignmentCompletionChanged(); virtual void modelReplaced(); @@ -297,10 +297,10 @@ virtual void layerMeasurementRectsChanged(); virtual void layerNameChanged(); - virtual void globalCentreFrameChanged(unsigned long); - virtual void viewCentreFrameChanged(View *, unsigned long); - virtual void viewManagerPlaybackFrameChanged(unsigned long); - virtual void viewZoomLevelChanged(View *, unsigned long, bool); + virtual void globalCentreFrameChanged(int); + virtual void viewCentreFrameChanged(View *, int); + virtual void viewManagerPlaybackFrameChanged(int); + virtual void viewZoomLevelChanged(View *, int, bool); virtual void propertyContainerSelected(View *, PropertyContainer *pc); @@ -316,7 +316,7 @@ virtual void paintEvent(QPaintEvent *e); virtual void drawSelections(QPainter &); virtual bool shouldLabelSelections() const { return true; } - virtual bool render(QPainter &paint, int x0, size_t f0, size_t f1); + virtual bool render(QPainter &paint, int x0, int f0, int f1); virtual void setPaintFont(QPainter &paint); typedef std::vector<Layer *> LayerList; @@ -325,7 +325,7 @@ bool areLayersScrollable() const; LayerList getScrollableBackLayers(bool testChanged, bool &changed) const; LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const; - size_t getZoomConstraintBlockSize(size_t blockSize, + int getZoomConstraintBlockSize(int blockSize, ZoomConstraint::RoundingDirection dir = ZoomConstraint::RoundNearest) const; @@ -340,24 +340,24 @@ // false. bool hasTopLayerTimeXAxis() const; - bool setCentreFrame(size_t f, bool doEmit); + bool setCentreFrame(int f, bool doEmit); - void movePlayPointer(unsigned long f); + void movePlayPointer(int f); void checkProgress(void *object); int getProgressBarWidth() const; // if visible - size_t m_centreFrame; + int m_centreFrame; int m_zoomLevel; bool m_followPan; bool m_followZoom; PlaybackFollowMode m_followPlay; - size_t m_playPointerFrame; + int m_playPointerFrame; bool m_lightBackground; bool m_showProgress; QPixmap *m_cache; - size_t m_cacheCentreFrame; + int m_cacheCentreFrame; int m_cacheZoomLevel; bool m_selectionCached;
--- a/view/ViewManager.cpp Tue Jun 17 15:18:06 2014 +0100 +++ b/view/ViewManager.cpp Tue Jun 17 15:36:56 2014 +0100 @@ -125,7 +125,7 @@ { } -unsigned long +int ViewManager::getGlobalCentreFrame() const { #ifdef DEBUG_VIEW_MANAGER @@ -135,7 +135,7 @@ } void -ViewManager::setGlobalCentreFrame(unsigned long f) +ViewManager::setGlobalCentreFrame(int f) { #ifdef DEBUG_VIEW_MANAGER cerr << "ViewManager::setGlobalCentreFrame to " << f << endl; @@ -144,7 +144,7 @@ emit globalCentreFrameChanged(f); } -unsigned long +int ViewManager::getGlobalZoom() const { #ifdef DEBUG_VIEW_MANAGER @@ -153,7 +153,7 @@ return m_globalZoom; } -unsigned long +int ViewManager::getPlaybackFrame() const { if (m_playSource && m_playSource->isPlaying()) { @@ -163,7 +163,7 @@ } void -ViewManager::setPlaybackFrame(unsigned long f) +ViewManager::setPlaybackFrame(int f) { if (m_playbackFrame != f) { m_playbackFrame = f; @@ -186,15 +186,15 @@ m_playbackModel = model; } -size_t -ViewManager::alignPlaybackFrameToReference(size_t frame) const +int +ViewManager::alignPlaybackFrameToReference(int frame) const { if (!m_playbackModel) return frame; else return m_playbackModel->alignToReference(frame); } -size_t -ViewManager::alignReferenceToPlaybackFrame(size_t frame) const +int +ViewManager::alignReferenceToPlaybackFrame(int frame) const { if (!m_playbackModel) return frame; else return m_playbackModel->alignFromReference(frame); @@ -292,8 +292,8 @@ } } -size_t -ViewManager::constrainFrameToSelection(size_t frame) const +int +ViewManager::constrainFrameToSelection(int frame) const { MultiSelection::SelectionList sl = getSelections(); if (sl.empty()) return frame; @@ -352,7 +352,7 @@ } Selection -ViewManager::getContainingSelection(size_t frame, bool defaultToFollowing) const +ViewManager::getContainingSelection(int frame, bool defaultToFollowing) const { return m_selections.getContainingSelection(frame, defaultToFollowing); } @@ -457,7 +457,7 @@ } } -size_t +int ViewManager::getPlaybackSampleRate() const { if (m_playSource) { @@ -466,7 +466,7 @@ return 0; } -size_t +int ViewManager::getOutputSampleRate() const { if (m_playSource) { @@ -538,7 +538,7 @@ } void -ViewManager::viewCentreFrameChanged(unsigned long f, bool locked, +ViewManager::viewCentreFrameChanged(int f, bool locked, PlaybackFollowMode mode) { View *v = dynamic_cast<View *>(sender()); @@ -570,15 +570,15 @@ } void -ViewManager::seek(unsigned long f) +ViewManager::seek(int f) { #ifdef DEBUG_VIEW_MANAGER cerr << "ViewManager::seek(" << f << ")" << endl; #endif if (m_playSource && m_playSource->isPlaying()) { - unsigned long playFrame = m_playSource->getCurrentPlayingFrame(); - unsigned long diff = std::max(f, playFrame) - std::min(f, playFrame); + int playFrame = m_playSource->getCurrentPlayingFrame(); + int diff = std::max(f, playFrame) - std::min(f, playFrame); if (diff > 20000) { m_playbackFrame = f; m_playSource->play(f); @@ -596,7 +596,7 @@ } void -ViewManager::viewZoomLevelChanged(unsigned long z, bool locked) +ViewManager::viewZoomLevelChanged(int z, bool locked) { View *v = dynamic_cast<View *>(sender());
--- a/view/ViewManager.h Tue Jun 17 15:18:06 2014 +0100 +++ b/view/ViewManager.h Tue Jun 17 15:36:56 2014 +0100 @@ -59,17 +59,17 @@ bool isPlaying() const; - unsigned long getGlobalCentreFrame() const; // the set method is a slot - unsigned long getGlobalZoom() const; + int getGlobalCentreFrame() const; // the set method is a slot + int getGlobalZoom() const; - unsigned long getPlaybackFrame() const; // the set method is a slot + int getPlaybackFrame() const; // the set method is a slot // Only meaningful in solo mode, and used for optional alignment feature Model *getPlaybackModel() const; void setPlaybackModel(Model *); - size_t alignPlaybackFrameToReference(size_t) const; - size_t alignReferenceToPlaybackFrame(size_t) const; + int alignPlaybackFrameToReference(int) const; + int alignReferenceToPlaybackFrame(int) const; bool haveInProgressSelection() const; const Selection &getInProgressSelection(bool &exclusive) const; @@ -83,7 +83,7 @@ void addSelection(const Selection &selection); void removeSelection(const Selection &selection); void clearSelections(); - size_t constrainFrameToSelection(size_t frame) const; + int constrainFrameToSelection(int frame) const; /** * Adding a selection normally emits the selectionChangedByUser @@ -98,7 +98,7 @@ * selected area, return the next selection after the given frame. * Return the empty selection if no appropriate selection is found. */ - Selection getContainingSelection(size_t frame, bool defaultToFollowing) const; + Selection getContainingSelection(int frame, bool defaultToFollowing) const; Clipboard &getClipboard() { return m_clipboard; } @@ -142,23 +142,23 @@ * differ from this will play back at the wrong speed -- there is * no per-model resampler. */ - size_t getPlaybackSampleRate() const; + int getPlaybackSampleRate() const; /** * The sample rate of the audio output device. If the playback * sample rate differs from this, everything will be resampled at * the output stage. */ - size_t getOutputSampleRate() const; + int getOutputSampleRate() const; /** * The sample rate of the current main model. This may in theory * differ from the playback sample rate, in which case even the * main model will play at the wrong speed. */ - size_t getMainModelSampleRate() const { return m_mainModelSampleRate; } + int getMainModelSampleRate() const { return m_mainModelSampleRate; } - void setMainModelSampleRate(size_t sr) { m_mainModelSampleRate = sr; } + void setMainModelSampleRate(int sr) { m_mainModelSampleRate = sr; } enum OverlayMode { NoOverlays, @@ -211,16 +211,16 @@ signals: /** Emitted when user causes the global centre frame to change. */ - void globalCentreFrameChanged(unsigned long frame); + void globalCentreFrameChanged(int frame); /** Emitted when user scrolls a view, but doesn't affect global centre. */ - void viewCentreFrameChanged(View *v, unsigned long frame); + void viewCentreFrameChanged(View *v, int frame); /** Emitted when a view zooms. */ - void viewZoomLevelChanged(View *v, unsigned long zoom, bool locked); + void viewZoomLevelChanged(View *v, int zoom, bool locked); /** Emitted when the playback frame changes. */ - void playbackFrameChanged(unsigned long frame); + void playbackFrameChanged(int frame); /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */ void outputLevelsChanged(float left, float right); @@ -268,24 +268,24 @@ void activity(QString); public slots: - void viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode); - void viewZoomLevelChanged(unsigned long, bool); - void setGlobalCentreFrame(unsigned long); - void setPlaybackFrame(unsigned long); + void viewCentreFrameChanged(int, bool, PlaybackFollowMode); + void viewZoomLevelChanged(int, bool); + void setGlobalCentreFrame(int); + void setPlaybackFrame(int); void playStatusChanged(bool playing); protected slots: void checkPlayStatus(); - void seek(unsigned long); -//!!! void considerZoomChange(void *, unsigned long, bool); + void seek(int); +//!!! void considerZoomChange(void *, int, bool); protected: AudioPlaySource *m_playSource; - unsigned long m_globalCentreFrame; - unsigned long m_globalZoom; - mutable unsigned long m_playbackFrame; + int m_globalCentreFrame; + int m_globalZoom; + mutable int m_playbackFrame; Model *m_playbackModel; //!!! - size_t m_mainModelSampleRate; + int m_mainModelSampleRate; float m_lastLeft; float m_lastRight;