diff options
author | Liam <byteslice@airmail.cc> | 2024-02-20 03:11:18 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-21 04:15:37 +0100 |
commit | f54277364c773e1721028628b44655e71b5685d0 (patch) | |
tree | 241bf462e71c916f22acb89fd4786f8f3ad65e1f /src/core/hle/service/audio/audio_in.h | |
parent | Merge pull request #13095 from liamwhite/ns-oops (diff) | |
download | yuzu-f54277364c773e1721028628b44655e71b5685d0.tar yuzu-f54277364c773e1721028628b44655e71b5685d0.tar.gz yuzu-f54277364c773e1721028628b44655e71b5685d0.tar.bz2 yuzu-f54277364c773e1721028628b44655e71b5685d0.tar.lz yuzu-f54277364c773e1721028628b44655e71b5685d0.tar.xz yuzu-f54277364c773e1721028628b44655e71b5685d0.tar.zst yuzu-f54277364c773e1721028628b44655e71b5685d0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/audio/audio_in.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/core/hle/service/audio/audio_in.h b/src/core/hle/service/audio/audio_in.h new file mode 100644 index 000000000..8d6398ef6 --- /dev/null +++ b/src/core/hle/service/audio/audio_in.h @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "audio_core/in/audio_in.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/service.h" + +namespace Service::Audio { + +class IAudioIn final : public ServiceFramework<IAudioIn> { +public: + explicit IAudioIn(Core::System& system_, AudioCore::AudioIn::Manager& manager, + size_t session_id, const std::string& device_name, + const AudioCore::AudioIn::AudioInParameter& in_params, + Kernel::KProcess* handle, u64 applet_resource_user_id); + ~IAudioIn() override; + + std::shared_ptr<AudioCore::AudioIn::In> GetImpl() { + return impl; + } + + Result GetAudioInState(Out<u32> out_state); + Result Start(); + Result Stop(); + Result AppendAudioInBuffer( + InArray<AudioCore::AudioIn::AudioInBuffer, BufferAttr_HipcMapAlias> buffer, + u64 buffer_client_ptr); + Result RegisterBufferEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); + Result GetReleasedAudioInBuffer(OutArray<u64, BufferAttr_HipcMapAlias> out_audio_buffer, + Out<u32> out_count); + Result ContainsAudioInBuffer(Out<bool> out_contains_buffer, u64 buffer_client_ptr); + Result GetAudioInBufferCount(Out<u32> out_buffer_count); + Result SetDeviceGain(f32 device_gain); + Result GetDeviceGain(Out<f32> out_device_gain); + Result FlushAudioInBuffers(Out<bool> out_flushed); + +private: + Kernel::KProcess* process; + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* event; + std::shared_ptr<AudioCore::AudioIn::In> impl; + Common::ScratchBuffer<u64> released_buffer; +}; + +} // namespace Service::Audio |