OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
AudioBufferSource.h
Go to the documentation of this file.
1
8
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
19
namespace
openshot
20
{
27
class
AudioBufferSource
:
public
juce::PositionableAudioSource
28
{
29
private
:
30
int
position;
31
bool
repeat;
32
juce::AudioBuffer<float>
*buffer;
33
34
public
:
37
AudioBufferSource
(
juce::AudioBuffer<float>
*audio_buffer);
38
40
~AudioBufferSource
();
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
juce::AudioBuffer
Definition
Frame.h:37
openshot::AudioBufferSource::AudioBufferSource
AudioBufferSource(juce::AudioBuffer< float > *audio_buffer)
Default constructor.
Definition
AudioBufferSource.cpp:19
openshot::AudioBufferSource::~AudioBufferSource
~AudioBufferSource()
Destructor.
Definition
AudioBufferSource.cpp:24
openshot::AudioBufferSource::prepareToPlay
void prepareToPlay(int, double)
Prepare to play this audio source.
Definition
AudioBufferSource.cpp:77
openshot::AudioBufferSource::releaseResources
void releaseResources()
Release all resources.
Definition
AudioBufferSource.cpp:80
openshot::AudioBufferSource::setBuffer
void setBuffer(juce::AudioBuffer< float > *audio_buffer)
Update the internal buffer used by this source.
Definition
AudioBufferSource.cpp:119
openshot::AudioBufferSource::getNextAudioBlock
void getNextAudioBlock(const juce::AudioSourceChannelInfo &info)
Get the next block of audio samples.
Definition
AudioBufferSource.cpp:31
openshot::AudioBufferSource::isLooping
bool isLooping() const
Determines if this audio source should repeat when it reaches the end.
Definition
AudioBufferSource.cpp:105
openshot::AudioBufferSource::setNextReadPosition
void setNextReadPosition(juce::int64 newPosition)
Set the next read position of this source.
Definition
AudioBufferSource.cpp:83
openshot::AudioBufferSource::getNextReadPosition
juce::int64 getNextReadPosition() const
Get the next read position of this source.
Definition
AudioBufferSource.cpp:91
openshot::AudioBufferSource::getTotalLength
juce::int64 getTotalLength() const
Get the total length (in samples) of this audio source.
Definition
AudioBufferSource.cpp:98
openshot::AudioBufferSource::setLooping
void setLooping(bool shouldLoop)
Set if this audio source should repeat when it reaches the end.
Definition
AudioBufferSource.cpp:112
openshot
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
AudioBufferSource.h
Generated by
1.17.0