dolphin/Source/Core/AudioCommon/CubebStream.h
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00

34 lines
840 B
C++

// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <cstddef>
#include <memory>
#include <vector>
#include "AudioCommon/SoundStream.h"
#include <cubeb/cubeb.h>
class CubebStream final : public SoundStream
{
public:
~CubebStream() override;
bool Init() override;
bool SetRunning(bool running) override;
void SetVolume(int) override;
private:
bool m_stereo = false;
std::shared_ptr<cubeb> m_ctx;
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);
};