mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
AudioCommon: add Cubeb backend
This commit is contained in:
32
Source/Core/AudioCommon/CubebStream.h
Normal file
32
Source/Core/AudioCommon/CubebStream.h
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
#include "AudioCommon/SoundStream.h"
|
||||
|
||||
#include <cubeb/cubeb.h>
|
||||
|
||||
class CubebStream final : public SoundStream
|
||||
{
|
||||
public:
|
||||
bool Start() override;
|
||||
void Stop() override;
|
||||
void SetVolume(int) override;
|
||||
|
||||
private:
|
||||
bool m_stereo = false;
|
||||
cubeb* m_ctx = nullptr;
|
||||
cubeb_stream* m_stream = nullptr;
|
||||
|
||||
std::vector<short> m_short_buffer;
|
||||
std::vector<float> m_floatstereo_buffer;
|
||||
|
||||
static long DataCallback(cubeb_stream* stream, void* user_data, const void* /*input_buffer*/,
|
||||
void* output_buffer, long num_frames);
|
||||
static void StateCallback(cubeb_stream* stream, void* user_data, cubeb_state state);
|
||||
};
|
Reference in New Issue
Block a user