diff options
| author | Zephyron <zephyron@citron-emu.orgq> | 2025-02-17 17:33:10 +1000 |
|---|---|---|
| committer | Mike Lothian <mike@fireburn.co.uk> | 2025-05-12 12:46:19 +0100 |
| commit | d83ca35df40e4869d823946dd9785ad5e43a1566 (patch) | |
| tree | 6a66871f676c98349af7e34fafdc225082a2d901 /src/core/hle/service/audio/audio_controller.cpp | |
| parent | 6f49b55c0a61d786cbf19b0ee4cb4b654191f33e (diff) | |
feat: Add Home Menu launch support and system improvements
This commit adds support for launching the system Home Menu and implements
several system-level improvements:
- Add Home Menu launch functionality through new UI action
- Implement shutdown/reboot sequence handlers in GlobalStateController
- Add support for reserved region extra size in page tables
- Enhance audio controller with output management
- Expand parental control service capabilities
- Add profile service improvements for user management
Technical changes:
- Add OnHomeMenu() handler to launch QLaunch system applet
- Implement m_alias_region_extra_size tracking in page tables
- Add new CreateProcessFlag for reserved region extra size
- Expand audio controller interface with output management
- Add self-controller methods to various services
- Implement play timer and profile service improvements
The changes primarily focus on system menu integration and core service
improvements to better support system functionality.
Diffstat (limited to 'src/core/hle/service/audio/audio_controller.cpp')
| -rw-r--r-- | src/core/hle/service/audio/audio_controller.cpp | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/src/core/hle/service/audio/audio_controller.cpp b/src/core/hle/service/audio/audio_controller.cpp index 300764ad6..c725e05fc 100644 --- a/src/core/hle/service/audio/audio_controller.cpp +++ b/src/core/hle/service/audio/audio_controller.cpp @@ -11,8 +11,19 @@ namespace Service::Audio { IAudioController::IAudioController(Core::System& system_) - : ServiceFramework{system_, "audctl"}, service_context{system, "audctl"} { - // clang-format off + : ServiceFramework{system_, "audctl"} + , service_context{system, "audctl"} + , m_current_output_target{1} // Initialize with default values + , m_current_parameter{0x1388} + , m_current_volume{100} { + + // Create notification event first + notification_event = service_context.CreateEvent("IAudioController:NotificationEvent"); + + // Get system settings service + m_set_sys = system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true); + + // Register handlers static const FunctionInfo functions[] = { {0, nullptr, "GetTargetVolume"}, {1, nullptr, "SetTargetVolume"}, @@ -67,15 +78,15 @@ IAudioController::IAudioController(Core::System& system_) {10104, nullptr, "GetAudioOutputChannelCountForPlayReport"}, {10105, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, {10106, nullptr, "GetDefaultAudioOutputTargetForPlayReport"}, - {50000, nullptr, "SetAnalogInputBoostGainForPrototyping"}, + {5000, D<&IAudioController::GetSelfController>, "GetSelfController"}, + {50001, D<&IAudioController::SetAudioControllerOutput>, "SetAudioControllerOutput"}, }; - // clang-format on - RegisterHandlers(functions); - m_set_sys = - system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true); - notification_event = service_context.CreateEvent("IAudioController:NotificationEvent"); + // Signal initial state + if (notification_event) { + notification_event->Signal(); + } } IAudioController::~IAudioController() { @@ -176,4 +187,34 @@ Result IAudioController::AcquireTargetNotification( R_SUCCEED(); } +Result IAudioController::SetAudioControllerOutput(u32 output_target, u32 parameter, u32 volume) { + LOG_DEBUG(Audio, "called. output_target={}, parameter={}, volume={}", output_target, parameter, volume); + + if (!notification_event) { + LOG_ERROR(Audio, "Notification event not initialized"); + R_THROW(ResultCode::ResultInvalidState); + } + + m_current_output_target = output_target; + m_current_parameter = parameter; + m_current_volume = volume; + + notification_event->Signal(); + R_SUCCEED(); +} + +Result IAudioController::GetSelfController(Out<SharedPointer<IAudioController>> out_controller) { + LOG_DEBUG(Audio, "called"); + + // Use ServiceFramework's built-in method to get a shared pointer + *out_controller = SharedPointer<IAudioController>(this); + + // Signal notification event since we're returning a new interface + if (notification_event) { + notification_event->Signal(); + } + + R_SUCCEED(); +} + } // namespace Service::Audio |
