mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-21 20:18:17 -05:00
Audio: Add sink selection to configuration files
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user