summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/audio/audin_u.h
blob: 0d75ae5acd4cc72f686cc6197aa0cb6f6e84ced2 (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
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include "core/hle/service/service.h"

namespace Core {
class System;
}

namespace Kernel {
class HLERequestContext;
}

namespace Service::Audio {

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