suyu/src/audio_core/audio_core.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
1.5 KiB
C++
Raw Normal View History

2022-07-17 00:48:45 +02:00
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <memory>
2023-08-31 16:09:15 +02:00
#include "audio_core/adsp/adsp.h"
2022-07-17 00:48:45 +02:00
#include "audio_core/audio_manager.h"
#include "audio_core/sink/sink.h"
namespace Core {
class System;
}
namespace AudioCore {
class AudioManager;
/**
* Main audio class, stored inside the core, and holding the audio manager, all sinks, and the ADSP.
2022-07-17 00:48:45 +02:00
*/
class AudioCore {
public:
explicit AudioCore(Core::System& system);
~AudioCore();
/**
* Shutdown the audio core.
*/
void Shutdown();
/**
* Get a reference to the audio manager.
*
* @return Ref to the audio manager.
*/
AudioManager& GetAudioManager();
/**
* Get the audio output sink currently in use.
*
* @return Ref to the sink.
*/
Sink::Sink& GetOutputSink();
/**
* Get the audio input sink currently in use.
*
* @return Ref to the sink.
*/
Sink::Sink& GetInputSink();
/**
* Get the ADSP.
*
* @return Ref to the ADSP.
*/
2023-08-31 16:09:15 +02:00
ADSP::ADSP& ADSP();
2022-07-17 00:48:45 +02:00
private:
/**
* Create the sinks on startup.
*/
void CreateSinks();
/// Main audio manager for audio in/out
std::unique_ptr<AudioManager> audio_manager;
/// Sink used for audio renderer and audio out
std::unique_ptr<Sink::Sink> output_sink;
/// Sink used for audio input
std::unique_ptr<Sink::Sink> input_sink;
/// The ADSP in the sysmodule
2023-08-31 16:09:15 +02:00
std::unique_ptr<ADSP::ADSP> adsp;
2022-07-17 00:48:45 +02:00
};
} // namespace AudioCore