FFTModel Class Reference

#include <FFTModel.h>

Inherits DenseThreeDimensionalModel.

Inheritance diagram for FFTModel:

Inheritance graph
[legend]
Collaboration diagram for FFTModel:

Collaboration graph
[legend]
List of all members.

Detailed Description

An implementation of DenseThreeDimensionalModel that makes FFT data derived from a DenseTimeValueModel available as a generic data grid.

The FFT data is acquired using FFTDataServer.

Definition at line 31 of file FFTModel.h.

Public Types

enum  PeakPickType { AllPeaks, MajorPeaks, MajorPitchAdaptivePeaks }
typedef std::set< size_t > PeakLocationSet
typedef std::map< size_t,
float > 
PeakSet
typedef std::vector< float > Column

Public Slots

void sourceModelAboutToBeDeleted ()
void aboutToDelete ()

Signals

void modelChanged ()
 Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly).
void modelChanged (size_t startFrame, size_t endFrame)
 Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly).
void completionChanged ()
 Emitted when some internal processing has advanced a stage, but the model has not changed externally.
void alignmentCompletionChanged ()
 Emitted when the completion percentage changes for the calculation of this model's alignment model.
void aboutToBeDeleted ()
 Emitted when something notifies this model (through calling aboutToDelete() that it is about to delete it.

Public Member Functions

 FFTModel (const DenseTimeValueModel *model, int channel, WindowType windowType, size_t windowSize, size_t windowIncrement, size_t fftSize, bool polar, StorageAdviser::Criteria criteria=StorageAdviser::NoCriteria, size_t fillFromColumn=0)
 Construct an FFT model derived from the given DenseTimeValueModel, with the given window parameters and FFT size (which may exceed the window size, for zero-padded FFTs).
 ~FFTModel ()
float getMagnitudeAt (size_t x, size_t y)
float getNormalizedMagnitudeAt (size_t x, size_t y)
float getMaximumMagnitudeAt (size_t x)
float getPhaseAt (size_t x, size_t y)
void getValuesAt (size_t x, size_t y, float &real, float &imaginary)
bool isColumnAvailable (size_t x) const
 Return true if there are data available for the given column.
size_t getFillExtent () const
virtual size_t getWidth () const
 Return the number of columns of bins in the model.
virtual size_t getHeight () const
 Return the number of bins in each column.
virtual float getValueAt (size_t x, size_t y) const
 Get the single data point from the n'th bin of the given column.
virtual bool isOK () const
 Return true if the model was constructed successfully.
virtual size_t getStartFrame () const
 Return the first audio frame spanned by the model.
virtual size_t getEndFrame () const
 Return the last audio frame spanned by the model.
virtual size_t getSampleRate () const
 Return the frame rate in frames per second.
virtual size_t getResolution () const
 Return the number of sample frames covered by each column of bins.
virtual size_t getYBinCount () const
virtual float getMinimumLevel () const
 Return the minimum permissible value in each bin.
virtual float getMaximumLevel () const
 Return the maximum permissible value in each bin.
virtual void getColumn (size_t x, Column &result) const
virtual QString getBinName (size_t n) const
 Get the name of a given bin (i.e.
virtual bool estimateStableFrequency (size_t x, size_t y, float &frequency)
 Calculate an estimated frequency for a stable signal in this bin, using phase unwrapping.
virtual PeakLocationSet getPeaks (PeakPickType type, size_t x, size_t ymin=0, size_t ymax=0)
 Return locations of peak bins in the range [ymin,ymax].
virtual PeakSet getPeakFrequencies (PeakPickType type, size_t x, size_t ymin=0, size_t ymax=0)
 Return locations and estimated stable frequencies of peak bins.
virtual int getCompletion () const
virtual Modelclone () const
 Return a copy of this model.
virtual void suspend ()
virtual void suspendWrites ()
virtual void resume ()
QString getTypeName () const
 Return the type of the model.
virtual void getColumn (size_t column, Column &result) const =0
 Get data from the given column of bin values.
bool isLocalPeak (size_t x, size_t y)
 Utility function to query whether a given bin is greater than its (vertical) neighbours.
bool isOverThreshold (size_t x, size_t y, float threshold)
 Utility function to query whether a given bin is greater than a certain threshold.
virtual size_t getNativeRate () const
 Return the frame rate of the underlying material, if the model itself has already been resampled.
virtual QString getTitle () const
 Return the "work title" of the model, if known.
virtual QString getMaker () const
 Return the "artist" or "maker" of the model, if known.
virtual QString getLocation () const
 Return the location of the data in this model (e.g.
virtual bool isReady (int *completion=0) const
 Return true if the model has finished loading or calculating all its data, for a model that is capable of calculating in a background thread.
virtual const ZoomConstraintgetZoomConstraint () const
 If this model imposes a zoom constraint, i.e.
virtual ModelgetSourceModel () const
 If this model was derived from another, return the model it was derived from.
virtual void setSourceModel (Model *model)
 Set the source model for this model.
virtual void setAlignment (AlignmentModel *alignment)
 Specify an aligment between this model's timeline and that of a reference model.
virtual const ModelgetAlignmentReference () const
 Return the reference model for the current alignment timeline, if any.
virtual size_t alignToReference (size_t frame) const
 Return the frame number of the reference model that corresponds to the given frame number in this model.
virtual size_t alignFromReference (size_t referenceFrame) const
 Return the frame number in this model that corresponds to the given frame number of the reference model.
virtual int getAlignmentCompletion () const
 Return the completion percentage for the alignment model: 100 if there is no alignment model or it has been entirely calculated, or less than 100 if it is still being calculated.
virtual void toXml (QTextStream &stream, QString indent="", QString extraAttributes="") const
 Stream this exportable object out to XML on a text stream.
virtual QString toDelimitedDataString (QString) const
virtual QString toXmlString (QString indent="", QString extraAttributes="") const
 Convert this exportable object to XML in a string.

Static Public Member Functions

static QString encodeEntities (QString)
static QString encodeColour (QColor)
static int getObjectExportId (const void *)

Static Public Attributes

static const int COMPLETION_UNKNOWN

Protected Attributes

Modelm_sourceModel
AlignmentModelm_alignment
bool m_aboutToDelete

Private Member Functions

 FFTModel (const FFTModel &)
FFTModeloperator= (const FFTModel &)
FFTDataServergetServer (const DenseTimeValueModel *, int, WindowType, size_t, size_t, size_t, bool, StorageAdviser::Criteria, size_t)
size_t getPeakPickWindowSize (PeakPickType type, size_t sampleRate, size_t bin, float &percentile) const

Private Attributes

FFTDataServerm_server
int m_xshift
int m_yshift


Member Typedef Documentation

typedef std::set<size_t> FFTModel::PeakLocationSet

Definition at line 144 of file FFTModel.h.

typedef std::map<size_t, float> FFTModel::PeakSet

Definition at line 145 of file FFTModel.h.

typedef std::vector<float> DenseThreeDimensionalModel::Column [inherited]

Definition at line 64 of file DenseThreeDimensionalModel.h.


Member Enumeration Documentation

enum FFTModel::PeakPickType

Enumerator:
AllPeaks 
MajorPeaks  Any bin exceeding its immediate neighbours.
MajorPitchAdaptivePeaks  Bigger window for higher frequencies.

Definition at line 137 of file FFTModel.h.


Constructor & Destructor Documentation

FFTModel::FFTModel ( const DenseTimeValueModel model,
int  channel,
WindowType  windowType,
size_t  windowSize,
size_t  windowIncrement,
size_t  fftSize,
bool  polar,
StorageAdviser::Criteria  criteria = StorageAdviser::NoCriteria,
size_t  fillFromColumn = 0 
)

Construct an FFT model derived from the given DenseTimeValueModel, with the given window parameters and FFT size (which may exceed the window size, for zero-padded FFTs).

If the model has multiple channels use only the given channel, unless the channel is -1 in which case merge all available channels.

If polar is true, the data will normally be retrieved from the FFT model in magnitude/phase form; otherwise it will normally be retrieved in "cartesian" real/imaginary form. The results should be the same either way, but a "polar" model addressed in "cartesian" form or vice versa may suffer a performance penalty.

The fillFromColumn argument gives a hint that the FFT data server should aim to start calculating FFT data at that column number if possible, as that is likely to be requested first.

!! hmm.

Definition at line 25 of file FFTModel.cpp.

References FFTDataServer::getFFTSize(), getServer(), FFTDataServer::getWindowIncrement(), m_server, m_xshift, m_yshift, and Model::setSourceModel().

Referenced by clone().

FFTModel::~FFTModel (  ) 

Definition at line 80 of file FFTModel.cpp.

References m_server, and FFTDataServer::releaseInstance().

FFTModel::FFTModel ( const FFTModel  )  [private]

Definition at line 390 of file FFTModel.cpp.

References FFTDataServer::claimInstance(), and m_server.


Member Function Documentation

float FFTModel::getMagnitudeAt ( size_t  x,
size_t  y 
) [inline]

Definition at line 67 of file FFTModel.h.

References FFTDataServer::getMagnitudeAt(), m_server, m_xshift, and m_yshift.

Referenced by getPeaks(), getValueAt(), SpectrogramLayer::getXYBinSourceRange(), and SpectrogramLayer::paint().

float FFTModel::getNormalizedMagnitudeAt ( size_t  x,
size_t  y 
) [inline]

Definition at line 70 of file FFTModel.h.

References FFTDataServer::getNormalizedMagnitudeAt(), m_server, m_xshift, and m_yshift.

Referenced by SpectrogramLayer::paint().

float FFTModel::getMaximumMagnitudeAt ( size_t  x  )  [inline]

Definition at line 73 of file FFTModel.h.

References FFTDataServer::getMaximumMagnitudeAt(), m_server, and m_xshift.

float FFTModel::getPhaseAt ( size_t  x,
size_t  y 
) [inline]

Definition at line 76 of file FFTModel.h.

References FFTDataServer::getPhaseAt(), m_server, m_xshift, and m_yshift.

Referenced by estimateStableFrequency(), getPeakFrequencies(), SpectrogramLayer::getXYBinSourceRange(), and SpectrogramLayer::paint().

void FFTModel::getValuesAt ( size_t  x,
size_t  y,
float &  real,
float &  imaginary 
) [inline]

Definition at line 79 of file FFTModel.h.

References FFTDataServer::getValuesAt(), m_server, m_xshift, and m_yshift.

bool FFTModel::isColumnAvailable ( size_t  x  )  const [inline, virtual]

Return true if there are data available for the given column.

This should return true only if getColumn(column) would not have to do any substantial work to calculate its return values. If this function returns false, it may still be possible to retrieve the column, but its values may have to be calculated.

Implements DenseThreeDimensionalModel.

Definition at line 82 of file FFTModel.h.

References FFTDataServer::isColumnReady(), m_server, and m_xshift.

Referenced by SpectrogramLayer::getAdjustedYBinSourceRange(), SpectrogramLayer::getXYBinSourceRange(), and SpectrogramLayer::paint().

size_t FFTModel::getFillExtent (  )  const [inline]

Definition at line 86 of file FFTModel.h.

References FFTDataServer::getFillExtent(), and m_server.

virtual size_t FFTModel::getWidth (  )  const [inline, virtual]

Return the number of columns of bins in the model.

Implements DenseThreeDimensionalModel.

Definition at line 90 of file FFTModel.h.

References FFTDataServer::getWidth(), m_server, and m_xshift.

Referenced by estimateStableFrequency(), SpectrogramLayer::getAdjustedYBinSourceRange(), getEndFrame(), SpectrogramLayer::getXYBinSourceRange(), and SpectrogramLayer::paint().

virtual size_t FFTModel::getHeight (  )  const [inline, virtual]

Return the number of bins in each column.

Implements DenseThreeDimensionalModel.

Definition at line 93 of file FFTModel.h.

References FFTDataServer::getHeight(), m_server, and m_yshift.

Referenced by getBinName(), getColumn(), getPeaks(), SpectrogramLayer::getXYBinSourceRange(), getYBinCount(), and SpectrumLayer::paint().

virtual float FFTModel::getValueAt ( size_t  x,
size_t  y 
) const [inline, virtual]

Get the single data point from the n'th bin of the given column.

Implements DenseThreeDimensionalModel.

Definition at line 102 of file FFTModel.h.

References getMagnitudeAt().

virtual bool FFTModel::isOK (  )  const [inline, virtual]

Return true if the model was constructed successfully.

Classes that refer to the model should always test this before use.

Implements Model.

Definition at line 105 of file FFTModel.h.

References FFTDataServer::getModel(), and m_server.

Referenced by estimateStableFrequency(), getPeakFrequencies(), getPeaks(), and getSampleRate().

virtual size_t FFTModel::getStartFrame (  )  const [inline, virtual]

Return the first audio frame spanned by the model.

Implements Model.

Definition at line 108 of file FFTModel.h.

virtual size_t FFTModel::getEndFrame (  )  const [inline, virtual]

Return the last audio frame spanned by the model.

Implements Model.

Definition at line 111 of file FFTModel.h.

References getResolution(), and getWidth().

size_t FFTModel::getSampleRate (  )  const [virtual]

Return the frame rate in frames per second.

Implements Model.

Definition at line 157 of file FFTModel.cpp.

References FFTDataServer::getModel(), Model::getSampleRate(), isOK(), and m_server.

Referenced by getBinName(), getPeakFrequencies(), getPeaks(), and SpectrumLayer::paint().

virtual size_t FFTModel::getResolution (  )  const [inline, virtual]

Return the number of sample frames covered by each column of bins.

Implements DenseThreeDimensionalModel.

Definition at line 115 of file FFTModel.h.

References FFTDataServer::getWindowIncrement(), m_server, and m_xshift.

Referenced by estimateStableFrequency(), getEndFrame(), getPeakFrequencies(), and SpectrumLayer::paint().

virtual size_t FFTModel::getYBinCount (  )  const [inline, virtual]

Definition at line 118 of file FFTModel.h.

References getHeight().

virtual float FFTModel::getMinimumLevel (  )  const [inline, virtual]

Return the minimum permissible value in each bin.

Implements DenseThreeDimensionalModel.

Definition at line 121 of file FFTModel.h.

virtual float FFTModel::getMaximumLevel (  )  const [inline, virtual]

Return the maximum permissible value in each bin.

Implements DenseThreeDimensionalModel.

Definition at line 124 of file FFTModel.h.

void FFTModel::getColumn ( size_t  x,
Column result 
) const [virtual]

Definition at line 163 of file FFTModel.cpp.

References getHeight().

Referenced by getPeaks().

QString FFTModel::getBinName ( size_t  n  )  const [virtual]

Get the name of a given bin (i.e.

a label to associate with that bin across all columns).

Implements DenseThreeDimensionalModel.

Definition at line 175 of file FFTModel.cpp.

References getHeight(), and getSampleRate().

bool FFTModel::estimateStableFrequency ( size_t  x,
size_t  y,
float &  frequency 
) [virtual]

Calculate an estimated frequency for a stable signal in this bin, using phase unwrapping.

This will be completely wrong if the signal is not stable here.

Definition at line 184 of file FFTModel.cpp.

References FFTDataServer::getFFTSize(), FFTDataServer::getModel(), getPhaseAt(), getResolution(), Model::getSampleRate(), getWidth(), isOK(), m_server, m_yshift, and princargf().

Referenced by SpectrogramLayer::getAdjustedYBinSourceRange().

FFTModel::PeakLocationSet FFTModel::getPeaks ( PeakPickType  type,
size_t  x,
size_t  ymin = 0,
size_t  ymax = 0 
) [virtual]

Return locations of peak bins in the range [ymin,ymax].

If ymax is zero, getHeight()-1 will be used.

Definition at line 226 of file FFTModel.cpp.

References AllPeaks, getColumn(), getHeight(), getMagnitudeAt(), getPeakPickWindowSize(), getSampleRate(), isOK(), and MajorPitchAdaptivePeaks.

Referenced by getPeakFrequencies().

FFTModel::PeakSet FFTModel::getPeakFrequencies ( PeakPickType  type,
size_t  x,
size_t  ymin = 0,
size_t  ymax = 0 
) [virtual]

Return locations and estimated stable frequencies of peak bins.

Definition at line 343 of file FFTModel.cpp.

References FFTDataServer::getFFTSize(), getPeaks(), getPhaseAt(), getResolution(), getSampleRate(), isOK(), m_server, m_yshift, and princargf().

Referenced by SpectrumLayer::paint(), and SpectrogramLayer::paint().

virtual int FFTModel::getCompletion (  )  const [inline, virtual]

Implements DenseThreeDimensionalModel.

Definition at line 160 of file FFTModel.h.

References FFTDataServer::getFillCompletion(), and m_server.

Model * FFTModel::clone (  )  const [virtual]

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.

Implements Model.

Definition at line 385 of file FFTModel.cpp.

References FFTModel().

virtual void FFTModel::suspend (  )  [inline, virtual]

Definition at line 164 of file FFTModel.h.

References m_server, and FFTDataServer::suspend().

virtual void FFTModel::suspendWrites (  )  [inline, virtual]

Definition at line 165 of file FFTModel.h.

References m_server, and FFTDataServer::suspendWrites().

Referenced by SpectrogramLayer::paint().

virtual void FFTModel::resume (  )  [inline, virtual]

Definition at line 166 of file FFTModel.h.

References m_server, and FFTDataServer::resume().

Referenced by SpectrogramLayer::paint(), and SpectrumLayer::setupFFT().

QString FFTModel::getTypeName (  )  const [inline, virtual]

Return the type of the model.

For display purposes only.

Reimplemented from DenseThreeDimensionalModel.

Definition at line 168 of file FFTModel.h.

void FFTModel::sourceModelAboutToBeDeleted (  )  [slot]

Reimplemented from Model.

Definition at line 86 of file FFTModel.cpp.

References m_server, Model::m_sourceModel, FFTDataServer::modelAboutToBeDeleted(), and FFTDataServer::releaseInstance().

FFTModel& FFTModel::operator= ( const FFTModel  )  [private]

FFTDataServer * FFTModel::getServer ( const DenseTimeValueModel ,
int  ,
WindowType  ,
size_t  ,
size_t  ,
size_t  ,
bool  ,
StorageAdviser::Criteria  ,
size_t   
) [private]

Definition at line 99 of file FFTModel.cpp.

References AggregateWaveModel::ModelChannelSpec::channel, AggregateWaveModel::getComponent(), FFTDataServer::getFuzzyInstance(), and AggregateWaveModel::ModelChannelSpec::model.

Referenced by FFTModel().

size_t FFTModel::getPeakPickWindowSize ( PeakPickType  type,
size_t  sampleRate,
size_t  bin,
float &  percentile 
) const [private]

Definition at line 322 of file FFTModel.cpp.

References FFTDataServer::getFFTSize(), Pitch::getFrequencyForPitch(), m_server, m_yshift, and MajorPeaks.

Referenced by getPeaks().

virtual void DenseThreeDimensionalModel::getColumn ( size_t  column,
Column result 
) const [pure virtual, inherited]

Get data from the given column of bin values.

Referenced by Colour3DPlotLayer::getColumn().

bool DenseThreeDimensionalModel::isLocalPeak ( size_t  x,
size_t  y 
) [inline, inherited]

Utility function to query whether a given bin is greater than its (vertical) neighbours.

Definition at line 86 of file DenseThreeDimensionalModel.h.

References DenseThreeDimensionalModel::getHeight(), and DenseThreeDimensionalModel::getValueAt().

Referenced by SpectrogramLayer::getAdjustedYBinSourceRange(), and SpectrogramLayer::paint().

bool DenseThreeDimensionalModel::isOverThreshold ( size_t  x,
size_t  y,
float  threshold 
) [inline, inherited]

Utility function to query whether a given bin is greater than a certain threshold.

Definition at line 97 of file DenseThreeDimensionalModel.h.

References DenseThreeDimensionalModel::getValueAt().

Referenced by SpectrogramLayer::getAdjustedYBinSourceRange(), SpectrumLayer::paint(), and SpectrogramLayer::paint().

virtual size_t Model::getNativeRate (  )  const [inline, virtual, inherited]

Return the frame rate of the underlying material, if the model itself has already been resampled.

Reimplemented in WaveFileModel.

Definition at line 67 of file Model.h.

References Model::getSampleRate().

Referenced by Pane::drawDurationAndRate().

QString Model::getTitle (  )  const [virtual, inherited]

Return the "work title" of the model, if known.

Reimplemented in WaveFileModel.

Definition at line 150 of file Model.cpp.

References Model::getTitle(), and Model::m_sourceModel.

Referenced by Pane::drawWorkTitle(), and Model::getTitle().

QString Model::getMaker (  )  const [virtual, inherited]

Return the "artist" or "maker" of the model, if known.

Reimplemented in WaveFileModel.

Definition at line 157 of file Model.cpp.

References Model::getMaker(), and Model::m_sourceModel.

Referenced by ModelDataModel::data(), Pane::drawWorkTitle(), and Model::getMaker().

QString Model::getLocation (  )  const [virtual, inherited]

Return the location of the data in this model (e.g.

source URL). This should not normally be returned for editable models that have been edited.

Reimplemented in WaveFileModel.

Definition at line 164 of file Model.cpp.

References Model::getLocation(), and Model::m_sourceModel.

Referenced by ModelDataModel::data(), and Model::getLocation().

virtual bool Model::isReady ( int *  completion = 0  )  const [inline, virtual, inherited]

Return true if the model has finished loading or calculating all its data, for a model that is capable of calculating in a background thread.

The default implementation is appropriate for a thread that does not background any work but carries out all its calculation from the constructor or accessors.

If "completion" is non-NULL, this function should return through it an estimated percentage value showing how far through the background operation it thinks it is (for progress reporting). If it has no way to calculate progress, it may return the special value COMPLETION_UNKNOWN.

Reimplemented in AggregateWaveModel, AlignmentModel, SparseModel< PointType >, WaveFileModel, WritableWaveFileModel, SparseModel< Note >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, and SparseModel< AlignmentModel::PathPoint >.

Definition at line 120 of file Model.h.

References Model::isOK().

Referenced by FFTDataServer::fillColumn(), SpectrogramLayer::getAdjustedYBinSourceRange(), WaveformLayer::getCompletion(), SpectrogramLayer::getXYBinSourceRange(), WaveformLayer::paint(), SpectrumLayer::paint(), SpectrogramLayer::paint(), SliceLayer::paint(), Colour3DPlotLayer::paint(), RealTimeEffectModelTransformer::run(), FFTDataServer::FillThread::run(), and FeatureExtractionModelTransformer::run().

virtual const ZoomConstraint* Model::getZoomConstraint (  )  const [inline, virtual, inherited]

If this model imposes a zoom constraint, i.e.

some limit to the set of resolutions at which its data can meaningfully be displayed, then return it.

Reimplemented in AggregateWaveModel, AlignmentModel, WaveFileModel, and WritableWaveFileModel.

Definition at line 132 of file Model.h.

Referenced by WaveformLayer::getZoomConstraint(), and Colour3DPlotLayer::getZoomConstraint().

virtual Model* Model::getSourceModel (  )  const [inline, virtual, inherited]

If this model was derived from another, return the model it was derived from.

The assumption is that the source model's alignment will also apply to this model, unless some other property (such as a specific alignment model set on this model) indicates otherwise.

Definition at line 143 of file Model.h.

References Model::m_sourceModel.

Referenced by View::checkProgress(), and Pane::paintEvent().

void Model::setSourceModel ( Model model  )  [virtual, inherited]

Set the source model for this model.

Definition at line 49 of file Model.cpp.

References Model::aboutToBeDeleted(), Model::alignmentCompletionChanged(), Model::m_sourceModel, and Model::sourceModelAboutToBeDeleted().

Referenced by Document::addDerivedModel(), FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(), and FFTModel().

void Model::setAlignment ( AlignmentModel alignment  )  [virtual, inherited]

Specify an aligment between this model's timeline and that of a reference model.

The alignment model records both the reference and the alignment. This model takes ownership of the alignment model.

Definition at line 89 of file Model.cpp.

References Model::aboutToDelete(), Model::alignmentCompletionChanged(), Model::completionChanged(), and Model::m_alignment.

Referenced by Document::alignModel().

const Model * Model::getAlignmentReference (  )  const [virtual, inherited]

Return the reference model for the current alignment timeline, if any.

Definition at line 101 of file Model.cpp.

References Model::getAlignmentReference(), AlignmentModel::getReferenceModel(), Model::m_alignment, and Model::m_sourceModel.

Referenced by Layer::alignFromReference(), Document::alignModel(), Layer::alignToReference(), Pane::drawAlignmentStatus(), View::getAligningModel(), and Model::getAlignmentReference().

size_t Model::alignToReference ( size_t  frame  )  const [virtual, inherited]

Return the frame number of the reference model that corresponds to the given frame number in this model.

Definition at line 111 of file Model.cpp.

References Model::getEndFrame(), AlignmentModel::getReferenceModel(), Model::m_alignment, Model::m_sourceModel, and AlignmentModel::toReference().

Referenced by ViewManager::alignPlaybackFrameToReference(), View::alignToReference(), and Layer::alignToReference().

size_t Model::alignFromReference ( size_t  referenceFrame  )  const [virtual, inherited]

Return the frame number in this model that corresponds to the given frame number of the reference model.

Definition at line 124 of file Model.cpp.

References AlignmentModel::fromReference(), Model::getEndFrame(), Model::m_alignment, and Model::m_sourceModel.

Referenced by View::alignFromReference(), Layer::alignFromReference(), ViewManager::alignReferenceToPlaybackFrame(), and View::getAlignedPlaybackFrame().

int Model::getAlignmentCompletion (  )  const [virtual, inherited]

Return the completion percentage for the alignment model: 100 if there is no alignment model or it has been entirely calculated, or less than 100 if it is still being calculated.

Definition at line 136 of file Model.cpp.

References AlignmentModel::isReady(), Model::m_alignment, and Model::m_sourceModel.

Referenced by View::checkProgress(), and Pane::drawAlignmentStatus().

void Model::toXml ( QTextStream &  stream,
QString  indent = "",
QString  extraAttributes = "" 
) const [virtual, inherited]

Stream this exportable object out to XML on a text stream.

Implements XmlExportable.

Reimplemented in AggregateWaveModel, EditableDenseThreeDimensionalModel, ImageModel, NoteModel, SparseModel< PointType >, SparseValueModel< PointType >, TextModel, WaveFileModel, WritableWaveFileModel, SparseModel< Note >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, SparseModel< AlignmentModel::PathPoint >, SparseValueModel< Note >, and SparseValueModel< TimeValuePoint >.

Definition at line 171 of file Model.cpp.

References XmlExportable::encodeEntities(), Model::getEndFrame(), XmlExportable::getObjectExportId(), Model::getSampleRate(), and Model::getStartFrame().

Referenced by WritableWaveFileModel::toXml(), WaveFileModel::toXml(), SparseModel< PointType >::toXml(), and EditableDenseThreeDimensionalModel::toXml().

virtual QString Model::toDelimitedDataString ( QString   )  const [inline, virtual, inherited]

Reimplemented in EditableDenseThreeDimensionalModel, SparseModel< PointType >, SparseModel< Note >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, and SparseModel< AlignmentModel::PathPoint >.

Definition at line 189 of file Model.h.

Referenced by CSVFileWriter::write().

void Model::aboutToDelete (  )  [slot, inherited]

Definition at line 67 of file Model.cpp.

References Model::aboutToBeDeleted(), and Model::m_aboutToDelete.

Referenced by Document::releaseModel(), Model::setAlignment(), Document::setMainModel(), SpectrumLayer::setModel(), SpectrumLayer::setupFFT(), Document::~Document(), Model::~Model(), and SpectrumLayer::~SpectrumLayer().

void Model::modelChanged (  )  [signal, inherited]

Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly).

Reimplemented in AggregateWaveModel, AlignmentModel, and WaveFileModel.

Referenced by SparseValueModel< TimeValuePoint >::addPoint(), SparseModel< PointType >::addPoint(), SparseModel< PointType >::clear(), SparseValueModel< TimeValuePoint >::deletePoint(), SparseModel< PointType >::deletePoint(), EditableDenseThreeDimensionalModel::setBinName(), EditableDenseThreeDimensionalModel::setBinNames(), EditableDenseThreeDimensionalModel::setColumn(), SparseModel< PointType >::setCompletion(), EditableDenseThreeDimensionalModel::setCompletion(), SparseModel< PointType >::setResolution(), and WritableWaveFileModel::WritableWaveFileModel().

void Model::modelChanged ( size_t  startFrame,
size_t  endFrame 
) [signal, inherited]

Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly).

Reimplemented in AggregateWaveModel, AlignmentModel, and WaveFileModel.

void Model::completionChanged (  )