changeset 435:618d5816b04d cxx11

More type fixes
author Chris Cannam
date Tue, 10 Mar 2015 13:22:10 +0000
parents dee4aceb131c
children 72c662fe7ea3
files audioio/AudioCallbackPlaySource.cpp audioio/AudioCallbackPlaySource.h framework/MainWindowBase.cpp framework/MainWindowBase.h framework/SVFileReader.h
diffstat 5 files changed, 69 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Wed Mar 04 13:53:13 2015 +0000
+++ b/audioio/AudioCallbackPlaySource.cpp	Tue Mar 10 13:22:10 2015 +0000
@@ -256,8 +256,8 @@
 	emit modelReplaced();
     }
 
-    connect(model, SIGNAL(modelChangedWithin(int, int)),
-            this, SLOT(modelChangedWithin(int, int)));
+    connect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)),
+            this, SLOT(modelChangedWithin(sv_frame_t, sv_frame_t)));
 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
     cout << "AudioCallbackPlaySource::addModel: awakening thread" << endl;
@@ -267,11 +267,11 @@
 }
 
 void
-AudioCallbackPlaySource::modelChangedWithin(int 
+AudioCallbackPlaySource::modelChangedWithin(sv_frame_t 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
                                             startFrame
 #endif
-                                            , int endFrame)
+                                            , sv_frame_t endFrame)
 {
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
     SVDEBUG << "AudioCallbackPlaySource::modelChangedWithin(" << startFrame << "," << endFrame << ")" << endl;
@@ -291,8 +291,8 @@
     cout << "AudioCallbackPlaySource::removeModel(" << model << ")" << endl;
 #endif
 
-    disconnect(model, SIGNAL(modelChangedWithin(int, int)),
-               this, SLOT(modelChangedWithin(int, int)));
+    disconnect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)),
+               this, SLOT(modelChangedWithin(sv_frame_t, sv_frame_t)));
 
     m_models.erase(model);
 
--- a/audioio/AudioCallbackPlaySource.h	Wed Mar 04 13:53:13 2015 +0000
+++ b/audioio/AudioCallbackPlaySource.h	Tue Mar 10 13:22:10 2015 +0000
@@ -260,7 +260,7 @@
     void playSelectionModeChanged();
     void playParametersChanged(PlayParameters *);
     void preferenceChanged(PropertyContainer::PropertyName);
-    void modelChangedWithin(int startFrame, int endFrame);
+    void modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame);
 
 protected:
     ViewManagerBase                  *m_viewManager;
--- a/framework/MainWindowBase.cpp	Wed Mar 04 13:53:13 2015 +0000
+++ b/framework/MainWindowBase.cpp	Tue Mar 10 13:22:10 2015 +0000
@@ -228,14 +228,14 @@
     connect(m_viewManager, SIGNAL(outputLevelsChanged(float, float)),
 	    this, SLOT(outputLevelsChanged(float, float)));
 
-    connect(m_viewManager, SIGNAL(playbackFrameChanged(int)),
-            this, SLOT(playbackFrameChanged(int)));
-
-    connect(m_viewManager, SIGNAL(globalCentreFrameChanged(int)),
-            this, SLOT(globalCentreFrameChanged(int)));
-
-    connect(m_viewManager, SIGNAL(viewCentreFrameChanged(View *, int)),
-            this, SLOT(viewCentreFrameChanged(View *, int)));
+    connect(m_viewManager, SIGNAL(playbackFrameChanged(sv_frame_t)),
+            this, SLOT(playbackFrameChanged(sv_frame_t)));
+
+    connect(m_viewManager, SIGNAL(globalCentreFrameChanged(sv_frame_t)),
+            this, SLOT(globalCentreFrameChanged(sv_frame_t)));
+
+    connect(m_viewManager, SIGNAL(viewCentreFrameChanged(View *, sv_frame_t)),
+            this, SLOT(viewCentreFrameChanged(View *, sv_frame_t)));
 
     connect(m_viewManager, SIGNAL(viewZoomLevelChanged(View *, int, bool)),
             this, SLOT(viewZoomLevelChanged(View *, int, bool)));
@@ -691,7 +691,7 @@
     // frame before switching to whichever one we decide we want to
     // switch to, regardless of our efforts.
 
-    int frame = m_playSource->getCurrentBufferedFrame();
+    sv_frame_t frame = m_playSource->getCurrentBufferedFrame();
 
     cerr << "currentPaneChanged: current frame (in ref model) = " << frame << endl;
 
@@ -780,7 +780,7 @@
     Pane *currentPane = m_paneStack->getCurrentPane();
     if (!currentPane) return;
 
-    int startFrame, endFrame;
+    sv_frame_t startFrame, endFrame;
 
     if (currentPane->getStartFrame() < 0) startFrame = 0;
     else startFrame = currentPane->getStartFrame();
@@ -851,11 +851,11 @@
 void
 MainWindowBase::pasteAtPlaybackPosition()
 {
-    int pos = getFrame();
+    sv_frame_t pos = getFrame();
     Clipboard &clipboard = m_viewManager->getClipboard();
     if (!clipboard.empty()) {
-        int firstEventFrame = clipboard.getPoints()[0].getFrame();
-        int offset = 0;
+        sv_frame_t firstEventFrame = clipboard.getPoints()[0].getFrame();
+        sv_frame_t offset = 0;
         if (firstEventFrame < 0) {
             offset = pos - firstEventFrame;
         } else if (firstEventFrame < pos) {
@@ -868,7 +868,7 @@
 }
 
 void
-MainWindowBase::pasteRelative(int offset)
+MainWindowBase::pasteRelative(sv_frame_t offset)
 {
     Pane *currentPane = m_paneStack->getCurrentPane();
     if (!currentPane) return;
@@ -936,7 +936,7 @@
 
 // FrameTimer method
 
-int
+sv_frame_t
 MainWindowBase::getFrame() const
 {
     if (m_playSource && m_playSource->isPlaying()) {
@@ -958,8 +958,8 @@
     MultiSelection::SelectionList selections = m_viewManager->getSelections();
     for (MultiSelection::SelectionList::iterator i = selections.begin();
          i != selections.end(); ++i) {
-        int start = i->getStartFrame();
-        int end = i->getEndFrame();
+        sv_frame_t start = i->getStartFrame();
+        sv_frame_t end = i->getEndFrame();
         if (start != end) {
             insertInstantAt(start);
             insertInstantAt(end);
@@ -968,7 +968,7 @@
 }
 
 void
-MainWindowBase::insertInstantAt(int frame)
+MainWindowBase::insertInstantAt(sv_frame_t frame)
 {
     Pane *pane = m_paneStack->getCurrentPane();
     if (!pane) {
@@ -1060,8 +1060,8 @@
     MultiSelection::SelectionList selections = m_viewManager->getSelections();
     for (MultiSelection::SelectionList::iterator i = selections.begin();
          i != selections.end(); ++i) {
-        int start = i->getStartFrame();
-        int end = i->getEndFrame();
+        sv_frame_t start = i->getStartFrame();
+        sv_frame_t end = i->getEndFrame();
         if (start < end) {
             insertItemAt(start, end - start);
         }
@@ -1069,7 +1069,7 @@
 }
 
 void
-MainWindowBase::insertItemAt(int frame, int duration)
+MainWindowBase::insertItemAt(sv_frame_t frame, sv_frame_t duration)
 {
     Pane *pane = m_paneStack->getCurrentPane();
     if (!pane) {
@@ -1078,10 +1078,10 @@
 
     // ugh!
 
-    int alignedStart = pane->alignFromReference(frame);
-    int alignedEnd = pane->alignFromReference(frame + duration);
+    sv_frame_t alignedStart = pane->alignFromReference(frame);
+    sv_frame_t alignedEnd = pane->alignFromReference(frame + duration);
     if (alignedStart >= alignedEnd) return;
-    int alignedDuration = alignedEnd - alignedStart;
+    sv_frame_t alignedDuration = alignedEnd - alignedStart;
 
     Command *c = 0;
 
@@ -1281,7 +1281,7 @@
 
     m_openingAudioFile = true;
 
-    int rate = 0;
+    sv_samplerate_t rate = 0;
 
     if (Preferences::getInstance()->getFixedSampleRate() != 0) {
         rate = Preferences::getInstance()->getFixedSampleRate();
@@ -1990,7 +1990,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openLayersFromRDF(FileSource source)
 {
-    int rate = 0;
+    sv_samplerate_t rate = 0;
 
     SVDEBUG << "MainWindowBase::openLayersFromRDF" << endl;
 
@@ -2609,18 +2609,18 @@
 {
     if (!getMainModel()) return;
 
-    int frame = m_viewManager->getPlaybackFrame();
+    sv_frame_t frame = m_viewManager->getPlaybackFrame();
     ++frame;
 
     Pane *pane = m_paneStack->getCurrentPane();
     Layer *layer = getSnapLayer();
-    int sr = getMainModel()->getSampleRate();
+    sv_samplerate_t sr = getMainModel()->getSampleRate();
 
     if (!layer) {
 
         frame = RealTime::realTime2Frame
             (RealTime::frame2RealTime(frame, sr) + m_defaultFfwdRwdStep, sr);
-        if (frame > int(getMainModel()->getEndFrame())) {
+        if (frame > getMainModel()->getEndFrame()) {
             frame = getMainModel()->getEndFrame();
         }
 
@@ -2639,12 +2639,12 @@
     if (frame < 0) frame = 0;
 
     if (m_viewManager->getPlaySelectionMode()) {
-        frame = m_viewManager->constrainFrameToSelection(int(frame));
+        frame = m_viewManager->constrainFrameToSelection(frame);
     }
     
     m_viewManager->setPlaybackFrame(frame);
 
-    if (frame == (int)getMainModel()->getEndFrame() &&
+    if (frame == getMainModel()->getEndFrame() &&
         m_playSource &&
         m_playSource->isPlaying() &&
         !m_viewManager->getPlayLoopMode()) {
@@ -2663,7 +2663,7 @@
         stop();
     }
 
-    int frame = getMainModel()->getEndFrame();
+    sv_frame_t frame = getMainModel()->getEndFrame();
 
     if (m_viewManager->getPlaySelectionMode()) {
         frame = m_viewManager->constrainFrameToSelection(frame);
@@ -2681,7 +2681,7 @@
     if (!layer) { ffwd(); return; }
 
     Pane *pane = m_paneStack->getCurrentPane();
-    int frame = m_viewManager->getPlaybackFrame();
+    sv_frame_t frame = m_viewManager->getPlaybackFrame();
 
     int resolution = 0;
     if (pane) frame = pane->alignFromReference(frame);
@@ -2695,12 +2695,12 @@
     if (frame < 0) frame = 0;
 
     if (m_viewManager->getPlaySelectionMode()) {
-        frame = m_viewManager->constrainFrameToSelection(int(frame));
+        frame = m_viewManager->constrainFrameToSelection(frame);
     }
     
     m_viewManager->setPlaybackFrame(frame);
 
-    if (frame == (int)getMainModel()->getEndFrame() &&
+    if (frame == getMainModel()->getEndFrame() &&
         m_playSource &&
         m_playSource->isPlaying() &&
         !m_viewManager->getPlayLoopMode()) {
@@ -2713,12 +2713,12 @@
 {
     if (!getMainModel()) return;
 
-    int frame = m_viewManager->getPlaybackFrame();
+    sv_frame_t frame = m_viewManager->getPlaybackFrame();
     if (frame > 0) --frame;
 
     Pane *pane = m_paneStack->getCurrentPane();
     Layer *layer = getSnapLayer();
-    int sr = getMainModel()->getSampleRate();
+    sv_samplerate_t sr = getMainModel()->getSampleRate();
     
     // when rewinding during playback, we want to allow a period
     // following a rewind target point at which the rewind will go to
@@ -2734,7 +2734,7 @@
         
         frame = RealTime::realTime2Frame
             (RealTime::frame2RealTime(frame, sr) - m_defaultFfwdRwdStep, sr);
-        if (frame < int(getMainModel()->getStartFrame())) {
+        if (frame < getMainModel()->getStartFrame()) {
             frame = getMainModel()->getStartFrame();
         }
 
@@ -2753,7 +2753,7 @@
     if (frame < 0) frame = 0;
 
     if (m_viewManager->getPlaySelectionMode()) {
-        frame = m_viewManager->constrainFrameToSelection(int(frame));
+        frame = m_viewManager->constrainFrameToSelection(frame);
     }
 
     m_viewManager->setPlaybackFrame(frame);
@@ -2764,7 +2764,7 @@
 {
     if (!getMainModel()) return;
 
-    int frame = getMainModel()->getStartFrame();
+    sv_frame_t frame = getMainModel()->getStartFrame();
 
     if (m_viewManager->getPlaySelectionMode()) {
         frame = m_viewManager->constrainFrameToSelection(frame);
@@ -2782,7 +2782,7 @@
     if (!layer) { rewind(); return; }
 
     Pane *pane = m_paneStack->getCurrentPane();
-    int frame = m_viewManager->getPlaybackFrame();
+    sv_frame_t frame = m_viewManager->getPlaybackFrame();
 
     int resolution = 0;
     if (pane) frame = pane->alignFromReference(frame);
@@ -2796,7 +2796,7 @@
     if (frame < 0) frame = 0;
 
     if (m_viewManager->getPlaySelectionMode()) {
-        frame = m_viewManager->constrainFrameToSelection(int(frame));
+        frame = m_viewManager->constrainFrameToSelection(frame);
     }
     
     m_viewManager->setPlaybackFrame(frame);
@@ -3009,24 +3009,24 @@
 MainWindowBase::connectLayerEditDialog(ModelDataTableDialog *dialog)
 {
     connect(m_viewManager,
-            SIGNAL(globalCentreFrameChanged(int)),
+            SIGNAL(globalCentreFrameChanged(sv_frame_t)),
             dialog,
-            SLOT(userScrolledToFrame(int)));
+            SLOT(userScrolledToFrame(sv_frame_t)));
 
     connect(m_viewManager,
-            SIGNAL(playbackFrameChanged(int)),
+            SIGNAL(playbackFrameChanged(sv_frame_t)),
             dialog,
-            SLOT(playbackScrolledToFrame(int)));
+            SLOT(playbackScrolledToFrame(sv_frame_t)));
 
     connect(dialog,
-            SIGNAL(scrollToFrame(int)),
+            SIGNAL(scrollToFrame(sv_frame_t)),
             m_viewManager,
-            SLOT(setGlobalCentreFrame(int)));
+            SLOT(setGlobalCentreFrame(sv_frame_t)));
 
     connect(dialog,
-            SIGNAL(scrollToFrame(int)),
+            SIGNAL(scrollToFrame(sv_frame_t)),
             m_viewManager,
-            SLOT(setPlaybackFrame(int)));
+            SLOT(setPlaybackFrame(sv_frame_t)));
 }    
 
 void
@@ -3136,7 +3136,7 @@
 }
 
 void
-MainWindowBase::playbackFrameChanged(int frame)
+MainWindowBase::playbackFrameChanged(sv_frame_t frame)
 {
     if (!(m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
 
@@ -3172,7 +3172,7 @@
 }
 
 void
-MainWindowBase::globalCentreFrameChanged(int )
+MainWindowBase::globalCentreFrameChanged(sv_frame_t )
 {
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
     Pane *p = 0;
@@ -3182,7 +3182,7 @@
 }
 
 void
-MainWindowBase::viewCentreFrameChanged(View *v, int frame)
+MainWindowBase::viewCentreFrameChanged(View *v, sv_frame_t frame)
 {
 //    SVDEBUG << "MainWindowBase::viewCentreFrameChanged(" << v << "," << frame << ")" << endl;
 
--- a/framework/MainWindowBase.h	Wed Mar 04 13:53:13 2015 +0000
+++ b/framework/MainWindowBase.h	Tue Mar 10 13:22:10 2015 +0000
@@ -111,7 +111,7 @@
     virtual bool saveSessionTemplate(QString path);
 
     /// Implementation of FrameTimer interface method
-    virtual int getFrame() const;
+    virtual sv_frame_t getFrame() const;
 
     void setDefaultFfwdRwdStep(RealTime step) {
         m_defaultFfwdRwdStep = step;
@@ -217,9 +217,9 @@
     virtual void audioOverloadPluginDisabled() = 0;
     virtual void audioTimeStretchMultiChannelDisabled() = 0;
 
-    virtual void playbackFrameChanged(int);
-    virtual void globalCentreFrameChanged(int);
-    virtual void viewCentreFrameChanged(View *, int);
+    virtual void playbackFrameChanged(sv_frame_t);
+    virtual void globalCentreFrameChanged(sv_frame_t);
+    virtual void viewCentreFrameChanged(View *, sv_frame_t);
     virtual void viewZoomLevelChanged(View *, int, bool);
     virtual void outputLevelsChanged(float, float) = 0;
 
@@ -236,14 +236,14 @@
     virtual void copy();
     virtual void paste();
     virtual void pasteAtPlaybackPosition();
-    virtual void pasteRelative(int offset);
+    virtual void pasteRelative(sv_frame_t offset);
     virtual void deleteSelected();
 
     virtual void insertInstant();
-    virtual void insertInstantAt(int);
+    virtual void insertInstantAt(sv_frame_t);
     virtual void insertInstantsAtBoundaries();
     virtual void insertItemAtSelection();
-    virtual void insertItemAt(int, int);
+    virtual void insertItemAt(sv_frame_t, sv_frame_t);
     virtual void renumberInstants();
 
     virtual void documentModified();
@@ -366,7 +366,7 @@
 	virtual void setWindowSize(int width, int height) {
 	    m_mw->resizeConstrained(QSize(width, height));
 	}
-	virtual void addSelection(int start, int end) {
+	virtual void addSelection(sv_frame_t start, sv_frame_t end) {
 	    m_mw->m_viewManager->addSelectionQuietly(Selection(start, end));
 	}
     protected:
--- a/framework/SVFileReader.h	Wed Mar 04 13:53:13 2015 +0000
+++ b/framework/SVFileReader.h	Tue Mar 10 13:22:10 2015 +0000
@@ -34,7 +34,7 @@
     virtual ~SVFileReaderPaneCallback();
     virtual Pane *addPane() = 0;
     virtual void setWindowSize(int width, int height) = 0;
-    virtual void addSelection(int start, int end) = 0;
+    virtual void addSelection(sv_frame_t start, sv_frame_t end) = 0;
 };
 
 /**