mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-24 13:44:58 +00:00
refactor: Remove AudioPlayer integration from AudioManager and transition to service-based audio handling
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user