Browse Source

audio_manager: Remove dependence on system state

This isn't used by the class, so this can be removed for the time being.
nce_cpp
Lioncash 3 years ago
parent
commit
1019e52885
  1. 2
      src/audio_core/audio_core.cpp
  2. 2
      src/audio_core/audio_manager.cpp
  3. 10
      src/audio_core/audio_manager.h

2
src/audio_core/audio_core.cpp

@ -8,7 +8,7 @@
namespace AudioCore { namespace AudioCore {
AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>(system)} {
AudioCore::AudioCore(Core::System& system) : audio_manager{std::make_unique<AudioManager>()} {
CreateSinks(); CreateSinks();
// Must be created after the sinks // Must be created after the sinks
adsp = std::make_unique<AudioRenderer::ADSP::ADSP>(system, *output_sink); adsp = std::make_unique<AudioRenderer::ADSP::ADSP>(system, *output_sink);

2
src/audio_core/audio_manager.cpp

@ -8,7 +8,7 @@
namespace AudioCore { namespace AudioCore {
AudioManager::AudioManager(Core::System& system_) : system{system_} {
AudioManager::AudioManager() {
thread = std::jthread([this]() { ThreadFunc(); }); thread = std::jthread([this]() { ThreadFunc(); });
} }

10
src/audio_core/audio_manager.h

@ -12,10 +12,6 @@
#include "audio_core/audio_event.h" #include "audio_core/audio_event.h"
#include "core/hle/service/audio/errors.h" #include "core/hle/service/audio/errors.h"
namespace Core {
class System;
}
namespace AudioCore { namespace AudioCore {
namespace AudioOut { namespace AudioOut {
@ -43,7 +39,7 @@ class AudioManager {
using BufferEventFunc = std::function<void()>; using BufferEventFunc = std::function<void()>;
public: public:
explicit AudioManager(Core::System& system);
explicit AudioManager();
/** /**
* Shutdown the audio manager. * Shutdown the audio manager.
@ -80,9 +76,7 @@ private:
*/ */
void ThreadFunc(); void ThreadFunc();
/// Core system
Core::System& system;
/// Have sessions started palying?
/// Have sessions started playing?
bool sessions_started{}; bool sessions_started{};
/// Is the main thread running? /// Is the main thread running?
std::atomic<bool> running{}; std::atomic<bool> running{};

Loading…
Cancel
Save