14#ifndef OPENSHOT_AUDIO_PLAYBACK_THREAD_H
15#define OPENSHOT_AUDIO_PLAYBACK_THREAD_H
24#include <OpenShotAudio.h>
26#include <juce_audio_basics/juce_audio_basics.h>
27#include <juce_audio_devices/juce_audio_devices.h>
42class AudioDeviceManagerSingleton {
48 static AudioDeviceManagerSingleton* m_pInstance;
61 static AudioDeviceManagerSingleton*
Instance();
65 static AudioDeviceManagerSingleton*
Instance(
int rate,
int channels);
77 class AudioPlaybackThread : juce::Thread
79 juce::AudioSourcePlayer player;
80 juce::AudioTransportSource transport;
81 juce::MixerAudioSource mixer;
85 juce::WaitableEvent play;
87 juce::TimeSliceThread time_thread;
89 std::mutex transportMutex;
90 std::condition_variable transportCondition;
95 ~AudioPlaybackThread();
98 void NotifyTransportStateChanged();
104 std::shared_ptr<openshot::Frame> getFrame();
110 void Seek(int64_t new_position);
119 void setSpeed(
int new_speed) {
if (source) source->setSpeed(new_speed); }
122 int getSpeed()
const {
if (source)
return source->getSpeed();
else return 1; }
125 std::string getError()
131 double getDefaultSampleRate()
Header file for Audio Device Info struct.
Header file for AudioReaderSource class.
Header file for ReaderBase class.
Header file for RendererBase class.
Header file for VideoCacheThread class.
double defaultSampleRate
Default sample rate (as detected).
void CloseAudioDevice()
Close audio device.
static AudioDeviceManagerSingleton * Instance()
Override with default sample rate & channels (44100, 2) and no preferred audio device.
juce::AudioDeviceManager audioDeviceManager
Public device manager property.
AudioDeviceInfo currentAudioDevice
Current open audio device (or last attempted device - if none were successful).
std::string initialise_error
Error found during JUCE initialise method.
A class which probes the available audio devices.
AudioDeviceList getNames()
friend class PlayerPrivate
This class is used to expose any ReaderBase derived class as an AudioSource in JUCE.
This class represents a single frame of video (i.e. image & audio data).
The private part of QtPlayer class, which contains an audio thread and video thread,...
This class is used to playback a video from a reader.
This abstract class is the base class, used by all readers in libopenshot.
Handles prefetching and caching of video/audio frames for smooth playback.
This namespace is the default namespace for all code in the openshot library.
std::vector< std::pair< std::string, std::string > > AudioDeviceList
This struct hold information about Audio Devices.