# HG changeset patch # User Chris Cannam # Date 1427800351 -3600 # Node ID 0fd3661bcfffc7002c399bd9b7b6c8579f42be3a # Parent c9fdd99211466a26e4cb4b9fa652573a7d976d73 clone() is never used (therefore presumably never works either) diff -r c9fdd9921146 -r 0fd3661bcfff data/model/AggregateWaveModel.cpp --- a/data/model/AggregateWaveModel.cpp Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/AggregateWaveModel.cpp Tue Mar 31 12:12:31 2015 +0100 @@ -92,12 +92,6 @@ return m_components.begin()->model->getSampleRate(); } -Model * -AggregateWaveModel::clone() const -{ - return new AggregateWaveModel(m_components); -} - sv_frame_t AggregateWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count, float *buffer) const diff -r c9fdd9921146 -r 0fd3661bcfff data/model/AggregateWaveModel.h --- a/data/model/AggregateWaveModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/AggregateWaveModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -53,8 +53,6 @@ int getChannelCount() const; sv_samplerate_t getSampleRate() const; - virtual Model *clone() const; - float getValueMinimum() const { return -1.0f; } float getValueMaximum() const { return 1.0f; } diff -r c9fdd9921146 -r 0fd3661bcfff data/model/AlignmentModel.cpp --- a/data/model/AlignmentModel.cpp Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/AlignmentModel.cpp Tue Mar 31 12:12:31 2015 +0100 @@ -96,15 +96,6 @@ return m_reference->getSampleRate(); } -Model * -AlignmentModel::clone() const -{ - return new AlignmentModel - (m_reference, m_aligned, - m_inputModel ? m_inputModel->clone() : 0, - m_rawPath ? static_cast(m_rawPath->clone()) : 0); -} - bool AlignmentModel::isReady(int *completion) const { diff -r c9fdd9921146 -r 0fd3661bcfff data/model/AlignmentModel.h --- a/data/model/AlignmentModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/AlignmentModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -40,7 +40,6 @@ virtual sv_frame_t getStartFrame() const; virtual sv_frame_t getEndFrame() const; virtual sv_samplerate_t getSampleRate() const; - virtual Model *clone() const; virtual bool isReady(int *completion = 0) const; virtual const ZoomConstraint *getZoomConstraint() const; diff -r c9fdd9921146 -r 0fd3661bcfff data/model/Dense3DModelPeakCache.h --- a/data/model/Dense3DModelPeakCache.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/Dense3DModelPeakCache.h Tue Mar 31 12:12:31 2015 +0100 @@ -45,10 +45,6 @@ return m_source->getEndFrame(); } - virtual Model *clone() const { - return new Dense3DModelPeakCache(m_source, m_resolution); - } - virtual int getResolution() const { return m_source->getResolution() * m_resolution; } diff -r c9fdd9921146 -r 0fd3661bcfff data/model/EditableDenseThreeDimensionalModel.cpp --- a/data/model/EditableDenseThreeDimensionalModel.cpp Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/EditableDenseThreeDimensionalModel.cpp Tue Mar 31 12:12:31 2015 +0100 @@ -81,26 +81,6 @@ return m_resolution * m_data.size() + (m_resolution - 1); } -Model * -EditableDenseThreeDimensionalModel::clone() const -{ - QReadLocker locker(&m_lock); - - EditableDenseThreeDimensionalModel *model = - new EditableDenseThreeDimensionalModel - (m_sampleRate, m_resolution, m_yBinCount, m_compression); - - model->m_minimum = m_minimum; - model->m_maximum = m_maximum; - model->m_haveExtents = m_haveExtents; - - for (int i = 0; i < m_data.size(); ++i) { - model->setColumn(i, m_data.at(i)); - } - - return model; -} - int EditableDenseThreeDimensionalModel::getResolution() const { diff -r c9fdd9921146 -r 0fd3661bcfff data/model/EditableDenseThreeDimensionalModel.h --- a/data/model/EditableDenseThreeDimensionalModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/EditableDenseThreeDimensionalModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -54,9 +54,6 @@ virtual sv_frame_t getStartFrame() const; virtual sv_frame_t getEndFrame() const; - virtual Model *clone() const; - - /** * Set the frame offset of the first column. */ diff -r c9fdd9921146 -r 0fd3661bcfff data/model/FFTModel.cpp --- a/data/model/FFTModel.cpp Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/FFTModel.cpp Tue Mar 31 12:12:31 2015 +0100 @@ -437,12 +437,6 @@ return peaks; } -Model * -FFTModel::clone() const -{ - return new FFTModel(*this); -} - FFTModel::FFTModel(const FFTModel &model) : DenseThreeDimensionalModel(), m_server(model.m_server), diff -r c9fdd9921146 -r 0fd3661bcfff data/model/FFTModel.h --- a/data/model/FFTModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/FFTModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -179,8 +179,6 @@ virtual int getCompletion() const { return m_server->getFillCompletion(); } virtual QString getError() const { return m_server->getError(); } - virtual Model *clone() const; - virtual void suspend() { m_server->suspend(); } virtual void suspendWrites() { m_server->suspendWrites(); } virtual void resume() { m_server->resume(); } diff -r c9fdd9921146 -r 0fd3661bcfff data/model/Model.h --- a/data/model/Model.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/Model.h Tue Mar 31 12:12:31 2015 +0100 @@ -93,22 +93,6 @@ virtual QString getTypeName() const = 0; /** - * Return a copy of this model. - * - * If the model is not editable, this may be effectively a shallow - * copy. If the model is editable, however, this operation must - * properly copy all of the model's editable data. - * - * In general this operation is not useful for non-editable dense - * models such as waveforms, because there may be no efficient - * copy operation implemented -- for such models it is better not - * to copy at all. - * - * Caller owns the returned value. - */ - virtual Model *clone() const = 0; - - /** * Mark the model as abandoning. This means that the application * no longer needs it, so it can stop doing any background * calculations it may be involved in. Note that as far as the diff -r c9fdd9921146 -r 0fd3661bcfff data/model/SparseModel.h --- a/data/model/SparseModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/SparseModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -52,8 +52,6 @@ virtual sv_frame_t getEndFrame() const; virtual sv_samplerate_t getSampleRate() const { return m_sampleRate; } - virtual Model *clone() const; - // Number of frames of the underlying sample rate that this model // is capable of resolving to. For example, if m_resolution == 10 // then every point in this model will be at a multiple of 10 @@ -552,20 +550,6 @@ } template -Model * -SparseModel::clone() const -{ - return 0; //!!! is this ever used? -/* - SparseModel *model = - new SparseModel(m_sampleRate, m_resolution, m_notifyOnAdd); - model->m_points = m_points; - model->m_pointCount = m_pointCount; - return model; -*/ -} - -template bool SparseModel::isEmpty() const { diff -r c9fdd9921146 -r 0fd3661bcfff data/model/WaveFileModel.cpp --- a/data/model/WaveFileModel.cpp Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/WaveFileModel.cpp Tue Mar 31 12:12:31 2015 +0100 @@ -124,13 +124,6 @@ return ready; } -Model * -WaveFileModel::clone() const -{ - WaveFileModel *model = new WaveFileModel(m_source); - return model; -} - sv_frame_t WaveFileModel::getFrameCount() const { diff -r c9fdd9921146 -r 0fd3661bcfff data/model/WaveFileModel.h --- a/data/model/WaveFileModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/WaveFileModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -54,8 +54,6 @@ QString getLocalFilename() const; - virtual Model *clone() const; - float getValueMinimum() const { return -1.0f; } float getValueMaximum() const { return 1.0f; } diff -r c9fdd9921146 -r 0fd3661bcfff data/model/WritableWaveFileModel.cpp --- a/data/model/WritableWaveFileModel.cpp Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/WritableWaveFileModel.cpp Tue Mar 31 12:12:31 2015 +0100 @@ -169,13 +169,6 @@ return m_frameCount; } -Model * -WritableWaveFileModel::clone() const -{ - assert(0); //!!! - return 0; -} - sv_frame_t WritableWaveFileModel::getData(int channel, sv_frame_t start, sv_frame_t count, float *buffer) const diff -r c9fdd9921146 -r 0fd3661bcfff data/model/WritableWaveFileModel.h --- a/data/model/WritableWaveFileModel.h Tue Mar 31 11:54:57 2015 +0100 +++ b/data/model/WritableWaveFileModel.h Tue Mar 31 12:12:31 2015 +0100 @@ -52,8 +52,6 @@ int getChannelCount() const { return m_channels; } sv_samplerate_t getSampleRate() const { return m_sampleRate; } - virtual Model *clone() const; - float getValueMinimum() const { return -1.0f; } float getValueMaximum() const { return 1.0f; }