Loading...
Searching...
No Matches
AudioBufferSource.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_AUDIOBUFFERSOURCE_H
#define OPENSHOT_AUDIOBUFFERSOURCE_H
#include <AppConfig.h>
#include <juce_audio_basics/juce_audio_basics.h>
namespace openshot
{
class AudioBufferSource : public juce::PositionableAudioSource
{
private:
int position;
bool repeat;
juce::AudioBuffer<float> *buffer;
public:
AudioBufferSource(juce::AudioBuffer<float> *audio_buffer);
~AudioBufferSource();
void getNextAudioBlock (const juce::AudioSourceChannelInfo& info);
void prepareToPlay(int, double);
void releaseResources();
void setNextReadPosition (juce::int64 newPosition);
juce::int64 getNextReadPosition() const;
juce::int64 getTotalLength() const;
bool isLooping() const;
void setLooping (bool shouldLoop);
void setBuffer (juce::AudioBuffer<float> *audio_buffer);
};
}
#endif
juce::AudioBuffer
Definition Frame.h:38
openshot::AudioBufferSource
This class is used to expose an AudioBuffer<float> as an AudioSource in JUCE.
Definition AudioBufferSource.h:28
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 Compressor.h:29