// Copyright 2017 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include #include #include #include #ifdef _WIN32 #include "Common/WorkQueueThread.h" #endif struct cubeb; namespace CubebUtils { std::shared_ptr GetContext(); std::vector> ListInputDevices(); const void* GetInputDeviceById(std::string_view id); // Helper used to handle Windows COM library for cubeb WASAPI backend class CoInitSyncWorker { public: using FunctionType = std::function; CoInitSyncWorker(std::string_view worker_name); ~CoInitSyncWorker(); bool Execute(FunctionType f); #ifdef _WIN32 private: Common::WorkQueueThread m_work_queue; bool m_coinit_success = false; bool m_should_couninit = false; #endif }; } // namespace CubebUtils