From 02c991e5ea1ec93c8245157a3f174b547774a7e3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 13 Mar 2021 14:58:50 -0500 Subject: Sound volume is controllable from settings menu #7 --- src/mixer.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mixer.h') diff --git a/src/mixer.h b/src/mixer.h index c2a0681..f9c958a 100644 --- a/src/mixer.h +++ b/src/mixer.h @@ -77,6 +77,10 @@ public: void unpauseSounds(); + int getSoundVolume() const { return std::round(static_cast(soundVolume_) / MIX_MAX_VOLUME * 10); } + + void setSoundVolume(int vol); + // name is the name of the file, not containing the extension // ms is the time in milliseconds to fade in void playMusic(std::string_view name, int ms = 0); @@ -113,6 +117,7 @@ private: std::string playingTrack_; int musicVolume_ = MIX_MAX_VOLUME; bool musicMuted_ = false; + int soundVolume_ = MIX_MAX_VOLUME; }; #endif /* end of include guard: MIXER_H_6DF82000 */ -- cgit 1.4.1