Loading...
Searching...
No Matches
juce_AudioSubsectionReader.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
Agreement and JUCE Privacy Policy.
End User License Agreement: www.juce.com/juce-7-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API AudioSubsectionReader : public AudioFormatReader
{
public:
//==============================================================================
AudioSubsectionReader (AudioFormatReader* sourceReader,
int64 subsectionStartSample,
int64 subsectionLength,
bool deleteSourceWhenDeleted);
~AudioSubsectionReader() override;
//==============================================================================
bool readSamples (int* const* destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples) override;
void readMaxLevels (int64 startSample, int64 numSamples,
Range<float>* results, int numChannelsToRead) override;
using AudioFormatReader::readMaxLevels;
private:
//==============================================================================
AudioFormatReader* const source;
int64 startSample, length;
const bool deleteSourceWhenDeleted;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioSubsectionReader)
};
} // namespace juce
juce::AudioFormatReader::AudioFormatReader
AudioFormatReader(InputStream *sourceStream, const String &formatName)
Definition juce_AudioFormatReader.cpp:29
juce::AudioFormatReader::readMaxLevels
virtual void readMaxLevels(int64 startSample, int64 numSamples, Range< float > *results, int numChannelsToRead)
Definition juce_AudioFormatReader.cpp:209
juce::AudioSubsectionReader::AudioSubsectionReader
AudioSubsectionReader(AudioFormatReader *sourceReader, int64 subsectionStartSample, int64 subsectionLength, bool deleteSourceWhenDeleted)
Definition juce_AudioSubsectionReader.cpp:29
juce::AudioSubsectionReader::readMaxLevels
void readMaxLevels(int64 startSample, int64 numSamples, Range< float > *results, int numChannelsToRead) override
Definition juce_AudioSubsectionReader.cpp:66
juce::AudioSubsectionReader::readSamples
bool readSamples(int *const *destSamples, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int numSamples) override
Definition juce_AudioSubsectionReader.cpp:53
juce::Range
Definition juce_Range.h:40