Kelsidavis-WoWee/include/audio/movement_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

125 lines
4.2 KiB
C++

#pragma once
#include <vector>
#include <memory>
#include <string>
#include <cstdint>
namespace wowee {
namespace pipeline {
class AssetManager;
}
namespace audio {
class MovementSoundManager {
public:
MovementSoundManager() = default;
~MovementSoundManager() = default;
// Initialization
bool initialize(pipeline::AssetManager* assets);
void shutdown();
// Volume control
void setVolumeScale(float scale);
float getVolumeScale() const { return volumeScale_; }
// Character size (for water splash intensity)
enum class CharacterSize {
SMALL, // Gnome, Dwarf
MEDIUM, // Human, Night Elf, Undead, Troll, Blood Elf, Draenei
LARGE, // Orc, Tauren
GIANT // Large NPCs, bosses
};
// Player race (for jump/land vocalizations)
enum class PlayerRace {
HUMAN_MALE,
HUMAN_FEMALE,
DWARF_MALE,
DWARF_FEMALE,
NIGHT_ELF_MALE,
NIGHT_ELF_FEMALE,
ORC_MALE,
ORC_FEMALE,
TAUREN_MALE,
TAUREN_FEMALE,
TROLL_MALE,
TROLL_FEMALE,
UNDEAD_MALE,
UNDEAD_FEMALE,
GNOME_MALE,
GNOME_FEMALE
};
// Water interaction sounds
void playEnterWater(CharacterSize size); // Jumping into water
void playWaterFootstep(CharacterSize size); // Walking/running in water
// Jump/Land sounds (player vocalizations)
void playJump(PlayerRace race);
void playLand(PlayerRace race);
private:
struct MovementSample {
std::string path;
std::vector<uint8_t> data;
bool loaded;
};
// Water splash sound libraries
std::vector<MovementSample> enterWaterSmallSounds_;
std::vector<MovementSample> enterWaterMediumSounds_;
std::vector<MovementSample> enterWaterGiantSounds_;
std::vector<MovementSample> waterFootstepSmallSounds_;
std::vector<MovementSample> waterFootstepMediumSounds_;
std::vector<MovementSample> waterFootstepHugeSounds_;
// Jump/Land vocal libraries (all 16 race/gender combos)
std::vector<MovementSample> jumpHumanMaleSounds_;
std::vector<MovementSample> landHumanMaleSounds_;
std::vector<MovementSample> jumpHumanFemaleSounds_;
std::vector<MovementSample> landHumanFemaleSounds_;
std::vector<MovementSample> jumpDwarfMaleSounds_;
std::vector<MovementSample> landDwarfMaleSounds_;
std::vector<MovementSample> jumpDwarfFemaleSounds_;
std::vector<MovementSample> landDwarfFemaleSounds_;
std::vector<MovementSample> jumpNightElfMaleSounds_;
std::vector<MovementSample> landNightElfMaleSounds_;
std::vector<MovementSample> jumpNightElfFemaleSounds_;
std::vector<MovementSample> landNightElfFemaleSounds_;
std::vector<MovementSample> jumpOrcMaleSounds_;
std::vector<MovementSample> landOrcMaleSounds_;
std::vector<MovementSample> jumpOrcFemaleSounds_;
std::vector<MovementSample> landOrcFemaleSounds_;
std::vector<MovementSample> jumpTaurenMaleSounds_;
std::vector<MovementSample> landTaurenMaleSounds_;
std::vector<MovementSample> jumpTaurenFemaleSounds_;
std::vector<MovementSample> landTaurenFemaleSounds_;
std::vector<MovementSample> jumpTrollMaleSounds_;
std::vector<MovementSample> landTrollMaleSounds_;
std::vector<MovementSample> jumpTrollFemaleSounds_;
std::vector<MovementSample> landTrollFemaleSounds_;
std::vector<MovementSample> jumpUndeadMaleSounds_;
std::vector<MovementSample> landUndeadMaleSounds_;
std::vector<MovementSample> jumpUndeadFemaleSounds_;
std::vector<MovementSample> landUndeadFemaleSounds_;
std::vector<MovementSample> jumpGnomeMaleSounds_;
std::vector<MovementSample> landGnomeMaleSounds_;
std::vector<MovementSample> jumpGnomeFemaleSounds_;
std::vector<MovementSample> landGnomeFemaleSounds_;
// State tracking
float volumeScale_ = 1.0f;
bool initialized_ = false;
// Helper methods
bool loadSound(const std::string& path, MovementSample& sample, pipeline::AssetManager* assets);
void playSound(const std::vector<MovementSample>& library, float volumeMultiplier = 1.0f);
void playRandomSound(const std::vector<MovementSample>& library, float volumeMultiplier = 1.0f);
};
} // namespace audio
} // namespace wowee