![]() |
Audacity 3.2.0
|
This allows multiple clips to be a part of one WaveTrack. More...
#include <WaveClip.h>
Public Types | |
using | Caches = Site< WaveClip, WaveClipListener > |
![]() | |
using | DataType = WaveClipListener |
using | DataPointer = UniquePtr< WaveClipListener > |
using | DataFactory = std::function< DataPointer(WaveClip &) > |
Type of function from which RegisteredFactory is constructed; it builds attachments. More... | |
Public Member Functions | |
WaveClip (const SampleBlockFactoryPtr &factory, sampleFormat format, int rate, int colourIndex) | |
WaveClip (const WaveClip &orig, const SampleBlockFactoryPtr &factory, bool copyCutlines) | |
WaveClip (const WaveClip &orig, const SampleBlockFactoryPtr &factory, bool copyCutlines, double t0, double t1) | |
virtual | ~WaveClip () |
void | ConvertToSampleFormat (sampleFormat format, const std::function< void(size_t)> &progressReport={}) |
sampleCount | TimeToSequenceSamples (double t) const |
sampleCount | ToSequenceSamples (sampleCount s) const |
int | GetRate () const |
void | SetRate (int rate) |
void | Resample (int rate, BasicUI::ProgressDialog *progress=NULL) |
void | SetColourIndex (int index) |
int | GetColourIndex () const |
double | GetSequenceStartTime () const noexcept |
void | SetSequenceStartTime (double startTime) |
double | GetSequenceEndTime () const |
sampleCount | GetSequenceStartSample () const |
Returns the index of the first sample of the underlying sequence. More... | |
sampleCount | GetSequenceEndSample () const |
Returns the index of the sample next after the last sample of the underlying sequence. More... | |
sampleCount | GetSequenceSamplesCount () const |
Returns the total number of samples in underlying sequence (not counting the cutlines) More... | |
double | GetPlayStartTime () const noexcept |
void | SetPlayStartTime (double time) |
double | GetPlayEndTime () const |
sampleCount | GetPlayStartSample () const |
sampleCount | GetPlayEndSample () const |
sampleCount | GetPlaySamplesCount () const |
void | SetTrimLeft (double trim) |
Sets the play start offset in seconds from the beginning of the underlying sequence. More... | |
double | GetTrimLeft () const noexcept |
Returns the play start offset in seconds from the beginning of the underlying sequence. More... | |
void | SetTrimRight (double trim) |
Sets the play end offset in seconds from the ending of the underlying sequence. More... | |
double | GetTrimRight () const noexcept |
Returns the play end offset in seconds from the ending of the underlying sequence. More... | |
void | TrimLeft (double deltaTime) |
Moves play start position by deltaTime. More... | |
void | TrimRight (double deltaTime) |
Moves play end position by deltaTime. More... | |
void | TrimLeftTo (double to) |
Sets the the left trimming to the absolute time (if that is in bounds) More... | |
void | TrimRightTo (double to) |
Sets the the right trimming to the absolute time (if that is in bounds) More... | |
void | Offset (double delta) noexcept |
bool | WithinPlayRegion (double t) const |
bool | BeforePlayStartTime (double t) const |
bool | AfterPlayEndTime (double t) const |
bool | GetSamples (samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool mayThrow=true) const |
void | SetSamples (constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len) |
Envelope * | GetEnvelope () |
const Envelope * | GetEnvelope () const |
BlockArray * | GetSequenceBlockArray () |
const BlockArray * | GetSequenceBlockArray () const |
Sequence * | GetSequence () |
const Sequence * | GetSequence () const |
void | MarkChanged () |
std::pair< float, float > | GetMinMax (double t0, double t1, bool mayThrow=true) const |
float | GetRMS (double t0, double t1, bool mayThrow=true) const |
void | UpdateEnvelopeTrackLen () |
std::shared_ptr< SampleBlock > | AppendNewBlock (samplePtr buffer, sampleFormat format, size_t len) |
For use in importing pre-version-3 projects to preserve sharing of blocks. More... | |
void | AppendSharedBlock (const std::shared_ptr< SampleBlock > &pBlock) |
For use in importing pre-version-3 projects to preserve sharing of blocks. More... | |
bool | Append (constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride) |
void | Flush () |
Flush must be called after last Append. More... | |
void | Clear (double t0, double t1) |
void | ClearLeft (double t) |
void | ClearRight (double t) |
void | ClearAndAddCutLine (double t0, double t1) |
Clear, and add cut line that starts at t0 and contains everything until t1. More... | |
void | Paste (double t0, const WaveClip *other) |
Paste data from other clip, resampling it if not equal rate. More... | |
void | InsertSilence (double t, double len, double *pEnvelopeValue=nullptr) |
void | AppendSilence (double len, double envelopeValue) |
WaveClipHolders & | GetCutLines () |
Get access to cut lines list. More... | |
const WaveClipConstHolders & | GetCutLines () const |
size_t | NumCutLines () const |
bool | FindCutLine (double cutLinePosition, double *cutLineStart=NULL, double *cutLineEnd=NULL) const |
void | ExpandCutLine (double cutLinePosition) |
bool | RemoveCutLine (double cutLinePosition) |
Remove cut line, without expanding the audio in it. More... | |
void | OffsetCutLines (double t0, double len) |
Offset cutlines right to time 't0' by time amount 'len'. More... | |
void | CloseLock () |
bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override |
void | HandleXMLEndTag (const std::string_view &tag) override |
XMLTagHandler * | HandleXMLChild (const std::string_view &tag) override |
void | WriteXML (XMLWriter &xmlFile) const |
bool | GetIsPlaceholder () const |
void | SetIsPlaceholder (bool val) |
bool | SharesBoundaryWithNextClip (const WaveClip *next) const |
void | SetName (const wxString &name) |
const wxString & | GetName () const |
sampleCount | TimeToSamples (double time) const noexcept |
double | SamplesToTime (sampleCount s) const noexcept |
void | SetSilence (sampleCount offset, sampleCount length) |
Silences the 'length' amount of samples starting from 'offset'(relative to the play start) More... | |
const SampleBuffer & | GetAppendBuffer () const |
size_t | GetAppendBufferLen () const |
![]() | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
![]() | |
~Site () | |
Site () | |
Site (const Site &other) | |
Site (Site &&other) | |
Site & | operator= (const Site &other) |
Site & | operator= (Site &&other) |
size_t | size () const |
How many attachment pointers are in the Site. More... | |
Subclass & | Get (const RegisteredFactory &key) |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
auto | Get (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass & > |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
Subclass * | Find (const RegisteredFactory &key) |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
auto | Find (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass * > |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
void | Assign (const RegisteredFactory &key, ReplacementPointer &&replacement) |
Reassign Site's pointer to ClientData. More... | |
Protected Member Functions | |
void | ClearSequence (double t0, double t1) |
![]() | |
void | ForEach (const Function &function) |
Invoke function on each ClientData object that has been created in this . More... | |
void | ForEach (const Function &function) const |
Invoke function on each ClientData object that has been created in this . More... | |
WaveClipListener * | FindIf (const Function &function) |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
const WaveClipListener * | FindIf (const Function &function) const |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
void | BuildAll () |
For each RegisteredFactory, if the corresponding attachment is absent in this , build and store it. More... | |
Protected Attributes | |
double | mSequenceOffset { 0 } |
double | mTrimLeft { 0 } |
double | mTrimRight { 0 } |
int | mRate |
int | mColourIndex |
std::unique_ptr< Sequence > | mSequence |
std::unique_ptr< Envelope > | mEnvelope |
SampleBuffer | mAppendBuffer {} |
size_t | mAppendBufferLen { 0 } |
WaveClipHolders | mCutLines {} |
bool | mIsPlaceholder { false } |
Private Member Functions | |
WaveClip (const WaveClip &) PROHIBITED | |
WaveClip & | operator= (const WaveClip &) PROHIBITED |
Private Attributes | |
wxString | mName |
Additional Inherited Members | |
![]() | |
static size_t | slots () |
How many static factories have been registered with this specialization of Site. More... | |
This allows multiple clips to be a part of one WaveTrack.
Definition at line 99 of file WaveClip.h.
using WaveClip::Caches = Site< WaveClip, WaveClipListener > |
Definition at line 110 of file WaveClip.h.
|
private |
WaveClip::WaveClip | ( | const SampleBlockFactoryPtr & | factory, |
sampleFormat | format, | ||
int | rate, | ||
int | colourIndex | ||
) |
Definition at line 43 of file WaveClip.cpp.
References factory, format, mColourIndex, mEnvelope, mRate, and mSequence.
WaveClip::WaveClip | ( | const WaveClip & | orig, |
const SampleBlockFactoryPtr & | factory, | ||
bool | copyCutlines | ||
) |
Definition at line 53 of file WaveClip.cpp.
References factory, GetIsPlaceholder(), mColourIndex, mCutLines, mEnvelope, mIsPlaceholder, mName, mRate, mSequence, mSequenceOffset, mTrimLeft, and mTrimRight.
WaveClip::WaveClip | ( | const WaveClip & | orig, |
const SampleBlockFactoryPtr & | factory, | ||
bool | copyCutlines, | ||
double | t0, | ||
double | t1 | ||
) |
Definition at line 80 of file WaveClip.cpp.
References factory, GetIsPlaceholder(), GetPlayEndTime(), GetPlayStartTime(), GetSequenceStartTime(), mColourIndex, mCutLines, mEnvelope, mIsPlaceholder, mRate, mSequence, mSequenceOffset, mTrimLeft, mTrimRight, and TimeToSequenceSamples().
|
virtual |
Definition at line 120 of file WaveClip.cpp.
bool WaveClip::AfterPlayEndTime | ( | double | t | ) | const |
Definition at line 1031 of file WaveClip.cpp.
References GetPlayEndSample(), mAppendBufferLen, and TimeToSamples().
bool WaveClip::Append | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
size_t | len, | ||
unsigned int | stride | ||
) |
You must call Flush after the last Append
Definition at line 229 of file WaveClip.cpp.
References SampleBuffer::Allocate(), CopySamples(), format, gHighQualityDither, mAppendBuffer, mAppendBufferLen, MarkChanged(), min(), mSequence, SampleBuffer::ptr(), SAMPLE_SIZE, and UpdateEnvelopeTrackLen().
Referenced by WaveTrack::Append().
std::shared_ptr< SampleBlock > WaveClip::AppendNewBlock | ( | samplePtr | buffer, |
sampleFormat | format, | ||
size_t | len | ||
) |
void WaveClip::AppendSharedBlock | ( | const std::shared_ptr< SampleBlock > & | pBlock | ) |
For use in importing pre-version-3 projects to preserve sharing of blocks.
Definition at line 221 of file WaveClip.cpp.
References mSequence.
void WaveClip::AppendSilence | ( | double | len, |
double | envelopeValue | ||
) |
Insert silence at the end, and causes the envelope to ramp linearly to the given value
Definition at line 520 of file WaveClip.cpp.
References GetPlayEndTime(), and InsertSilence().
bool WaveClip::BeforePlayStartTime | ( | double | t | ) | const |
Definition at line 1025 of file WaveClip.cpp.
References GetPlayStartSample(), and TimeToSamples().
void WaveClip::Clear | ( | double | t0, |
double | t1 | ||
) |
This name is consistent with WaveTrack::Clear. It performs a "Cut" operation (but without putting the cut audio to the clipboard)
Definition at line 527 of file WaveClip.cpp.
References ClearSequence(), GetPlayEndTime(), GetPlayStartTime(), GetSequenceEndTime(), GetSequenceStartTime(), GetTrimLeft(), Offset(), SetTrimLeft(), and SetTrimRight().
void WaveClip::ClearAndAddCutLine | ( | double | t0, |
double | t1 | ||
) |
Clear, and add cut line that starts at t0 and contains everything until t1.
Definition at line 629 of file WaveClip.cpp.
References Envelope::CollapseRegion(), Sequence::Delete(), GetEnvelope(), GetPlayEndTime(), GetPlayStartTime(), GetRate(), GetSequence(), GetSequenceStartTime(), MarkChanged(), mCutLines, min(), mSequence, Offset(), and TimeToSequenceSamples().
void WaveClip::ClearLeft | ( | double | t | ) |
Removes samples starting from the left boundary of the clip till t, if it's inside the play region. Also removes trimmed (hidden) data, if present. Changes offset to make remaining samples stay at their old place. Destructive operation.
Definition at line 550 of file WaveClip.cpp.
References ClearSequence(), GetPlayEndTime(), GetPlayStartTime(), GetSequenceStartTime(), SetSequenceStartTime(), and SetTrimLeft().
void WaveClip::ClearRight | ( | double | t | ) |
Removes samples starting from t (if it's inside the clip), till the right boundary. Also removes trimmed (hidden) data, if present. Destructive operation.
Definition at line 560 of file WaveClip.cpp.
References ClearSequence(), GetPlayEndTime(), GetPlayStartTime(), GetSequenceEndTime(), and SetTrimRight().
|
protected |
This name is consistent with WaveTrack::Clear. It performs a "Cut" operation (but without putting the cut audio to the clipboard)
Definition at line 569 of file WaveClip.cpp.
References Envelope::CollapseRegion(), Sequence::Delete(), GetEnvelope(), GetRate(), GetSequence(), GetSequenceEndTime(), GetSequenceStartTime(), MarkChanged(), mCutLines, min(), Offset(), and TimeToSequenceSamples().
Referenced by Clear(), ClearLeft(), ClearRight(), InsertSilence(), and Paste().
void WaveClip::CloseLock | ( | ) |
Definition at line 755 of file WaveClip.cpp.
References Sequence::CloseLock(), GetSequence(), and mCutLines.
void WaveClip::ConvertToSampleFormat | ( | sampleFormat | format, |
const std::function< void(size_t)> & | progressReport = {} |
||
) |
Definition at line 194 of file WaveClip.cpp.
References format, MarkChanged(), and mSequence.
void WaveClip::ExpandCutLine | ( | double | cutLinePosition | ) |
Expand cut line (that is, re-insert audio, then DELETE audio saved in cut line). Returns true if a cut line could be found and successfully expanded, false otherwise
Definition at line 697 of file WaveClip.cpp.
References PackedArray::end(), GetSequenceStartTime(), mCutLines, and Paste().
bool WaveClip::FindCutLine | ( | double | cutLinePosition, |
double * | cutLineStart = NULL , |
||
double * | cutLineEnd = NULL |
||
) | const |
Find cut line at (approximately) this position. Returns true and fills in cutLineStart and cutLineEnd (if specified) if a cut line at this position could be found. Return false otherwise.
Definition at line 677 of file WaveClip.cpp.
References GetSequenceStartTime(), and mCutLines.
void WaveClip::Flush | ( | ) |
Flush must be called after last Append.
Definition at line 290 of file WaveClip.cpp.
References mAppendBuffer, mAppendBufferLen, MarkChanged(), mSequence, SampleBuffer::ptr(), and UpdateEnvelopeTrackLen().
Referenced by WaveTrack::Flush().
|
inline |
Definition at line 327 of file WaveClip.h.
Referenced by WaveClipWaveformCache::GetWaveDisplay().
|
inline |
Definition at line 328 of file WaveClip.h.
Referenced by WaveClipWaveformCache::GetWaveDisplay().
|
inline |
Definition at line 149 of file WaveClip.h.
Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform().
|
inline |
|
inline |
Definition at line 277 of file WaveClip.h.
|
inline |
Definition at line 205 of file WaveClip.h.
Referenced by SetEnvelopeCommand::ApplyInner(), ClearAndAddCutLine(), ClearSequence(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), WaveTrack::GetEnvelopeAtTime(), AUPImportFileHandle::HandleEnvelope(), WaveTrack::HandleXMLChild(), and InsertSilence().
|
inline |
Definition at line 206 of file WaveClip.h.
|
inline |
Definition at line 312 of file WaveClip.h.
Referenced by WaveClip().
std::pair< float, float > WaveClip::GetMinMax | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
Getting high-level data for screen display and clipping calculations and Contrast
Definition at line 156 of file WaveClip.cpp.
References mSequence, THROW_INCONSISTENCY_EXCEPTION, and TimeToSequenceSamples().
const wxString & WaveClip::GetName | ( | ) | const |
sampleCount WaveClip::GetPlayEndSample | ( | ) | const |
Definition at line 925 of file WaveClip.cpp.
References GetPlaySamplesCount(), and GetPlayStartSample().
Referenced by AfterPlayEndTime(), EffectReverse::ProcessOneWave(), and WithinPlayRegion().
double WaveClip::GetPlayEndTime | ( | ) | const |
Definition at line 908 of file WaveClip.cpp.
References GetSequenceStartTime(), mAppendBufferLen, mRate, mSequence, mTrimRight, SamplesToTime(), and TimeToSamples().
Referenced by AUPImportFileHandle::AddSilence(), AppendSilence(), SetClipCommand::ApplyInner(), SetEnvelopeCommand::ApplyInner(), WaveTrack::CanInsertClip(), Clear(), ClearAndAddCutLine(), WaveTrack::ClearAndPaste(), ClearLeft(), ClearRight(), ClipParameters::ClipParameters(), ClipParameters::GetClipRect(), InsertSilence(), WaveTrackUtils::IsClipSelected(), WaveTrack::MergeClips(), Paste(), WaveTrack::PasteWaveTrack(), TrimLeftTo(), WaveTrack::UpdateLocationsCache(), and WaveClip().
sampleCount WaveClip::GetPlaySamplesCount | ( | ) | const |
Definition at line 930 of file WaveClip.cpp.
References mSequence, mTrimLeft, mTrimRight, and TimeToSamples().
Referenced by anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), GetPlayEndSample(), and SharesBoundaryWithNextClip().
sampleCount WaveClip::GetPlayStartSample | ( | ) | const |
Definition at line 920 of file WaveClip.cpp.
References GetPlayStartTime(), and TimeToSamples().
Referenced by BeforePlayStartTime(), WaveTrack::GetClipAtSample(), GetPlayEndSample(), EffectReverse::ProcessOneWave(), and WithinPlayRegion().
|
noexcept |
Definition at line 898 of file WaveClip.cpp.
References mSequenceOffset, mTrimLeft, SamplesToTime(), and TimeToSamples().
Referenced by SetClipCommand::ApplyInner(), SetEnvelopeCommand::ApplyInner(), WaveTrack::CanInsertClip(), Clear(), ClearAndAddCutLine(), WaveTrack::ClearAndPaste(), ClearLeft(), ClearRight(), ClipParameters::ClipParameters(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), ClipParameters::GetClipRect(), GetPlayStartSample(), InsertSilence(), WaveTrackUtils::IsClipSelected(), Paste(), WaveTrack::PasteWaveTrack(), WaveTrack::RightmostOrNewClip(), SharesBoundaryWithNextClip(), TrimRightTo(), and WaveClip().
|
inline |
Definition at line 139 of file WaveClip.h.
Referenced by ClearAndAddCutLine(), ClearSequence(), ClipParameters::ClipParameters(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), ClipParameters::GetClipRect(), WaveClipSpectrumCache::GetSpectrogram(), WaveClipWaveformCache::GetWaveDisplay(), InsertSilence(), Paste(), SharesBoundaryWithNextClip(), and UpdateEnvelopeTrackLen().
float WaveClip::GetRMS | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
Definition at line 177 of file WaveClip.cpp.
References mSequence, THROW_INCONSISTENCY_EXCEPTION, and TimeToSequenceSamples().
bool WaveClip::GetSamples | ( | samplePtr | buffer, |
sampleFormat | format, | ||
sampleCount | start, | ||
size_t | len, | ||
bool | mayThrow = true |
||
) | const |
Definition at line 124 of file WaveClip.cpp.
References format, mSequence, mTrimLeft, and TimeToSamples().
Referenced by anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples().
|
inline |
Definition at line 213 of file WaveClip.h.
Referenced by ClearAndAddCutLine(), ClearSequence(), CloseLock(), WaveTrack::GetIdealBlockSize(), WaveTrack::GetSequenceAtTime(), WaveClipWaveformCache::GetWaveDisplay(), AUPImportFileHandle::HandleSequence(), WaveTrack::HandleXMLChild(), InsertSilence(), and SetSilence().
|
inline |
Definition at line 214 of file WaveClip.h.
BlockArray * WaveClip::GetSequenceBlockArray | ( | ) |
Definition at line 141 of file WaveClip.cpp.
References mSequence.
const BlockArray * WaveClip::GetSequenceBlockArray | ( | ) | const |
Definition at line 146 of file WaveClip.cpp.
References mSequence.
sampleCount WaveClip::GetSequenceEndSample | ( | ) | const |
Returns the index of the sample next after the last sample of the underlying sequence.
Definition at line 1004 of file WaveClip.cpp.
References GetSequenceStartSample(), and mSequence.
double WaveClip::GetSequenceEndTime | ( | ) | const |
Definition at line 988 of file WaveClip.cpp.
References GetSequenceStartTime(), mAppendBufferLen, mRate, and mSequence.
Referenced by Clear(), ClearRight(), ClearSequence(), InsertSilence(), Paste(), TimeToSequenceSamples(), and TrimRightTo().
sampleCount WaveClip::GetSequenceSamplesCount | ( | ) | const |
Returns the total number of samples in underlying sequence (not counting the cutlines)
Definition at line 893 of file WaveClip.cpp.
References mSequence.
Referenced by WaveClipSpectrumCache::GetSpectrogram().
sampleCount WaveClip::GetSequenceStartSample | ( | ) | const |
Returns the index of the first sample of the underlying sequence.
Definition at line 999 of file WaveClip.cpp.
References mSequenceOffset, and TimeToSamples().
Referenced by GetSequenceEndSample(), and ToSequenceSamples().
|
noexcept |
Definition at line 976 of file WaveClip.cpp.
References mSequenceOffset.
Referenced by Clear(), ClearAndAddCutLine(), WaveTrack::ClearAndPaste(), ClearLeft(), ClearSequence(), ExpandCutLine(), FindCutLine(), GetPlayEndTime(), GetSequenceEndTime(), WaveClipSpectrumCache::GetSpectrogram(), InsertSilence(), OffsetCutLines(), Paste(), RemoveCutLine(), TimeToSequenceSamples(), TrimLeftTo(), WaveTrack::UpdateLocationsCache(), and WaveClip().
|
noexcept |
Returns the play start offset in seconds from the beginning of the underlying sequence.
Definition at line 941 of file WaveClip.cpp.
References mTrimLeft.
Referenced by Clear(), WaveTrack::ClearAndPaste(), WaveClipSpectrumCache::GetSpectrogram(), WaveClipWaveformCache::GetWaveDisplay(), Paste(), and SetSilence().
|
noexcept |
Returns the play end offset in seconds from the ending of the underlying sequence.
Definition at line 951 of file WaveClip.cpp.
References mTrimRight.
Referenced by WaveTrack::ClearAndPaste(), WaveClipSpectrumCache::GetSpectrogram(), and Paste().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 368 of file WaveClip.cpp.
References mCutLines, mEnvelope, mRate, and mSequence.
Referenced by AUPImportFileHandle::HandleWaveClip().
|
override |
Definition at line 362 of file WaveClip.cpp.
References UpdateEnvelopeTrackLen().
Referenced by WaveTrack::HandleXMLEndTag().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 315 of file WaveClip.cpp.
References SetColourIndex(), SetName(), SetSequenceStartTime(), SetTrimLeft(), and SetTrimRight().
void WaveClip::InsertSilence | ( | double | t, |
double | len, | ||
double * | pEnvelopeValue = nullptr |
||
) |
Insert silence - note that this is an efficient operation for large amounts of silence
Definition at line 481 of file WaveClip.cpp.
References ClearSequence(), GetEnvelope(), GetPlayEndTime(), GetPlayStartTime(), GetRate(), GetSequence(), GetSequenceEndTime(), GetSequenceStartTime(), Sequence::InsertSilence(), MarkChanged(), mRate, OffsetCutLines(), SetTrimRight(), and TimeToSequenceSamples().
Referenced by AUPImportFileHandle::AddSilence(), and AppendSilence().
void WaveClip::MarkChanged | ( | ) |
WaveTrack calls this whenever data in the wave clip changes. It is called automatically when WaveClip has a chance to know that something has changed, like when member functions SetSamples() etc. are called.
Definition at line 151 of file WaveClip.cpp.
References WaveClipListener::MarkChanged().
Referenced by Append(), ClearAndAddCutLine(), ClearSequence(), ConvertToSampleFormat(), Flush(), InsertSilence(), Paste(), SetRate(), SetSamples(), and SetSilence().
|
inline |
Definition at line 279 of file WaveClip.h.
Referenced by WaveTrack::UpdateLocationsCache().
|
noexcept |
Definition at line 1009 of file WaveClip.cpp.
Referenced by Clear(), ClearAndAddCutLine(), WaveTrack::ClearAndPaste(), ClearSequence(), and WaveTrack::Copy().
void WaveClip::OffsetCutLines | ( | double | t0, |
double | len | ||
) |
Offset cutlines right to time 't0' by time amount 'len'.
Definition at line 746 of file WaveClip.cpp.
References GetSequenceStartTime(), and mCutLines.
Referenced by InsertSilence(), and Paste().
void WaveClip::Paste | ( | double | t0, |
const WaveClip * | other | ||
) |
Paste data from other clip, resampling it if not equal rate.
Definition at line 406 of file WaveClip.cpp.
References sampleCount::as_double(), ClearSequence(), GetPlayEndTime(), GetPlayStartTime(), GetRate(), GetSequenceEndTime(), GetSequenceStartTime(), GetTrimLeft(), GetTrimRight(), MarkChanged(), mCutLines, mEnvelope, mRate, mSequence, OffsetCutLines(), SetTrimLeft(), SetTrimRight(), and TimeToSequenceSamples().
Referenced by WaveTrack::ClearAndPaste(), ExpandCutLine(), WaveTrack::MergeClips(), and WaveTrack::PasteWaveTrack().
bool WaveClip::RemoveCutLine | ( | double | cutLinePosition | ) |
Remove cut line, without expanding the audio in it.
Definition at line 729 of file WaveClip.cpp.
References GetSequenceStartTime(), and mCutLines.
void WaveClip::Resample | ( | int | rate, |
BasicUI::ProgressDialog * | progress = NULL |
||
) |
We want to keep going as long as we have something to feed the resampler with OR as long as the resampler spews out samples (which could continue for a few iterations after we stop feeding it)
Definition at line 771 of file WaveClip.cpp.
References floatSample, Internal, WaveClipListener::Invalidate(), limitSampleBufferSize(), mRate, mSequence, BasicUI::ProgressDialog::Poll(), Resample::Process(), BasicUI::Success, and XO.
|
noexcept |
Definition at line 882 of file WaveClip.cpp.
Referenced by GetPlayEndTime(), and GetPlayStartTime().
|
inline |
Definition at line 148 of file WaveClip.h.
Referenced by SetClipCommand::ApplyInner(), and HandleXMLTag().
|
inline |
Definition at line 313 of file WaveClip.h.
void WaveClip::SetName | ( | const wxString & | name | ) |
Definition at line 867 of file WaveClip.cpp.
Referenced by SetClipCommand::ApplyInner(), and HandleXMLTag().
void WaveClip::SetPlayStartTime | ( | double | time | ) |
Definition at line 903 of file WaveClip.cpp.
References mTrimLeft, and SetSequenceStartTime().
Referenced by SetClipCommand::ApplyInner().
void WaveClip::SetRate | ( | int | rate | ) |
Definition at line 762 of file WaveClip.cpp.
References MarkChanged(), mEnvelope, mRate, and mSequence.
void WaveClip::SetSamples | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
sampleCount | start, | ||
size_t | len | ||
) |
Definition at line 131 of file WaveClip.cpp.
References format, MarkChanged(), mSequence, mTrimLeft, and TimeToSamples().
void WaveClip::SetSequenceStartTime | ( | double | startTime | ) |
Definition at line 982 of file WaveClip.cpp.
References mEnvelope, and mSequenceOffset.
Referenced by WaveTrack::ClearAndPaste(), ClearLeft(), WaveTrack::HandleXMLChild(), HandleXMLTag(), and SetPlayStartTime().
void WaveClip::SetSilence | ( | sampleCount | offset, |
sampleCount | length | ||
) |
Silences the 'length' amount of samples starting from 'offset'(relative to the play start)
Definition at line 887 of file WaveClip.cpp.
References GetSequence(), GetTrimLeft(), MarkChanged(), Sequence::SetSilence(), and TimeToSamples().
void WaveClip::SetTrimLeft | ( | double | trim | ) |
Sets the play start offset in seconds from the beginning of the underlying sequence.
Definition at line 936 of file WaveClip.cpp.
References mTrimLeft.
Referenced by Clear(), WaveTrack::ClearAndPaste(), ClearLeft(), HandleXMLTag(), and Paste().
void WaveClip::SetTrimRight | ( | double | trim | ) |
Sets the play end offset in seconds from the ending of the underlying sequence.
Definition at line 946 of file WaveClip.cpp.
References mTrimRight.
Referenced by Clear(), WaveTrack::ClearAndPaste(), ClearRight(), HandleXMLTag(), InsertSilence(), and Paste().
bool WaveClip::SharesBoundaryWithNextClip | ( | const WaveClip * | next | ) | const |
Definition at line 857 of file WaveClip.cpp.
References sampleCount::as_double(), GetPlaySamplesCount(), GetPlayStartTime(), and GetRate().
|
noexcept |
Definition at line 877 of file WaveClip.cpp.
Referenced by AfterPlayEndTime(), BeforePlayStartTime(), GetPlayEndTime(), GetPlaySamplesCount(), GetPlayStartSample(), GetPlayStartTime(), GetSamples(), GetSequenceStartSample(), SetSamples(), SetSilence(), TimeToSequenceSamples(), and WithinPlayRegion().
sampleCount WaveClip::TimeToSequenceSamples | ( | double | t | ) | const |
Definition at line 1037 of file WaveClip.cpp.
References GetSequenceEndTime(), GetSequenceStartTime(), mSequence, and TimeToSamples().
Referenced by ClearAndAddCutLine(), ClearSequence(), GetMinMax(), GetRMS(), InsertSilence(), Paste(), and WaveClip().
sampleCount WaveClip::ToSequenceSamples | ( | sampleCount | s | ) | const |
Definition at line 1046 of file WaveClip.cpp.
References GetSequenceStartSample().
void WaveClip::TrimLeft | ( | double | deltaTime | ) |
Moves play start position by deltaTime.
Definition at line 956 of file WaveClip.cpp.
References mTrimLeft.
void WaveClip::TrimLeftTo | ( | double | to | ) |
Sets the the left trimming to the absolute time (if that is in bounds)
Definition at line 966 of file WaveClip.cpp.
References GetPlayEndTime(), GetSequenceStartTime(), and mTrimLeft.
void WaveClip::TrimRight | ( | double | deltaTime | ) |
Moves play end position by deltaTime.
Definition at line 961 of file WaveClip.cpp.
References mTrimRight.
void WaveClip::TrimRightTo | ( | double | to | ) |
Sets the the right trimming to the absolute time (if that is in bounds)
Definition at line 971 of file WaveClip.cpp.
References GetPlayStartTime(), GetSequenceEndTime(), and mTrimRight.
void WaveClip::UpdateEnvelopeTrackLen | ( | ) |
Whenever you do an operation to the sequence that will change the number of samples (that is, the length of the clip), you will want to call this function to tell the envelope about it.
Definition at line 206 of file WaveClip.cpp.
References GetRate(), mEnvelope, mRate, and mSequence.
Referenced by Append(), Flush(), and HandleXMLEndTag().
bool WaveClip::WithinPlayRegion | ( | double | t | ) | const |
Definition at line 1019 of file WaveClip.cpp.
References GetPlayEndSample(), GetPlayStartSample(), mAppendBufferLen, and TimeToSamples().
void WaveClip::WriteXML | ( | XMLWriter & | xmlFile | ) | const |
Definition at line 386 of file WaveClip.cpp.
|
protected |
Definition at line 347 of file WaveClip.h.
|
protected |
Definition at line 348 of file WaveClip.h.
Referenced by AfterPlayEndTime(), Append(), Flush(), GetPlayEndTime(), GetSequenceEndTime(), and WithinPlayRegion().
|
protected |
Definition at line 342 of file WaveClip.h.
Referenced by WaveClip().
|
protected |
Definition at line 352 of file WaveClip.h.
Referenced by ClearAndAddCutLine(), ClearSequence(), CloseLock(), ExpandCutLine(), FindCutLine(), HandleXMLChild(), OffsetCutLines(), Paste(), RemoveCutLine(), and WaveClip().
|
protected |
Definition at line 345 of file WaveClip.h.
Referenced by HandleXMLChild(), Paste(), SetRate(), SetSequenceStartTime(), UpdateEnvelopeTrackLen(), and WaveClip().
|
protected |
Definition at line 355 of file WaveClip.h.
Referenced by WaveClip().
|
private |
Definition at line 358 of file WaveClip.h.
Referenced by GetName(), SetName(), and WaveClip().
|
protected |
Definition at line 341 of file WaveClip.h.
Referenced by GetPlayEndTime(), GetSequenceEndTime(), HandleXMLChild(), InsertSilence(), Paste(), Resample(), SetRate(), UpdateEnvelopeTrackLen(), and WaveClip().
|
protected |
Definition at line 344 of file WaveClip.h.
Referenced by Append(), AppendNewBlock(), AppendSharedBlock(), ClearAndAddCutLine(), ConvertToSampleFormat(), Flush(), GetMinMax(), GetPlayEndTime(), GetPlaySamplesCount(), GetRMS(), GetSamples(), GetSequenceBlockArray(), GetSequenceEndSample(), GetSequenceEndTime(), GetSequenceSamplesCount(), HandleXMLChild(), Paste(), Resample(), SetRate(), SetSamples(), TimeToSequenceSamples(), UpdateEnvelopeTrackLen(), and WaveClip().
|
protected |
Definition at line 337 of file WaveClip.h.
Referenced by GetPlayStartTime(), GetSequenceStartSample(), GetSequenceStartTime(), SetSequenceStartTime(), and WaveClip().
|
protected |
Definition at line 338 of file WaveClip.h.
Referenced by GetPlaySamplesCount(), GetPlayStartTime(), GetSamples(), GetTrimLeft(), SetPlayStartTime(), SetSamples(), SetTrimLeft(), TrimLeft(), TrimLeftTo(), and WaveClip().
|
protected |
Definition at line 339 of file WaveClip.h.
Referenced by GetPlayEndTime(), GetPlaySamplesCount(), GetTrimRight(), SetTrimRight(), TrimRight(), TrimRightTo(), and WaveClip().