|
Audacity
3.0.3
|
Go to the documentation of this file.
19 #include "../Audacity.h"
22 #include "../blockfile/ODDecodeBlockFile.h"
23 #include "../Sequence.h"
24 #include "../WaveClip.h"
25 #include "../WaveTrack.h"
63 auto locker = bf->LockForRead();
68 bf->SetODFileDecoder(decoder);
70 ret = bf->DoWriteBlockFile();
75 blockStartSample = bf->GetStart();
76 blockEndSample = blockStartSample + bf->GetLength();
108 #if 0 // LLL: Commented out while removing OD files handling
109 waveTrack->AddInvalidRegion(blockStartSample,blockEndSample);
130 for (
unsigned int i = 0; i <
mDecoders.size(); i++) {
140 std::vector< std::weak_ptr< ODDecodeBlockFile > > tempBlocks;
153 for (
const auto &clip : waveTrack->GetAllClips()) {
154 seq = clip->GetSequence();
156 seq->LockDeleteUpdateMutex();
159 blocks = clip->GetSequenceBlockArray();
164 for (i = 0; i<(int)blocks->size(); i++)
168 const auto &file = block.f;
169 std::shared_ptr<ODDecodeBlockFile> oddbFile;
170 if (!file->IsDataAvailable() &&
172 std::static_pointer_cast<ODDecodeBlockFile>(file))->GetDecodeType() == this->
GetODType())
176 clip->GetStartTime()*clip->GetRate()
181 std::shared_ptr< ODDecodeBlockFile > ptr;
182 while(insertCursor < (
int)tempBlocks.size() &&
183 (!(ptr = tempBlocks[insertCursor].lock()) ||
189 tempBlocks.insert(tempBlocks.begin() + insertCursor++, oddbFile);
193 seq->UnlockDeleteUpdateMutex();
207 (std::vector< std::weak_ptr< ODDecodeBlockFile > > &unorderedBlocks)
216 std::shared_ptr< ODDecodeBlockFile > firstBlock;
217 for(
auto i = unorderedBlocks.size(); i--; )
219 auto ptr = unorderedBlocks[i].lock();
227 ptr->GetGlobalEnd() >= processStartSample &&
A Track that contains audio waveform data.
virtual ODFileDecoder * CreateFileDecoder(const wxString &fileName)=0
Creates an ODFileDecoder that decodes a file of filetype the subclass handles.
virtual void DemandTrackUpdate(WaveTrack *track, double seconds)
changes the tasks associated with this Waveform to process the task from a different point in the tra...
void CalculatePercentComplete() override
recalculates the percentage complete.
virtual int GetNumFileDecoders()
An AliasBlockFile that references uncompressed data in an existing file.
void SetStart(sampleCount startSample)
Sets the value that indicates where the first sample in this block corresponds to the global sequence...
void DoSomeInternal() override
Computes and writes the data for one BlockFile if it still has a refcount.
sampleCount GetGlobalStart() const
A WaveTrack contains WaveClip(s). A WaveClip contains a Sequence. A Sequence is primarily an interfac...
void SetClipOffset(sampleCount numSamples)
sets the amount of samples the clip associated with this blockfile is offset in the wavetrack (non ef...
ODLock mPercentCompleteMutex
std::vector< std::weak_ptr< WaveTrack > > mWaveTracks
std::vector< std::unique_ptr< ODFileDecoder > > mDecoders
void Update() override
by default creates the order of the wavetrack to load.
unsigned int GetDecodeType() const
Returns the type of audiofile this blockfile is loaded from.
ODDecodeTask()
Creates a NEW task that decodes files.
void OrderBlockFiles(std::vector< std::weak_ptr< ODDecodeBlockFile > > &unorderedBlocks)
Orders the input as either On-Demand or default layered order.
virtual ODFileDecoder * GetOrCreateMatchingFileDecoder(ODDecodeBlockFile *blockFile)
sampleCount GetGlobalEnd() const
sampleCount GetStart() const
Gets the value that indicates where the first sample in this block corresponds to the global sequence...
Data structure containing pointer to a sample block and a start time. Element of a BlockArray.
class to decode a particular file (one per file). Saves info such as filename and length (after the h...
Positions or offsets within audio files need a wide type.
void DemandTrackUpdate(WaveTrack *track, double seconds) override
volatile float mPercentComplete
virtual sampleCount GetDemandSample() const
virtual bool SeekingAllowed()
const wxFileName & GetAudioFileName()
std::vector< std::weak_ptr< ODDecodeBlockFile > > mBlockFiles
unsigned int GetODType() override
Subclasses should override to return respective type.
sampleCount GetClipOffset() const
Gets the number of samples the clip associated with this blockfile is offset by.
sampleCount start
the sample in the global wavetrack that this block starts at.