2016-04-28 13:28:59 +00:00
|
|
|
// Copyright 2016 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-01 19:17:45 +00:00
|
|
|
#include <memory>
|
2018-09-12 01:36:07 +00:00
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
2016-04-28 13:28:59 +00:00
|
|
|
#include <vector>
|
2023-05-01 19:17:45 +00:00
|
|
|
#include "common/common_types.h"
|
2016-04-28 13:28:59 +00:00
|
|
|
|
|
|
|
namespace AudioCore {
|
|
|
|
|
|
|
|
class Sink;
|
|
|
|
|
2023-05-01 19:17:45 +00:00
|
|
|
enum class SinkType : u32 {
|
|
|
|
Auto = 0,
|
|
|
|
Null = 1,
|
|
|
|
Cubeb = 2,
|
|
|
|
OpenAL = 3,
|
|
|
|
SDL2 = 4,
|
|
|
|
};
|
|
|
|
|
2023-12-22 19:38:06 +00:00
|
|
|
struct SinkDetails {
|
|
|
|
using FactoryFn = std::unique_ptr<Sink> (*)(std::string_view);
|
|
|
|
using ListDevicesFn = std::vector<std::string> (*)();
|
|
|
|
|
|
|
|
/// Type of this sink.
|
|
|
|
SinkType type;
|
|
|
|
/// Name for this sink.
|
|
|
|
std::string_view name;
|
|
|
|
/// A method to call to construct an instance of this type of sink.
|
|
|
|
FactoryFn create_sink;
|
|
|
|
/// A method to call to list available devices.
|
|
|
|
ListDevicesFn list_devices;
|
|
|
|
};
|
2018-08-02 03:55:59 +00:00
|
|
|
|
2023-12-22 19:38:06 +00:00
|
|
|
/// Lists all available sink types.
|
|
|
|
std::vector<SinkDetails> ListSinks();
|
2016-04-28 13:28:59 +00:00
|
|
|
|
2023-12-22 19:38:06 +00:00
|
|
|
/// Gets the details of an sink type.
|
|
|
|
const SinkDetails& GetSinkDetails(SinkType input_type);
|
2017-01-26 03:33:26 +00:00
|
|
|
|
2016-04-28 13:28:59 +00:00
|
|
|
} // namespace AudioCore
|