Loading...
Searching...
No Matches
juce_AudioFormatReaderSource.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 AudioFormatReaderSource : public PositionableAudioSource
{
public:
//==============================================================================
AudioFormatReaderSource (AudioFormatReader* sourceReader,
bool deleteReaderWhenThisIsDeleted);
~AudioFormatReaderSource() override;
//==============================================================================
void setLooping (bool shouldLoop) override;
bool isLooping() const override { return looping; }
AudioFormatReader* getAudioFormatReader() const noexcept { return reader; }
//==============================================================================
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
void releaseResources() override;
void getNextAudioBlock (const AudioSourceChannelInfo&) override;
//==============================================================================
void setNextReadPosition (int64 newPosition) override;
int64 getNextReadPosition() const override;
int64 getTotalLength() const override;
private:
//==============================================================================
OptionalScopedPointer<AudioFormatReader> reader;
int64 nextPlayPos;
bool looping;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioFormatReaderSource)
};
} // namespace juce
juce::AudioFormatReaderSource
Definition juce_AudioFormatReaderSource.h:38
juce::AudioFormatReaderSource::isLooping
bool isLooping() const override
Definition juce_AudioFormatReaderSource.h:66
juce::AudioFormatReaderSource::AudioFormatReaderSource
AudioFormatReaderSource(AudioFormatReader *sourceReader, bool deleteReaderWhenThisIsDeleted)
Definition juce_AudioFormatReaderSource.cpp:29
juce::AudioFormatReaderSource::getAudioFormatReader
AudioFormatReader * getAudioFormatReader() const noexcept
Definition juce_AudioFormatReaderSource.h:69
juce::AudioFormatReaderSource::setLooping
void setLooping(bool shouldLoop) override
Definition juce_AudioFormatReaderSource.cpp:42
juce::AudioFormatReader
Definition juce_AudioFormatReader.h:44
juce::OptionalScopedPointer
Definition juce_OptionalScopedPointer.h:38
juce::PositionableAudioSource::PositionableAudioSource
PositionableAudioSource()=default
juce::AudioSourceChannelInfo
Definition juce_AudioSource.h:33