OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
AudioBufferSource.h
Go to the documentation of this file.
1
9// Copyright (c) 2008-2019 OpenShot Studios, LLC
10//
11// SPDX-License-Identifier: LGPL-3.0-or-later
12
13#ifndef OPENSHOT_AUDIOBUFFERSOURCE_H
14#define OPENSHOT_AUDIOBUFFERSOURCE_H
15
16#include <AppConfig.h>
17#include <juce_audio_basics/juce_audio_basics.h>
18
19namespace openshot
20{
27 class AudioBufferSource : public juce::PositionableAudioSource
28 {
29 private:
30 int position;
31 bool repeat;
33
34 public:
38
41
44 void getNextAudioBlock (const juce::AudioSourceChannelInfo& info);
45
47 void prepareToPlay(int, double);
48
50 void releaseResources();
51
54 void setNextReadPosition (juce::int64 newPosition);
55
57 juce::int64 getNextReadPosition() const;
58
60 juce::int64 getTotalLength() const;
61
63 bool isLooping() const;
64
67 void setLooping (bool shouldLoop);
68
70 void setBuffer (juce::AudioBuffer<float> *audio_buffer);
71 };
72
73}
74
75#endif
This class is used to expose an AudioBuffer<float> as an AudioSource in JUCE.
void prepareToPlay(int, double)
Prepare to play this audio source.
void releaseResources()
Release all resources.
void setBuffer(juce::AudioBuffer< float > *audio_buffer)
Update the internal buffer used by this source.
void getNextAudioBlock(const juce::AudioSourceChannelInfo &info)
Get the next block of audio samples.
bool isLooping() const
Determines if this audio source should repeat when it reaches the end.
void setNextReadPosition(juce::int64 newPosition)
Set the next read position of this source.
juce::int64 getNextReadPosition() const
Get the next read position of this source.
juce::int64 getTotalLength() const
Get the total length (in samples) of this audio source.
void setLooping(bool shouldLoop)
Set if this audio source should repeat when it reaches the end.
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29