# HG changeset patch # User Chris Cannam # Date 1543240125 0 # Node ID c01cbe41aeb5ee271267a9a1cdfc254f2908b915 # Parent 232d6ddf257d5b8c38702587cdd051e0d2fa2085 Use override throughout diff -r 232d6ddf257d -r c01cbe41aeb5 base/Command.h --- a/base/Command.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/Command.h Mon Nov 26 13:48:45 2018 +0000 @@ -13,8 +13,8 @@ COPYING included with this distribution for more information. */ -#ifndef _COMMAND_H_ -#define _COMMAND_H_ +#ifndef SV_COMMAND_H +#define SV_COMMAND_H #include #include @@ -42,10 +42,10 @@ virtual void deleteCommand(Command *command); virtual bool haveCommands() const; - virtual void execute(); - virtual void unexecute(); + void execute() override; + void unexecute() override; - virtual QString getName() const; + QString getName() const override; virtual void setName(QString name); protected: @@ -66,7 +66,7 @@ BundleCommand(QString name); virtual ~BundleCommand(); - virtual QString getName() const; + QString getName() const override; }; #endif diff -r 232d6ddf257d -r c01cbe41aeb5 base/Exceptions.h --- a/base/Exceptions.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/Exceptions.h Mon Nov 26 13:48:45 2018 +0000 @@ -13,8 +13,8 @@ COPYING included with this distribution for more information. */ -#ifndef _EXCEPTIONS_H_ -#define _EXCEPTIONS_H_ +#ifndef SV_EXCEPTIONS_H +#define SV_EXCEPTIONS_H #include @@ -27,7 +27,7 @@ public: FileNotFound(QString file) throw(); virtual ~FileNotFound() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; protected: QString m_file; @@ -38,7 +38,7 @@ public: FailedToOpenFile(QString file) throw(); virtual ~FailedToOpenFile() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; protected: QString m_file; @@ -49,7 +49,7 @@ public: DirectoryCreationFailed(QString directory) throw(); virtual ~DirectoryCreationFailed() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; protected: QString m_directory; @@ -60,7 +60,7 @@ public: FileReadFailed(QString file) throw(); virtual ~FileReadFailed() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; protected: QString m_file; @@ -71,7 +71,7 @@ public: FileOperationFailed(QString file, QString operation) throw(); virtual ~FileOperationFailed() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; protected: QString m_file; @@ -85,7 +85,7 @@ size_t required, size_t available) throw(); InsufficientDiscSpace(QString directory) throw(); virtual ~InsufficientDiscSpace() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; QString getDirectory() const { return m_directory; } size_t getRequired() const { return m_required; } @@ -102,7 +102,7 @@ public: AllocationFailed(QString purpose) throw(); virtual ~AllocationFailed() throw() { } - virtual const char *what() const throw(); + const char *what() const throw() override; protected: QString m_purpose; diff -r 232d6ddf257d -r c01cbe41aeb5 base/PlayParameterRepository.h --- a/base/PlayParameterRepository.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/PlayParameterRepository.h Mon Nov 26 13:48:45 2018 +0000 @@ -13,8 +13,8 @@ COPYING included with this distribution for more information. */ -#ifndef _PLAY_PARAMETER_REPOSITORY_H_ -#define _PLAY_PARAMETER_REPOSITORY_H_ +#ifndef SV_PLAY_PARAMETER_REPOSITORY_H +#define SV_PLAY_PARAMETER_REPOSITORY_H #include "PlayParameters.h" #include "Command.h" @@ -52,9 +52,9 @@ void setPlayPan(float); void setPlayGain(float); void setPlayClipId(QString); - void execute(); - void unexecute(); - QString getName() const; + void execute() override; + void unexecute() override; + QString getName() const override; protected: PlayParameters *m_params; diff -r 232d6ddf257d -r c01cbe41aeb5 base/PlayParameters.h --- a/base/PlayParameters.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/PlayParameters.h Mon Nov 26 13:48:45 2018 +0000 @@ -13,8 +13,8 @@ COPYING included with this distribution for more information. */ -#ifndef _PLAY_PARAMETERS_H_ -#define _PLAY_PARAMETERS_H_ +#ifndef SV_PLAY_PARAMETERS_H +#define SV_PLAY_PARAMETERS_H #include @@ -36,9 +36,9 @@ virtual void copyFrom(const PlayParameters *); - virtual void toXml(QTextStream &stream, + void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; public slots: virtual void setPlayMuted(bool muted); diff -r 232d6ddf257d -r c01cbe41aeb5 base/Preferences.h --- a/base/Preferences.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/Preferences.h Mon Nov 26 13:48:45 2018 +0000 @@ -27,13 +27,13 @@ public: static Preferences *getInstance(); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, int *, int *, int *) const; - virtual QString getPropertyValueLabel(const PropertyName &, int value) const; - virtual QString getPropertyContainerName() const; - virtual QString getPropertyContainerIconName() const; + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, int *, int *, int *) const override; + QString getPropertyValueLabel(const PropertyName &, int value) const override; + QString getPropertyContainerName() const override; + QString getPropertyContainerIconName() const override; enum SpectrogramSmoothing { NoSpectrogramSmoothing, @@ -108,7 +108,7 @@ bool getShowSplash() const { return m_showSplash; } public slots: - virtual void setProperty(const PropertyName &, int); + void setProperty(const PropertyName &, int) override; void setSpectrogramSmoothing(SpectrogramSmoothing smoothing); void setSpectrogramXSmoothing(SpectrogramXSmoothing smoothing); diff -r 232d6ddf257d -r c01cbe41aeb5 base/ProgressPrinter.h --- a/base/ProgressPrinter.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/ProgressPrinter.h Mon Nov 26 13:48:45 2018 +0000 @@ -26,14 +26,14 @@ ProgressPrinter(QString message, QObject *parent = 0); virtual ~ProgressPrinter(); - virtual bool isDefinite() const; - virtual void setDefinite(bool definite); + bool isDefinite() const override; + void setDefinite(bool definite) override; - virtual bool wasCancelled() const { return false; } // no mechanism + bool wasCancelled() const override { return false; } // no mechanism public slots: - virtual void setMessage(QString); - virtual void setProgress(int); + void setMessage(QString) override; + void setProgress(int) override; virtual void done(); protected: diff -r 232d6ddf257d -r c01cbe41aeb5 base/PropertyContainer.h --- a/base/PropertyContainer.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/PropertyContainer.h Mon Nov 26 13:48:45 2018 +0000 @@ -162,9 +162,9 @@ SetPropertyCommand(PropertyContainer *pc, const PropertyName &pn, int); virtual ~SetPropertyCommand() { } - virtual void execute(); - virtual void unexecute(); - virtual QString getName() const; + void execute() override; + void unexecute() override; + QString getName() const override; protected: PropertyContainer *m_pc; diff -r 232d6ddf257d -r c01cbe41aeb5 base/RangeMapper.h --- a/base/RangeMapper.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/RangeMapper.h Mon Nov 26 13:48:45 2018 +0000 @@ -89,14 +89,14 @@ QString unit = "", bool inverted = false, std::map labels = {}); - 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; - virtual QString getUnit() const { return m_unit; } - virtual QString getLabel(int position) const; + QString getUnit() const override { return m_unit; } + QString getLabel(int position) const override; protected: int m_minpos; @@ -131,13 +131,13 @@ double minval, double maxval, double &minlog, double &ratio); - 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; - virtual QString getUnit() const { return m_unit; } + QString getUnit() const override { return m_unit; } protected: int m_minpos; @@ -175,13 +175,13 @@ InterpolatingRangeMapper(CoordMap pointMappings, QString unit); - 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; - virtual QString getUnit() const { return m_unit; } + QString getUnit() const override { return m_unit; } protected: CoordMap m_mappings; @@ -248,13 +248,13 @@ */ MappingType getType() const { return m_type; } - 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; - virtual QString getUnit() const { return m_unit; } + QString getUnit() const override { return m_unit; } protected: MappingType m_type; diff -r 232d6ddf257d -r c01cbe41aeb5 base/Selection.h --- a/base/Selection.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/Selection.h Mon Nov 26 13:48:45 2018 +0000 @@ -83,8 +83,8 @@ */ Selection getContainingSelection(sv_frame_t frame, bool defaultToFollowing) const; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; protected: SelectionList m_selections; diff -r 232d6ddf257d -r c01cbe41aeb5 base/Thread.h --- a/base/Thread.h Thu Nov 22 14:55:18 2018 +0000 +++ b/base/Thread.h Mon Nov 26 13:48:45 2018 +0000 @@ -34,7 +34,7 @@ void start(); protected: - virtual void run() = 0; + void run() override = 0; private: Type m_type; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/BZipFileDevice.h --- a/data/fileio/BZipFileDevice.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/BZipFileDevice.h Mon Nov 26 13:48:45 2018 +0000 @@ -29,16 +29,16 @@ BZipFileDevice(QString fileName); virtual ~BZipFileDevice(); - virtual bool open(OpenMode mode); - virtual void close(); + bool open(OpenMode mode) override; + void close() override; virtual bool isOK() const; - virtual bool isSequential() const { return true; } + bool isSequential() const override { return true; } protected: - virtual qint64 readData(char *data, qint64 maxSize); - virtual qint64 writeData(const char *data, qint64 maxSize); + qint64 readData(char *data, qint64 maxSize) override; + qint64 writeData(const char *data, qint64 maxSize) override; QString m_fileName; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/CSVFileReader.h --- a/data/fileio/CSVFileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/CSVFileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -52,10 +52,10 @@ virtual ~CSVFileReader(); - virtual bool isOK() const; - virtual QString getError() const; + bool isOK() const override; + QString getError() const override; - virtual Model *load() const; + Model *load() const override; protected: CSVFormat m_format; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/CodedAudioFileReader.h --- a/data/fileio/CodedAudioFileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/CodedAudioFileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -52,14 +52,14 @@ DecodeThreaded // decode in a background thread after construction }; - virtual floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count) const; + floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count) const override; - virtual sv_samplerate_t getNativeRate() const { return m_fileRate; } + sv_samplerate_t getNativeRate() const override { return m_fileRate; } - virtual QString getLocalFilename() const { return m_cacheFileName; } + QString getLocalFilename() const override { return m_cacheFileName; } /// Intermediate cache means all CodedAudioFileReaders are quickly seekable - virtual bool isQuicklySeekable() const { return true; } + bool isQuicklySeekable() const override { return true; } signals: void progress(int); diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/DecodingWavFileReader.h --- a/data/fileio/DecodingWavFileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/DecodingWavFileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -37,16 +37,16 @@ ProgressReporter *reporter = 0); virtual ~DecodingWavFileReader(); - virtual QString getError() const { return m_error; } - virtual QString getLocation() const { return m_source.getLocation(); } + QString getError() const override { return m_error; } + QString getLocation() const override { return m_source.getLocation(); } static void getSupportedExtensions(std::set &extensions); static bool supportsExtension(QString ext); static bool supportsContentType(QString type); static bool supports(FileSource &source); - virtual int getDecodeCompletion() const { return m_completion; } + int getDecodeCompletion() const override { return m_completion; } - virtual bool isUpdating() const { + bool isUpdating() const override { return m_decodeThread && m_decodeThread->isRunning(); } @@ -70,7 +70,7 @@ { public: DecodeThread(DecodingWavFileReader *reader) : m_reader(reader) { } - virtual void run(); + void run() override; protected: DecodingWavFileReader *m_reader; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/FileReadThread.h --- a/data/fileio/FileReadThread.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/FileReadThread.h Mon Nov 26 13:48:45 2018 +0000 @@ -33,7 +33,7 @@ public: FileReadThread(); - virtual void run(); + void run() override; virtual void finish(); struct Request { diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/MIDIFileReader.h --- a/data/fileio/MIDIFileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/MIDIFileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -66,9 +66,9 @@ ProgressReporter *reporter = 0); virtual ~MIDIFileReader(); - virtual bool isOK() const; - virtual QString getError() const; - virtual Model *load() const; + bool isOK() const override; + QString getError() const override; + Model *load() const override; protected: typedef std::vector MIDITrack; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/MP3FileReader.h --- a/data/fileio/MP3FileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/MP3FileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -74,21 +74,21 @@ ProgressReporter *reporter = 0); virtual ~MP3FileReader(); - virtual QString getError() const { return m_error; } + QString getError() const override { return m_error; } - virtual QString getLocation() const { return m_source.getLocation(); } - virtual QString getTitle() const { return m_title; } - virtual QString getMaker() const { return m_maker; } - virtual TagMap getTags() const { return m_tags; } + QString getLocation() const override { return m_source.getLocation(); } + QString getTitle() const override { return m_title; } + QString getMaker() const override { return m_maker; } + TagMap getTags() const override { return m_tags; } static void getSupportedExtensions(std::set &extensions); static bool supportsExtension(QString ext); static bool supportsContentType(QString type); static bool supports(FileSource &source); - virtual int getDecodeCompletion() const { return m_completion; } + int getDecodeCompletion() const override { return m_completion; } - virtual bool isUpdating() const { + bool isUpdating() const override { return m_decodeThread && m_decodeThread->isRunning(); } @@ -144,7 +144,7 @@ { public: DecodeThread(MP3FileReader *reader) : m_reader(reader) { } - virtual void run(); + void run() override; protected: MP3FileReader *m_reader; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/OggVorbisFileReader.h --- a/data/fileio/OggVorbisFileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/OggVorbisFileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -44,21 +44,21 @@ ProgressReporter *reporter = nullptr); virtual ~OggVorbisFileReader(); - virtual QString getError() const { return m_error; } + QString getError() const override { return m_error; } - virtual QString getLocation() const { return m_source.getLocation(); } - virtual QString getTitle() const { return m_title; } - virtual QString getMaker() const { return m_maker; } - virtual TagMap getTags() const { return m_tags; } + QString getLocation() const override { return m_source.getLocation(); } + QString getTitle() const override { return m_title; } + QString getMaker() const override { return m_maker; } + TagMap getTags() const override { return m_tags; } static void getSupportedExtensions(std::set &extensions); static bool supportsExtension(QString ext); static bool supportsContentType(QString type); static bool supports(FileSource &source); - virtual int getDecodeCompletion() const { return m_completion; } + int getDecodeCompletion() const override { return m_completion; } - virtual bool isUpdating() const { + bool isUpdating() const override { return m_decodeThread && m_decodeThread->isRunning(); } @@ -91,7 +91,7 @@ { public: DecodeThread(OggVorbisFileReader *reader) : m_reader(reader) { } - virtual void run(); + void run() override; protected: OggVorbisFileReader *m_reader; diff -r 232d6ddf257d -r c01cbe41aeb5 data/fileio/WavFileReader.h --- a/data/fileio/WavFileReader.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/fileio/WavFileReader.h Mon Nov 26 13:48:45 2018 +0000 @@ -48,28 +48,27 @@ Normalisation normalise = Normalisation::None); virtual ~WavFileReader(); - virtual QString getLocation() const { return m_source.getLocation(); } - virtual QString getError() const { return m_error; } + QString getLocation() const override { return m_source.getLocation(); } + QString getError() const override { return m_error; } - virtual QString getLocalFilename() const { return m_path; } + QString getLocalFilename() const override { return m_path; } - virtual bool isQuicklySeekable() const { return m_seekable; } + bool isQuicklySeekable() const override { return m_seekable; } /** * Must be safe to call from multiple threads with different * arguments on the same object at the same time. */ - virtual floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count) - const; + floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count) const override; static void getSupportedExtensions(std::set &extensions); static bool supportsExtension(QString ext); static bool supportsContentType(QString type); static bool supports(FileSource &source); - virtual int getDecodeCompletion() const { return 100; } + int getDecodeCompletion() const override { return 100; } - bool isUpdating() const { return m_updating; } + bool isUpdating() const override { return m_updating; } void updateFrameCount(); void updateDone(); diff -r 232d6ddf257d -r c01cbe41aeb5 data/midi/MIDIEvent.h --- a/data/midi/MIDIEvent.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/midi/MIDIEvent.h Mon Nov 26 13:48:45 2018 +0000 @@ -226,7 +226,7 @@ } virtual ~MIDIException() throw() { } - virtual const char *what() const throw() { + const char *what() const throw() override { return m_message.toLocal8Bit().data(); } diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/AggregateWaveModel.h --- a/data/model/AggregateWaveModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/AggregateWaveModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -39,41 +39,41 @@ AggregateWaveModel(ChannelSpecList channelSpecs); ~AggregateWaveModel(); - bool isOK() const; - bool isReady(int *) const; + bool isOK() const override; + bool isReady(int *) const override; - QString getTypeName() const { return tr("Aggregate Wave"); } + QString getTypeName() const override { return tr("Aggregate Wave"); } int getComponentCount() const; ModelChannelSpec getComponent(int c) const; - const ZoomConstraint *getZoomConstraint() const { return &m_zoomConstraint; } + const ZoomConstraint *getZoomConstraint() const override { return &m_zoomConstraint; } sv_frame_t getFrameCount() const; - int getChannelCount() const; - sv_samplerate_t getSampleRate() const; + int getChannelCount() const override; + sv_samplerate_t getSampleRate() const override; - float getValueMinimum() const { return -1.0f; } - float getValueMaximum() const { return 1.0f; } + float getValueMinimum() const override { return -1.0f; } + float getValueMaximum() const override { return 1.0f; } - virtual sv_frame_t getStartFrame() const { return 0; } - virtual sv_frame_t getEndFrame() const { return getFrameCount(); } + sv_frame_t getStartFrame() const override { return 0; } + sv_frame_t getEndFrame() const override { return getFrameCount(); } - virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const; + floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const override; - virtual std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const; + std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const override; - virtual int getSummaryBlockSize(int desired) const; + int getSummaryBlockSize(int desired) const override; - virtual void getSummaries(int channel, sv_frame_t start, sv_frame_t count, + void getSummaries(int channel, sv_frame_t start, sv_frame_t count, RangeBlock &ranges, - int &blockSize) const; + int &blockSize) const override; - virtual Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const; + Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const override; - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; signals: void modelChanged(); diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/AlignmentModel.h --- a/data/model/AlignmentModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/AlignmentModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -36,14 +36,14 @@ SparseTimeValueModel *path); // I take ownership ~AlignmentModel(); - virtual bool isOK() const; - virtual sv_frame_t getStartFrame() const; - virtual sv_frame_t getEndFrame() const; - virtual sv_samplerate_t getSampleRate() const; - virtual bool isReady(int *completion = 0) const; - virtual const ZoomConstraint *getZoomConstraint() const; + bool isOK() const override; + sv_frame_t getStartFrame() const override; + sv_frame_t getEndFrame() const override; + sv_samplerate_t getSampleRate() const override; + bool isReady(int *completion = 0) const override; + const ZoomConstraint *getZoomConstraint() const override; - QString getTypeName() const { return tr("Alignment"); } + QString getTypeName() const override { return tr("Alignment"); } const Model *getReferenceModel() const; const Model *getAlignedModel() const; @@ -54,9 +54,9 @@ void setPathFrom(SparseTimeValueModel *rawpath); void setPath(PathModel *path); - virtual void toXml(QTextStream &stream, + void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; signals: void modelChanged(); diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/Dense3DModelPeakCache.h --- a/data/model/Dense3DModelPeakCache.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/Dense3DModelPeakCache.h Mon Nov 26 13:48:45 2018 +0000 @@ -28,23 +28,23 @@ int columnsPerPeak); ~Dense3DModelPeakCache(); - virtual bool isOK() const { + bool isOK() const override { return m_source && m_source->isOK(); } - virtual sv_samplerate_t getSampleRate() const { + sv_samplerate_t getSampleRate() const override { return m_source->getSampleRate(); } - virtual sv_frame_t getStartFrame() const { + sv_frame_t getStartFrame() const override { return m_source->getStartFrame(); } - virtual sv_frame_t getEndFrame() const { + sv_frame_t getEndFrame() const override { return m_source->getEndFrame(); } - virtual int getResolution() const { + int getResolution() const override { return m_source->getResolution() * m_columnsPerPeak; } @@ -52,7 +52,7 @@ return m_columnsPerPeak; } - virtual int getWidth() const { + int getWidth() const override { int sourceWidth = m_source->getWidth(); if ((sourceWidth % m_columnsPerPeak) == 0) { return sourceWidth / m_columnsPerPeak; @@ -61,15 +61,15 @@ } } - virtual int getHeight() const { + int getHeight() const override { return m_source->getHeight(); } - virtual float getMinimumLevel() const { + float getMinimumLevel() const override { return m_source->getMinimumLevel(); } - virtual float getMaximumLevel() const { + float getMaximumLevel() const override { return m_source->getMaximumLevel(); } @@ -79,21 +79,21 @@ * columns (col * getColumnsPerPeak()) to ((col+1) * * getColumnsPerPeak() - 1) inclusive. */ - virtual Column getColumn(int col) const; + Column getColumn(int col) const override; - virtual float getValueAt(int col, int n) const; + float getValueAt(int col, int n) const override; - virtual QString getBinName(int n) const { + QString getBinName(int n) const override { return m_source->getBinName(n); } - virtual bool shouldUseLogValueScale() const { + bool shouldUseLogValueScale() const override { return m_source->shouldUseLogValueScale(); } - QString getTypeName() const { return tr("Dense 3-D Peak Cache"); } + QString getTypeName() const override { return tr("Dense 3-D Peak Cache"); } - virtual int getCompletion() const { + int getCompletion() const override { return m_source->getCompletion(); } diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/DenseThreeDimensionalModel.h --- a/data/model/DenseThreeDimensionalModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/DenseThreeDimensionalModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -118,7 +118,7 @@ return getValueAt(x, y) > threshold; } - QString getTypeName() const { return tr("Dense 3-D"); } + QString getTypeName() const override { return tr("Dense 3-D"); } virtual int getCompletion() const = 0; @@ -129,10 +129,10 @@ "on its side"). */ - virtual int getRowCount() const { return getWidth(); } - virtual int getColumnCount() const { return getHeight() + 2; } + int getRowCount() const override { return getWidth(); } + int getColumnCount() const override { return getHeight() + 2; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -146,8 +146,8 @@ } } - virtual QVariant getData(int row, int column, int) const - { + QVariant getData(int row, int column, int) const + override { switch (column) { case 0: { RealTime rt = RealTime::frame2RealTime @@ -161,17 +161,17 @@ } } - virtual bool isColumnTimeValue(int col) const { + bool isColumnTimeValue(int col) const override { return col < 2; } - virtual SortType getSortType(int) const { + SortType getSortType(int) const override { return SortNumeric; } - virtual sv_frame_t getFrameForRow(int row) const { + sv_frame_t getFrameForRow(int row) const override { return sv_frame_t(row) * getResolution() + getStartFrame(); } - virtual int getRowForFrame(sv_frame_t frame) const { + int getRowForFrame(sv_frame_t frame) const override { return int((frame - getStartFrame()) / getResolution()); } diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/DenseTimeValueModel.h --- a/data/model/DenseTimeValueModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/DenseTimeValueModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -79,14 +79,13 @@ sv_frame_t count) const = 0; - virtual bool canPlay() const { return true; } - virtual QString getDefaultPlayClipId() const { return ""; } + bool canPlay() const override { return true; } + QString getDefaultPlayClipId() const override { return ""; } - virtual QString toDelimitedDataStringSubset(QString delimiter, - sv_frame_t f0, sv_frame_t f1) - const; + QString toDelimitedDataStringSubset(QString delimiter, + sv_frame_t f0, sv_frame_t f1) const override; - QString getTypeName() const { return tr("Dense Time-Value"); } + QString getTypeName() const override { return tr("Dense Time-Value"); } }; #endif diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/EditableDenseThreeDimensionalModel.h --- a/data/model/EditableDenseThreeDimensionalModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/EditableDenseThreeDimensionalModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -48,11 +48,11 @@ CompressionType compression, bool notifyOnAdd = true); - virtual bool isOK() const; + bool isOK() const override; - virtual sv_samplerate_t getSampleRate() const; - virtual sv_frame_t getStartFrame() const; - virtual sv_frame_t getEndFrame() const; + sv_samplerate_t getSampleRate() const override; + sv_frame_t getStartFrame() const override; + sv_frame_t getEndFrame() const override; /** * Set the frame offset of the first column. @@ -62,7 +62,7 @@ /** * Return the number of sample frames covered by each set of bins. */ - virtual int getResolution() const; + int getResolution() const override; /** * Set the number of sample frames covered by each set of bins. @@ -72,12 +72,12 @@ /** * Return the number of columns. */ - virtual int getWidth() const; + int getWidth() const override; /** * Return the number of bins in each column. */ - virtual int getHeight() const; + int getHeight() const override; /** * Set the number of bins in each column. @@ -94,7 +94,7 @@ /** * Return the minimum value of the value in each bin. */ - virtual float getMinimumLevel() const; + float getMinimumLevel() const override; /** * Set the minimum value of the value in a bin. @@ -104,7 +104,7 @@ /** * Return the maximum value of the value in each bin. */ - virtual float getMaximumLevel() const; + float getMaximumLevel() const override; /** * Set the maximum value of the value in a bin. @@ -114,12 +114,12 @@ /** * Get the set of bin values at the given column. */ - virtual Column getColumn(int x) const; + Column getColumn(int x) const override; /** * Get a single value, from the n'th bin of the given column. */ - virtual float getValueAt(int x, int n) const; + float getValueAt(int x, int n) const override; /** * Set the entire set of bin values at the given column. @@ -130,7 +130,7 @@ * Return the name of bin n. This is a single label per bin that * does not vary from one column to the next. */ - virtual QString getBinName(int n) const; + QString getBinName(int n) const override; /** * Set the name of bin n. @@ -148,14 +148,14 @@ * numbers from them.) If this returns true, getBinValue() may be * used to retrieve the values. */ - virtual bool hasBinValues() const; + bool hasBinValues() const override; /** * Return the value of bin n, if any. This is a "vertical scale" * value which does not vary from one column to the next. This is * only meaningful if hasBinValues() returns true. */ - virtual float getBinValue(int n) const; + float getBinValue(int n) const override; /** * Set the values of all bins (separate from their labels). These @@ -168,7 +168,7 @@ * Obtain the name of the unit of the values returned from * getBinValue(), if any. */ - virtual QString getBinValueUnit() const; + QString getBinValueUnit() const override; /** * Set the name of the unit of the values return from @@ -181,19 +181,19 @@ * as to suggest a log scale (mapping to colour etc) may be better * than a linear one. */ - bool shouldUseLogValueScale() const; + bool shouldUseLogValueScale() const override; virtual void setCompletion(int completion, bool update = true); - virtual int getCompletion() const { return m_completion; } + int getCompletion() const override { return m_completion; } - QString getTypeName() const { return tr("Editable Dense 3-D"); } + QString getTypeName() const override { return tr("Editable Dense 3-D"); } - virtual QString toDelimitedDataString(QString delimiter) const; - virtual QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const; + QString toDelimitedDataString(QString delimiter) const override; + QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const override; - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; protected: typedef std::vector ValueMatrix; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/FFTModel.h --- a/data/model/FFTModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/FFTModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -60,26 +60,26 @@ // DenseThreeDimensionalModel and Model methods: // - virtual int getWidth() const; - virtual int getHeight() const; - virtual float getValueAt(int x, int y) const { return getMagnitudeAt(x, y); } - virtual bool isOK() const { return m_model && m_model->isOK(); } - virtual sv_frame_t getStartFrame() const { return 0; } - virtual sv_frame_t getEndFrame() const { + int getWidth() const override; + int getHeight() const override; + float getValueAt(int x, int y) const override { return getMagnitudeAt(x, y); } + bool isOK() const override { return m_model && m_model->isOK(); } + sv_frame_t getStartFrame() const override { return 0; } + sv_frame_t getEndFrame() const override { return sv_frame_t(getWidth()) * getResolution() + getResolution(); } - virtual sv_samplerate_t getSampleRate() const { + sv_samplerate_t getSampleRate() const override { return isOK() ? m_model->getSampleRate() : 0; } - virtual int getResolution() const { return m_windowIncrement; } + int getResolution() const override { return m_windowIncrement; } virtual int getYBinCount() const { return getHeight(); } - virtual float getMinimumLevel() const { return 0.f; } // Can't provide - virtual float getMaximumLevel() const { return 1.f; } // Can't provide - virtual Column getColumn(int x) const; // magnitudes + float getMinimumLevel() const override { return 0.f; } // Can't provide + float getMaximumLevel() const override { return 1.f; } // Can't provide + Column getColumn(int x) const override; // magnitudes virtual Column getPhases(int x) const; - virtual QString getBinName(int n) const; - virtual bool shouldUseLogValueScale() const { return true; } - virtual int getCompletion() const { + QString getBinName(int n) const override; + bool shouldUseLogValueScale() const override { return true; } + int getCompletion() const override { int c = 100; if (m_model) { if (m_model->isReady(&c)) return 100; @@ -137,7 +137,7 @@ virtual PeakSet getPeakFrequencies(PeakPickType type, int x, int ymin = 0, int ymax = 0) const; - QString getTypeName() const { return tr("FFT"); } + QString getTypeName() const override { return tr("FFT"); } public slots: void sourceModelAboutToBeDeleted(); diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/FlexiNoteModel.h --- a/data/model/FlexiNoteModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/FlexiNoteModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -130,21 +130,21 @@ float getValueQuantization() const { return m_valueQuantization; } void setValueQuantization(float q) { m_valueQuantization = q; } - float getValueMinimum() const { return 33; } - float getValueMaximum() const { return 88; } + float getValueMinimum() const override { return 33; } + float getValueMaximum() const override { return 88; } - QString getTypeName() const { return tr("FlexiNote"); } + QString getTypeName() const override { return tr("FlexiNote"); } - virtual bool canPlay() const { return true; } + bool canPlay() const override { return true; } - virtual QString getDefaultPlayClipId() const + QString getDefaultPlayClipId() const override { return "elecpiano"; } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { std::cerr << "FlexiNoteModel::toXml: extraAttributes = \"" << extraAttributes.toStdString() << std::endl; @@ -160,12 +160,12 @@ * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 6; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -178,7 +178,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 4) { return IntervalModel::getData(row, column, role); @@ -194,7 +194,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 4) { return IntervalModel::getSetDataCommand @@ -218,7 +218,7 @@ return command->finish(); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column == 5) return SortAlphabetical; return SortNumeric; @@ -229,12 +229,12 @@ */ NoteList getNotes() const - { + override { return getNotesWithin(getStartFrame(), getEndFrame()); } NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const - { + override { PointList points = getPoints(startFrame, endFrame); NoteList notes; for (PointList::iterator pli = points.begin(); pli != points.end(); ++pli) { diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/ImageModel.h --- a/data/model/ImageModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/ImageModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -45,7 +45,7 @@ void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { stream << QString("%1\n") @@ -93,11 +93,11 @@ SparseModel(sampleRate, resolution, notifyOnAdd) { } - QString getTypeName() const { return tr("Image"); } + QString getTypeName() const override { return tr("Image"); } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { SparseModel::toXml (out, @@ -121,15 +121,15 @@ m_newPoint.label = newLabel; } - virtual QString getName() const { return tr("Edit Image"); } + QString getName() const override { return tr("Edit Image"); } - virtual void execute() { + void execute() override { m_model->deletePoint(m_oldPoint); m_model->addPoint(m_newPoint); std::swap(m_oldPoint, m_newPoint); } - virtual void unexecute() { execute(); } + void unexecute() override { execute(); } private: ImageModel *m_model; @@ -141,12 +141,12 @@ * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 4; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -157,7 +157,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 2) { return SparseModel::getData @@ -174,7 +174,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 2) { return SparseModel::getSetDataCommand @@ -198,12 +198,12 @@ return command->finish(); } - virtual bool isColumnTimeValue(int column) const + bool isColumnTimeValue(int column) const override { return (column < 2); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column > 2) return SortAlphabetical; return SortNumeric; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/IntervalModel.h --- a/data/model/IntervalModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/IntervalModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -57,7 +57,7 @@ */ virtual typename SparseValueModel::PointList getPoints(sv_frame_t frame) const; - virtual const typename SparseModel::PointList &getPoints() const { + const typename SparseModel::PointList &getPoints() const override { return SparseModel::getPoints(); } @@ -65,7 +65,7 @@ * TabularModel methods. */ - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 2) { return SparseValueModel::getData @@ -86,7 +86,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { typedef IntervalModel I; @@ -115,7 +115,7 @@ return command->finish(); } - virtual bool isColumnTimeValue(int column) const + bool isColumnTimeValue(int column) const override { // NB duration is not a "time value" -- that's for columns // whose sort ordering is exactly that of the frame time diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/Model.h --- a/data/model/Model.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/Model.h Mon Nov 26 13:48:45 2018 +0000 @@ -232,9 +232,9 @@ */ QString getRDFTypeURI() const { return m_typeUri; } - virtual void toXml(QTextStream &stream, + void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; virtual QString toDelimitedDataString(QString delimiter) const { return toDelimitedDataStringSubset diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/ModelDataTableModel.h --- a/data/model/ModelDataTableModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/ModelDataTableModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -33,30 +33,30 @@ ModelDataTableModel(TabularModel *m); virtual ~ModelDataTableModel(); - QVariant data(const QModelIndex &index, int role) const; + QVariant data(const QModelIndex &index, int role) const override; - bool setData(const QModelIndex &index, const QVariant &value, int role); + bool setData(const QModelIndex &index, const QVariant &value, int role) override; bool insertRow(int row, const QModelIndex &parent = QModelIndex()); bool removeRow(int row, const QModelIndex &parent = QModelIndex()); - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; + const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &index) const; + QModelIndex parent(const QModelIndex &index) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; QModelIndex getModelIndexForFrame(sv_frame_t frame) const; sv_frame_t getFrameForModelIndex(const QModelIndex &) const; - void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; QModelIndex findText(QString text) const; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/NoteModel.h --- a/data/model/NoteModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/NoteModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -126,18 +126,18 @@ float getValueQuantization() const { return m_valueQuantization; } void setValueQuantization(float q) { m_valueQuantization = q; } - QString getTypeName() const { return tr("Note"); } + QString getTypeName() const override { return tr("Note"); } - virtual bool canPlay() const { return true; } + bool canPlay() const override { return true; } - virtual QString getDefaultPlayClipId() const + QString getDefaultPlayClipId() const override { return "elecpiano"; } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { std::cerr << "NoteModel::toXml: extraAttributes = \"" << extraAttributes.toStdString() << std::endl; @@ -153,12 +153,12 @@ * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 6; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -171,7 +171,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 4) { return IntervalModel::getData(row, column, role); @@ -187,7 +187,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 4) { return IntervalModel::getSetDataCommand @@ -211,7 +211,7 @@ return command->finish(); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column == 5) return SortAlphabetical; return SortNumeric; @@ -221,11 +221,11 @@ * NoteExportable methods. */ - NoteList getNotes() const { + NoteList getNotes() const override { return getNotesWithin(getStartFrame(), getEndFrame()); } - NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const { + NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const override { PointList points = getPoints(startFrame, endFrame); NoteList notes; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/PathModel.h --- a/data/model/PathModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/PathModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -71,9 +71,9 @@ PathModel(sv_samplerate_t sampleRate, int resolution, bool notify = true) : SparseModel(sampleRate, resolution, notify) { } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { SparseModel::toXml (out, @@ -85,9 +85,9 @@ /** * TabularModel is inherited via SparseModel, but we don't need it here. */ - virtual QString getHeading(int) const { return ""; } - virtual bool isColumnTimeValue(int) const { return false; } - virtual SortType getSortType(int) const { return SortNumeric; } + QString getHeading(int) const override { return ""; } + bool isColumnTimeValue(int) const override { return false; } + SortType getSortType(int) const override { return SortNumeric; } }; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/RangeSummarisableTimeValueModel.h --- a/data/model/RangeSummarisableTimeValueModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/RangeSummarisableTimeValueModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -98,7 +98,7 @@ virtual int getSummaryBlockSize(int desired) const = 0; - QString getTypeName() const { return tr("Range-Summarisable Time-Value"); } + QString getTypeName() const override { return tr("Range-Summarisable Time-Value"); } }; #endif diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/ReadOnlyWaveFileModel.h --- a/data/model/ReadOnlyWaveFileModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/ReadOnlyWaveFileModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -52,47 +52,47 @@ ~ReadOnlyWaveFileModel(); - bool isOK() const; - bool isReady(int *) const; + bool isOK() const override; + bool isReady(int *) const override; - const ZoomConstraint *getZoomConstraint() const { return &m_zoomConstraint; } + const ZoomConstraint *getZoomConstraint() const override { return &m_zoomConstraint; } - sv_frame_t getFrameCount() const; - int getChannelCount() const; - sv_samplerate_t getSampleRate() const; - sv_samplerate_t getNativeRate() const; + sv_frame_t getFrameCount() const override; + int getChannelCount() const override; + sv_samplerate_t getSampleRate() const override; + sv_samplerate_t getNativeRate() const override; - QString getTitle() const; - QString getMaker() const; - QString getLocation() const; + QString getTitle() const override; + QString getMaker() const override; + QString getLocation() const override; QString getLocalFilename() const; - float getValueMinimum() const { return -1.0f; } - float getValueMaximum() const { return 1.0f; } + float getValueMinimum() const override { return -1.0f; } + float getValueMaximum() const override { return 1.0f; } - virtual sv_frame_t getStartFrame() const { return m_startFrame; } - virtual sv_frame_t getEndFrame() const { return m_startFrame + getFrameCount(); } + sv_frame_t getStartFrame() const override { return m_startFrame; } + sv_frame_t getEndFrame() const override { return m_startFrame + getFrameCount(); } - void setStartFrame(sv_frame_t startFrame) { m_startFrame = startFrame; } + void setStartFrame(sv_frame_t startFrame) override { m_startFrame = startFrame; } - virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const; + floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const override; - virtual std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const; + std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const override; - virtual int getSummaryBlockSize(int desired) const; + int getSummaryBlockSize(int desired) const override; - virtual void getSummaries(int channel, sv_frame_t start, sv_frame_t count, + void getSummaries(int channel, sv_frame_t start, sv_frame_t count, RangeBlock &ranges, - int &blockSize) const; + int &blockSize) const override; - virtual Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const; + Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const override; - QString getTypeName() const { return tr("Wave File"); } + QString getTypeName() const override { return tr("Wave File"); } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; protected slots: void fillTimerTimedOut(); @@ -109,7 +109,7 @@ m_frameCount(model.getFrameCount()) { } sv_frame_t getFillExtent() const { return m_fillExtent; } - virtual void run(); + void run() override; protected: ReadOnlyWaveFileModel &m_model; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/RegionModel.h --- a/data/model/RegionModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/RegionModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -122,11 +122,11 @@ bool haveDistinctValues() const { return m_haveDistinctValues; } - QString getTypeName() const { return tr("Region"); } + QString getTypeName() const override { return tr("Region"); } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { std::cerr << "RegionModel::toXml: extraAttributes = \"" << extraAttributes.toStdString() << std::endl; @@ -142,12 +142,12 @@ * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 5; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -159,7 +159,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 4) { return IntervalModel::getData(row, column, role); @@ -174,7 +174,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 4) { return IntervalModel::getSetDataCommand @@ -197,13 +197,13 @@ return command->finish(); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column == 4) return SortAlphabetical; return SortNumeric; } - virtual void addPoint(const Point &point) + void addPoint(const Point &point) override { if (point.value != 0.f) m_haveDistinctValues = true; IntervalModel::addPoint(point); diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/SparseModel.h --- a/data/model/SparseModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/SparseModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -55,10 +55,10 @@ bool notifyOnAdd = true); virtual ~SparseModel() { } - virtual bool isOK() const { return true; } + bool isOK() const override { return true; } virtual sv_frame_t getStartFrame() const; virtual sv_frame_t getEndFrame() const; - virtual sv_samplerate_t getSampleRate() const { return m_sampleRate; } + sv_samplerate_t getSampleRate() const override { return m_sampleRate; } // Number of frames of the underlying sample rate that this model // is capable of resolving to. For example, if m_resolution == 10 @@ -147,7 +147,7 @@ */ virtual bool containsPoint(const PointType &point); - virtual bool isReady(int *completion = 0) const { + bool isReady(int *completion = 0) const override { bool ready = isOK() && (m_completion == 100); if (completion) *completion = m_completion; return ready; @@ -158,9 +158,9 @@ virtual bool hasTextLabels() const { return m_hasTextLabels; } - virtual bool isSparse() const { return true; } + bool isSparse() const override { return true; } - QString getTypeName() const { return tr("Sparse"); } + QString getTypeName() const override { return tr("Sparse"); } virtual QString getXmlOutputType() const { return "sparse"; } @@ -168,24 +168,24 @@ QString indent = "", QString extraAttributes = "") const; - virtual QString toDelimitedDataString(QString delimiter) const { + QString toDelimitedDataString(QString delimiter) const override { return toDelimitedDataStringWithOptions (delimiter, DataExportDefaults); } - virtual QString toDelimitedDataStringWithOptions(QString delimiter, - DataExportOptions opts) const { + QString toDelimitedDataStringWithOptions(QString delimiter, + DataExportOptions opts) const override { return toDelimitedDataStringSubsetWithOptions (delimiter, opts, std::min(getStartFrame(), sv_frame_t(0)), getEndFrame()); } - virtual QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const { + QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const override { return toDelimitedDataStringSubsetWithOptions (delimiter, DataExportDefaults, f0, f1); } - virtual QString toDelimitedDataStringSubsetWithOptions(QString delimiter, DataExportOptions opts, sv_frame_t f0, sv_frame_t f1) const { + QString toDelimitedDataStringSubsetWithOptions(QString delimiter, DataExportOptions opts, sv_frame_t f0, sv_frame_t f1) const override { if (opts & DataExportFillGaps) { return toDelimitedDataStringSubsetFilled(delimiter, opts, f0, f1); } else { @@ -210,12 +210,12 @@ QString name = "") : m_model(model), m_point(point), m_name(name) { } - virtual QString getName() const { + QString getName() const override { return (m_name == "" ? tr("Add Point") : m_name); } - virtual void execute() { m_model->addPoint(m_point); } - virtual void unexecute() { m_model->deletePoint(m_point); } + void execute() override { m_model->addPoint(m_point); } + void unexecute() override { m_model->deletePoint(m_point); } const PointType &getPoint() const { return m_point; } @@ -236,10 +236,10 @@ const PointType &point) : m_model(model), m_point(point) { } - virtual QString getName() const { return tr("Delete Point"); } + QString getName() const override { return tr("Delete Point"); } - virtual void execute() { m_model->deletePoint(m_point); } - virtual void unexecute() { m_model->addPoint(m_point); } + void execute() override { m_model->deletePoint(m_point); } + void unexecute() override { m_model->addPoint(m_point); } const PointType &getPoint() const { return m_point; } @@ -264,7 +264,7 @@ /** * Stack an arbitrary other command in the same sequence. */ - virtual void addCommand(Command *command) { addCommand(command, true); } + void addCommand(Command *command) override { addCommand(command, true); } /** * If any points have been added or deleted, return this @@ -293,15 +293,15 @@ m_newPoint.label = newLabel; } - virtual QString getName() const { return tr("Re-Label Point"); } + QString getName() const override { return tr("Re-Label Point"); } - virtual void execute() { + void execute() override { m_model->deletePoint(m_oldPoint); m_model->addPoint(m_newPoint); std::swap(m_oldPoint, m_newPoint); } - virtual void unexecute() { execute(); } + void unexecute() override { execute(); } private: SparseModel *m_model; @@ -313,19 +313,19 @@ * TabularModel methods. */ - virtual int getRowCount() const + int getRowCount() const override { return int(m_points.size()); } - virtual sv_frame_t getFrameForRow(int row) const + sv_frame_t getFrameForRow(int row) const override { PointListConstIterator i = getPointListIteratorForRow(row); if (i == m_points.end()) return 0; return i->frame; } - virtual int getRowForFrame(sv_frame_t frame) const + int getRowForFrame(sv_frame_t frame) const override { if (m_rows.empty()) rebuildRowVector(); std::vector::iterator i = @@ -337,8 +337,8 @@ return int(row); } - virtual int getColumnCount() const { return 1; } - virtual QVariant getData(int row, int column, int role) const + int getColumnCount() const override { return 1; } + QVariant getData(int row, int column, int role) const override { PointListConstIterator i = getPointListIteratorForRow(row); if (i == m_points.end()) { @@ -361,8 +361,8 @@ return QVariant(); } - virtual Command *getSetDataCommand(int row, int column, - const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, + const QVariant &value, int role) override { if (role != Qt::EditRole) return 0; PointListIterator i = getPointListIteratorForRow(row); @@ -381,7 +381,7 @@ return command->finish(); } - virtual Command *getInsertRowCommand(int row) + Command *getInsertRowCommand(int row) override { EditCommand *command = new EditCommand(this, tr("Insert Data Point")); Point point(0); @@ -392,7 +392,7 @@ return command->finish(); } - virtual Command *getRemoveRowCommand(int row) + Command *getRemoveRowCommand(int row) override { PointListIterator i = getPointListIteratorForRow(row); if (i == m_points.end()) return 0; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/SparseOneDimensionalModel.h --- a/data/model/SparseOneDimensionalModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/SparseOneDimensionalModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -88,9 +88,9 @@ PlayParameterRepository::getInstance()->removePlayable(this); } - virtual bool canPlay() const { return true; } + bool canPlay() const override { return true; } - virtual QString getDefaultPlayClipId() const + QString getDefaultPlayClipId() const override { return "tap"; } @@ -107,18 +107,18 @@ return -1; } - QString getTypeName() const { return tr("Sparse 1-D"); } + QString getTypeName() const override { return tr("Sparse 1-D"); } /** * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 3; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -128,7 +128,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 2) { return SparseModel::getData @@ -144,7 +144,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 2) { return SparseModel::getSetDataCommand @@ -168,12 +168,12 @@ } - virtual bool isColumnTimeValue(int column) const + bool isColumnTimeValue(int column) const override { return (column < 2); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column == 2) return SortAlphabetical; return SortNumeric; @@ -183,11 +183,11 @@ * NoteExportable methods. */ - NoteList getNotes() const { + NoteList getNotes() const override { return getNotesWithin(getStartFrame(), getEndFrame()); } - NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const { + NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const override { PointList points = getPoints(startFrame, endFrame); NoteList notes; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/SparseTimeValueModel.h --- a/data/model/SparseTimeValueModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/SparseTimeValueModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -108,21 +108,21 @@ PlayParameterRepository::getInstance()->removePlayable(this); } - QString getTypeName() const { return tr("Sparse Time-Value"); } + QString getTypeName() const override { return tr("Sparse Time-Value"); } - virtual bool canPlay() const { return true; } - virtual bool getDefaultPlayAudible() const { return false; } // user must unmute + bool canPlay() const override { return true; } + bool getDefaultPlayAudible() const override { return false; } // user must unmute /** * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 4; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -133,7 +133,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 2) { return SparseValueModel::getData @@ -152,7 +152,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 2) { return SparseValueModel::getSetDataCommand @@ -176,12 +176,12 @@ return command->finish(); } - virtual bool isColumnTimeValue(int column) const + bool isColumnTimeValue(int column) const override { return (column < 2); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column == 3) return SortAlphabetical; return SortNumeric; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/SparseValueModel.h --- a/data/model/SparseValueModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/SparseValueModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -53,7 +53,7 @@ using SparseModel::getPoints; using SparseModel::tr; - QString getTypeName() const { return tr("Sparse Value"); } + QString getTypeName() const override { return tr("Sparse Value"); } virtual float getValueMinimum() const { return m_valueMinimum; } virtual float getValueMaximum() const { return m_valueMaximum; } @@ -64,7 +64,7 @@ UnitDatabase::getInstance()->registerUnit(units); } - virtual void addPoint(const PointType &point) + void addPoint(const PointType &point) override { bool allChange = false; @@ -84,7 +84,7 @@ if (allChange) emit modelChanged(); } - virtual void deletePoint(const PointType &point) + void deletePoint(const PointType &point) override { SparseModel::deletePoint(point); @@ -113,9 +113,9 @@ } } - virtual void toXml(QTextStream &stream, + void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { std::cerr << "SparseValueModel::toXml: extraAttributes = \"" << extraAttributes.toStdString() << std::endl; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/TextModel.h --- a/data/model/TextModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/TextModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -44,7 +44,7 @@ QString getLabel() const { return label; } void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { stream << QString("%1\n") .arg(indent).arg(frame).arg(height) @@ -89,9 +89,9 @@ SparseModel(sampleRate, resolution, notifyOnAdd) { } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const + QString extraAttributes = "") const override { SparseModel::toXml (out, @@ -100,18 +100,18 @@ .arg(extraAttributes)); } - QString getTypeName() const { return tr("Text"); } + QString getTypeName() const override { return tr("Text"); } /** * TabularModel methods. */ - virtual int getColumnCount() const + int getColumnCount() const override { return 4; } - virtual QString getHeading(int column) const + QString getHeading(int column) const override { switch (column) { case 0: return tr("Time"); @@ -122,7 +122,7 @@ } } - virtual QVariant getData(int row, int column, int role) const + QVariant getData(int row, int column, int role) const override { if (column < 2) { return SparseModel::getData @@ -139,7 +139,7 @@ } } - virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) + Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override { if (column < 2) { return SparseModel::getSetDataCommand @@ -163,12 +163,12 @@ return command->finish(); } - virtual bool isColumnTimeValue(int column) const + bool isColumnTimeValue(int column) const override { return (column < 2); } - virtual SortType getSortType(int column) const + SortType getSortType(int column) const override { if (column == 3) return SortAlphabetical; return SortNumeric; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/WaveFileModel.h --- a/data/model/WaveFileModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/WaveFileModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -28,16 +28,16 @@ virtual ~WaveFileModel(); virtual sv_frame_t getFrameCount() const = 0; - virtual int getChannelCount() const = 0; - virtual sv_samplerate_t getSampleRate() const = 0; - virtual sv_samplerate_t getNativeRate() const = 0; + int getChannelCount() const override = 0; + sv_samplerate_t getSampleRate() const override = 0; + sv_samplerate_t getNativeRate() const override = 0; - virtual QString getTitle() const = 0; - virtual QString getMaker() const = 0; - virtual QString getLocation() const = 0; + QString getTitle() const override = 0; + QString getMaker() const override = 0; + QString getLocation() const override = 0; - virtual sv_frame_t getStartFrame() const = 0; - virtual sv_frame_t getEndFrame() const = 0; + sv_frame_t getStartFrame() const override = 0; + sv_frame_t getEndFrame() const override = 0; virtual void setStartFrame(sv_frame_t startFrame) = 0; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/WritableWaveFileModel.h --- a/data/model/WritableWaveFileModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/WritableWaveFileModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -138,8 +138,8 @@ */ int getWriteProportion() const; - bool isOK() const; - bool isReady(int *) const; + bool isOK() const override; + bool isReady(int *) const override; /** * Return the generation completion percentage of this model. This @@ -149,53 +149,53 @@ */ virtual int getCompletion() const { return 100; } - const ZoomConstraint *getZoomConstraint() const { + const ZoomConstraint *getZoomConstraint() const override { static PowerOfSqrtTwoZoomConstraint zc; return &zc; } - sv_frame_t getFrameCount() const; - int getChannelCount() const { return m_channels; } - sv_samplerate_t getSampleRate() const { return m_sampleRate; } - sv_samplerate_t getNativeRate() const { return m_sampleRate; } + sv_frame_t getFrameCount() const override; + int getChannelCount() const override { return m_channels; } + sv_samplerate_t getSampleRate() const override { return m_sampleRate; } + sv_samplerate_t getNativeRate() const override { return m_sampleRate; } - QString getTitle() const { + QString getTitle() const override { if (m_model) return m_model->getTitle(); else return ""; } - QString getMaker() const { + QString getMaker() const override { if (m_model) return m_model->getMaker(); else return ""; } - QString getLocation() const { + QString getLocation() const override { if (m_model) return m_model->getLocation(); else return ""; } - float getValueMinimum() const { return -1.0f; } - float getValueMaximum() const { return 1.0f; } + float getValueMinimum() const override { return -1.0f; } + float getValueMaximum() const override { return 1.0f; } - virtual sv_frame_t getStartFrame() const { return m_startFrame; } - virtual sv_frame_t getEndFrame() const { return m_startFrame + getFrameCount(); } + sv_frame_t getStartFrame() const override { return m_startFrame; } + sv_frame_t getEndFrame() const override { return m_startFrame + getFrameCount(); } - void setStartFrame(sv_frame_t startFrame); + void setStartFrame(sv_frame_t startFrame) override; - virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const; + floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const override; - virtual std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const; + std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const override; - virtual int getSummaryBlockSize(int desired) const; + int getSummaryBlockSize(int desired) const override; - virtual void getSummaries(int channel, sv_frame_t start, sv_frame_t count, - RangeBlock &ranges, int &blockSize) const; + void getSummaries(int channel, sv_frame_t start, sv_frame_t count, + RangeBlock &ranges, int &blockSize) const override; - virtual Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const; + Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const override; - QString getTypeName() const { return tr("Writable Wave File"); } + QString getTypeName() const override { return tr("Writable Wave File"); } - virtual void toXml(QTextStream &out, + void toXml(QTextStream &out, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; protected: ReadOnlyWaveFileModel *m_model; diff -r 232d6ddf257d -r c01cbe41aeb5 data/model/test/MockWaveModel.h --- a/data/model/test/MockWaveModel.h Thu Nov 22 14:55:18 2018 +0000 +++ b/data/model/test/MockWaveModel.h Mon Nov 26 13:48:45 2018 +0000 @@ -37,22 +37,22 @@ * to "pad" number of zero samples at the start and end */ MockWaveModel(std::vector sorts, int length, int pad); - virtual float getValueMinimum() const { return -1.f; } - virtual float getValueMaximum() const { return 1.f; } - virtual int getChannelCount() const { return int(m_data.size()); } + float getValueMinimum() const override { return -1.f; } + float getValueMaximum() const override { return 1.f; } + int getChannelCount() const override { return int(m_data.size()); } - virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const; - virtual std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const; + floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const override; + std::vector getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const override; - virtual bool canPlay() const { return true; } - virtual QString getDefaultPlayClipId() const { return ""; } + bool canPlay() const override { return true; } + QString getDefaultPlayClipId() const override { return ""; } - virtual sv_frame_t getStartFrame() const { return 0; } - virtual sv_frame_t getEndFrame() const { return m_data[0].size(); } - virtual sv_samplerate_t getSampleRate() const { return 44100; } - virtual bool isOK() const { return true; } + sv_frame_t getStartFrame() const override { return 0; } + sv_frame_t getEndFrame() const override { return m_data[0].size(); } + sv_samplerate_t getSampleRate() const override { return 44100; } + bool isOK() const override { return true; } - QString getTypeName() const { return tr("Mock Wave"); } + QString getTypeName() const override { return tr("Mock Wave"); } private: std::vector > m_data; diff -r 232d6ddf257d -r c01cbe41aeb5 plugin/DSSIPluginFactory.h --- a/plugin/DSSIPluginFactory.h Thu Nov 22 14:55:18 2018 +0000 +++ b/plugin/DSSIPluginFactory.h Mon Nov 26 13:48:45 2018 +0000 @@ -35,14 +35,14 @@ public: virtual ~DSSIPluginFactory(); - virtual void enumeratePlugins(std::vector &list); + void enumeratePlugins(std::vector &list) override; - virtual RealTimePluginInstance *instantiatePlugin(QString identifier, + RealTimePluginInstance *instantiatePlugin(QString identifier, int clientId, int position, sv_samplerate_t sampleRate, int blockSize, - int channels); + int channels) override; static std::vector getPluginPath(); @@ -50,15 +50,15 @@ DSSIPluginFactory(); friend class RealTimePluginFactory; - virtual PluginScan::PluginType getPluginType() const { + PluginScan::PluginType getPluginType() const override { return PluginScan::DSSIPlugin; } - virtual std::vector getLRDFPath(QString &baseUri); + std::vector getLRDFPath(QString &baseUri) override; - virtual void discoverPluginsFrom(QString soName); + void discoverPluginsFrom(QString soName) override; - virtual const LADSPA_Descriptor *getLADSPADescriptor(QString identifier); + const LADSPA_Descriptor *getLADSPADescriptor(QString identifier) override; virtual const DSSI_Descriptor *getDSSIDescriptor(QString identifier); DSSI_Host_Descriptor m_hostDescriptor; diff -r 232d6ddf257d -r c01cbe41aeb5 plugin/DSSIPluginInstance.h --- a/plugin/DSSIPluginInstance.h Thu Nov 22 14:55:18 2018 +0000 +++ b/plugin/DSSIPluginInstance.h Mon Nov 26 13:48:45 2018 +0000 @@ -41,64 +41,64 @@ public: virtual ~DSSIPluginInstance(); - virtual bool isOK() const { return m_instanceHandle != 0; } + bool isOK() const override { return m_instanceHandle != 0; } int getClientId() const { return m_client; } - virtual QString getPluginIdentifier() const { return m_identifier; } + QString getPluginIdentifier() const override { return m_identifier; } int getPosition() const { return m_position; } - virtual std::string getIdentifier() const; - virtual std::string getName() const; - virtual std::string getDescription() const; - virtual std::string getMaker() const; - virtual int getPluginVersion() const; - virtual std::string getCopyright() const; + std::string getIdentifier() const override; + std::string getName() const override; + std::string getDescription() const override; + std::string getMaker() const override; + int getPluginVersion() const override; + std::string getCopyright() const override; - virtual void run(const RealTime &, int count = 0); + void run(const RealTime &, int count = 0) override; - virtual int getParameterCount() const; - virtual void setParameterValue(int parameter, float value); - virtual float getParameterValue(int parameter) const; - virtual float getParameterDefault(int parameter) const; - virtual int getParameterDisplayHint(int parameter) const; + int getParameterCount() const override; + void setParameterValue(int parameter, float value) override; + float getParameterValue(int parameter) const override; + float getParameterDefault(int parameter) const override; + int getParameterDisplayHint(int parameter) const override; - virtual ParameterList getParameterDescriptors() const; - virtual float getParameter(std::string) const; - virtual void setParameter(std::string, float); + ParameterList getParameterDescriptors() const override; + float getParameter(std::string) const override; + void setParameter(std::string, float) override; - virtual std::string configure(std::string key, std::string value); - virtual void sendEvent(const RealTime &eventTime, - const void *event); - virtual void clearEvents(); + std::string configure(std::string key, std::string value) override; + void sendEvent(const RealTime &eventTime, + const void *event) override; + void clearEvents() override; - virtual int getBufferSize() const { return m_blockSize; } - virtual int getAudioInputCount() const { return (int)m_audioPortsIn.size(); } - virtual int getAudioOutputCount() const { return m_idealChannelCount; } - virtual sample_t **getAudioInputBuffers() { return m_inputBuffers; } - virtual sample_t **getAudioOutputBuffers() { return m_outputBuffers; } + int getBufferSize() const override { return m_blockSize; } + int getAudioInputCount() const override { return (int)m_audioPortsIn.size(); } + int getAudioOutputCount() const override { return m_idealChannelCount; } + sample_t **getAudioInputBuffers() override { return m_inputBuffers; } + sample_t **getAudioOutputBuffers() override { return m_outputBuffers; } - virtual int getControlOutputCount() const { return (int)m_controlPortsOut.size(); } - virtual float getControlOutputValue(int n) const; + int getControlOutputCount() const override { return (int)m_controlPortsOut.size(); } + float getControlOutputValue(int n) const override; - virtual ProgramList getPrograms() const; - virtual std::string getCurrentProgram() const; - virtual std::string getProgram(int bank, int program) const; + ProgramList getPrograms() const override; + std::string getCurrentProgram() const override; + std::string getProgram(int bank, int program) const override; virtual int getProgram(std::string name) const; - virtual void selectProgram(std::string program); + void selectProgram(std::string program) override; - virtual bool isBypassed() const { return m_bypassed; } - virtual void setBypassed(bool bypassed) { m_bypassed = bypassed; } + bool isBypassed() const override { return m_bypassed; } + void setBypassed(bool bypassed) override { m_bypassed = bypassed; } - virtual sv_frame_t getLatency(); + sv_frame_t getLatency() override; - virtual void silence(); - virtual void discardEvents(); - virtual void setIdealChannelCount(int channels); // may re-instantiate + void silence() override; + void discardEvents() override; + void setIdealChannelCount(int channels) override; // may re-instantiate virtual bool isInGroup() const { return m_grouped; } virtual void detachFromGroup(); - virtual std::string getType() const { return "DSSI Real-Time Plugin"; } + std::string getType() const override { return "DSSI Real-Time Plugin"; } protected: // To be constructed only by DSSIPluginFactory @@ -209,7 +209,7 @@ m_runFunction(runFunction), m_exiting(false) { } - virtual void run(); + void run() override; void setExiting() { m_exiting = true; } protected: diff -r 232d6ddf257d -r c01cbe41aeb5 plugin/LADSPAPluginFactory.h --- a/plugin/LADSPAPluginFactory.h Thu Nov 22 14:55:18 2018 +0000 +++ b/plugin/LADSPAPluginFactory.h Mon Nov 26 13:48:45 2018 +0000 @@ -38,24 +38,24 @@ public: virtual ~LADSPAPluginFactory(); - virtual void discoverPlugins(); + void discoverPlugins() override; - virtual const std::vector &getPluginIdentifiers() const; + const std::vector &getPluginIdentifiers() const override; - virtual void enumeratePlugins(std::vector &list); + void enumeratePlugins(std::vector &list) override; - virtual const RealTimePluginDescriptor *getPluginDescriptor(QString identifier) const; + const RealTimePluginDescriptor *getPluginDescriptor(QString identifier) const override; - virtual RealTimePluginInstance *instantiatePlugin(QString identifier, + RealTimePluginInstance *instantiatePlugin(QString identifier, int clientId, int position, sv_samplerate_t sampleRate, int blockSize, - int channels); + int channels) override; - virtual QString getPluginCategory(QString identifier); + QString getPluginCategory(QString identifier) override; - virtual QString getPluginLibraryPath(QString identifier); + QString getPluginLibraryPath(QString identifier) override; float getPortMinimum(const LADSPA_Descriptor *, int port); float getPortMaximum(const LADSPA_Descriptor *, int port); @@ -79,7 +79,7 @@ virtual void generateTaxonomy(QString uri, QString base); virtual void generateFallbackCategories(); - virtual void releasePlugin(RealTimePluginInstance *, QString); + void releasePlugin(RealTimePluginInstance *, QString) override; virtual const LADSPA_Descriptor *getLADSPADescriptor(QString identifier); diff -r 232d6ddf257d -r c01cbe41aeb5 plugin/LADSPAPluginInstance.h --- a/plugin/LADSPAPluginInstance.h Thu Nov 22 14:55:18 2018 +0000 +++ b/plugin/LADSPAPluginInstance.h Mon Nov 26 13:48:45 2018 +0000 @@ -38,49 +38,49 @@ public: virtual ~LADSPAPluginInstance(); - virtual bool isOK() const { return m_instanceHandles.size() != 0; } + bool isOK() const override { return m_instanceHandles.size() != 0; } int getClientId() const { return m_client; } - virtual QString getPluginIdentifier() const { return m_identifier; } + QString getPluginIdentifier() const override { return m_identifier; } int getPosition() const { return m_position; } - virtual std::string getIdentifier() const; - virtual std::string getName() const; - virtual std::string getDescription() const; - virtual std::string getMaker() const; - virtual int getPluginVersion() const; - virtual std::string getCopyright() const; + std::string getIdentifier() const override; + std::string getName() const override; + std::string getDescription() const override; + std::string getMaker() const override; + int getPluginVersion() const override; + std::string getCopyright() const override; - virtual void run(const RealTime &rt, int count = 0); + void run(const RealTime &rt, int count = 0) override; - virtual int getParameterCount() const; - virtual void setParameterValue(int parameter, float value); - virtual float getParameterValue(int parameter) const; - virtual float getParameterDefault(int parameter) const; - virtual int getParameterDisplayHint(int parameter) const; + int getParameterCount() const override; + void setParameterValue(int parameter, float value) override; + float getParameterValue(int parameter) const override; + float getParameterDefault(int parameter) const override; + int getParameterDisplayHint(int parameter) const override; - virtual ParameterList getParameterDescriptors() const; - virtual float getParameter(std::string) const; - virtual void setParameter(std::string, float); + ParameterList getParameterDescriptors() const override; + float getParameter(std::string) const override; + void setParameter(std::string, float) override; - virtual int getBufferSize() const { return m_blockSize; } - virtual int getAudioInputCount() const { return int(m_instanceCount * m_audioPortsIn.size()); } - virtual int getAudioOutputCount() const { return int(m_instanceCount * m_audioPortsOut.size()); } - virtual sample_t **getAudioInputBuffers() { return m_inputBuffers; } - virtual sample_t **getAudioOutputBuffers() { return m_outputBuffers; } + int getBufferSize() const override { return m_blockSize; } + int getAudioInputCount() const override { return int(m_instanceCount * m_audioPortsIn.size()); } + int getAudioOutputCount() const override { return int(m_instanceCount * m_audioPortsOut.size()); } + sample_t **getAudioInputBuffers() override { return m_inputBuffers; } + sample_t **getAudioOutputBuffers() override { return m_outputBuffers; } - virtual int getControlOutputCount() const { return int(m_controlPortsOut.size()); } - virtual float getControlOutputValue(int n) const; + int getControlOutputCount() const override { return int(m_controlPortsOut.size()); } + float getControlOutputValue(int n) const override; - virtual bool isBypassed() const { return m_bypassed; } - virtual void setBypassed(bool bypassed) { m_bypassed = bypassed; } + bool isBypassed() const override { return m_bypassed; } + void setBypassed(bool bypassed) override { m_bypassed = bypassed; } - virtual sv_frame_t getLatency(); + sv_frame_t getLatency() override; - virtual void silence(); - virtual void setIdealChannelCount(int channels); // may re-instantiate + void silence() override; + void setIdealChannelCount(int channels) override; // may re-instantiate - virtual std::string getType() const { return "LADSPA Real-Time Plugin"; } + std::string getType() const override { return "LADSPA Real-Time Plugin"; } protected: // To be constructed only by LADSPAPluginFactory diff -r 232d6ddf257d -r c01cbe41aeb5 plugin/PluginXml.h --- a/plugin/PluginXml.h Thu Nov 22 14:55:18 2018 +0000 +++ b/plugin/PluginXml.h Mon Nov 26 13:48:45 2018 +0000 @@ -30,9 +30,9 @@ /** * Export plugin settings to XML. */ - virtual void toXml(QTextStream &stream, + void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; /** * Set the parameters and program of a plugin from a set of XML diff -r 232d6ddf257d -r c01cbe41aeb5 plugin/RealTimePluginInstance.h --- a/plugin/RealTimePluginInstance.h Thu Nov 22 14:55:18 2018 +0000 +++ b/plugin/RealTimePluginInstance.h Mon Nov 26 13:48:45 2018 +0000 @@ -136,7 +136,7 @@ void setFactory(RealTimePluginFactory *f) { m_factory = f; } // ew - virtual std::string getType() const { return "Real-Time Plugin"; } + std::string getType() const override { return "Real-Time Plugin"; } typedef std::map ConfigurationPairMap; virtual ConfigurationPairMap getConfigurePairs() { diff -r 232d6ddf257d -r c01cbe41aeb5 rdf/RDFFeatureWriter.h --- a/rdf/RDFFeatureWriter.h Thu Nov 22 14:55:18 2018 +0000 +++ b/rdf/RDFFeatureWriter.h Mon Nov 26 13:48:45 2018 +0000 @@ -44,24 +44,24 @@ RDFFeatureWriter(); virtual ~RDFFeatureWriter(); - virtual string getDescription() const; + string getDescription() const override; - virtual ParameterList getSupportedParameters() const; - virtual void setParameters(map ¶ms); + ParameterList getSupportedParameters() const override; + void setParameters(map ¶ms) override; - virtual void setTrackMetadata(QString trackid, TrackMetadata metadata); + void setTrackMetadata(QString trackid, TrackMetadata metadata) override; - virtual void write(QString trackid, + void write(QString trackid, const Transform &transform, const Vamp::Plugin::OutputDescriptor &output, const Vamp::Plugin::FeatureList &features, - std::string summaryType = ""); + std::string summaryType = "") override; virtual void setFixedEventTypeURI(QString uri); // something of a hack - virtual void finish(); + void finish() override; - virtual QString getWriterTag() const { return "rdf"; } + QString getWriterTag() const override { return "rdf"; } private: typedef map RDFDescriptionMap; // by plugin id @@ -85,7 +85,7 @@ QString m_fixedEventTypeURI; - virtual void reviewFileForAppending(QString filename); + void reviewFileForAppending(QString filename) override; void writePrefixes(QTextStream *); void writeSignalDescription(QTextStream *, QString); diff -r 232d6ddf257d -r c01cbe41aeb5 transform/CSVFeatureWriter.h --- a/transform/CSVFeatureWriter.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/CSVFeatureWriter.h Mon Nov 26 13:48:45 2018 +0000 @@ -40,20 +40,20 @@ CSVFeatureWriter(); virtual ~CSVFeatureWriter(); - virtual string getDescription() const; + string getDescription() const override; - virtual ParameterList getSupportedParameters() const; - virtual void setParameters(map ¶ms); + ParameterList getSupportedParameters() const override; + void setParameters(map ¶ms) override; - virtual void write(QString trackid, + void write(QString trackid, const Transform &transform, const Vamp::Plugin::OutputDescriptor &output, const Vamp::Plugin::FeatureList &features, - std::string summaryType = ""); + std::string summaryType = "") override; - virtual void finish(); + void finish() override; - virtual QString getWriterTag() const { return "csv"; } + QString getWriterTag() const override { return "csv"; } private: QString m_separator; diff -r 232d6ddf257d -r c01cbe41aeb5 transform/FeatureExtractionModelTransformer.h --- a/transform/FeatureExtractionModelTransformer.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/FeatureExtractionModelTransformer.h Mon Nov 26 13:48:45 2018 +0000 @@ -47,14 +47,14 @@ virtual ~FeatureExtractionModelTransformer(); // ModelTransformer method, retrieve the additional models - Models getAdditionalOutputModels(); - bool willHaveAdditionalOutputModels(); + Models getAdditionalOutputModels() override; + bool willHaveAdditionalOutputModels() override; protected: bool initialise(); void deinitialise(); - virtual void run(); + void run() override; Vamp::Plugin *m_plugin; std::vector m_descriptors; // per transform @@ -80,7 +80,7 @@ bool m_haveOutputs; QMutex m_outputMutex; QWaitCondition m_outputsCondition; - void awaitOutputModels(); + void awaitOutputModels() override; // just casts: diff -r 232d6ddf257d -r c01cbe41aeb5 transform/FeatureWriter.h --- a/transform/FeatureWriter.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/FeatureWriter.h Mon Nov 26 13:48:45 2018 +0000 @@ -72,7 +72,7 @@ m_transformId(transformId) { } virtual ~FailedToOpenOutputStream() throw() { } - virtual const char *what() const throw() { + const char *what() const throw() override { return QString("Failed to open output stream for track id \"%1\", transform id \"%2\"") .arg(m_trackId).arg(m_transformId).toLocal8Bit().data(); } diff -r 232d6ddf257d -r c01cbe41aeb5 transform/FileFeatureWriter.h --- a/transform/FileFeatureWriter.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/FileFeatureWriter.h Mon Nov 26 13:48:45 2018 +0000 @@ -40,12 +40,12 @@ public: virtual ~FileFeatureWriter(); - virtual ParameterList getSupportedParameters() const; - virtual void setParameters(map ¶ms); + ParameterList getSupportedParameters() const override; + void setParameters(map ¶ms) override; - virtual void testOutputFile(QString trackId, TransformId transformId); - virtual void flush(); - virtual void finish(); + void testOutputFile(QString trackId, TransformId transformId) override; + void flush() override; + void finish() override; protected: enum FileWriteSupport { diff -r 232d6ddf257d -r c01cbe41aeb5 transform/RealTimeEffectModelTransformer.h --- a/transform/RealTimeEffectModelTransformer.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/RealTimeEffectModelTransformer.h Mon Nov 26 13:48:45 2018 +0000 @@ -29,9 +29,9 @@ virtual ~RealTimeEffectModelTransformer(); protected: - virtual void run(); + void run() override; - virtual void awaitOutputModels() { } // they're created synchronously + void awaitOutputModels() override { } // they're created synchronously QString m_units; RealTimePluginInstance *m_plugin; diff -r 232d6ddf257d -r c01cbe41aeb5 transform/Transform.h --- a/transform/Transform.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/Transform.h Mon Nov 26 13:48:45 2018 +0000 @@ -140,7 +140,7 @@ void setSampleRate(sv_samplerate_t rate); void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + QString extraAttributes = "") const override; /** * Set the main transform data from the given XML attributes. diff -r 232d6ddf257d -r c01cbe41aeb5 transform/TransformFactory.h --- a/transform/TransformFactory.h Thu Nov 22 14:55:18 2018 +0000 +++ b/transform/TransformFactory.h Mon Nov 26 13:48:45 2018 +0000 @@ -226,7 +226,7 @@ UninstalledTransformsPopulateThread(TransformFactory *factory) : m_factory(factory) { } - virtual void run(); + void run() override; TransformFactory *m_factory; };