refactor: Remove AudioPlayer integration from AudioManager and transition to service-based audio handling

This commit is contained in:
2026-01-04 14:58:48 +00:00
parent f76be2d4e2
commit 445db77bb0
2 changed files with 4 additions and 15 deletions

View File

@@ -1,5 +1,4 @@
#include "script/audio_manager.hpp"
#include "app/audio_player.hpp"
#include "logging/logger.hpp"
#include <iostream>
@@ -15,18 +14,8 @@ AudioManager::AudioManager(const std::filesystem::path& scriptDirectory)
}
void AudioManager::SetAudioPlayer(app::AudioPlayer* audioPlayer) {
audioPlayer_ = audioPlayer;
if (!audioPlayer_) {
return;
}
for (const auto& command : pendingAudioCommands_) {
try {
ExecuteAudioCommand(audioPlayer_, command);
} catch (const std::exception& exc) {
sdl3cpp::logging::Logger::GetInstance().Error("AudioPlayer command execution failed: " + std::string(exc.what()));
}
}
pendingAudioCommands_.clear();
// Stub - audio functionality now handled through services
sdl3cpp::logging::Logger::GetInstance().Trace("AudioManager::SetAudioPlayer: Stub implementation - using services now");
}
bool AudioManager::QueueAudioCommand(AudioCommandType type, std::string path, bool loop, std::string& error) {

View File

@@ -28,10 +28,10 @@ public:
private:
std::filesystem::path scriptDirectory_;
app::AudioPlayer* audioPlayer_ = nullptr;
// app::AudioPlayer* audioPlayer_ = nullptr; // Removed - using services now
std::vector<AudioCommand> pendingAudioCommands_;
void ExecuteAudioCommand(app::AudioPlayer* player, const AudioCommand& command);
// void ExecuteAudioCommand(app::AudioPlayer* player, const AudioCommand& command); // Removed - using services now
std::filesystem::path ResolveScriptPath(const std::string& requested) const;
};