mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-15 13:16:43 +00:00
3aa0d46259
reworked a bit to remove references of parent objects and instead pass as arguments to methods to prevent useless reloads Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3908 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev>
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "audio_core/audio_core.h"
|
|
#include "audio_core/sink/sink_details.h"
|
|
#include "common/settings.h"
|
|
#include "core/core.h"
|
|
|
|
namespace AudioCore {
|
|
|
|
AudioCore::AudioCore(Core::System& system) {
|
|
audio_manager.emplace();
|
|
CreateSinks();
|
|
// Must be created after the sinks
|
|
adsp.emplace(system, *output_sink);
|
|
}
|
|
|
|
AudioCore ::~AudioCore() {
|
|
Shutdown();
|
|
}
|
|
|
|
void AudioCore::CreateSinks() {
|
|
const auto& sink_id{Settings::values.sink_id};
|
|
const auto& audio_output_device_id{Settings::values.audio_output_device_id};
|
|
const auto& audio_input_device_id{Settings::values.audio_input_device_id};
|
|
|
|
output_sink = Sink::CreateSinkFromID(sink_id.GetValue(), audio_output_device_id.GetValue());
|
|
input_sink = Sink::CreateSinkFromID(sink_id.GetValue(), audio_input_device_id.GetValue());
|
|
}
|
|
|
|
void AudioCore::Shutdown() {
|
|
audio_manager->Shutdown();
|
|
}
|
|
|
|
AudioManager& AudioCore::GetAudioManager() {
|
|
return *audio_manager;
|
|
}
|
|
|
|
Sink::Sink& AudioCore::GetOutputSink() {
|
|
return *output_sink;
|
|
}
|
|
|
|
Sink::Sink& AudioCore::GetInputSink() {
|
|
return *input_sink;
|
|
}
|
|
|
|
ADSP::ADSP& AudioCore::ADSP() {
|
|
return *adsp;
|
|
}
|
|
|
|
} // namespace AudioCore
|