mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-30 19:13:09 +00:00
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
// Copyright 2017 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "AudioCommon/SoundStream.h"
|
|
#ifdef _WIN32
|
|
#include "Common/WorkQueueThread.h"
|
|
#endif
|
|
|
|
#ifdef HAVE_CUBEB
|
|
#include <cubeb/cubeb.h>
|
|
#endif
|
|
|
|
class CubebStream final : public SoundStream
|
|
{
|
|
#ifdef HAVE_CUBEB
|
|
public:
|
|
CubebStream();
|
|
CubebStream(const CubebStream& other) = delete;
|
|
CubebStream(CubebStream&& other) = delete;
|
|
CubebStream& operator=(const CubebStream& other) = delete;
|
|
CubebStream& operator=(CubebStream&& other) = delete;
|
|
~CubebStream() override;
|
|
bool Init() override;
|
|
bool SetRunning(bool running) override;
|
|
void SetVolume(int) override;
|
|
static bool IsValid() { return true; }
|
|
|
|
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;
|
|
|
|
#ifdef _WIN32
|
|
Common::AsyncWorkThread m_work_queue;
|
|
bool m_coinit_success = false;
|
|
bool m_should_couninit = false;
|
|
#endif
|
|
|
|
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);
|
|
#endif
|
|
};
|