From 2a742229ee3abc2c3b3a9c41cc8a164850d6a0b1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 26 Jul 2018 22:03:33 -0400 Subject: [PATCH] core: Add AudioCore to global state. --- src/core/core.cpp | 2 ++ src/core/core.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/core/core.cpp b/src/core/core.cpp index b7f4b4532..186fa46df 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -177,6 +177,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { } gpu_core = std::make_unique(); + audio_core = std::make_unique(); telemetry_session = std::make_unique(); service_manager = std::make_shared(); @@ -228,6 +229,7 @@ void System::Shutdown() { service_manager.reset(); telemetry_session.reset(); gpu_core.reset(); + audio_core.reset(); // Close all CPU/threading state cpu_barrier->NotifyEnd(); diff --git a/src/core/core.h b/src/core/core.h index c123fe401..6f4df775f 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -8,6 +8,7 @@ #include #include #include +#include "audio_core/audio_out.h" #include "common/common_types.h" #include "core/arm/exclusive_monitor.h" #include "core/core_cpu.h" @@ -131,6 +132,11 @@ public: return *gpu_core; } + /// Gets the AudioCore interface + AudioCore::AudioOut& AudioCore() { + return *audio_core; + } + /// Gets the scheduler for the CPU core that is currently running Kernel::Scheduler& CurrentScheduler() { return *CurrentCpuCore().Scheduler(); @@ -195,6 +201,7 @@ private: /// AppLoader used to load the current executing application std::unique_ptr app_loader; std::unique_ptr gpu_core; + std::unique_ptr audio_core; std::shared_ptr debug_context; Kernel::SharedPtr current_process; std::shared_ptr cpu_exclusive_monitor;