svcore
1.9
|
#include <WritableWaveFileModel.h>
Public Types | |
enum | Normalisation { Normalisation::None, Normalisation::Peak } |
typedef std::vector< Range > | RangeBlock |
typedef Id | ModelId |
typedef TypedId< Model > | Id |
enum | { NO_ID = -1 } |
typedef int | ExportId |
Signals | |
void | writeCompleted (ModelId) |
void | modelChanged (ModelId myId) |
Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly) More... | |
void | modelChangedWithin (ModelId myId, sv_frame_t startFrame, sv_frame_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) More... | |
void | completionChanged (ModelId myId) |
Emitted when some internal processing has advanced a stage, but the model has not changed externally. More... | |
void | ready (ModelId myId) |
Emitted when internal processing is complete (i.e. More... | |
void | alignmentCompletionChanged (ModelId myId) |
Emitted when the completion percentage changes for the calculation of this model's alignment model. More... | |
Public Member Functions | |
WritableWaveFileModel (QString path, sv_samplerate_t sampleRate, int channels, Normalisation normalisation) | |
Create a WritableWaveFileModel of the given sample rate and channel count, storing data in a new float-type extended WAV file with the given path. More... | |
WritableWaveFileModel (sv_samplerate_t sampleRate, int channels, Normalisation normalisation) | |
Create a WritableWaveFileModel of the given sample rate and channel count, storing data in a new float-type extended WAV file in a temporary location. More... | |
WritableWaveFileModel (sv_samplerate_t sampleRate, int channels) | |
Create a WritableWaveFileModel of the given sample rate and channel count, storing data in a new float-type extended WAV file in a temporary location, and applying no normalisation. More... | |
~WritableWaveFileModel () | |
virtual bool | addSamples (const float *const *samples, sv_frame_t count) |
Call addSamples to append a block of samples to the end of the file. More... | |
void | updateModel () |
Tell the model to update its own (read) view of the (written) file. More... | |
void | setWriteProportion (int proportion) |
Set the proportion of the file which has been written so far, as a percentage. More... | |
void | writeComplete () |
Indicate that writing is complete. More... | |
int | getWriteProportion () const |
Get the proportion of the file which has been written so far, as a percentage. More... | |
bool | isOK () const override |
Return true if the model was constructed successfully. More... | |
int | getCompletion () const override |
Return the generation completion percentage of this model. More... | |
const ZoomConstraint * | getZoomConstraint () const override |
If this model imposes a zoom constraint, i.e. More... | |
sv_frame_t | getFrameCount () const override |
int | getChannelCount () const override |
Return the number of distinct channels for this model. More... | |
sv_samplerate_t | getSampleRate () const override |
Return the frame rate in frames per second. More... | |
sv_samplerate_t | getNativeRate () const override |
Return the frame rate of the underlying material, if the model itself has already been resampled. More... | |
QString | getTitle () const override |
Return the "work title" of the model, if known. More... | |
QString | getMaker () const override |
Return the "artist" or "maker" of the model, if known. More... | |
QString | getLocation () const override |
Return the location of the data in this model (e.g. More... | |
float | getValueMinimum () const override |
Return the minimum possible value found in this model type. More... | |
float | getValueMaximum () const override |
Return the minimum possible value found in this model type. More... | |
sv_frame_t | getStartFrame () const override |
Return the first audio frame spanned by the model. More... | |
sv_frame_t | getTrueEndFrame () const override |
Return the audio frame at the end of the model. More... | |
void | setStartFrame (sv_frame_t startFrame) override |
floatvec_t | getData (int channel, sv_frame_t start, sv_frame_t count) const override |
Get the specified set of samples from the given channel of the model in single-precision floating-point format. More... | |
std::vector< floatvec_t > | getMultiChannelData (int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const override |
Get the specified set of samples from given contiguous range of channels of the model in single-precision floating-point format. More... | |
int | getSummaryBlockSize (int desired) const override |
void | getSummaries (int channel, sv_frame_t start, sv_frame_t count, RangeBlock &ranges, int &blockSize) const override |
Return ranges from the given start frame, corresponding to the given number of underlying sample frames, summarised at the given block size. More... | |
Range | getSummary (int channel, sv_frame_t start, sv_frame_t count) const override |
Return the range from the given start frame, corresponding to the given number of underlying sample frames, summarised at a block size equal to the distance between start and end frames. More... | |
QString | getTypeName () const override |
Return the type of the model. More... | |
void | toXml (QTextStream &out, QString indent="", QString extraAttributes="") const override |
Stream this exportable object out to XML on a text stream. More... | |
bool | canPlay () const override |
QString | getDefaultPlayClipId () const override |
QVector< QString > | getStringExportHeaders (DataExportOptions options) const override |
Return a label for each column that would be written by toStringExportRows. More... | |
QVector< QVector< QString > > | toStringExportRows (DataExportOptions options, sv_frame_t startFrame, sv_frame_t duration) const override |
Emit events starting within the given range as string rows ready for conversion to an e.g. More... | |
sv_frame_t | getEndFrame () const |
Return the audio frame at the end of the model, i.e. More... | |
void | extendEndFrame (sv_frame_t to) |
Extend the end of the model. More... | |
virtual bool | isSparse () const |
Return true if this is a sparse model. More... | |
virtual bool | isReady (int *cp=nullptr) 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. More... | |
virtual ModelId | getSourceModel () const |
If this model was derived from another, return the id of the model it was derived from. More... | |
virtual void | setSourceModel (ModelId model) |
Set the source model for this model. More... | |
virtual void | setAlignment (ModelId alignmentModel) |
Specify an alignment between this model's timeline and that of a reference model. More... | |
virtual const ModelId | getAlignment () const |
Retrieve the alignment model for this model. More... | |
virtual const ModelId | getAlignmentReference () const |
Return the reference model for the current alignment timeline, if any. More... | |
virtual sv_frame_t | alignToReference (sv_frame_t frame) const |
Return the frame number of the reference model that corresponds to the given frame number in this model. More... | |
virtual sv_frame_t | alignFromReference (sv_frame_t referenceFrame) const |
Return the frame number in this model that corresponds to the given frame number of the reference model. More... | |
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. More... | |
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. More... | |
QString | getRDFTypeURI () const |
Retrieve the event, feature, or signal type URI for the features contained in this model, if previously set with setRDFTypeURI. More... | |
ExportId | getExportId () const |
Return the numerical export identifier for this object. More... | |
virtual QString | toXmlString (QString indent="", QString extraAttributes="") const |
Convert this exportable object to XML in a string. More... | |
virtual bool | getDefaultPlayAudible () const |
Static Public Member Functions | |
static QString | encodeEntities (QString) |
static QString | encodeColour (int r, int g, int b) |
Static Public Attributes | |
static const int | PROPORTION_UNKNOWN = -1 |
Protected Slots | |
void | componentModelChanged (ModelId) |
void | componentModelChangedWithin (ModelId, sv_frame_t, sv_frame_t) |
Protected Member Functions | |
Id | getId () const |
Return an id for this object. More... | |
int | getUntypedId () const |
Return an id for this object. More... | |
Protected Attributes | |
ReadOnlyWaveFileModel * | m_model |
WavFileWriter * | m_temporaryWriter |
When normalising, this writer is used to write verbatim samples to the temporary file prior to normalisation. More... | |
QString | m_temporaryPath |
WavFileWriter * | m_targetWriter |
When not normalising, this writer is used to write verbatim samples direct to the target file. More... | |
QString | m_targetPath |
WavFileReader * | m_reader |
Normalisation | m_normalisation |
sv_samplerate_t | m_sampleRate |
int | m_channels |
sv_frame_t | m_frameCount |
sv_frame_t | m_startFrame |
int | m_proportion |
QMutex | m_mutex |
ModelId | m_sourceModel |
ModelId | m_alignmentModel |
QString | m_typeUri |
std::atomic< sv_frame_t > | m_extendTo |
Private Member Functions | |
void | init (QString path="") |
void | normaliseToTarget () |
Detailed Description
Definition at line 26 of file WritableWaveFileModel.h.
Member Typedef Documentation
|
inherited |
Definition at line 76 of file RangeSummarisableTimeValueModel.h.
|
inherited |
|
inherited |
Definition at line 33 of file XmlExportable.h.
Member Enumeration Documentation
|
strong |
Enumerator | |
---|---|
None | |
Peak |
Definition at line 31 of file WritableWaveFileModel.h.
|
inherited |
Enumerator | |
---|---|
NO_ID |
Definition at line 28 of file XmlExportable.h.
Constructor & Destructor Documentation
WritableWaveFileModel::WritableWaveFileModel | ( | QString | path, |
sv_samplerate_t | sampleRate, | ||
int | channels, | ||
Normalisation | normalisation | ||
) |
Create a WritableWaveFileModel of the given sample rate and channel count, storing data in a new float-type extended WAV file with the given path.
If path is the empty string, the data will be stored in a newly-created temporary file.
If normalisation == None, sample values will be written verbatim, and will be ready to read as soon as they have been written. Otherwise samples will be normalised on writing; this will require an additional pass and temporary file, and no samples will be available to read until after writeComplete() has returned.
Definition at line 40 of file WritableWaveFileModel.cpp.
References init().
WritableWaveFileModel::WritableWaveFileModel | ( | sv_samplerate_t | sampleRate, |
int | channels, | ||
Normalisation | normalisation | ||
) |
Create a WritableWaveFileModel of the given sample rate and channel count, storing data in a new float-type extended WAV file in a temporary location.
This is equivalent to passing an empty path to the constructor above.
If normalisation == None, sample values will be written verbatim, and will be ready to read as soon as they have been written. Otherwise samples will be normalised on writing; this will require an additional pass and temporary file, and no samples will be available to read until after writeComplete() has returned.
Definition at line 58 of file WritableWaveFileModel.cpp.
References init().
WritableWaveFileModel::WritableWaveFileModel | ( | sv_samplerate_t | sampleRate, |
int | channels | ||
) |
Create a WritableWaveFileModel of the given sample rate and channel count, storing data in a new float-type extended WAV file in a temporary location, and applying no normalisation.
This is equivalent to passing an empty path and Normalisation::None to the first constructor above.
Definition at line 75 of file WritableWaveFileModel.cpp.
WritableWaveFileModel::~WritableWaveFileModel | ( | ) |
Definition at line 170 of file WritableWaveFileModel.cpp.
References WithTypedId< Model >::getId(), PlayParameterRepository::getInstance(), m_model, m_reader, m_targetWriter, m_temporaryWriter, and PlayParameterRepository::removePlayable().
Member Function Documentation
|
virtual |
Call addSamples to append a block of samples to the end of the file.
This function only appends the samples to the file being written; it does not update the model's view of the samples in that file. That is, it updates the file on disc but the model itself does not change its content. This is because re-reading the file to update the model may be more expensive than adding the samples in the first place. If you are writing small numbers of samples repeatedly, you probably only want the model to update periodically rather than after every write.
Call updateModel() periodically to tell the model to update its own view of the samples in the file being written.
Call setWriteProportion() periodically if the file being written has known duration and you want the model to be able to report the write progress as a percentage.
Call writeComplete() when the file has been completely written.
Definition at line 203 of file WritableWaveFileModel.cpp.
References AudioFileReader::getChannelCount(), WavFileWriter::getError(), m_frameCount, m_model, m_normalisation, m_reader, m_targetWriter, m_temporaryWriter, None, SVCERR, WavFileReader::updateFrameCount(), and WavFileWriter::writeSamples().
Referenced by CSVFileReader::load().
void WritableWaveFileModel::updateModel | ( | ) |
Tell the model to update its own (read) view of the (written) file.
May cause modelChanged() and modelChangedWithin() to be emitted. See the comment to addSamples above for rationale.
Definition at line 233 of file WritableWaveFileModel.cpp.
References m_model, m_reader, and WavFileReader::updateFrameCount().
Referenced by CSVFileReader::load().
void WritableWaveFileModel::setWriteProportion | ( | int | proportion | ) |
Set the proportion of the file which has been written so far, as a percentage.
This may be used to indicate progress.
Note that this differs from the "completion" percentage reported through isReady()/getCompletion(). That percentage is updated when "internal processing has advanced... but the model has not changed externally", i.e. it reports progress in calculating the initial state of a model. In contrast, an update to setWriteProportion corresponds to a change in the externally visible state of the model (i.e. it contains more data than before).
Definition at line 247 of file WritableWaveFileModel.cpp.
References m_proportion.
void WritableWaveFileModel::writeComplete | ( | ) |
Indicate that writing is complete.
You should call this even if you have never called setWriteProportion() or updateModel().
Definition at line 259 of file WritableWaveFileModel.cpp.
References WavFileWriter::close(), WithTypedId< Model >::getId(), m_model, m_normalisation, m_proportion, m_reader, m_targetWriter, m_temporaryWriter, Model::modelChanged(), None, normaliseToTarget(), WavFileReader::updateDone(), and writeCompleted().
Referenced by CSVFileReader::load().
int WritableWaveFileModel::getWriteProportion | ( | ) | const |
Get the proportion of the file which has been written so far, as a percentage.
Return PROPORTION_UNKNOWN if unknown.
Definition at line 253 of file WritableWaveFileModel.cpp.
References m_proportion.
|
overridevirtual |
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 241 of file WritableWaveFileModel.cpp.
References ReadOnlyWaveFileModel::isOK(), and m_model.
|
inlineoverridevirtual |
Return the generation completion percentage of this model.
This is always 100, because the model is always in a complete state – it just contains varying amounts of data depending on how much has been written.
Implements Model.
Definition at line 149 of file WritableWaveFileModel.h.
|
inlineoverridevirtual |
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 from Model.
Definition at line 151 of file WritableWaveFileModel.h.
References getFrameCount().
|
overridevirtual |
Implements WaveFileModel.
Definition at line 313 of file WritableWaveFileModel.cpp.
References m_frameCount.
Referenced by getTrueEndFrame(), and getZoomConstraint().
|
inlineoverridevirtual |
Return the number of distinct channels for this model.
Implements WaveFileModel.
Definition at line 157 of file WritableWaveFileModel.h.
References m_channels.
|
inlineoverridevirtual |
Return the frame rate in frames per second.
Implements WaveFileModel.
Definition at line 158 of file WritableWaveFileModel.h.
References m_sampleRate.
|
inlineoverridevirtual |
Return the frame rate of the underlying material, if the model itself has already been resampled.
Implements WaveFileModel.
Definition at line 159 of file WritableWaveFileModel.h.
References m_sampleRate.
|
inlineoverridevirtual |
Return the "work title" of the model, if known.
Implements WaveFileModel.
Definition at line 161 of file WritableWaveFileModel.h.
References ReadOnlyWaveFileModel::getTitle(), and m_model.
|
inlineoverridevirtual |
Return the "artist" or "maker" of the model, if known.
Implements WaveFileModel.
Definition at line 165 of file WritableWaveFileModel.h.
References ReadOnlyWaveFileModel::getMaker(), and m_model.
|
inlineoverridevirtual |
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.
Implements WaveFileModel.
Definition at line 169 of file WritableWaveFileModel.h.
References ReadOnlyWaveFileModel::getLocation(), and m_model.
|
inlineoverridevirtual |
Return the minimum possible value found in this model type.
(That is, the minimum that would be valid, not the minimum actually found in a particular model).
Implements DenseTimeValueModel.
Definition at line 174 of file WritableWaveFileModel.h.
|
inlineoverridevirtual |
Return the minimum possible value found in this model type.
(That is, the minimum that would be valid, not the minimum actually found in a particular model).
Implements DenseTimeValueModel.
Definition at line 175 of file WritableWaveFileModel.h.
|
inlineoverridevirtual |
Return the first audio frame spanned by the model.
Implements WaveFileModel.
Definition at line 177 of file WritableWaveFileModel.h.
References m_startFrame.
|
inlineoverridevirtual |
Return the audio frame at the end of the model.
This is identical to getEndFrame(), except that it ignores any extended duration set with extendEndFrame().
Implements WaveFileModel.
Definition at line 178 of file WritableWaveFileModel.h.
References getData(), getFrameCount(), getMultiChannelData(), getSummaries(), getSummary(), getSummaryBlockSize(), m_startFrame, and setStartFrame().
|
overridevirtual |
Implements WaveFileModel.
Definition at line 194 of file WritableWaveFileModel.cpp.
References m_model, m_startFrame, and ReadOnlyWaveFileModel::setStartFrame().
Referenced by getTrueEndFrame().
|
overridevirtual |
Get the specified set of samples from the given channel of the model in single-precision floating-point format.
Returned vector may have fewer samples than requested, if the end of file was reached.
If the channel is given as -1, mix all available channels and return the result.
Implements DenseTimeValueModel.
Definition at line 320 of file WritableWaveFileModel.cpp.
References ReadOnlyWaveFileModel::getChannelCount(), ReadOnlyWaveFileModel::getData(), and m_model.
Referenced by getTrueEndFrame().
|
overridevirtual |
Get the specified set of samples from given contiguous range of channels of the model in single-precision floating-point format.
Returned vector may have fewer samples than requested, if the end of file was reached.
Implements DenseTimeValueModel.
Definition at line 327 of file WritableWaveFileModel.cpp.
References ReadOnlyWaveFileModel::getChannelCount(), ReadOnlyWaveFileModel::getMultiChannelData(), and m_model.
Referenced by getTrueEndFrame().
|
overridevirtual |
Implements RangeSummarisableTimeValueModel.
Definition at line 335 of file WritableWaveFileModel.cpp.
References ReadOnlyWaveFileModel::getSummaryBlockSize(), and m_model.
Referenced by getTrueEndFrame().
|
overridevirtual |
Return ranges from the given start frame, corresponding to the given number of underlying sample frames, summarised at the given block size.
duration / blockSize ranges should ideally be returned.
If the given block size is not supported by this model (according to its zoom constraint), also modify the blockSize parameter so as to return the block size that was actually obtained.
Implements RangeSummarisableTimeValueModel.
Definition at line 342 of file WritableWaveFileModel.cpp.
References ReadOnlyWaveFileModel::getChannelCount(), ReadOnlyWaveFileModel::getSummaries(), and m_model.
Referenced by getTrueEndFrame().
|
overridevirtual |
Return the range from the given start frame, corresponding to the given number of underlying sample frames, summarised at a block size equal to the distance between start and end frames.
Implements RangeSummarisableTimeValueModel.
Definition at line 352 of file WritableWaveFileModel.cpp.
References ReadOnlyWaveFileModel::getChannelCount(), ReadOnlyWaveFileModel::getSummary(), and m_model.
Referenced by getTrueEndFrame().
|
inlineoverridevirtual |
Return the type of the model.
For display purposes only.
Reimplemented from RangeSummarisableTimeValueModel.
Definition at line 193 of file WritableWaveFileModel.h.
References componentModelChanged(), componentModelChangedWithin(), toXml(), and writeCompleted().
|
overridevirtual |
Stream this exportable object out to XML on a text stream.
Reimplemented from Model.
Definition at line 359 of file WritableWaveFileModel.cpp.
References XmlExportable::encodeEntities(), m_targetPath, and Model::toXml().
Referenced by getTypeName().
|
signal |
Referenced by getTypeName(), and writeComplete().
|
protectedslot |
Definition at line 182 of file WritableWaveFileModel.cpp.
References WithTypedId< Model >::getId(), and Model::modelChanged().
Referenced by getTypeName(), and init().
|
protectedslot |
Definition at line 188 of file WritableWaveFileModel.cpp.
References WithTypedId< Model >::getId(), and Model::modelChangedWithin().
Referenced by getTypeName(), and init().
|
private |
Definition at line 92 of file WritableWaveFileModel.cpp.
References PlayParameterRepository::addPlayable(), componentModelChanged(), componentModelChangedWithin(), WavFileReader::getError(), WavFileWriter::getError(), WithTypedId< Model >::getId(), PlayParameterRepository::getInstance(), TempDirectory::getInstance(), ReadOnlyWaveFileModel::isOK(), WavFileWriter::isOK(), m_channels, m_model, m_normalisation, m_reader, m_sampleRate, m_startFrame, m_targetPath, m_targetWriter, m_temporaryPath, m_temporaryWriter, Model::modelChanged(), Model::modelChangedWithin(), None, ReadOnlyWaveFileModel::setStartFrame(), SVCERR, and WavFileWriter::WriteToTarget.
Referenced by WritableWaveFileModel().
|
private |
Definition at line 277 of file WritableWaveFileModel.cpp.
References WavFileWriter::close(), WavFileReader::getError(), WavFileWriter::getError(), AudioFileReader::getFrameCount(), WavFileReader::getInterleavedFrames(), m_targetWriter, m_temporaryPath, m_temporaryWriter, WavFileReader::Peak, WavFileWriter::putInterleavedFrames(), and SVCERR.
Referenced by writeComplete().
|
inlineoverridevirtualinherited |
Reimplemented from Playable.
Definition at line 82 of file DenseTimeValueModel.h.
|
inlineoverridevirtualinherited |
Reimplemented from Playable.
Definition at line 83 of file DenseTimeValueModel.h.
References DenseTimeValueModel::getStringExportHeaders(), and DenseTimeValueModel::toStringExportRows().
|
overridevirtualinherited |
Return a label for each column that would be written by toStringExportRows.
Implements Model.
Definition at line 23 of file DenseTimeValueModel.cpp.
Referenced by DenseTimeValueModel::getDefaultPlayClipId().
|
overridevirtualinherited |
Emit events starting within the given range as string rows ready for conversion to an e.g.
comma-separated data format.
Implements Model.
Definition at line 34 of file DenseTimeValueModel.cpp.
References in_range_for().
Referenced by DenseTimeValueModel::getDefaultPlayClipId().
|
inlineinherited |
Return the audio frame at the end of the model, i.e.
the final frame contained within the model plus 1 (rounded up to the model's "resolution" granularity, if more than 1). The end frame minus the start frame should yield the total duration in frames (as a multiple of the resolution) spanned by the model. This is broadly consistent with the definition of the end frame of a Selection object.
If the end has been extended by extendEndFrame() beyond the true end frame, return the extended end instead. This is usually the behaviour you want.
Definition at line 87 of file Model.h.
References Model::getTrueEndFrame(), and Model::m_extendTo.
Referenced by Model::alignFromReference(), ReadOnlyWaveFileModel::cacheFilled(), WaveformOversampler::getFixedRatioData(), SparseOneDimensionalModel::getNotes(), NoteModel::getNotes(), ReadOnlyWaveFileModel::isReady(), Model::toXml(), CSVFileWriter::write(), CSVStreamWriter::writeInChunks(), and WavFileWriter::writeModel().
|
inlineinherited |
Extend the end of the model.
If this is set to something beyond the true end of the data within the model, then getEndFrame() will return this value instead of the true end. (This is used by the Tony application.)
Definition at line 109 of file Model.h.
References Model::getSampleRate(), and Model::m_extendTo.
|
inlinevirtualinherited |
Return true if this is a sparse model.
Reimplemented in NoteModel, SparseTimeValueModel, BoxModel, RegionModel, SparseOneDimensionalModel, ImageModel, and TextModel.
Definition at line 149 of file Model.h.
Referenced by CSVFileWriter::writeSelection().
|
inlinevirtualinherited |
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.
If "completion" is non-NULL, return through it an estimated percentage value showing how far through the background operation it thinks it is (for progress reporting). This should be identical to the value returned by getCompletion().
A model that carries out all its calculation from the constructor or accessor functions would typically return true (and completion == 100) as long as isOK() is true. Other models may make the return value here depend on the internal completion status.
See also getCompletion().
Reimplemented in ReadOnlyWaveFileModel, AlignmentModel, BasicCompressedDenseThreeDimensionalModel, AggregateWaveModel, and EditableDenseThreeDimensionalModel.
Definition at line 169 of file Model.h.
References Model::getCompletion(), and Model::isOK().
|
inlinevirtualinherited |
If this model was derived from another, return the id of 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 207 of file Model.h.
References Model::alignFromReference(), Model::alignToReference(), Model::getAlignment(), Model::getAlignmentCompletion(), Model::getAlignmentReference(), Model::m_sourceModel, Model::setAlignment(), and Model::setSourceModel().
|
virtualinherited |
Set the source model for this model.
Definition at line 31 of file Model.cpp.
References Model::alignmentCompletionChanged(), TypedById< Item, Id >::get(), Model::m_mutex, and Model::m_sourceModel.
Referenced by RDFImporterImpl::getDataModelsSparse(), and Model::getSourceModel().
|
virtualinherited |
Specify an alignment between this model's timeline and that of a reference model.
The alignment model, of type AlignmentModel, records both the reference and the alignment.
Definition at line 45 of file Model.cpp.
References Model::alignmentModelCompletionChanged(), Model::completionChanged(), TypedById< Item, Id >::get(), Model::m_alignmentModel, Model::m_mutex, and SVDEBUG.
Referenced by Model::getSourceModel().
|
virtualinherited |
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 72 of file Model.cpp.
References Model::m_alignmentModel, and Model::m_mutex.
Referenced by Model::getSourceModel().
|
virtualinherited |
Return the reference model for the current alignment timeline, if any.
Definition at line 79 of file Model.cpp.
References Model::m_alignmentModel, and Model::m_mutex.
Referenced by Model::getSourceModel().
|
virtualinherited |
Return the frame number of the reference model that corresponds to the given frame number in this model.
Definition at line 88 of file Model.cpp.
References TypedById< Item, Id >::get(), Model::m_alignmentModel, Model::m_mutex, and Model::m_sourceModel.
Referenced by Model::getSourceModel().
|
virtualinherited |
Return the frame number in this model that corresponds to the given frame number of the reference model.
Definition at line 116 of file Model.cpp.
References TypedById< Item, Id >::get(), Model::getEndFrame(), Model::m_alignmentModel, Model::m_mutex, and Model::m_sourceModel.
Referenced by Model::getSourceModel().
|
virtualinherited |
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 141 of file Model.cpp.
References TypedById< Item, Id >::get(), Model::m_alignmentModel, Model::m_mutex, Model::m_sourceModel, and SVCERR.
Referenced by Model::getSourceModel().
|
inlineinherited |
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 264 of file Model.h.
References Model::m_typeUri.
Referenced by FeatureExtractionModelTransformer::getAdditionalModel(), and RDFImporterImpl::getDataModelsSparse().
|
inlineinherited |
Retrieve the event, feature, or signal type URI for the features contained in this model, if previously set with setRDFTypeURI.
Definition at line 271 of file Model.h.
References Model::alignmentCompletionChanged(), Model::alignmentModelCompletionChanged(), Model::completionChanged(), Model::getStringExportHeaders(), Model::m_typeUri, Model::modelChanged(), Model::modelChangedWithin(), Model::ready(), Model::toStringExportRows(), and Model::toXml().
|
signalinherited |
Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly)
Referenced by BoxModel::add(), RegionModel::add(), SparseTimeValueModel::add(), NoteModel::add(), AggregateWaveModel::AggregateWaveModel(), ReadOnlyWaveFileModel::cacheFilled(), AggregateWaveModel::componentModelChanged(), componentModelChanged(), Dense3DModelPeakCache::Dense3DModelPeakCache(), FFTModel::FFTModel(), ReadOnlyWaveFileModel::fillTimerTimedOut(), Model::getRDFTypeURI(), init(), EditableDenseThreeDimensionalModel::setBinName(), BasicCompressedDenseThreeDimensionalModel::setBinName(), EditableDenseThreeDimensionalModel::setBinNames(), BasicCompressedDenseThreeDimensionalModel::setBinNames(), EditableDenseThreeDimensionalModel::setColumn(), BasicCompressedDenseThreeDimensionalModel::setColumn(), EditableDenseThreeDimensionalModel::setCompletion(), BasicCompressedDenseThreeDimensionalModel::setCompletion(), TextModel::setCompletion(), ImageModel::setCompletion(), SparseOneDimensionalModel::setCompletion(), BoxModel::setCompletion(), RegionModel::setCompletion(), SparseTimeValueModel::setCompletion(), NoteModel::setCompletion(), and writeComplete().
|
signalinherited |
Emitted when a model has been edited (or more data retrieved from cache, in the case of a cached model that generates slowly)
Referenced by AggregateWaveModel::AggregateWaveModel(), ReadOnlyWaveFileModel::cacheFilled(), AggregateWaveModel::componentModelChangedWithin(), componentModelChangedWithin(), FFTModel::FFTModel(), ReadOnlyWaveFileModel::fillTimerTimedOut(), Model::getRDFTypeURI(), init(), DeferredNotifier::makeDeferredNotifications(), ImageModel::remove(), TextModel::remove(), SparseOneDimensionalModel::remove(), BoxModel::remove(), RegionModel::remove(), SparseTimeValueModel::remove(), NoteModel::remove(), EditableDenseThreeDimensionalModel::setColumn(), BasicCompressedDenseThreeDimensionalModel::setColumn(), EditableDenseThreeDimensionalModel::setCompletion(), BasicCompressedDenseThreeDimensionalModel::setCompletion(), AlignmentModel::setPathFrom(), and DeferredNotifier::update().
|
signalinherited |
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.
Referenced by AggregateWaveModel::AggregateWaveModel(), AggregateWaveModel::componentModelCompletionChanged(), Model::getRDFTypeURI(), Model::setAlignment(), EditableDenseThreeDimensionalModel::setCompletion(), BasicCompressedDenseThreeDimensionalModel::setCompletion(), TextModel::setCompletion(), ImageModel::setCompletion(), SparseOneDimensionalModel::setCompletion(), BoxModel::setCompletion(), RegionModel::setCompletion(), SparseTimeValueModel::setCompletion(), and NoteModel::setCompletion().
|
signalinherited |
Emitted when internal processing is complete (i.e.
when isReady() would return true, with completion at 100).
Referenced by ReadOnlyWaveFileModel::cacheFilled(), Model::getRDFTypeURI(), AggregateWaveModel::isReady(), and ReadOnlyWaveFileModel::isReady().
|
signalinherited |
Emitted when the completion percentage changes for the calculation of this model's alignment model.
(The ModelId provided is that of this model, not the alignment model.)
Referenced by Model::alignmentModelCompletionChanged(), Model::getRDFTypeURI(), and Model::setSourceModel().
|
inlineprotectedinherited |
Return an id for this object.
The id is a unique value for this object among all objects that implement WithId within this single run of the application.
Definition at line 193 of file ById.h.
References TypedId< T >::untyped.
Referenced by BoxModel::add(), RegionModel::add(), SparseTimeValueModel::add(), NoteModel::add(), Model::alignmentModelCompletionChanged(), ReadOnlyWaveFileModel::cacheFilled(), AggregateWaveModel::componentModelChanged(), componentModelChanged(), AggregateWaveModel::componentModelChangedWithin(), componentModelChangedWithin(), AggregateWaveModel::componentModelCompletionChanged(), ReadOnlyWaveFileModel::fillTimerTimedOut(), ImageModel::getInsertRowCommand(), TextModel::getInsertRowCommand(), SparseOneDimensionalModel::getInsertRowCommand(), RegionModel::getInsertRowCommand(), BoxModel::getInsertRowCommand(), SparseTimeValueModel::getInsertRowCommand(), NoteModel::getInsertRowCommand(), ImageModel::getRemoveRowCommand(), TextModel::getRemoveRowCommand(), SparseOneDimensionalModel::getRemoveRowCommand(), RegionModel::getRemoveRowCommand(), BoxModel::getRemoveRowCommand(), SparseTimeValueModel::getRemoveRowCommand(), NoteModel::getRemoveRowCommand(), ImageModel::getSetDataCommand(), TextModel::getSetDataCommand(), SparseOneDimensionalModel::getSetDataCommand(), RegionModel::getSetDataCommand(), BoxModel::getSetDataCommand(), SparseTimeValueModel::getSetDataCommand(), NoteModel::getSetDataCommand(), init(), NoteModel::NoteModel(), AlignmentModel::pathSourceCompletionChanged(), ReadOnlyWaveFileModel::ReadOnlyWaveFileModel(), ImageModel::remove(), TextModel::remove(), SparseOneDimensionalModel::remove(), BoxModel::remove(), RegionModel::remove(), SparseTimeValueModel::remove(), NoteModel::remove(), EditableDenseThreeDimensionalModel::setBinName(), BasicCompressedDenseThreeDimensionalModel::setBinName(), EditableDenseThreeDimensionalModel::setBinNames(), BasicCompressedDenseThreeDimensionalModel::setBinNames(), EditableDenseThreeDimensionalModel::setColumn(), BasicCompressedDenseThreeDimensionalModel::setColumn(), EditableDenseThreeDimensionalModel::setCompletion(), BasicCompressedDenseThreeDimensionalModel::setCompletion(), AlignmentModel::setCompletion(), TextModel::setCompletion(), ImageModel::setCompletion(), SparseOneDimensionalModel::setCompletion(), BoxModel::setCompletion(), RegionModel::setCompletion(), SparseTimeValueModel::setCompletion(), NoteModel::setCompletion(), SparseOneDimensionalModel::SparseOneDimensionalModel(), SparseTimeValueModel::SparseTimeValueModel(), writeComplete(), Model::~Model(), NoteModel::~NoteModel(), ReadOnlyWaveFileModel::~ReadOnlyWaveFileModel(), SparseOneDimensionalModel::~SparseOneDimensionalModel(), SparseTimeValueModel::~SparseTimeValueModel(), and ~WritableWaveFileModel().
|
inlineprotectedinherited |
|
inherited |
Return the numerical export identifier for this object.
It's allocated the first time this is called, so objects on which this is never called do not get allocated one.
Definition at line 71 of file XmlExportable.cpp.
References XmlExportable::m_exportId, and mutex.
Referenced by EditableDenseThreeDimensionalModel::toXml(), BasicCompressedDenseThreeDimensionalModel::toXml(), EventSeries::toXml(), ImageModel::toXml(), TextModel::toXml(), Model::toXml(), SparseOneDimensionalModel::toXml(), RegionModel::toXml(), BoxModel::toXml(), SparseTimeValueModel::toXml(), NoteModel::toXml(), and XmlExportable::~XmlExportable().
|
virtualinherited |
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(), RDFTransformFactoryImpl::getTransforms(), and XmlExportable::~XmlExportable().
|
staticinherited |
Definition at line 41 of file XmlExportable.cpp.
Referenced by TextMatcher::test(), PluginXml::toXml(), ReadOnlyWaveFileModel::toXml(), Transform::toXml(), toXml(), Model::toXml(), Event::toXml(), RegionModel::toXml(), BoxModel::toXml(), SparseTimeValueModel::toXml(), NoteModel::toXml(), and XmlExportable::~XmlExportable().
|
staticinherited |
Definition at line 54 of file XmlExportable.cpp.
Referenced by XmlExportable::~XmlExportable().
|
inlinevirtualinherited |
Reimplemented in SparseTimeValueModel.
Definition at line 28 of file Playable.h.
Referenced by PlayParameterRepository::addPlayable().
Member Data Documentation
|
static |
Definition at line 133 of file WritableWaveFileModel.h.
|
protected |
Definition at line 207 of file WritableWaveFileModel.h.
Referenced by addSamples(), getData(), getLocation(), getMaker(), getMultiChannelData(), getSummaries(), getSummary(), getSummaryBlockSize(), getTitle(), init(), isOK(), setStartFrame(), updateModel(), writeComplete(), and ~WritableWaveFileModel().
|
protected |
When normalising, this writer is used to write verbatim samples to the temporary file prior to normalisation.
Otherwise it's null
Definition at line 213 of file WritableWaveFileModel.h.
Referenced by addSamples(), init(), normaliseToTarget(), writeComplete(), and ~WritableWaveFileModel().
|
protected |
Definition at line 214 of file WritableWaveFileModel.h.
Referenced by init(), and normaliseToTarget().
|
protected |
When not normalising, this writer is used to write verbatim samples direct to the target file.
When normalising, it is used to write normalised samples to the target after the temporary file has been completed. But it is still created on initialisation, so that there is a file header ready for the reader to address.
Definition at line 223 of file WritableWaveFileModel.h.
Referenced by addSamples(), init(), normaliseToTarget(), writeComplete(), and ~WritableWaveFileModel().
|
protected |
Definition at line 224 of file WritableWaveFileModel.h.
|
protected |
Definition at line 226 of file WritableWaveFileModel.h.
Referenced by addSamples(), init(), updateModel(), writeComplete(), and ~WritableWaveFileModel().
|
protected |
Definition at line 227 of file WritableWaveFileModel.h.
Referenced by addSamples(), init(), and writeComplete().
|
protected |
Definition at line 228 of file WritableWaveFileModel.h.
Referenced by getNativeRate(), getSampleRate(), and init().
|
protected |
Definition at line 229 of file WritableWaveFileModel.h.
Referenced by getChannelCount(), and init().
|
protected |
Definition at line 230 of file WritableWaveFileModel.h.
Referenced by addSamples(), and getFrameCount().
|
protected |
Definition at line 231 of file WritableWaveFileModel.h.
Referenced by getStartFrame(), getTrueEndFrame(), init(), and setStartFrame().
|
protected |
Definition at line 232 of file WritableWaveFileModel.h.
Referenced by getWriteProportion(), setWriteProportion(), and writeComplete().
|
mutableprotectedinherited |
Definition at line 337 of file Model.h.
Referenced by Model::alignFromReference(), Model::alignToReference(), Model::getAlignment(), Model::getAlignmentCompletion(), Model::getAlignmentReference(), Model::getLocation(), Model::getMaker(), SparseTimeValueModel::getScaleUnits(), NoteModel::getScaleUnits(), NoteModel::getStartFrame(), Model::getTitle(), NoteModel::getTrueEndFrame(), Model::setAlignment(), SparseTimeValueModel::setScaleUnits(), NoteModel::setScaleUnits(), and Model::setSourceModel().
|
protectedinherited |
Definition at line 338 of file Model.h.
Referenced by Model::alignFromReference(), Model::alignToReference(), Model::getAlignmentCompletion(), Model::getLocation(), Model::getMaker(), Model::getSourceModel(), Model::getTitle(), and Model::setSourceModel().
|
protectedinherited |
Definition at line 339 of file Model.h.
Referenced by Model::alignFromReference(), Model::alignToReference(), Model::getAlignment(), Model::getAlignmentCompletion(), Model::getAlignmentReference(), and Model::setAlignment().
|
protectedinherited |
Definition at line 340 of file Model.h.
Referenced by Model::getRDFTypeURI(), and Model::setRDFTypeURI().
|
protectedinherited |
Definition at line 341 of file Model.h.
Referenced by Model::extendEndFrame(), and Model::getEndFrame().
The documentation for this class was generated from the following files:
Generated by 1.8.11