34 for (
auto track : outputs.Get().Selected<
WaveTrack>()) {
35 auto pNewTrack = track->EmptyCopy();
69 auto outTrack = *outTracks;
72 double trackStart =
mPass == 0 ? track->GetStartTime() : (*outTracks)->GetStartTime();
73 double trackEnd =
mPass == 0 ? track->GetEndTime() : (*outTracks)->GetEndTime();
83 (*outTracks)->InsertSilence(0,
mCurT0);
88 auto start = track->TimeToLongSamples(
mCurT0);
89 auto end = track->TimeToLongSamples(
mCurT1);
104 auto outIter = outTrack->Channels().begin();
105 for (
const auto pChannel : track->Channels())
130 auto len = (
end - start).as_double();
135 Floats buffer1{ maxblock };
136 Floats buffer2{ maxblock };
141 track.
GetFloats(buffer1.get(), start, samples1);
154 auto s = start + samples1;
162 track.
GetFloats(buffer2.get(), s, samples2);
178 if (!outTrack.
SetFloats(buffer1.get(), s - samples1,
203 buffer1.swap(buffer2);
220 if (!outTrack.
SetFloats(buffer1.get(), s - samples1,
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
static Settings & settings()
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
std::shared_ptr< TrackList > mTracks
const AudacityProject * FindProject() const
virtual EffectType GetType() const =0
Type determines how it behaves.
bool TotalProgress(double frac, const TranslatableString &={}) const
int GetNumWaveTracks() const
Performs effect computation.
Use this object to copy the input tracks to tentative outputTracks.
virtual bool TwoBufferProcessPass2(float *buffer1, size_t len1, float *buffer2, size_t len2)
bool ProcessPass(EffectSettings &settings)
virtual bool NewTrackPass1()
TrackList * mTrackLists[2]
virtual bool TwoBufferProcessPass1(float *buffer1, size_t len1, float *buffer2, size_t len2)
bool Process(EffectInstance &instance, EffectSettings &settings) override
~EffectTwoPassSimpleMono() override
std::shared_ptr< TrackList > mWorkTracks
virtual bool NewTrackPass2()
bool ProcessOne(WaveChannel &t, WaveChannel &outTrack, sampleCount start, sampleCount end)
static TrackListHolder Create(AudacityProject *pOwner)
static TrackList & Get(AudacityProject &project)
bool SetFloats(const float *buffer, sampleCount start, size_t len, sampleFormat effectiveFormat=widestSampleFormat)
Random-access assignment of a range of samples.
bool Append(constSamplePtr buffer, sampleFormat format, size_t len)
bool GetFloats(float *buffer, sampleCount start, size_t len, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
"narrow" overload fetches from the unique channel
size_t GetBestBlockSize(sampleCount t) const
A hint for sizing of well aligned fetches.
size_t GetMaxBlockSize() const
A Track that contains audio waveform data.
Positions or offsets within audio files need a wide type.
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
const char * end(const char *str) noexcept
Externalized state of a plug-in.