changeset 1065:0fd3661bcfff tonioni

clone() is never used (therefore presumably never works either)
author Chris Cannam
date Tue, 31 Mar 2015 12:12:31 +0100
parents c9fdd9921146
children 9fc8823a73e9
files data/model/AggregateWaveModel.cpp data/model/AggregateWaveModel.h data/model/AlignmentModel.cpp data/model/AlignmentModel.h data/model/Dense3DModelPeakCache.h data/model/EditableDenseThreeDimensionalModel.cpp data/model/EditableDenseThreeDimensionalModel.h data/model/FFTModel.cpp data/model/FFTModel.h data/model/Model.h data/model/SparseModel.h data/model/WaveFileModel.cpp data/model/WaveFileModel.h data/model/WritableWaveFileModel.cpp data/model/WritableWaveFileModel.h
diffstat 15 files changed, 0 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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; }
 
--- 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<SparseTimeValueModel *>(m_rawPath->clone()) : 0);
-}
-
 bool
 AlignmentModel::isReady(int *completion) const
 {
--- 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;
 
--- 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;
     }
--- 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
 {
--- 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.
      */
--- 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),
--- 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(); }
--- 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
--- 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 <typename PointType>
-Model *
-SparseModel<PointType>::clone() const
-{
-    return 0; //!!! is this ever used?
-/*
-    SparseModel<PointType> *model =
-	new SparseModel<PointType>(m_sampleRate, m_resolution, m_notifyOnAdd);
-    model->m_points = m_points;
-    model->m_pointCount = m_pointCount;
-    return model;
-*/
-}
-
-template <typename PointType>
 bool
 SparseModel<PointType>::isEmpty() const
 {
--- 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
 {
--- 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; }
 
--- 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
--- 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; }