OpenShot Audio Library | OpenShotAudio 0.3.2

Loading...
Searching...
No Matches
juce_AudioFormatReaderSource.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 5 End-User License
11 Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
12 27th April 2017).
13
14 End User License Agreement: www.juce.com/juce-5-licence
15 Privacy Policy: www.juce.com/juce-5-privacy-policy
16
17 Or: You may also use this code under the terms of the GPL v3 (see
18 www.gnu.org/licenses).
19
20 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22 DISCLAIMED.
23
24 ==============================================================================
25*/
26
27 namespace juce
28{
29
30//==============================================================================
38 class JUCE_API AudioFormatReaderSource : public PositionableAudioSource
39{
40 public:
41 //==============================================================================
50 AudioFormatReaderSource (AudioFormatReader* sourceReader,
51 bool deleteReaderWhenThisIsDeleted);
52
54 ~AudioFormatReaderSource() override;
55
56 //==============================================================================
64 void setLooping (bool shouldLoop) override;
65
67 bool isLooping() const override { return looping; }
68
70 AudioFormatReader* getAudioFormatReader() const noexcept { return reader; }
71
72 //==============================================================================
74 void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
75
77 void releaseResources() override;
78
80 void getNextAudioBlock (const AudioSourceChannelInfo&) override;
81
82 //==============================================================================
84 void setNextReadPosition (int64 newPosition) override;
85
87 int64 getNextReadPosition() const override;
88
90 int64 getTotalLength() const override;
91
92 private:
93 //==============================================================================
94 OptionalScopedPointer<AudioFormatReader> reader;
95
96 int64 nextPlayPos;
97 bool looping;
98
99 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioFormatReaderSource)
100};
101
102} // namespace juce
juce::AudioFormatReaderSource
Definition: juce_AudioFormatReaderSource.h:39
juce::AudioFormatReaderSource::isLooping
bool isLooping() const override
Definition: juce_AudioFormatReaderSource.h:67
juce::AudioFormatReaderSource::getAudioFormatReader
AudioFormatReader * getAudioFormatReader() const noexcept
Definition: juce_AudioFormatReaderSource.h:70
juce::AudioFormatReader
Definition: juce_AudioFormatReader.h:45
juce::OptionalScopedPointer
Definition: juce_OptionalScopedPointer.h:38
juce::PositionableAudioSource
Definition: juce_PositionableAudioSource.h:39
juce::AudioSourceChannelInfo
Definition: juce_AudioSource.h:33