Kelsidavis-WoWee/include/audio/mount_sound_manager.hpp
Kelsi 9741c8ee7c Implement comprehensive audio control panel with tabbed settings interface
Adds complete audio volume controls for all 11 audio systems with master volume. Reorganizes settings window into Video, Audio, and Gameplay tabs for better UX.

Audio Features:
- Master volume control affecting all audio systems
- Individual volume sliders for: Music, Ambient, UI, Combat, Spell, Movement, Footsteps, NPC Voices, Mounts, Activity sounds
- Real-time volume adjustment with master volume multiplier
- Restore defaults button per tab

Technical Changes:
- Added getVolumeScale() getters to all audio managers
- Integrated all 10 audio managers into renderer (UI, Combat, Spell, Movement added)
- Expanded game_screen.hpp with 11 pending volume variables
- Reorganized settings window using ImGui tab bars (Video/Audio/Gameplay)
- Audio settings uses scrollable child window for 11 volume controls
- Settings window expanded to 520x720px to accommodate comprehensive controls
2026-02-09 17:07:22 -08:00

76 lines
2 KiB
C++

#pragma once
#include <string>
#include <cstdint>
#include <vector>
#include <chrono>
namespace wowee {
namespace pipeline { class AssetManager; }
namespace audio {
enum class MountType {
NONE,
GROUND, // Horse, wolf, raptor, etc.
FLYING, // Griffin, wyvern, drake, etc.
SWIMMING // Sea turtle, etc.
};
struct MountSample {
std::string path;
std::vector<uint8_t> data;
};
class MountSoundManager {
public:
MountSoundManager();
~MountSoundManager();
bool initialize(pipeline::AssetManager* assets);
void shutdown();
void update(float deltaTime);
// Called when mounting/dismounting
void onMount(uint32_t creatureDisplayId, bool isFlying);
void onDismount();
// Update movement state
void setMoving(bool moving);
void setFlying(bool flying);
void setGrounded(bool grounded);
bool isMounted() const { return mounted_; }
void setVolumeScale(float scale) { volumeScale_ = scale; }
float getVolumeScale() const { return volumeScale_; }
private:
MountType detectMountType(uint32_t creatureDisplayId) const;
void updateMountSounds();
void stopAllMountSounds();
void loadMountSounds();
bool loadSound(const std::string& path, MountSample& sample);
pipeline::AssetManager* assetManager_ = nullptr;
bool mounted_ = false;
bool moving_ = false;
bool flying_ = false;
MountType currentMountType_ = MountType::NONE;
uint32_t currentDisplayId_ = 0;
float volumeScale_ = 1.0f;
// Mount sound samples (loaded from MPQ)
std::vector<MountSample> wingFlapSounds_;
std::vector<MountSample> wingIdleSounds_;
std::vector<MountSample> horseBreathSounds_;
std::vector<MountSample> horseMoveSounds_;
// Sound state tracking
bool playingMovementSound_ = false;
bool playingIdleSound_ = false;
std::chrono::steady_clock::time_point lastSoundUpdate_;
float soundLoopTimer_ = 0.0f;
};
} // namespace audio
} // namespace wowee