blob: 2bfa38eccb92d1ec49e7b7d4a5487eb5b3cf0ac6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "core/hle/service/kernel_helpers.h"
#include "core/hle/service/service.h"
namespace Core {
class System;
}
namespace Kernel {
class HLERequestContext;
}
namespace Service::Audio {
class IAudioIn final : public ServiceFramework<IAudioIn> {
public:
explicit IAudioIn(Core::System& system_);
~IAudioIn() override;
private:
void Start(Kernel::HLERequestContext& ctx);
void RegisterBufferEvent(Kernel::HLERequestContext& ctx);
void AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx);
KernelHelpers::ServiceContext service_context;
Kernel::KEvent* buffer_event;
};
class AudInU final : public ServiceFramework<AudInU> {
public:
explicit AudInU(Core::System& system_);
~AudInU() override;
private:
enum class SampleFormat : u32_le {
PCM16 = 2,
};
enum class State : u32_le {
Started = 0,
Stopped = 1,
};
struct AudInOutParams {
u32_le sample_rate{};
u32_le channel_count{};
SampleFormat sample_format{};
State state{};
};
static_assert(sizeof(AudInOutParams) == 0x10, "AudInOutParams is an invalid size");
using AudioInDeviceName = std::array<char, 256>;
static constexpr std::array<std::string_view, 1> audio_device_names{{
"BuiltInHeadset",
}};
void ListAudioIns(Kernel::HLERequestContext& ctx);
void ListAudioInsAutoFiltered(Kernel::HLERequestContext& ctx);
void OpenInOutImpl(Kernel::HLERequestContext& ctx);
void OpenAudioIn(Kernel::HLERequestContext& ctx);
void OpenAudioInProtocolSpecified(Kernel::HLERequestContext& ctx);
};
} // namespace Service::Audio
|