summary refs log tree commit diff stats
path: root/src/mixer.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-03-13 13:34:12 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-03-13 15:34:50 -0500
commit9107e9e6c337fbd9790eeb7e89e473d5da129f36 (patch)
tree4dc08eaebcbff0e284713965b743c6189ba9aaad /src/mixer.h
parent8a7d87a312b3dc42877577e99533c96d48714368 (diff)
downloadtanetane-9107e9e6c337fbd9790eeb7e89e473d5da129f36.tar.gz
tanetane-9107e9e6c337fbd9790eeb7e89e473d5da129f36.tar.bz2
tanetane-9107e9e6c337fbd9790eeb7e89e473d5da129f36.zip
Music volume is controllable from settings menu
#7
Diffstat (limited to 'src/mixer.h')
-rw-r--r--src/mixer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mixer.h b/src/mixer.h index 854c67d..c2a0681 100644 --- a/src/mixer.h +++ b/src/mixer.h
@@ -2,6 +2,7 @@
2#define MIXER_H_6DF82000 2#define MIXER_H_6DF82000
3 3
4#include <SDL_mixer.h> 4#include <SDL_mixer.h>
5#include <cmath>
5#include <memory> 6#include <memory>
6#include <stdexcept> 7#include <stdexcept>
7#include <map> 8#include <map>
@@ -92,6 +93,10 @@ public:
92 93
93 bool isMusicMuted() const { return musicMuted_; } 94 bool isMusicMuted() const { return musicMuted_; }
94 95
96 int getMusicVolume() const { return std::round(static_cast<double>(musicVolume_) / MIX_MAX_VOLUME * 10); }
97
98 void setMusicVolume(int vol);
99
95 void pauseMusic(); 100 void pauseMusic();
96 101
97 void unpauseMusic(); 102 void unpauseMusic();