summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-31 05:29:17 +0200
committerGitHub <noreply@github.com>2018-07-31 05:29:17 +0200
commitbf9c62bc76a2296c1a81cfc1b83aaf4028578901 (patch)
treedad8906c597af3f579d4f72f4c9f493503c40665 /src/core/hle
parentPort #3758 from Citra (#852): Add missing std::string import in text_formatter (diff)
parentaudio_core: Implement Sink and SinkStream interfaces with cubeb. (diff)
downloadyuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.tar
yuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.tar.gz
yuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.tar.bz2
yuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.tar.lz
yuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.tar.xz
yuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.tar.zst
yuzu-bf9c62bc76a2296c1a81cfc1b83aaf4028578901.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/audio/audout_u.cpp8
-rw-r--r--src/core/hle/service/audio/audout_u.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index a15d53ff8..ab37c2a69 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -25,9 +25,8 @@ constexpr int DefaultSampleRate{48000};
class IAudioOut final : public ServiceFramework<IAudioOut> {
public:
- IAudioOut(AudoutParams audio_params)
- : ServiceFramework("IAudioOut"), audio_params(audio_params),
- audio_core(Core::System::GetInstance().AudioCore()) {
+ IAudioOut(AudoutParams audio_params, AudioCore::AudioOut& audio_core)
+ : ServiceFramework("IAudioOut"), audio_params(audio_params), audio_core(audio_core) {
static const FunctionInfo functions[] = {
{0, &IAudioOut::GetAudioOutState, "GetAudioOutState"},
@@ -195,7 +194,7 @@ void AudOutU::OpenAudioOutImpl(Kernel::HLERequestContext& ctx) {
// TODO(bunnei): Support more than one IAudioOut interface. When we add this, ListAudioOutsImpl
// will likely need to be updated as well.
ASSERT_MSG(!audio_out_interface, "Unimplemented");
- audio_out_interface = std::make_shared<IAudioOut>(std::move(params));
+ audio_out_interface = std::make_shared<IAudioOut>(std::move(params), *audio_core);
IPC::ResponseBuilder rb{ctx, 6, 0, 1};
rb.Push(RESULT_SUCCESS);
@@ -212,6 +211,7 @@ AudOutU::AudOutU() : ServiceFramework("audout:u") {
{2, &AudOutU::ListAudioOutsImpl, "ListAudioOutsAuto"},
{3, &AudOutU::OpenAudioOutImpl, "OpenAudioOutAuto"}};
RegisterHandlers(functions);
+ audio_core = std::make_unique<AudioCore::AudioOut>();
}
} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audout_u.h b/src/core/hle/service/audio/audout_u.h
index bc43f1f44..e5c2184d5 100644
--- a/src/core/hle/service/audio/audout_u.h
+++ b/src/core/hle/service/audio/audout_u.h
@@ -4,6 +4,7 @@
#pragma once
+#include "audio_core/audio_out.h"
#include "core/hle/service/service.h"
namespace Kernel {
@@ -33,6 +34,7 @@ public:
private:
std::shared_ptr<IAudioOut> audio_out_interface;
+ std::unique_ptr<AudioCore::AudioOut> audio_core;
void ListAudioOutsImpl(Kernel::HLERequestContext& ctx);
void OpenAudioOutImpl(Kernel::HLERequestContext& ctx);