summaryrefslogtreecommitdiff
path: root/src/audio_core/hle
diff options
context:
space:
mode:
authorGravatar MerryMage2016-04-27 13:53:23 +0100
committerGravatar MerryMage2016-04-30 07:41:02 +0100
commit4e971f44a27c2e4abc25ddf0720d287a688e0a4d (patch)
treec88ce045e20e40dd022a56dbd4a5281024591e61 /src/audio_core/hle
parentAudioCore: List of sink types (diff)
downloadyuzu-4e971f44a27c2e4abc25ddf0720d287a688e0a4d.tar.gz
yuzu-4e971f44a27c2e4abc25ddf0720d287a688e0a4d.tar.xz
yuzu-4e971f44a27c2e4abc25ddf0720d287a688e0a4d.zip
Audio: Add sink selection to configuration files
Diffstat (limited to 'src/audio_core/hle')
-rw-r--r--src/audio_core/hle/dsp.cpp9
-rw-r--r--src/audio_core/hle/dsp.h11
2 files changed, 20 insertions, 0 deletions
diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp
index 5759a5b9e..4d44bd2d9 100644
--- a/src/audio_core/hle/dsp.cpp
+++ b/src/audio_core/hle/dsp.cpp
@@ -2,8 +2,11 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <memory>
6
5#include "audio_core/hle/dsp.h" 7#include "audio_core/hle/dsp.h"
6#include "audio_core/hle/pipe.h" 8#include "audio_core/hle/pipe.h"
9#include "audio_core/sink.h"
7 10
8namespace DSP { 11namespace DSP {
9namespace HLE { 12namespace HLE {
@@ -35,6 +38,8 @@ static SharedMemory& WriteRegion() {
35 return g_regions[1 - CurrentRegionIndex()]; 38 return g_regions[1 - CurrentRegionIndex()];
36} 39}
37 40
41static std::unique_ptr<AudioCore::Sink> sink;
42
38void Init() { 43void Init() {
39 DSP::HLE::ResetPipes(); 44 DSP::HLE::ResetPipes();
40} 45}
@@ -46,5 +51,9 @@ bool Tick() {
46 return true; 51 return true;
47} 52}
48 53
54void SetSink(std::unique_ptr<AudioCore::Sink> sink_) {
55 sink = std::move(sink_);
56}
57
49} // namespace HLE 58} // namespace HLE
50} // namespace DSP 59} // namespace DSP
diff --git a/src/audio_core/hle/dsp.h b/src/audio_core/hle/dsp.h
index f0f125284..4f2410c27 100644
--- a/src/audio_core/hle/dsp.h
+++ b/src/audio_core/hle/dsp.h
@@ -6,6 +6,7 @@
6 6
7#include <array> 7#include <array>
8#include <cstddef> 8#include <cstddef>
9#include <memory>
9#include <type_traits> 10#include <type_traits>
10 11
11#include "audio_core/hle/common.h" 12#include "audio_core/hle/common.h"
@@ -15,6 +16,10 @@
15#include "common/common_types.h" 16#include "common/common_types.h"
16#include "common/swap.h" 17#include "common/swap.h"
17 18
19namespace AudioCore {
20class Sink;
21}
22
18namespace DSP { 23namespace DSP {
19namespace HLE { 24namespace HLE {
20 25
@@ -535,5 +540,11 @@ void Shutdown();
535 */ 540 */
536bool Tick(); 541bool Tick();
537 542
543/**
544 * Set the output sink. This must be called before calling Tick().
545 * @param sink The sink to which audio will be output to.
546 */
547void SetSink(std::unique_ptr<AudioCore::Sink> sink);
548
538} // namespace HLE 549} // namespace HLE
539} // namespace DSP 550} // namespace DSP