changeset 644:6fd0ebfd2bbe

Merge from branch fix-static-analysis
author Chris Cannam
date Wed, 09 Jan 2019 15:25:09 +0000
parents 713b9a6b284a (current diff) 8c5379570f36 (diff)
children 6240788893e7 e19c609a7bec
files audio/AudioCallbackRecordTarget.cpp framework/MainWindowBase.cpp
diffstat 17 files changed, 192 insertions(+), 192 deletions(-) [+]
line wrap: on
line diff
--- a/audio/AudioCallbackPlaySource.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/audio/AudioCallbackPlaySource.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -50,8 +50,8 @@
     m_viewManager(manager),
     m_audioGenerator(new AudioGenerator()),
     m_clientName(clientName.toUtf8().data()),
-    m_readBuffers(0),
-    m_writeBuffers(0),
+    m_readBuffers(nullptr),
+    m_writeBuffers(nullptr),
     m_readBufferFill(0),
     m_writeBufferFill(0),
     m_bufferScavenger(1),
@@ -61,7 +61,7 @@
     m_deviceSampleRate(0),
     m_deviceChannelCount(0),
     m_playLatency(0),
-    m_target(0),
+    m_target(nullptr),
     m_lastRetrievalTimestamp(0.0),
     m_lastRetrievedBlockSize(0),
     m_trustworthyTimestamps(true),
@@ -73,19 +73,19 @@
     m_outputLeft(0.0),
     m_outputRight(0.0),
     m_levelsSet(false),
-    m_auditioningPlugin(0),
+    m_auditioningPlugin(nullptr),
     m_auditioningPluginBypassed(false),
     m_playStartFrame(0),
     m_playStartFramePassed(false),
-    m_timeStretcher(0),
-    m_monoStretcher(0),
+    m_timeStretcher(nullptr),
+    m_monoStretcher(nullptr),
     m_stretchRatio(1.0),
     m_stretchMono(false),
     m_stretcherInputCount(0),
-    m_stretcherInputs(0),
-    m_stretcherInputSizes(0),
-    m_fillThread(0),
-    m_resamplerWrapper(0)
+    m_stretcherInputs(nullptr),
+    m_stretcherInputSizes(nullptr),
+    m_fillThread(nullptr),
+    m_resamplerWrapper(nullptr)
 {
     m_viewManager->setAudioPlaySource(this);
 
@@ -258,8 +258,8 @@
 
         delete m_timeStretcher;
         delete m_monoStretcher;
-        m_timeStretcher = 0;
-        m_monoStretcher = 0;
+        m_timeStretcher = nullptr;
+        m_monoStretcher = nullptr;
         
         if (m_stretchRatio != 1.f) {
             setTimeStretch(m_stretchRatio);
@@ -612,7 +612,7 @@
 void
 AudioCallbackPlaySource::setSystemPlaybackTarget(breakfastquay::SystemPlaybackTarget *target)
 {
-    if (target == 0) {
+    if (target == nullptr) {
         // reset target-related facts and figures
         m_deviceSampleRate = 0;
         m_deviceChannelCount = 0;
@@ -1400,7 +1400,7 @@
 bool
 AudioCallbackPlaySource::fillBuffers()
 {
-    static float *tmp = 0;
+    static float *tmp = nullptr;
     static sv_frame_t tmpSize = 0;
 
     sv_frame_t space = 0;
@@ -1439,7 +1439,7 @@
 
     int channels = getTargetChannelCount();
 
-    static float **bufferPtrs = 0;
+    static float **bufferPtrs = nullptr;
     static int bufferPtrCount = 0;
 
     if (bufferPtrCount < channels) {
@@ -1539,7 +1539,7 @@
     }
 #endif
     
-    static float **chunkBufferPtrs = 0;
+    static float **chunkBufferPtrs = nullptr;
     static int chunkBufferPtrCount = 0;
 
     if (chunkBufferPtrCount < channels) {
--- a/audio/AudioCallbackPlaySource.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/audio/AudioCallbackPlaySource.h	Wed Jan 09 15:25:09 2019 +0000
@@ -431,7 +431,7 @@
             Thread(Thread::NonRTThread),
             m_source(source) { }
 
-        virtual void run();
+        void run() override;
 
     protected:
         AudioCallbackPlaySource &m_source;
--- a/audio/AudioCallbackRecordTarget.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/audio/AudioCallbackRecordTarget.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -35,8 +35,8 @@
     m_recordSampleRate(44100),
     m_recordChannelCount(2),
     m_frameCount(0),
-    m_model(0),
-    m_buffers(0),
+    m_model(nullptr),
+    m_buffers(nullptr),
     m_bufferCount(0),
     m_inputLeft(0.f),
     m_inputRight(0.f),
@@ -56,7 +56,7 @@
     cerr << "AudioCallbackRecordTarget dtor" << endl;
 #endif
     
-    m_viewManager->setAudioRecordTarget(0);
+    m_viewManager->setAudioRecordTarget(nullptr);
 
     QMutexLocker locker(&m_bufPtrMutex);
     for (int c = 0; c < m_bufferCount; ++c) {
@@ -232,7 +232,7 @@
 #ifdef DEBUG_AUDIO_CALLBACK_RECORD_TARGET
         cerr << "AudioCallbackRecordTarget::modelAboutToBeDeleted: taking note" << endl;
 #endif
-        m_model = 0;
+        m_model = nullptr;
         m_recording = false;
     } else if (m_model) {
         SVCERR << "WARNING: AudioCallbackRecordTarget::modelAboutToBeDeleted: this is not my model!" << endl;
@@ -244,14 +244,14 @@
 {
     if (m_recording) {
         SVCERR << "WARNING: AudioCallbackRecordTarget::startRecording: We are already recording" << endl;
-        return 0;
+        return nullptr;
     }
 
-    m_model = 0;
+    m_model = nullptr;
     m_frameCount = 0;
 
     QString folder = RecordDirectory::getRecordDirectory();
-    if (folder == "") return 0;
+    if (folder == "") return nullptr;
     QDir recordedDir(folder);
 
     QDateTime now = QDateTime::currentDateTime();
@@ -276,8 +276,8 @@
                << endl;
         //!!! and throw?
         delete m_model;
-        m_model = 0;
-        return 0;
+        m_model = nullptr;
+        return nullptr;
     }
 
     connect(m_model, SIGNAL(aboutToBeDeleted()), 
@@ -310,7 +310,7 @@
     updateModel();
 
     m_model->writeComplete();
-    m_model = 0;
+    m_model = nullptr;
     
     emit recordStatusChanged(false);
     emit recordCompleted();
--- a/audio/AudioGenerator.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/audio/AudioGenerator.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -50,7 +50,7 @@
     m_targetChannelCount(1),
     m_waveType(0),
     m_soloing(false),
-    m_channelBuffer(0),
+    m_channelBuffer(nullptr),
     m_channelBufSiz(0),
     m_channelBufCount(0)
 {
@@ -216,7 +216,7 @@
     QString clipId;
 
     const Playable *playable = model;
-    if (!playable || !playable->canPlay()) return 0;
+    if (!playable || !playable->canPlay()) return nullptr;
 
     PlayParameters *parameters =
         PlayParameterRepository::getInstance()->getPlayParameters(playable);
@@ -230,7 +230,7 @@
 
     if (clipId == "") {
         SVDEBUG << "AudioGenerator::makeClipMixerFor(" << model << "): no sample, skipping" << endl;
-        return 0;
+        return nullptr;
     }
 
     ClipMixer *mixer = new ClipMixer(m_targetChannelCount,
@@ -244,7 +244,7 @@
     double level = wantsQuieterClips(model) ? 0.5 : 1.0;
     if (!mixer->loadClipData(clipPath, clipF0, level)) {
         delete mixer;
-        return 0;
+        return nullptr;
     }
 
 #ifdef DEBUG_AUDIO_GENERATOR
@@ -258,7 +258,7 @@
 AudioGenerator::makeSynthFor(const Model *model)
 {
     const Playable *playable = model;
-    if (!playable || !playable->canPlay()) return 0;
+    if (!playable || !playable->canPlay()) return nullptr;
 
     ContinuousSynth *synth = new ContinuousSynth(m_targetChannelCount,
                                                  m_sourceSampleRate,
--- a/audio/ClipMixer.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/audio/ClipMixer.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -26,7 +26,7 @@
     m_channels(channels),
     m_sampleRate(sampleRate),
     m_blockSize(blockSize),
-    m_clipData(0),
+    m_clipData(nullptr),
     m_clipLength(0),
     m_clipF0(0),
     m_clipRate(0)
--- a/audio/PlaySpeedRangeMapper.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/audio/PlaySpeedRangeMapper.h	Wed Jan 09 15:25:09 2019 +0000
@@ -13,8 +13,8 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef _PLAY_SPEED_RANGE_MAPPER_H_
-#define _PLAY_SPEED_RANGE_MAPPER_H_
+#ifndef SV_PLAY_SPEED_RANGE_MAPPER_H
+#define SV_PLAY_SPEED_RANGE_MAPPER_H
 
 #include "base/RangeMapper.h"
 
@@ -26,11 +26,11 @@
     int getMinPosition() const { return m_minpos; }
     int getMaxPosition() const { return m_maxpos; }
     
-    virtual int getPositionForValue(double value) const;
-    virtual int getPositionForValueUnclamped(double value) const;
+    int getPositionForValue(double value) const override;
+    int getPositionForValueUnclamped(double value) const override;
 
-    virtual double getValueForPosition(int position) const;
-    virtual double getValueForPositionUnclamped(int position) const;
+    double getValueForPosition(int position) const override;
+    double getValueForPositionUnclamped(int position) const override;
 
     int getPositionForFactor(double factor) const;
     double getValueForFactor(double factor) const;
@@ -38,7 +38,7 @@
     double getFactorForPosition(int position) const;
     double getFactorForValue(double value) const;
 
-    virtual QString getUnit() const;
+    QString getUnit() const override;
     
 protected:
     int m_minpos;
--- a/framework/Align.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/Align.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -178,7 +178,7 @@
         return false; // but this should have been tested already
     }
 
-    while (!reference->isReady(0) || !rm->isReady(0)) {
+    while (!reference->isReady(nullptr) || !rm->isReady(nullptr)) {
         qApp->processEvents();
     }
     
@@ -203,7 +203,7 @@
 
     m_error = "";
     
-    AlignmentModel *alignmentModel = new AlignmentModel(reference, other, 0, 0);
+    AlignmentModel *alignmentModel = new AlignmentModel(reference, other, nullptr, nullptr);
     rm->setAlignment(alignmentModel);
 
     QProcess *process = new QProcess;
@@ -223,7 +223,7 @@
              << endl;
         m_error = "Alignment program could not be started";
         m_processModels.erase(process);
-        rm->setAlignment(0); // deletes alignmentModel as well
+        rm->setAlignment(nullptr); // deletes alignmentModel as well
         delete process;
     }
 
--- a/framework/Document.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/Document.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -49,7 +49,7 @@
 //!!! still need to handle command history, documentRestored/documentModified
 
 Document::Document() :
-    m_mainModel(0),
+    m_mainModel(nullptr),
     m_autoAlignment(false),
     m_align(new Align()),
     m_isIncomplete(false)
@@ -115,7 +115,7 @@
         emit modelAboutToBeDeleted(m_mainModel);
     }
 
-    emit mainModelChanged(0);
+    emit mainModelChanged(nullptr);
     delete m_mainModel;
 }
 
@@ -123,7 +123,7 @@
 Document::createLayer(LayerFactory::LayerType type)
 {
     Layer *newLayer = LayerFactory::getInstance()->createLayer(type);
-    if (!newLayer) return 0;
+    if (!newLayer) return nullptr;
 
     newLayer->setObjectName(getUniqueLayerName(newLayer->objectName()));
 
@@ -143,7 +143,7 @@
 Document::createMainModelLayer(LayerFactory::LayerType type)
 {
     Layer *newLayer = createLayer(type);
-    if (!newLayer) return 0;
+    if (!newLayer) return nullptr;
     setModel(newLayer, m_mainModel);
     return newLayer;
 }
@@ -156,14 +156,14 @@
 
     if (types.empty()) {
         cerr << "WARNING: Document::importLayer: no valid display layer for model" << endl;
-        return 0;
+        return nullptr;
     }
 
     //!!! for now, just use the first suitable layer type
     LayerFactory::LayerType type = *types.begin();
 
     Layer *newLayer = LayerFactory::getInstance()->createLayer(type);
-    if (!newLayer) return 0;
+    if (!newLayer) return nullptr;
 
     newLayer->setObjectName(getUniqueLayerName(newLayer->objectName()));
 
@@ -187,16 +187,16 @@
 Layer *
 Document::createEmptyLayer(LayerFactory::LayerType type)
 {
-    if (!m_mainModel) return 0;
+    if (!m_mainModel) return nullptr;
 
     Model *newModel =
         LayerFactory::getInstance()->createEmptyModel(type, m_mainModel);
-    if (!newModel) return 0;
+    if (!newModel) return nullptr;
 
     Layer *newLayer = createLayer(type);
     if (!newLayer) {
         delete newModel;
-        return 0;
+        return nullptr;
     }
 
     addImportedModel(newModel);
@@ -210,7 +210,7 @@
                              TransformId transform)
 {
     Layer *newLayer = createLayer(type);
-    if (!newLayer) return 0;
+    if (!newLayer) return nullptr;
 
     newLayer->setObjectName(getUniqueLayerName
                             (TransformFactory::getInstance()->
@@ -226,7 +226,7 @@
     Transforms transforms;
     transforms.push_back(transform);
     vector<Layer *> layers = createDerivedLayers(transforms, input);
-    if (layers.empty()) return 0;
+    if (layers.empty()) return nullptr;
     else return layers[0];
 }
 
@@ -235,7 +235,7 @@
                               const ModelTransformer::Input &input)
 {
     QString message;
-    vector<Model *> newModels = addDerivedModels(transforms, input, message, 0);
+    vector<Model *> newModels = addDerivedModels(transforms, input, message, nullptr);
 
     if (newModels.empty()) {
         //!!! This identifier may be wrong!
@@ -268,7 +268,7 @@
         m_handler(handler) {
     }
 
-    virtual ~AdditionalModelConverter() { }
+    ~AdditionalModelConverter() override { }
 
     void
     setPrimaryLayers(vector<Layer *> layers) {
@@ -276,7 +276,7 @@
     }
 
     void
-    moreModelsAvailable(vector<Model *> models) {
+    moreModelsAvailable(vector<Model *> models) override {
         std::cerr << "AdditionalModelConverter::moreModelsAvailable: " << models.size() << " model(s)" << std::endl;
         // We can't automatically regenerate the additional models on
         // reload -- we should delete them instead
@@ -292,7 +292,7 @@
     }
 
     void
-    noMoreModelsAvailable() {
+    noMoreModelsAvailable() override {
         std::cerr << "AdditionalModelConverter::noMoreModelsAvailable" << std::endl;
         m_handler->layersCreated(this, m_primary, vector<Layer *>());
         delete this;
@@ -640,7 +640,7 @@
     }
 
     ModelRecord rec;
-    rec.source = 0;
+    rec.source = nullptr;
     rec.channel = 0;
     rec.refcount = 0;
     rec.additional = false;
@@ -676,7 +676,7 @@
     }
 
     ModelRecord rec;
-    rec.source = 0;
+    rec.source = nullptr;
     rec.channel = 0;
     rec.refcount = 0;
     rec.additional = true;
@@ -732,8 +732,8 @@
 
     Transforms tt;
     tt.push_back(transform);
-    vector<Model *> mm = addDerivedModels(tt, input, message, 0);
-    if (mm.empty()) return 0;
+    vector<Model *> mm = addDerivedModels(tt, input, message, nullptr);
+    if (mm.empty()) return nullptr;
     else return mm[0];
 }
 
@@ -783,7 +783,7 @@
 void
 Document::releaseModel(Model *model) // Will _not_ release main model!
 {
-    if (model == 0) {
+    if (model == nullptr) {
         return;
     }
 
@@ -818,7 +818,7 @@
         for (ModelMap::iterator i = m_models.begin(); i != m_models.end(); ++i) {
             if (i->second.source == model) {
                 ++sourceCount;
-                i->second.source = 0;
+                i->second.source = nullptr;
             }
         }
 
@@ -1101,7 +1101,7 @@
         // unaligned model just by looking at the model itself,
         // without also knowing what the main model is
         SVDEBUG << "Document::alignModel(" << model << "): is main model, setting appropriately" << endl;
-        rm->setAlignment(new AlignmentModel(model, model, 0, 0));
+        rm->setAlignment(new AlignmentModel(model, model, nullptr, nullptr));
         return;
     }
 
--- a/framework/Document.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/Document.h	Wed Jan 09 15:25:09 2019 +0000
@@ -302,7 +302,7 @@
 
     void setIncomplete(bool i) { m_isIncomplete = i; }
 
-    void toXml(QTextStream &, QString indent, QString extraAttributes) const;
+    void toXml(QTextStream &, QString indent, QString extraAttributes) const override;
     void toXmlAsTemplate(QTextStream &, QString indent, QString extraAttributes) const;
 
 signals:
@@ -396,9 +396,9 @@
         AddLayerCommand(Document *d, View *view, Layer *layer);
         virtual ~AddLayerCommand();
         
-        virtual void execute();
-        virtual void unexecute();
-        virtual QString getName() const;
+        void execute() override;
+        void unexecute() override;
+        QString getName() const override;
 
     protected:
         Document *m_d;
@@ -414,9 +414,9 @@
         RemoveLayerCommand(Document *d, View *view, Layer *layer);
         virtual ~RemoveLayerCommand();
         
-        virtual void execute();
-        virtual void unexecute();
-        virtual QString getName() const;
+        void execute() override;
+        void unexecute() override;
+        QString getName() const override;
 
     protected:
         Document *m_d;
--- a/framework/MainWindowBase.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/MainWindowBase.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -137,32 +137,32 @@
 #endif
 
 MainWindowBase::MainWindowBase(SoundOptions options) :
-    m_document(0),
-    m_paneStack(0),
-    m_viewManager(0),
-    m_timeRulerLayer(0),
+    m_document(nullptr),
+    m_paneStack(nullptr),
+    m_viewManager(nullptr),
+    m_timeRulerLayer(nullptr),
     m_soundOptions(options),
-    m_playSource(0),
-    m_recordTarget(0),
-    m_resamplerWrapper(0),
-    m_playTarget(0),
-    m_audioIO(0),
-    m_oscQueue(0),
-    m_oscQueueStarter(0),
-    m_midiInput(0),
+    m_playSource(nullptr),
+    m_recordTarget(nullptr),
+    m_resamplerWrapper(nullptr),
+    m_playTarget(nullptr),
+    m_audioIO(nullptr),
+    m_oscQueue(nullptr),
+    m_oscQueueStarter(nullptr),
+    m_midiInput(nullptr),
     m_recentFiles("RecentFiles", 20),
     m_recentTransforms("RecentTransforms", 20),
     m_documentModified(false),
     m_openingAudioFile(false),
     m_abandoning(false),
-    m_labeller(0),
+    m_labeller(nullptr),
     m_lastPlayStatusSec(0),
     m_initialDarkBackground(false),
     m_defaultFfwdRwdStep(2, 0),
     m_audioRecordMode(RecordCreateAdditionalModel),
-    m_statusLabel(0),
+    m_statusLabel(nullptr),
     m_iconsVisibleInMenus(true),
-    m_menuShortcutMapper(0)
+    m_menuShortcutMapper(nullptr)
 {
     Profiler profiler("MainWindowBase::MainWindowBase");
 
@@ -219,7 +219,7 @@
     }
 #endif
 
-    m_paneStack = new PaneStack(0, m_viewManager);
+    m_paneStack = new PaneStack(nullptr, m_viewManager);
     connect(m_paneStack, SIGNAL(currentPaneChanged(Pane *)),
             this, SLOT(currentPaneChanged(Pane *)));
     connect(m_paneStack, SIGNAL(currentLayerChanged(Pane *, Layer *)),
@@ -329,7 +329,7 @@
     delete m_midiInput;
 
     if (m_oscQueueStarter) {
-        disconnect(m_oscQueueStarter, 0, 0, 0);
+        disconnect(m_oscQueueStarter, nullptr, nullptr, nullptr);
         m_oscQueueStarter->wait(1000);
         if (m_oscQueueStarter->isRunning()) {
             m_oscQueueStarter->terminate();
@@ -355,7 +355,7 @@
     SVDEBUG << "MainWindowBase::finaliseMenus called" << endl;
 
     delete m_menuShortcutMapper;
-    m_menuShortcutMapper = 0;
+    m_menuShortcutMapper = nullptr;
 
     foreach (QShortcut *sc, m_appShortcuts) {
         delete sc;
@@ -526,9 +526,9 @@
     FileFinder *ff = FileFinder::getInstance();
 
     if (type == FileFinder::AnyFile) {
-        if (getMainModel() != 0 &&
-            m_paneStack != 0 &&
-            m_paneStack->getCurrentPane() != 0) { // can import a layer
+        if (getMainModel() != nullptr &&
+            m_paneStack != nullptr &&
+            m_paneStack->getCurrentPane() != nullptr) { // can import a layer
             return ff->getOpenFileName(FileFinder::AnyFile, m_sessionFile);
         } else {
             return ff->getOpenFileName(FileFinder::SessionOrAudioFile,
@@ -586,8 +586,8 @@
 void
 MainWindowBase::updateMenuStates()
 {
-    Pane *currentPane = 0;
-    Layer *currentLayer = 0;
+    Pane *currentPane = nullptr;
+    Layer *currentLayer = nullptr;
 
     if (m_paneStack) currentPane = m_paneStack->getCurrentPane();
     if (currentPane) currentLayer = currentPane->getSelectedLayer();
@@ -614,14 +614,14 @@
     }        
 
     bool haveCurrentPane =
-        (currentPane != 0);
+        (currentPane != nullptr);
     bool haveCurrentLayer =
         (haveCurrentPane &&
-         (currentLayer != 0));
+         (currentLayer != nullptr));
     bool haveMainModel =
-        (getMainModel() != 0);
+        (getMainModel() != nullptr);
     bool havePlayTarget =
-        (m_playTarget != 0 || m_audioIO != 0);
+        (m_playTarget != nullptr || m_audioIO != nullptr);
     bool haveSelection = 
         (m_viewManager &&
          !m_viewManager->getSelections().empty());
@@ -766,7 +766,7 @@
     if (m_viewManager->getPlaySoloMode()) {
         currentPaneChanged(m_paneStack->getCurrentPane());
     } else {
-        m_viewManager->setPlaybackModel(0);
+        m_viewManager->setPlaybackModel(nullptr);
         if (m_playSource) {
             m_playSource->clearSoloModelSet();
         }
@@ -784,7 +784,7 @@
     if (!(m_viewManager &&
           m_playSource &&
           m_viewManager->getPlaySoloMode())) {
-        if (m_viewManager) m_viewManager->setPlaybackModel(0);
+        if (m_viewManager) m_viewManager->setPlaybackModel(nullptr);
         return;
     }
 
@@ -1168,7 +1168,7 @@
                 }
 
                 m_labeller->label<SparseOneDimensionalModel::Point>
-                    (point, havePrevPoint ? &prevPoint : 0);
+                    (point, havePrevPoint ? &prevPoint : nullptr);
 
                 if (m_labeller->actingOnPrevPoint() && havePrevPoint) {
                     command->addPoint(prevPoint);
@@ -1218,7 +1218,7 @@
     if (alignedStart >= alignedEnd) return;
     sv_frame_t alignedDuration = alignedEnd - alignedStart;
 
-    Command *c = 0;
+    Command *c = nullptr;
 
     QString name = tr("Add Item at %1 s")
         .arg(RealTime::frame2RealTime
@@ -1379,9 +1379,9 @@
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
 
-    bool canImportLayer = (getMainModel() != 0 &&
-                           m_paneStack != 0 &&
-                           m_paneStack->getCurrentPane() != 0);
+    bool canImportLayer = (getMainModel() != nullptr &&
+                           m_paneStack != nullptr &&
+                           m_paneStack->getCurrentPane() != nullptr);
 
     bool rdf = (source.getExtension().toLower() == "rdf" ||
                 source.getExtension().toLower() == "n3" ||
@@ -1709,7 +1709,7 @@
         // know whether the pane contains a waveform model at all.
         
         Pane *pane = m_paneStack->getCurrentPane();
-        Layer *replace = 0;
+        Layer *replace = nullptr;
 
         for (int i = 0; i < pane->getLayerCount(); ++i) {
             Layer *layer = pane->getLayer(i);
@@ -2076,9 +2076,9 @@
         }
     }
 
-    QXmlInputSource *inputSource = 0;
-    BZipFileDevice *bzFile = 0;
-    QFile *rawFile = 0;
+    QXmlInputSource *inputSource = nullptr;
+    BZipFileDevice *bzFile = nullptr;
+    QFile *rawFile = nullptr;
 
     if (source.getExtension().toLower() == sessionExt) {
         bzFile = new BZipFileDevice(source.getLocalFilename());
@@ -2202,8 +2202,8 @@
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
 
-    QXmlInputSource *inputSource = 0;
-    QFile *file = 0;
+    QXmlInputSource *inputSource = nullptr;
+    QFile *file = nullptr;
 
     file = new QFile(source.getLocalFilename());
     inputSource = new QXmlInputSource(file);
@@ -2346,7 +2346,7 @@
         if (w) {
 
             Pane *pane = addPaneToStack();
-            Layer *layer = 0;
+            Layer *layer = nullptr;
 
             if (m_timeRulerLayer) {
                 m_document->addLayerToView(pane, m_timeRulerLayer);
@@ -2565,8 +2565,8 @@
 {
     // First prevent this trying to call target.
     if (m_playSource) {
-        m_playSource->setSystemPlaybackTarget(0);
-        m_playSource->setResamplerWrapper(0);
+        m_playSource->setSystemPlaybackTarget(nullptr);
+        m_playSource->setResamplerWrapper(nullptr);
     }
 
     // Then delete the breakfastquay::System object.
@@ -2579,9 +2579,9 @@
     // of the use cases for recreateAudioIO() calling this
     delete m_resamplerWrapper;
 
-    m_audioIO = 0;
-    m_playTarget = 0;
-    m_resamplerWrapper = 0;
+    m_audioIO = nullptr;
+    m_playTarget = nullptr;
+    m_resamplerWrapper = nullptr;
 }
 
 void
@@ -2608,14 +2608,14 @@
 WaveFileModel *
 MainWindowBase::getMainModel()
 {
-    if (!m_document) return 0;
+    if (!m_document) return nullptr;
     return m_document->getMainModel();
 }
 
 const WaveFileModel *
 MainWindowBase::getMainModel() const
 {
-    if (!m_document) return 0;
+    if (!m_document) return nullptr;
     return m_document->getMainModel();
 }
 
@@ -2909,7 +2909,7 @@
     if (m_timeRulerLayer) {
         SVCERR << "WARNING: Time ruler layer was not reset to 0 before session template loaded?" << endl;
         delete m_timeRulerLayer;
-        m_timeRulerLayer = 0;
+        m_timeRulerLayer = nullptr;
     }
 }
 
@@ -3434,7 +3434,7 @@
 MainWindowBase::getSnapLayer() const
 {
     Pane *pane = m_paneStack->getCurrentPane();
-    if (!pane) return 0;
+    if (!pane) return nullptr;
 
     Layer *layer = pane->getSelectedLayer();
 
@@ -3443,7 +3443,7 @@
         !dynamic_cast<RegionLayer *>(layer) &&
         !dynamic_cast<TimeRulerLayer *>(layer)) {
 
-        layer = 0;
+        layer = nullptr;
 
         for (int i = pane->getLayerCount(); i > 0; --i) {
             Layer *l = pane->getLayer(i-1);
@@ -3484,8 +3484,8 @@
 
 MainWindowBase::AddPaneCommand::AddPaneCommand(MainWindowBase *mw) :
     m_mw(mw),
-    m_pane(0),
-    m_prevCurrentPane(0),
+    m_pane(nullptr),
+    m_prevCurrentPane(nullptr),
     m_added(false)
 {
 }
@@ -3531,7 +3531,7 @@
 MainWindowBase::RemovePaneCommand::RemovePaneCommand(MainWindowBase *mw, Pane *pane) :
     m_mw(mw),
     m_pane(pane),
-    m_prevCurrentPane(0),
+    m_prevCurrentPane(nullptr),
     m_added(true)
 {
 }
@@ -3607,7 +3607,7 @@
 void
 MainWindowBase::editCurrentLayer()
 {
-    Layer *layer = 0;
+    Layer *layer = nullptr;
     Pane *pane = m_paneStack->getCurrentPane();
     if (pane) layer = pane->getSelectedLayer();
     if (!layer) return;
@@ -3727,7 +3727,7 @@
             if (currentPane->getFixedOrderLayer(i) == currentLayer) {
                 if (i == 0) {
                     m_paneStack->setCurrentLayer
-                        (currentPane, 0); // pane
+                        (currentPane, nullptr); // pane
                 } else {
                     m_paneStack->setCurrentLayer
                         (currentPane, currentPane->getFixedOrderLayer(i-1));
@@ -3762,7 +3762,7 @@
             if (currentPane->getFixedOrderLayer(i) == currentLayer) {
                 if (i == currentPane->getLayerCount()-1) {
                     m_paneStack->setCurrentLayer
-                        (currentPane, 0); // pane
+                        (currentPane, nullptr); // pane
                 } else {
                     m_paneStack->setCurrentLayer
                         (currentPane, currentPane->getFixedOrderLayer(i+1));
@@ -3826,7 +3826,7 @@
 MainWindowBase::globalCentreFrameChanged(sv_frame_t )
 {
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
-    Pane *p = 0;
+    Pane *p = nullptr;
     if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;
     if (!p->getFollowGlobalPan()) return;
     updateVisibleRangeDisplay(p);
@@ -3844,7 +3844,7 @@
         }
     }
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
-    Pane *p = 0;
+    Pane *p = nullptr;
     if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;
     if (v == p) updateVisibleRangeDisplay(p);
 }
@@ -3853,7 +3853,7 @@
 MainWindowBase::viewZoomLevelChanged(View *v, ZoomLevel, bool )
 {
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
-    Pane *p = 0;
+    Pane *p = nullptr;
     if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;
     if (v == p) updateVisibleRangeDisplay(p);
 }
@@ -3881,7 +3881,7 @@
 
     if (m_timeRulerLayer && (layer == m_timeRulerLayer)) {
 //        cerr << "(this is the time ruler layer)" << endl;
-        m_timeRulerLayer = 0;
+        m_timeRulerLayer = nullptr;
     }
 }
 
@@ -3964,7 +3964,7 @@
 {
 //    SVDEBUG << "MainWindowBase::modelAboutToBeDeleted(" << model << ")" << endl;
     if (model == m_viewManager->getPlaybackModel()) {
-        m_viewManager->setPlaybackModel(0);
+        m_viewManager->setPlaybackModel(nullptr);
     }
     m_playSource->removeModel(model);
 }
@@ -4031,7 +4031,7 @@
 void
 MainWindowBase::inProgressSelectionChanged()
 {
-    Pane *currentPane = 0;
+    Pane *currentPane = nullptr;
     if (m_paneStack) currentPane = m_paneStack->getCurrentPane();
     if (currentPane) {
         //cerr << "JTEST: mouse event on selection pane" << endl;
--- a/framework/MainWindowBase.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/MainWindowBase.h	Wed Jan 09 15:25:09 2019 +0000
@@ -136,7 +136,7 @@
     virtual bool saveSessionTemplate(QString path);
 
     /// Implementation of FrameTimer interface method
-    virtual sv_frame_t getFrame() const;
+    sv_frame_t getFrame() const override;
 
     void setDefaultFfwdRwdStep(RealTime step) {
         m_defaultFfwdRwdStep = step;
@@ -357,7 +357,7 @@
     {
     public:
         OSCQueueStarter(MainWindowBase *mwb) : QThread(mwb), m_mwb(mwb) { }
-        virtual void run() {
+        void run() override {
             OSCQueue *queue = new OSCQueue(); // can take a long time
             m_mwb->m_oscQueue = queue;
         }
@@ -421,11 +421,11 @@
     {
     public:
         PaneCallback(MainWindowBase *mw) : m_mw(mw) { }
-        virtual Pane *addPane() { return m_mw->addPaneToStack(); }
-        virtual void setWindowSize(int width, int height) {
+        Pane *addPane() override { return m_mw->addPaneToStack(); }
+        void setWindowSize(int width, int height) override {
             m_mw->resizeConstrained(QSize(width, height));
         }
-        virtual void addSelection(sv_frame_t start, sv_frame_t end) {
+        void addSelection(sv_frame_t start, sv_frame_t end) override {
             m_mw->m_viewManager->addSelectionQuietly(Selection(start, end));
         }
     protected:
@@ -438,9 +438,9 @@
         AddPaneCommand(MainWindowBase *mw);
         virtual ~AddPaneCommand();
         
-        virtual void execute();
-        virtual void unexecute();
-        virtual QString getName() const;
+        void execute() override;
+        void unexecute() override;
+        QString getName() const override;
 
         Pane *getPane() { return m_pane; }
 
@@ -457,9 +457,9 @@
         RemovePaneCommand(MainWindowBase *mw, Pane *pane);
         virtual ~RemovePaneCommand();
         
-        virtual void execute();
-        virtual void unexecute();
-        virtual QString getName() const;
+        void execute() override;
+        void unexecute() override;
+        QString getName() const override;
 
     protected:
         MainWindowBase *m_mw;
--- a/framework/SVFileReader.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/SVFileReader.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -58,13 +58,13 @@
     m_document(document),
     m_paneCallback(callback),
     m_location(location),
-    m_currentPane(0),
-    m_currentLayer(0),
-    m_currentDataset(0),
-    m_currentDerivedModel(0),
+    m_currentPane(nullptr),
+    m_currentLayer(nullptr),
+    m_currentDataset(nullptr),
+    m_currentDerivedModel(nullptr),
     m_currentDerivedModelId(-1),
-    m_currentPlayParameters(0),
-    m_currentTransformSource(0),
+    m_currentPlayParameters(nullptr),
+    m_currentTransformSource(nullptr),
     m_currentTransformChannel(0),
     m_currentTransformIsNewStyle(true),
     m_datasetSeparator(" "),
@@ -297,7 +297,7 @@
             }
         }
 
-        m_currentDataset = 0;
+        m_currentDataset = nullptr;
 
     } else if (name == "data") {
 
@@ -341,9 +341,9 @@
         }
 
         m_addedModels.insert(m_currentDerivedModel);
-        m_currentDerivedModel = 0;
+        m_currentDerivedModel = nullptr;
         m_currentDerivedModelId = -1;
-        m_currentTransformSource = 0;
+        m_currentTransformSource = nullptr;
         m_currentTransform = Transform();
         m_currentTransformChannel = -1;
 
@@ -356,7 +356,7 @@
     } else if (name == "selections") {
         m_inSelections = false;
     } else if (name == "playparameters") {
-        m_currentPlayParameters = 0;
+        m_currentPlayParameters = nullptr;
     }
 
     return true;
@@ -509,7 +509,7 @@
 
     if (type == "wavefile") {
         
-        WaveFileModel *model = 0;
+        WaveFileModel *model = nullptr;
         FileFinder *ff = FileFinder::getInstance();
         QString originalPath = attributes.value("file");
         QString path = ff->find(FileFinder::AudioFile,
@@ -544,7 +544,7 @@
             model = new ReadOnlyWaveFileModel(file, rate);
             if (!model->isOK()) {
                 delete model;
-                model = 0;
+                model = nullptr;
             }
         }
 
@@ -760,7 +760,7 @@
         READ_MANDATORY(int, aligned, toInt);
         READ_MANDATORY(int, path, toInt);
 
-        Model *refModel = 0, *alignedModel = 0, *pathModel = 0;
+        Model *refModel = nullptr, *alignedModel = nullptr, *pathModel = nullptr;
 
         if (m_models.find(reference) != m_models.end()) {
             refModel = m_models[reference];
@@ -788,7 +788,7 @@
 
         if (refModel && alignedModel && pathModel) {
             AlignmentModel *model = new AlignmentModel
-                (refModel, alignedModel, 0, 0);
+                (refModel, alignedModel, nullptr, nullptr);
             PathModel *pm = dynamic_cast<PathModel *>(pathModel);
             if (!pm) {
                 SVCERR << "WARNING: SV-XML: Model id " << path
@@ -817,7 +817,7 @@
 SVFileReader::readView(const QXmlAttributes &attributes)
 {
     QString type = attributes.value("type");
-    m_currentPane = 0;
+    m_currentPane = nullptr;
     
     if (type != "pane") {
         SVCERR << "WARNING: SV-XML: Unexpected view type \""
@@ -895,7 +895,7 @@
         return false;
     }
 
-    Layer *layer = 0;
+    Layer *layer = nullptr;
     bool isNewLayer = false;
 
     // Layers are expected to be defined in layer elements in the data
@@ -977,7 +977,7 @@
                     // Don't add a layer with an unknown model id
                     // unless it explicitly supports this state
                     m_document->deleteLayer(layer);
-                    m_layers[id] = layer = 0;
+                    m_layers[id] = layer = nullptr;
                     return false;
                 }
             }
@@ -1006,7 +1006,7 @@
     }
 
     m_currentLayer = layer;
-    m_inLayer = (layer != 0);
+    m_inLayer = (layer != nullptr);
 
     return true;
 }
@@ -1026,7 +1026,7 @@
     
     int modelId = m_awaitingDatasets[id];
     
-    Model *model = 0;
+    Model *model = nullptr;
     if (haveModel(modelId)) {
         model = m_models[modelId];
     } else {
@@ -1062,7 +1062,7 @@
 
     if (!good) {
         SVCERR << "WARNING: SV-XML: Model id " << modelId << " has wrong number of dimensions or inappropriate type for " << dimensions << "-D dataset " << id << endl;
-        m_currentDataset = 0;
+        m_currentDataset = nullptr;
         return false;
     }
 
@@ -1297,7 +1297,7 @@
         m_currentDerivedModel = m_models[modelId];
     } else {
         // we'll regenerate the model when the derivation element ends
-        m_currentDerivedModel = 0;
+        m_currentDerivedModel = nullptr;
     }
     
     m_currentDerivedModelId = modelId;
@@ -1376,7 +1376,7 @@
 bool
 SVFileReader::readPlayParameters(const QXmlAttributes &attributes)
 {
-    m_currentPlayParameters = 0;
+    m_currentPlayParameters = nullptr;
 
     int modelId = 0;
     bool modelOk = false;
@@ -1554,7 +1554,7 @@
         m_inData(false),
         m_type(SVFileReader::UnknownFileType)
     { }
-    virtual ~SVFileIdentifier() { }
+    ~SVFileIdentifier() override { }
 
     void parse(QXmlInputSource &source) {
         QXmlSimpleReader reader;
@@ -1565,10 +1565,10 @@
 
     SVFileReader::FileType getType() const { return m_type; }
 
-    virtual bool startElement(const QString &,
+    bool startElement(const QString &,
                               const QString &,
                               const QString &qName,
-                              const QXmlAttributes& atts)
+                              const QXmlAttributes& atts) override
     {
         QString name = qName.toLower();
 
@@ -1601,9 +1601,9 @@
         return true;
     }
 
-    virtual bool endElement(const QString &,
+    bool endElement(const QString &,
                             const QString &,
-                            const QString &qName)
+                            const QString &qName) override
     {
         QString name = qName.toLower();
 
--- a/framework/SVFileReader.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/SVFileReader.h	Wed Jan 09 15:25:09 2019 +0000
@@ -13,8 +13,8 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef _SV_FILE_READER_H_
-#define _SV_FILE_READER_H_
+#ifndef SV_FILE_READER_H
+#define SV_FILE_READER_H
 
 #include "layer/LayerFactory.h"
 #include "transform/Transform.h"
@@ -181,19 +181,19 @@
     // For loading a single layer onto an existing pane
     void setCurrentPane(Pane *pane) { m_currentPane = pane; }
     
-    virtual bool startElement(const QString &namespaceURI,
+    bool startElement(const QString &namespaceURI,
                               const QString &localName,
                               const QString &qName,
-                              const QXmlAttributes& atts);
+                              const QXmlAttributes& atts) override;
 
-    virtual bool characters(const QString &);
+    bool characters(const QString &) override;
 
-    virtual bool endElement(const QString &namespaceURI,
+    bool endElement(const QString &namespaceURI,
                             const QString &localName,
-                            const QString &qName);
+                            const QString &qName) override;
 
-    bool error(const QXmlParseException &exception);
-    bool fatalError(const QXmlParseException &exception);
+    bool error(const QXmlParseException &exception) override;
+    bool fatalError(const QXmlParseException &exception) override;
 
     enum FileType
     {
--- a/framework/TransformUserConfigurator.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/TransformUserConfigurator.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -30,7 +30,7 @@
 
 #include <typeinfo>
 
-static QWidget *parentWidget = 0;
+static QWidget *parentWidget = nullptr;
 
 void
 TransformUserConfigurator::setParentWidget(QWidget *w)
@@ -226,7 +226,7 @@
     delete dialog;
 
     if (effect && source) {
-        source->setAuditioningEffect(0);
+        source->setAuditioningEffect(nullptr);
     }
 
     return ok;
--- a/framework/TransformUserConfigurator.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/TransformUserConfigurator.h	Wed Jan 09 15:25:09 2019 +0000
@@ -12,8 +12,8 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef _TRANSFORM_USER_CONFIGURATOR_H_
-#define _TRANSFORM_USER_CONFIGURATOR_H_
+#ifndef SV_TRANSFORM_USER_CONFIGURATOR_H
+#define SV_TRANSFORM_USER_CONFIGURATOR_H
 
 #include "transform/ModelTransformerFactory.h"
 
@@ -22,7 +22,7 @@
 public:
     // This is of course absolutely gross
 
-    virtual bool configure(ModelTransformer::Input &input,
+    bool configure(ModelTransformer::Input &input,
                            Transform &transform,
                            Vamp::PluginBase *plugin,
                            Model *&inputModel,
@@ -31,7 +31,7 @@
                            sv_frame_t duration,
                            const QMap<QString, Model *> &modelMap,
                            QStringList candidateModelNames,
-                           QString defaultModelName);
+                           QString defaultModelName) override;
 
     static void setParentWidget(QWidget *);
 
--- a/framework/VersionTester.cpp	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/VersionTester.cpp	Wed Jan 09 15:25:09 2019 +0000
@@ -29,7 +29,7 @@
 VersionTester::VersionTester(QString hostname, QString versionFilePath,
                              QString myVersion) :
     m_myVersion(myVersion),
-    m_reply(0),
+    m_reply(nullptr),
     m_httpFailed(false),
     m_nm(new QNetworkAccessManager)
 {
@@ -90,7 +90,7 @@
 VersionTester::finished()
 {
     QNetworkReply *r = m_reply;
-    m_reply = 0;
+    m_reply = nullptr;
 
     r->deleteLater();
     if (m_httpFailed) return;
--- a/framework/VersionTester.h	Wed Jan 09 14:42:25 2019 +0000
+++ b/framework/VersionTester.h	Wed Jan 09 15:25:09 2019 +0000
@@ -18,8 +18,8 @@
    This file copyright 2000-2009 Chris Cannam.
 */
 
-#ifndef _VERSION_TESTER_H_
-#define _VERSION_TESTER_H_
+#ifndef SV_VERSION_TESTER_H
+#define SV_VERSION_TESTER_H
 
 #include <QStringList>
 #include <QString>