From 5d6902b3f855128d60789bd1f667ad948c5ae882 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 4 Jun 2022 19:11:57 +0100 Subject: [PATCH] Stub audin:u --- app/CMakeLists.txt | 1 + .../services/audio/IAudioInManager.cpp | 15 ++++++++++ .../skyline/services/audio/IAudioInManager.h | 30 +++++++++++++++++++ .../main/cpp/skyline/services/serviceman.cpp | 2 ++ 4 files changed, 48 insertions(+) create mode 100644 app/src/main/cpp/skyline/services/audio/IAudioInManager.cpp create mode 100644 app/src/main/cpp/skyline/services/audio/IAudioInManager.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index c10db1cf..b2e542c7 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -221,6 +221,7 @@ add_library(skyline SHARED ${source_DIR}/skyline/services/base_service.cpp ${source_DIR}/skyline/services/sm/IUserInterface.cpp ${source_DIR}/skyline/services/fatalsrv/IService.cpp + ${source_DIR}/skyline/services/audio/IAudioInManager.cpp ${source_DIR}/skyline/services/audio/IAudioOutManager.cpp ${source_DIR}/skyline/services/audio/IAudioOut.cpp ${source_DIR}/skyline/services/audio/IAudioDevice.cpp diff --git a/app/src/main/cpp/skyline/services/audio/IAudioInManager.cpp b/app/src/main/cpp/skyline/services/audio/IAudioInManager.cpp new file mode 100644 index 00000000..cefa857b --- /dev/null +++ b/app/src/main/cpp/skyline/services/audio/IAudioInManager.cpp @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include +#include "IAudioInManager.h" + +namespace skyline::service::audio { + IAudioInManager::IAudioInManager(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} + + Result IAudioInManager::ListAudioIns(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + // Stub to return no available audio inputs + response.Push(0); + return {}; + } +} diff --git a/app/src/main/cpp/skyline/services/audio/IAudioInManager.h b/app/src/main/cpp/skyline/services/audio/IAudioInManager.h new file mode 100644 index 00000000..aac7666e --- /dev/null +++ b/app/src/main/cpp/skyline/services/audio/IAudioInManager.h @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include + +namespace skyline { + namespace service::audio { + /** + * @brief IAudioInManager or audin:u is used to manage audio inputs + * @url https://switchbrew.org/wiki/Audio_services#audin:u + */ + class IAudioInManager : public BaseService { + public: + IAudioInManager(const DeviceState &state, ServiceManager &manager); + + /** + * @url https://switchbrew.org/wiki/Audio_services#ListAudioIns + */ + Result ListAudioIns(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + SERVICE_DECL( + SFUNC(0x0, IAudioInManager, ListAudioIns), + SFUNC(0x2, IAudioInManager, ListAudioIns), + SFUNC(0x4, IAudioInManager, ListAudioIns) + ) + }; + } +} diff --git a/app/src/main/cpp/skyline/services/serviceman.cpp b/app/src/main/cpp/skyline/services/serviceman.cpp index b9e5bc35..27c0d04d 100644 --- a/app/src/main/cpp/skyline/services/serviceman.cpp +++ b/app/src/main/cpp/skyline/services/serviceman.cpp @@ -9,6 +9,7 @@ #include "apm/IManager.h" #include "am/IApplicationProxyService.h" #include "am/IAllSystemAppletProxiesService.h" +#include "audio/IAudioInManager.h" #include "audio/IAudioOutManager.h" #include "audio/IAudioRendererManager.h" #include "bcat/IServiceCreator.h" @@ -78,6 +79,7 @@ namespace skyline::service { SERVICE_CASE(apm::IManager, "apm") SERVICE_CASE(am::IApplicationProxyService, "appletOE") SERVICE_CASE(am::IAllSystemAppletProxiesService, "appletAE") + SERVICE_CASE(audio::IAudioInManager, "audin:u") SERVICE_CASE(audio::IAudioOutManager, "audout:u") SERVICE_CASE(audio::IAudioRendererManager, "audren:u") SERVICE_CASE(codec::IHardwareOpusDecoderManager, "hwopus")