mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Initial commit: wowee native WoW 3.3.5a client
This commit is contained in:
commit
ce6cb8f38e
147 changed files with 32347 additions and 0 deletions
45
include/audio/music_manager.hpp
Normal file
45
include/audio/music_manager.hpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline { class AssetManager; }
|
||||
|
||||
namespace audio {
|
||||
|
||||
class MusicManager {
|
||||
public:
|
||||
MusicManager();
|
||||
~MusicManager();
|
||||
|
||||
bool initialize(pipeline::AssetManager* assets);
|
||||
void shutdown();
|
||||
|
||||
void playMusic(const std::string& mpqPath, bool loop = true);
|
||||
void stopMusic(float fadeMs = 2000.0f);
|
||||
void crossfadeTo(const std::string& mpqPath, float fadeMs = 3000.0f);
|
||||
void update(float deltaTime);
|
||||
|
||||
bool isPlaying() const { return playing; }
|
||||
bool isInitialized() const { return assetManager != nullptr; }
|
||||
const std::string& getCurrentTrack() const { return currentTrack; }
|
||||
|
||||
private:
|
||||
void stopCurrentProcess();
|
||||
|
||||
pipeline::AssetManager* assetManager = nullptr;
|
||||
std::string currentTrack;
|
||||
std::string tempFilePath;
|
||||
pid_t playerPid = -1;
|
||||
bool playing = false;
|
||||
|
||||
// Crossfade state
|
||||
bool crossfading = false;
|
||||
std::string pendingTrack;
|
||||
float fadeTimer = 0.0f;
|
||||
float fadeDuration = 0.0f;
|
||||
};
|
||||
|
||||
} // namespace audio
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue