diff options
| author | bunnei <bunneidev@gmail.com> | 2016-04-30 03:49:11 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2016-04-30 03:49:11 -0400 |
| commit | c1f0044a4b10bdff45464e5957f7950a6059d0c9 (patch) | |
| tree | d9b4673f92da936ce763148f70b82bc7401dd968 /src/audio_core/hle | |
| parent | 594bd182b447059bd21d6a79169c19d7cac226f3 (diff) | |
| parent | 4e971f44a27c2e4abc25ddf0720d287a688e0a4d (diff) | |
Merge pull request #1729 from MerryMage/null-sink
Audio Config: Implement null sink and implement sink configuration
Diffstat (limited to 'src/audio_core/hle')
| -rw-r--r-- | src/audio_core/hle/dsp.cpp | 9 | ||||
| -rw-r--r-- | src/audio_core/hle/dsp.h | 11 |
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 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <memory> + #include "audio_core/hle/dsp.h" #include "audio_core/hle/pipe.h" +#include "audio_core/sink.h" namespace DSP { namespace HLE { @@ -35,6 +38,8 @@ static SharedMemory& WriteRegion() { return g_regions[1 - CurrentRegionIndex()]; } +static std::unique_ptr<AudioCore::Sink> sink; + void Init() { DSP::HLE::ResetPipes(); } @@ -46,5 +51,9 @@ bool Tick() { return true; } +void SetSink(std::unique_ptr<AudioCore::Sink> sink_) { + sink = std::move(sink_); +} + } // namespace HLE } // 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 @@ #include <array> #include <cstddef> +#include <memory> #include <type_traits> #include "audio_core/hle/common.h" @@ -15,6 +16,10 @@ #include "common/common_types.h" #include "common/swap.h" +namespace AudioCore { +class Sink; +} + namespace DSP { namespace HLE { @@ -535,5 +540,11 @@ void Shutdown(); */ bool Tick(); +/** + * Set the output sink. This must be called before calling Tick(). + * @param sink The sink to which audio will be output to. + */ +void SetSink(std::unique_ptr<AudioCore::Sink> sink); + } // namespace HLE } // namespace DSP |
