svcore
1.9
|
An implementation of DenseThreeDimensionalModel that makes FFT data derived from a DenseTimeValueModel available as a generic data grid. More...
#include <FFTModel.h>
Public Types | |
enum | PeakPickType { AllPeaks, MajorPeaks, MajorPitchAdaptivePeaks } |
typedef std::set< int > | PeakLocationSet |
typedef std::map< int, float > | PeakSet |
typedef QVector< float > | Column |
enum | { SortRole = Qt::UserRole } |
enum | SortType { SortNumeric, SortAlphabetical } |
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 | modelChangedWithin (int startFrame, int 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 | ready () |
Emitted when internal processing is complete (i.e. | |
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, int windowSize, int windowIncrement, int fftSize, bool polar, StorageAdviser::Criteria criteria=StorageAdviser::NoCriteria, int 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 (int x, int y) |
float | getNormalizedMagnitudeAt (int x, int y) |
float | getMaximumMagnitudeAt (int x) |
float | getPhaseAt (int x, int y) |
void | getValuesAt (int x, int y, float &real, float &imaginary) |
bool | isColumnAvailable (int x) const |
Return true if there are data available for the given column. | |
bool | getMagnitudesAt (int x, float *values, int minbin=0, int count=0) |
bool | getNormalizedMagnitudesAt (int x, float *values, int minbin=0, int count=0) |
bool | getPhasesAt (int x, float *values, int minbin=0, int count=0) |
bool | getValuesAt (int x, float *reals, float *imaginaries, int minbin=0, int count=0) |
int | getFillExtent () const |
virtual int | getWidth () const |
Return the number of columns of bins in the model. | |
virtual int | getHeight () const |
Return the number of bins in each column. | |
virtual float | getValueAt (int x, int 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 int | getStartFrame () const |
Return the first audio frame spanned by the model. | |
virtual int | getEndFrame () const |
Return the last audio frame spanned by the model. | |
virtual int | getSampleRate () const |
Return the frame rate in frames per second. | |
virtual int | getResolution () const |
Return the number of sample frames covered by each column of bins. | |
virtual int | 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 Column | getColumn (int x) const |
Get data from the given column of bin values. | |
virtual QString | getBinName (int n) const |
Get the name of a given bin (i.e. | |
virtual bool | shouldUseLogValueScale () const |
Estimate whether a logarithmic scale might be appropriate for the value scale. | |
virtual bool | estimateStableFrequency (int x, int y, float &frequency) |
Calculate an estimated frequency for a stable signal in this bin, using phase unwrapping. | |
virtual PeakLocationSet | getPeaks (PeakPickType type, int x, int ymin=0, int ymax=0) |
Return locations of peak bins in the range [ymin,ymax]. | |
virtual PeakSet | getPeakFrequencies (PeakPickType type, int x, int ymin=0, int ymax=0) |
Return locations and estimated stable frequencies of peak bins. | |
virtual int | getCompletion () const |
virtual QString | getError () const |
virtual Model * | clone () 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 bool | hasBinValues () const |
Return true if the bins have values as well as names. | |
virtual float | getBinValue (int n) const |
Return the value of bin n, if any. | |
virtual QString | getBinValueUnit () const |
Obtain the name of the unit of the values returned from getBinValue(), if any. | |
bool | isLocalPeak (int x, int y) |
Utility function to query whether a given bin is greater than its (vertical) neighbours. | |
bool | isOverThreshold (int x, int y, float threshold) |
Utility function to query whether a given bin is greater than a certain threshold. | |
virtual int | getRowCount () const |
virtual int | getColumnCount () const |
virtual QString | getHeading (int column) const |
virtual QVariant | getData (int row, int column, int) const |
virtual bool | isColumnTimeValue (int col) const |
virtual SortType | getSortType (int) const |
virtual long | getFrameForRow (int row) const |
virtual int | getRowForFrame (long frame) const |
virtual int | 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 void | abandon () |
Mark the model as abandoning. | |
virtual bool | isAbandoning () const |
Query whether the model has been marked as abandoning. | |
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 ZoomConstraint * | getZoomConstraint () const |
If this model imposes a zoom constraint, i.e. | |
virtual Model * | getSourceModel () 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 AlignmentModel * | getAlignment () const |
Retrieve the alignment model for this model. | |
virtual const Model * | getAlignmentReference () const |
Return the reference model for the current alignment timeline, if any. | |
virtual int | alignToReference (int frame) const |
Return the frame number of the reference model that corresponds to the given frame number in this model. | |
virtual int | alignFromReference (int 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. | |
void | setRDFTypeURI (QString uri) |
Set the event, feature, or signal type URI for the features contained in this model, according to the Audio Features RDF ontology. | |
QString | getRDFTypeURI () const |
Retrieve the event, feature, or signal type URI for the features contained in this model, if previously set with setRDFTypeURI. | |
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 delimiter) const |
virtual QString | toDelimitedDataStringSubset (QString, int, int) const |
virtual QString | toXmlString (QString indent="", QString extraAttributes="") const |
Convert this exportable object to XML in a string. | |
virtual bool | canPlay () const |
virtual QString | getDefaultPlayClipId () const |
virtual bool | getDefaultPlayAudible () const |
virtual bool | isEditable () const |
virtual Command * | getSetDataCommand (int, int, const QVariant &, int) |
virtual Command * | getInsertRowCommand (int) |
virtual Command * | getRemoveRowCommand (int) |
Static Public Member Functions | |
static QString | encodeEntities (QString) |
static QString | encodeColour (int r, int g, int b) |
static int | getObjectExportId (const void *) |
Static Public Attributes | |
static const int | COMPLETION_UNKNOWN = -1 |
Protected Attributes | |
Model * | m_sourceModel |
AlignmentModel * | m_alignment |
QString | m_typeUri |
bool | m_abandoning |
bool | m_aboutToDelete |
Private Member Functions | |
FFTModel (const FFTModel &) | |
FFTModel & | operator= (const FFTModel &) |
FFTDataServer * | getServer (const DenseTimeValueModel *, int, WindowType, int, int, int, bool, StorageAdviser::Criteria, int) |
int | getPeakPickWindowSize (PeakPickType type, int sampleRate, int bin, float &percentile) const |
int | getYRatio () |
Private Attributes | |
FFTDataServer * | m_server |
int | m_xshift |
int | m_yshift |
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. Note that any of the accessor functions may throw AllocationFailed if a cache resize fails.
Definition at line 33 of file FFTModel.h.
typedef std::set<int> FFTModel::PeakLocationSet |
Definition at line 163 of file FFTModel.h.
typedef std::map<int, float> FFTModel::PeakSet |
Definition at line 164 of file FFTModel.h.
typedef QVector<float> DenseThreeDimensionalModel::Column [inherited] |
Definition at line 67 of file DenseThreeDimensionalModel.h.
AllPeaks | |
MajorPeaks |
Any bin exceeding its immediate neighbours. |
MajorPitchAdaptivePeaks |
Peaks picked using sliding median window. Bigger window for higher frequencies |
Definition at line 156 of file FFTModel.h.
anonymous enum [inherited] |
Definition at line 44 of file TabularModel.h.
enum TabularModel::SortType [inherited] |
Definition at line 45 of file TabularModel.h.
FFTModel::FFTModel | ( | const DenseTimeValueModel * | model, |
int | channel, | ||
WindowType | windowType, | ||
int | windowSize, | ||
int | windowIncrement, | ||
int | fftSize, | ||
bool | polar, | ||
StorageAdviser::Criteria | criteria = StorageAdviser::NoCriteria , |
||
int | 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 31 of file FFTModel.cpp.
References FFTDataServer::getFFTSize(), getServer(), FFTDataServer::getWindowIncrement(), m_server, m_xshift, m_yshift, and Model::setSourceModel().
Referenced by clone().
Definition at line 86 of file FFTModel.cpp.
References m_server, and FFTDataServer::releaseInstance().
FFTModel::FFTModel | ( | const FFTModel & | model | ) | [private] |
Definition at line 446 of file FFTModel.cpp.
References FFTDataServer::claimInstance(), and m_server.
float FFTModel::getMagnitudeAt | ( | int | x, |
int | y | ||
) | [inline] |
Definition at line 69 of file FFTModel.h.
References FFTDataServer::getMagnitudeAt(), m_server, m_xshift, and m_yshift.
Referenced by getValueAt().
float FFTModel::getNormalizedMagnitudeAt | ( | int | x, |
int | y | ||
) | [inline] |
Definition at line 72 of file FFTModel.h.
References FFTDataServer::getNormalizedMagnitudeAt(), m_server, m_xshift, and m_yshift.
float FFTModel::getMaximumMagnitudeAt | ( | int | x | ) | [inline] |
Definition at line 75 of file FFTModel.h.
References FFTDataServer::getMaximumMagnitudeAt(), m_server, and m_xshift.
float FFTModel::getPhaseAt | ( | int | x, |
int | y | ||
) | [inline] |
Definition at line 78 of file FFTModel.h.
References FFTDataServer::getPhaseAt(), m_server, m_xshift, and m_yshift.
Referenced by estimateStableFrequency(), and getPeakFrequencies().
void FFTModel::getValuesAt | ( | int | x, |
int | y, | ||
float & | real, | ||
float & | imaginary | ||
) | [inline] |
Definition at line 81 of file FFTModel.h.
References FFTDataServer::getValuesAt(), m_server, m_xshift, and m_yshift.
bool FFTModel::isColumnAvailable | ( | int | column | ) | 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 84 of file FFTModel.h.
References FFTDataServer::isColumnReady(), m_server, and m_xshift.
bool FFTModel::getMagnitudesAt | ( | int | x, |
float * | values, | ||
int | minbin = 0 , |
||
int | count = 0 |
||
) | [inline] |
Definition at line 88 of file FFTModel.h.
References FFTDataServer::getMagnitudesAt(), getYRatio(), m_server, m_xshift, and m_yshift.
Referenced by getPeaks().
bool FFTModel::getNormalizedMagnitudesAt | ( | int | x, |
float * | values, | ||
int | minbin = 0 , |
||
int | count = 0 |
||
) | [inline] |
Definition at line 91 of file FFTModel.h.
References FFTDataServer::getNormalizedMagnitudesAt(), getYRatio(), m_server, m_xshift, and m_yshift.
bool FFTModel::getPhasesAt | ( | int | x, |
float * | values, | ||
int | minbin = 0 , |
||
int | count = 0 |
||
) | [inline] |
Definition at line 94 of file FFTModel.h.
References FFTDataServer::getPhasesAt(), getYRatio(), m_server, m_xshift, and m_yshift.
bool FFTModel::getValuesAt | ( | int | x, |
float * | reals, | ||
float * | imaginaries, | ||
int | minbin = 0 , |
||
int | count = 0 |
||
) | [inline] |
Definition at line 97 of file FFTModel.h.
References FFTDataServer::getValuesAt(), getYRatio(), m_server, m_xshift, and m_yshift.
int FFTModel::getFillExtent | ( | ) | const [inline] |
Definition at line 101 of file FFTModel.h.
References FFTDataServer::getFillExtent(), and m_server.
virtual int FFTModel::getWidth | ( | ) | const [inline, virtual] |
Return the number of columns of bins in the model.
Implements DenseThreeDimensionalModel.
Definition at line 105 of file FFTModel.h.
References FFTDataServer::getWidth(), m_server, and m_xshift.
Referenced by estimateStableFrequency(), and getEndFrame().
virtual int FFTModel::getHeight | ( | ) | const [inline, virtual] |
Return the number of bins in each column.
Implements DenseThreeDimensionalModel.
Definition at line 108 of file FFTModel.h.
References FFTDataServer::getHeight(), m_server, and m_yshift.
Referenced by getBinName(), getColumn(), getPeaks(), and getYBinCount().
virtual float FFTModel::getValueAt | ( | int | column, |
int | n | ||
) | const [inline, virtual] |
Get the single data point from the n'th bin of the given column.
Implements DenseThreeDimensionalModel.
Definition at line 117 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 120 of file FFTModel.h.
References FFTDataServer::getModel(), and m_server.
Referenced by estimateStableFrequency(), getPeakFrequencies(), getPeaks(), getSampleRate(), and FeatureExtractionModelTransformer::run().
virtual int FFTModel::getStartFrame | ( | ) | const [inline, virtual] |
Return the first audio frame spanned by the model.
Implements Model.
Definition at line 123 of file FFTModel.h.
virtual int FFTModel::getEndFrame | ( | ) | const [inline, virtual] |
Return the last audio frame spanned by the model.
Implements Model.
Definition at line 126 of file FFTModel.h.
References getResolution(), and getWidth().
int FFTModel::getSampleRate | ( | ) | const [virtual] |
Return the frame rate in frames per second.
Implements Model.
Definition at line 163 of file FFTModel.cpp.
References FFTDataServer::getModel(), Model::getSampleRate(), isOK(), and m_server.
Referenced by getBinName(), getPeakFrequencies(), and getPeaks().
virtual int FFTModel::getResolution | ( | ) | const [inline, virtual] |
Return the number of sample frames covered by each column of bins.
Implements DenseThreeDimensionalModel.
Definition at line 130 of file FFTModel.h.
References FFTDataServer::getWindowIncrement(), m_server, and m_xshift.
Referenced by estimateStableFrequency(), getEndFrame(), and getPeakFrequencies().
virtual int FFTModel::getYBinCount | ( | ) | const [inline, virtual] |
Definition at line 133 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 136 of file FFTModel.h.
virtual float FFTModel::getMaximumLevel | ( | ) | const [inline, virtual] |
Return the maximum permissible value in each bin.
Implements DenseThreeDimensionalModel.
Definition at line 139 of file FFTModel.h.
FFTModel::Column FFTModel::getColumn | ( | int | column | ) | const [virtual] |
Get data from the given column of bin values.
Implements DenseThreeDimensionalModel.
Definition at line 169 of file FFTModel.cpp.
References getHeight(), FFTDataServer::getMagnitudesAt(), m_server, and m_xshift.
Referenced by getPeaks().
QString FFTModel::getBinName | ( | int | 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 199 of file FFTModel.cpp.
References getHeight(), and getSampleRate().
virtual bool FFTModel::shouldUseLogValueScale | ( | ) | const [inline, virtual] |
Estimate whether a logarithmic scale might be appropriate for the value scale.
Implements DenseThreeDimensionalModel.
Definition at line 145 of file FFTModel.h.
bool FFTModel::estimateStableFrequency | ( | int | x, |
int | 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 208 of file FFTModel.cpp.
References FFTDataServer::getFFTSize(), FFTDataServer::getModel(), getPhaseAt(), getResolution(), Model::getSampleRate(), getWidth(), isOK(), m_server, m_yshift, and princargf().
FFTModel::PeakLocationSet FFTModel::getPeaks | ( | PeakPickType | type, |
int | x, | ||
int | ymin = 0 , |
||
int | 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 250 of file FFTModel.cpp.
References AllPeaks, getColumn(), getHeight(), getMagnitudesAt(), getPeakPickWindowSize(), getSampleRate(), isOK(), and MajorPitchAdaptivePeaks.
Referenced by getPeakFrequencies().
FFTModel::PeakSet FFTModel::getPeakFrequencies | ( | PeakPickType | type, |
int | x, | ||
int | ymin = 0 , |
||
int | ymax = 0 |
||
) | [virtual] |
Return locations and estimated stable frequencies of peak bins.
Definition at line 397 of file FFTModel.cpp.
References FFTDataServer::getFFTSize(), getPeaks(), getPhaseAt(), getResolution(), getSampleRate(), isOK(), m_server, m_yshift, and princargf().
virtual int FFTModel::getCompletion | ( | ) | const [inline, virtual] |
Implements DenseThreeDimensionalModel.
Definition at line 179 of file FFTModel.h.
References FFTDataServer::getFillCompletion(), and m_server.
virtual QString FFTModel::getError | ( | ) | const [inline, virtual] |
Definition at line 180 of file FFTModel.h.
References FFTDataServer::getError(), 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 441 of file FFTModel.cpp.
References FFTModel().
virtual void FFTModel::suspend | ( | ) | [inline, virtual] |
Definition at line 184 of file FFTModel.h.
References m_server, and FFTDataServer::suspend().
virtual void FFTModel::suspendWrites | ( | ) | [inline, virtual] |
Definition at line 185 of file FFTModel.h.
References m_server, and FFTDataServer::suspendWrites().
virtual void FFTModel::resume | ( | ) | [inline, virtual] |
Definition at line 186 of file FFTModel.h.
References m_server, and FFTDataServer::resume().
Referenced by FeatureExtractionModelTransformer::run().
QString FFTModel::getTypeName | ( | ) | const [inline, virtual] |
Return the type of the model.
For display purposes only.
Reimplemented from DenseThreeDimensionalModel.
Definition at line 188 of file FFTModel.h.
void FFTModel::sourceModelAboutToBeDeleted | ( | ) | [slot] |
Reimplemented from Model.
Definition at line 92 of file FFTModel.cpp.
References m_server, Model::m_sourceModel, FFTDataServer::modelAboutToBeDeleted(), and FFTDataServer::releaseInstance().
FFTDataServer * FFTModel::getServer | ( | const DenseTimeValueModel * | model, |
int | channel, | ||
WindowType | windowType, | ||
int | windowSize, | ||
int | windowIncrement, | ||
int | fftSize, | ||
bool | polar, | ||
StorageAdviser::Criteria | criteria, | ||
int | fillFromColumn | ||
) | [private] |
Definition at line 105 of file FFTModel.cpp.
References AggregateWaveModel::ModelChannelSpec::channel, AggregateWaveModel::getComponent(), FFTDataServer::getFuzzyInstance(), and AggregateWaveModel::ModelChannelSpec::model.
Referenced by FFTModel().
int FFTModel::getPeakPickWindowSize | ( | PeakPickType | type, |
int | sampleRate, | ||
int | bin, | ||
float & | percentile | ||
) | const [private] |
Definition at line 376 of file FFTModel.cpp.
References FFTDataServer::getFFTSize(), Pitch::getFrequencyForPitch(), m_server, m_yshift, and MajorPeaks.
Referenced by getPeaks().
int FFTModel::getYRatio | ( | ) | [inline, private] |
Definition at line 208 of file FFTModel.h.
References m_yshift.
Referenced by getMagnitudesAt(), getNormalizedMagnitudesAt(), getPhasesAt(), and getValuesAt().
virtual bool DenseThreeDimensionalModel::hasBinValues | ( | ) | const [inline, virtual, inherited] |
Return true if the bins have values as well as names.
If this returns true, getBinValue() may be used to retrieve the values.
Reimplemented in EditableDenseThreeDimensionalModel.
Definition at line 89 of file DenseThreeDimensionalModel.h.
virtual float DenseThreeDimensionalModel::getBinValue | ( | int | n | ) | const [inline, virtual, inherited] |
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.
Reimplemented in EditableDenseThreeDimensionalModel.
Definition at line 96 of file DenseThreeDimensionalModel.h.
virtual QString DenseThreeDimensionalModel::getBinValueUnit | ( | ) | const [inline, virtual, inherited] |
Obtain the name of the unit of the values returned from getBinValue(), if any.
Reimplemented in EditableDenseThreeDimensionalModel.
Definition at line 102 of file DenseThreeDimensionalModel.h.
bool DenseThreeDimensionalModel::isLocalPeak | ( | int | x, |
int | y | ||
) | [inline, inherited] |
Utility function to query whether a given bin is greater than its (vertical) neighbours.
Definition at line 114 of file DenseThreeDimensionalModel.h.
References DenseThreeDimensionalModel::getHeight(), and DenseThreeDimensionalModel::getValueAt().
bool DenseThreeDimensionalModel::isOverThreshold | ( | int | x, |
int | y, | ||
float | threshold | ||
) | [inline, inherited] |
Utility function to query whether a given bin is greater than a certain threshold.
Definition at line 125 of file DenseThreeDimensionalModel.h.
References DenseThreeDimensionalModel::getValueAt().
virtual int DenseThreeDimensionalModel::getRowCount | ( | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 140 of file DenseThreeDimensionalModel.h.
References DenseThreeDimensionalModel::getWidth().
virtual int DenseThreeDimensionalModel::getColumnCount | ( | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 141 of file DenseThreeDimensionalModel.h.
References DenseThreeDimensionalModel::getHeight().
virtual QString DenseThreeDimensionalModel::getHeading | ( | int | column | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 143 of file DenseThreeDimensionalModel.h.
References DenseThreeDimensionalModel::getBinName().
virtual QVariant DenseThreeDimensionalModel::getData | ( | int | row, |
int | column, | ||
int | |||
) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 152 of file DenseThreeDimensionalModel.h.
References RealTime::frame2RealTime(), DenseThreeDimensionalModel::getResolution(), Model::getSampleRate(), DenseThreeDimensionalModel::getValueAt(), and RealTime::toText().
virtual bool DenseThreeDimensionalModel::isColumnTimeValue | ( | int | col | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 167 of file DenseThreeDimensionalModel.h.
virtual SortType DenseThreeDimensionalModel::getSortType | ( | int | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 170 of file DenseThreeDimensionalModel.h.
References TabularModel::SortNumeric.
virtual long DenseThreeDimensionalModel::getFrameForRow | ( | int | row | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 174 of file DenseThreeDimensionalModel.h.
References Model::getSampleRate().
virtual int DenseThreeDimensionalModel::getRowForFrame | ( | long | frame | ) | const [inline, virtual, inherited] |
Implements TabularModel.
Definition at line 177 of file DenseThreeDimensionalModel.h.
References Model::getSampleRate().
virtual int 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 69 of file Model.h.
References Model::getSampleRate().
QString Model::getTitle | ( | ) | const [virtual, inherited] |
Return the "work title" of the model, if known.
Reimplemented in WaveFileModel.
Definition at line 153 of file Model.cpp.
References Model::getTitle(), and Model::m_sourceModel.
Referenced by Model::getTitle().
QString Model::getMaker | ( | ) | const [virtual, inherited] |
Return the "artist" or "maker" of the model, if known.
Reimplemented in WaveFileModel.
Definition at line 160 of file Model.cpp.
References Model::getMaker(), and Model::m_sourceModel.
Referenced by 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 167 of file Model.cpp.
References Model::getLocation(), and Model::m_sourceModel.
Referenced by Model::getLocation().
virtual void Model::abandon | ( | ) | [inline, virtual, inherited] |
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 model API is concerned, this does nothing more than tell the model to return true from isAbandoning(). The actual response to this will depend on the model's context -- it's possible nothing at all will change.
Definition at line 118 of file Model.h.
References Model::m_abandoning.
virtual bool Model::isAbandoning | ( | ) | const [inline, virtual, inherited] |
Query whether the model has been marked as abandoning.
Definition at line 125 of file Model.h.
References Model::m_abandoning.
Referenced by FeatureExtractionModelTransformer::setCompletion().
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 SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, SparseModel< RegionRec >, AlignmentModel, AggregateWaveModel, WaveFileModel, and WritableWaveFileModel.
Definition at line 142 of file Model.h.
References Model::isOK().
Referenced by FFTDataServer::fillColumn(), RealTimeEffectModelTransformer::run(), FeatureExtractionModelTransformer::run(), and FFTDataServer::FillThread::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, WritableWaveFileModel, AlignmentModel, and WaveFileModel.
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 165 of file Model.h.
References Model::m_sourceModel.
void Model::setSourceModel | ( | Model * | model | ) | [virtual, inherited] |
Set the source model for this model.
Definition at line 42 of file Model.cpp.
References Model::aboutToBeDeleted(), Model::alignmentCompletionChanged(), Model::m_sourceModel, and Model::sourceModelAboutToBeDeleted().
Referenced by FeatureExtractionModelTransformer::createOutputModels(), FFTModel(), and RDFImporterImpl::getDataModelsSparse().
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 82 of file Model.cpp.
References Model::aboutToDelete(), Model::alignmentCompletionChanged(), Model::completionChanged(), and Model::m_alignment.
const AlignmentModel * Model::getAlignment | ( | ) | const [virtual, inherited] |
Retrieve the alignment model for this model.
This is not a generally useful function, as the alignment you really want may be performed by the source model instead. You should normally use getAlignmentReference, alignToReference and alignFromReference instead of this. The main intended application for this function is in streaming out alignments to the session file.
Definition at line 94 of file Model.cpp.
References Model::m_alignment.
const Model * Model::getAlignmentReference | ( | ) | const [virtual, inherited] |
Return the reference model for the current alignment timeline, if any.
Definition at line 100 of file Model.cpp.
References Model::getAlignmentReference(), AlignmentModel::getReferenceModel(), Model::m_alignment, and Model::m_sourceModel.
Referenced by Model::getAlignmentReference().
int Model::alignToReference | ( | int | 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 110 of file Model.cpp.
References Model::alignToReference(), Model::getEndFrame(), AlignmentModel::getReferenceModel(), Model::m_alignment, Model::m_sourceModel, and AlignmentModel::toReference().
Referenced by Model::alignToReference().
int Model::alignFromReference | ( | int | 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 125 of file Model.cpp.
References Model::alignFromReference(), AlignmentModel::fromReference(), Model::getEndFrame(), Model::m_alignment, and Model::m_sourceModel.
Referenced by Model::alignFromReference().
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 139 of file Model.cpp.
References Model::getAlignmentCompletion(), AlignmentModel::isReady(), Model::m_alignment, and Model::m_sourceModel.
Referenced by Model::getAlignmentCompletion().
void Model::setRDFTypeURI | ( | QString | uri | ) | [inline, inherited] |
Set the event, feature, or signal type URI for the features contained in this model, according to the Audio Features RDF ontology.
Definition at line 223 of file Model.h.
References Model::m_typeUri.
Referenced by FeatureExtractionModelTransformer::createOutputModels(), FeatureExtractionModelTransformer::getAdditionalModel(), RDFImporterImpl::getDataModelsDense(), and RDFImporterImpl::getDataModelsSparse().
QString Model::getRDFTypeURI | ( | ) | const [inline, inherited] |
Retrieve the event, feature, or signal type URI for the features contained in this model, if previously set with setRDFTypeURI.
Definition at line 230 of file Model.h.
References Model::m_typeUri.
Referenced by FeatureExtractionModelTransformer::getAdditionalModel().
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 EditableDenseThreeDimensionalModel, SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, SparseModel< RegionRec >, FlexiNoteModel, NoteModel, RegionModel, SparseValueModel< PointType >, SparseValueModel< FlexiNote >, SparseValueModel< Note >, SparseValueModel< TimeValuePoint >, SparseValueModel< RegionRec >, ImageModel, TextModel, WaveFileModel, WritableWaveFileModel, AggregateWaveModel, PathModel, and AlignmentModel.
Definition at line 174 of file Model.cpp.
References XmlExportable::encodeEntities(), Model::getEndFrame(), XmlExportable::getObjectExportId(), Model::getSampleRate(), and Model::getStartFrame().
Referenced by SparseModel< PointType >::toXml().
virtual QString Model::toDelimitedDataString | ( | QString | delimiter | ) | const [inline, virtual, inherited] |
Reimplemented in EditableDenseThreeDimensionalModel, SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, and SparseModel< RegionRec >.
Definition at line 236 of file Model.h.
References Model::getEndFrame(), Model::getStartFrame(), and Model::toDelimitedDataStringSubset().
Referenced by CSVFileWriter::write().
virtual QString Model::toDelimitedDataStringSubset | ( | QString | , |
int | , | ||
int | |||
) | const [inline, virtual, inherited] |
Reimplemented in EditableDenseThreeDimensionalModel, SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, SparseModel< RegionRec >, and DenseTimeValueModel.
Definition at line 239 of file Model.h.
Referenced by Model::toDelimitedDataString(), and CSVFileWriter::writeSelection().
void Model::aboutToDelete | ( | ) | [slot, inherited] |
Definition at line 60 of file Model.cpp.
References Model::aboutToBeDeleted(), and Model::m_aboutToDelete.
Referenced by AlignmentModel::pathChanged(), AlignmentModel::pathCompletionChanged(), Model::setAlignment(), AlignmentModel::setPath(), AlignmentModel::~AlignmentModel(), and Model::~Model().
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, and AlignmentModel.
Referenced by SparseValueModel< RegionRec >::addPoint(), WaveFileModel::cacheFilled(), SparseValueModel< RegionRec >::deletePoint(), Dense3DModelPeakCache::Dense3DModelPeakCache(), WaveFileModel::fillTimerTimedOut(), EditableDenseThreeDimensionalModel::setBinName(), EditableDenseThreeDimensionalModel::setBinNames(), EditableDenseThreeDimensionalModel::setColumn(), EditableDenseThreeDimensionalModel::setCompletion(), and WritableWaveFileModel::WritableWaveFileModel().
void Model::modelChangedWithin | ( | int | startFrame, |
int | 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, and AlignmentModel.
Referenced by WaveFileModel::cacheFilled(), WaveFileModel::fillTimerTimedOut(), EditableDenseThreeDimensionalModel::setColumn(), EditableDenseThreeDimensionalModel::setCompletion(), and WritableWaveFileModel::WritableWaveFileModel().
void Model::completionChanged | ( | ) | [signal, inherited] |
Emitted when some internal processing has advanced a stage, but the model has not changed externally.
Views should respond by updating any progress meters or other monitoring, but not refreshing the actual view.
Reimplemented in AggregateWaveModel, and AlignmentModel.
Referenced by Model::setAlignment(), and EditableDenseThreeDimensionalModel::setCompletion().
void Model::ready | ( | ) | [signal, inherited] |
Emitted when internal processing is complete (i.e.
when isReady() would return true, with completion at 100).
Referenced by WaveFileModel::cacheFilled(), WaveFileModel::isReady(), AggregateWaveModel::isReady(), and SparseModel< RegionRec >::isReady().
void Model::alignmentCompletionChanged | ( | ) | [signal, inherited] |
Emitted when the completion percentage changes for the calculation of this model's alignment model.
Referenced by Model::setAlignment(), and Model::setSourceModel().
void Model::aboutToBeDeleted | ( | ) | [signal, inherited] |
Emitted when something notifies this model (through calling aboutToDelete() that it is about to delete it.
Note that this depends on an external agent such as a Document object or owning model telling the model that it is about to delete it; there is nothing in the model to guarantee that this signal will be emitted before the actual deletion.
Referenced by Model::aboutToDelete(), Dense3DModelPeakCache::Dense3DModelPeakCache(), and Model::setSourceModel().
QString XmlExportable::toXmlString | ( | QString | indent = "" , |
QString | extraAttributes = "" |
||
) | const [virtual, inherited] |
Convert this exportable object to XML in a string.
The default implementation calls toXml and returns the result as a string. Do not override this unless you really know what you're doing.
Definition at line 25 of file XmlExportable.cpp.
References XmlExportable::toXml().
Referenced by ModelTransformerFactory::getConfigurationForTransform(), and RDFTransformFactoryImpl::getTransforms().
QString XmlExportable::encodeEntities | ( | QString | s | ) | [static, inherited] |
Definition at line 41 of file XmlExportable.cpp.
Referenced by TextMatcher::test(), PluginXml::toXml(), OneDimensionalPoint::toXml(), TimeValuePoint::toXml(), TextPoint::toXml(), ImagePoint::toXml(), RegionRec::toXml(), Note::toXml(), FlexiNote::toXml(), WritableWaveFileModel::toXml(), WaveFileModel::toXml(), SparseValueModel< RegionRec >::toXml(), Transform::toXml(), and Model::toXml().
QString XmlExportable::encodeColour | ( | int | r, |
int | g, | ||
int | b | ||
) | [static, inherited] |
Definition at line 54 of file XmlExportable.cpp.
int XmlExportable::getObjectExportId | ( | const void * | object | ) | [static, inherited] |
Definition at line 71 of file XmlExportable.cpp.
References mutex.
Referenced by FFTDataServer::generateFileBasename(), AlignmentModel::toXml(), EditableDenseThreeDimensionalModel::toXml(), and Model::toXml().
virtual bool Playable::canPlay | ( | ) | const [inline, virtual, inherited] |
Reimplemented in FlexiNoteModel, NoteModel, SparseTimeValueModel, SparseOneDimensionalModel, and DenseTimeValueModel.
Definition at line 26 of file Playable.h.
virtual QString Playable::getDefaultPlayClipId | ( | ) | const [inline, virtual, inherited] |
Reimplemented in FlexiNoteModel, NoteModel, SparseOneDimensionalModel, and DenseTimeValueModel.
Definition at line 27 of file Playable.h.
Referenced by PlayParameterRepository::addPlayable().
virtual bool Playable::getDefaultPlayAudible | ( | ) | const [inline, virtual, inherited] |
Reimplemented in SparseTimeValueModel.
Definition at line 28 of file Playable.h.
Referenced by PlayParameterRepository::addPlayable().
virtual bool TabularModel::isEditable | ( | ) | const [inline, virtual, inherited] |
Definition at line 54 of file TabularModel.h.
virtual Command* TabularModel::getSetDataCommand | ( | int | , |
int | , | ||
const QVariant & | , | ||
int | |||
) | [inline, virtual, inherited] |
Reimplemented in SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, SparseModel< RegionRec >, FlexiNoteModel, NoteModel, ImageModel, RegionModel, SparseTimeValueModel, SparseOneDimensionalModel, TextModel, IntervalModel< PointType >, IntervalModel< FlexiNote >, IntervalModel< Note >, and IntervalModel< RegionRec >.
Definition at line 55 of file TabularModel.h.
Referenced by ModelDataTableModel::setData().
virtual Command* TabularModel::getInsertRowCommand | ( | int | ) | [inline, virtual, inherited] |
Reimplemented in SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, and SparseModel< RegionRec >.
Definition at line 56 of file TabularModel.h.
Referenced by ModelDataTableModel::insertRow().
virtual Command* TabularModel::getRemoveRowCommand | ( | int | ) | [inline, virtual, inherited] |
Reimplemented in SparseModel< PointType >, SparseModel< FlexiNote >, SparseModel< Note >, SparseModel< PathPoint >, SparseModel< TextPoint >, SparseModel< ImagePoint >, SparseModel< TimeValuePoint >, SparseModel< OneDimensionalPoint >, and SparseModel< RegionRec >.
Definition at line 57 of file TabularModel.h.
Referenced by ModelDataTableModel::removeRow().
FFTDataServer* FFTModel::m_server [private] |
Definition at line 197 of file FFTModel.h.
Referenced by estimateStableFrequency(), FFTModel(), getColumn(), getCompletion(), getError(), getFillExtent(), getHeight(), getMagnitudeAt(), getMagnitudesAt(), getMaximumMagnitudeAt(), getNormalizedMagnitudeAt(), getNormalizedMagnitudesAt(), getPeakFrequencies(), getPeakPickWindowSize(), getPhaseAt(), getPhasesAt(), getResolution(), getSampleRate(), getValuesAt(), getWidth(), isColumnAvailable(), isOK(), resume(), sourceModelAboutToBeDeleted(), suspend(), suspendWrites(), and ~FFTModel().
int FFTModel::m_xshift [private] |
Definition at line 198 of file FFTModel.h.
Referenced by FFTModel(), getColumn(), getMagnitudeAt(), getMagnitudesAt(), getMaximumMagnitudeAt(), getNormalizedMagnitudeAt(), getNormalizedMagnitudesAt(), getPhaseAt(), getPhasesAt(), getResolution(), getValuesAt(), getWidth(), and isColumnAvailable().
int FFTModel::m_yshift [private] |
Definition at line 199 of file FFTModel.h.
Referenced by estimateStableFrequency(), FFTModel(), getHeight(), getMagnitudeAt(), getMagnitudesAt(), getNormalizedMagnitudeAt(), getNormalizedMagnitudesAt(), getPeakFrequencies(), getPeakPickWindowSize(), getPhaseAt(), getPhasesAt(), getValuesAt(), and getYRatio().
const int Model::COMPLETION_UNKNOWN = -1 [static, inherited] |
Model* Model::m_sourceModel [protected, inherited] |
Definition at line 301 of file Model.h.
Referenced by Model::alignFromReference(), Model::alignToReference(), Model::getAlignmentCompletion(), Model::getAlignmentReference(), Model::getLocation(), Model::getMaker(), Model::getSourceModel(), Model::getTitle(), Model::setSourceModel(), sourceModelAboutToBeDeleted(), and Model::sourceModelAboutToBeDeleted().
AlignmentModel* Model::m_alignment [protected, inherited] |
Definition at line 302 of file Model.h.
Referenced by Model::alignFromReference(), Model::alignToReference(), Model::getAlignment(), Model::getAlignmentCompletion(), Model::getAlignmentReference(), Model::setAlignment(), and Model::~Model().
QString Model::m_typeUri [protected, inherited] |
Definition at line 303 of file Model.h.
Referenced by Model::getRDFTypeURI(), and Model::setRDFTypeURI().
bool Model::m_abandoning [protected, inherited] |
Definition at line 304 of file Model.h.
Referenced by Model::abandon(), and Model::isAbandoning().
bool Model::m_aboutToDelete [protected, inherited] |
Definition at line 305 of file Model.h.
Referenced by Model::aboutToDelete(), and Model::~Model().