18 std::optional<LibFileFormats::AcidizerTags> tags, std::string filename,
20 : tags {
std::move(tags) }
21 , filename {
std::move(filename) }
22 , clip(*singleClipWaveTrack.Intervals().
begin())
23 , mClip(singleClipWaveTrack.GetClipInterfaces()[0])
29 return mClip->GetRate();
34 return mClip->GetVisibleSampleCount().as_long_long();
38 float* buffer,
long long where,
size_t numFrames)
const
40 std::fill(buffer, buffer + numFrames, 0.f);
42 if (
mClip->NChannels() == 1)
46 buffer, buffer + numFrames, buffer, [](
float f) {
return f / 2; });
52 constexpr auto mayThrow =
false;
55 auto view =
mClip->GetSampleView(
iChannel, start, len, mayThrow);
56 cache.emplace(std::move(view));
57 cache->AddTo(buffer, len);
double GetSampleRate() const override
const std::shared_ptr< const ClipInterface > mClip
void AddChannel(size_t iChannel, float *buffer, sampleCount start, size_t len) const
ClipMirAudioReader(std::optional< LibFileFormats::AcidizerTags > tags, std::string filename, WaveTrack &singleClipWaveTrack)
long long GetNumSamples() const override
std::array< bool, 2 > mUseFirst
std::array< ChannelCache, 2 > mCache
void ReadFloats(float *buffer, long long where, size_t numFrames) const override
A Track that contains audio waveform data.
Positions or offsets within audio files need a wide type.
const char * begin(const char *str) noexcept