mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 23:25:46 -04:00
Move Cubeb AudioStream to FrontendCommon
This way it doesn't need to be built for libretro.
This commit is contained in:
35
src/frontend-common/cubeb_audio_stream.h
Normal file
35
src/frontend-common/cubeb_audio_stream.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
#include "common/audio_stream.h"
|
||||
#include "cubeb/cubeb.h"
|
||||
#include <cstdint>
|
||||
|
||||
class CubebAudioStream final : public AudioStream
|
||||
{
|
||||
public:
|
||||
CubebAudioStream();
|
||||
~CubebAudioStream();
|
||||
|
||||
static std::unique_ptr<AudioStream> Create();
|
||||
|
||||
protected:
|
||||
bool IsOpen() const { return m_cubeb_stream != nullptr; }
|
||||
|
||||
bool OpenDevice() override;
|
||||
void PauseDevice(bool paused) override;
|
||||
void CloseDevice() override;
|
||||
void FramesAvailable() override;
|
||||
|
||||
void DestroyContext();
|
||||
|
||||
static long DataCallback(cubeb_stream* stm, void* user_ptr, const void* input_buffer, void* output_buffer,
|
||||
long nframes);
|
||||
static void StateCallback(cubeb_stream* stream, void* user_ptr, cubeb_state state);
|
||||
|
||||
cubeb* m_cubeb_context = nullptr;
|
||||
cubeb_stream* m_cubeb_stream = nullptr;
|
||||
bool m_paused = true;
|
||||
|
||||
#ifdef WIN32
|
||||
bool m_com_initialized_by_us = false;
|
||||
#endif
|
||||
};
|
Reference in New Issue
Block a user