diff --git a/SDL2pp/Chunk.cc b/SDL2pp/Chunk.cc index f0edb95..1b3555e 100644 --- a/SDL2pp/Chunk.cc +++ b/SDL2pp/Chunk.cc @@ -61,8 +61,12 @@ Mix_Chunk* Chunk::Get() const { return chunk_; } -int Chunk::Volume(int volume) { +int Chunk::SetVolume(int volume) { return Mix_VolumeChunk(chunk_, volume); } +int Chunk::GetVolume() const { + return Mix_VolumeChunk(chunk_, -1); +} + } diff --git a/SDL2pp/Chunk.hh b/SDL2pp/Chunk.hh index b706b5a..91077e9 100644 --- a/SDL2pp/Chunk.hh +++ b/SDL2pp/Chunk.hh @@ -142,7 +142,17 @@ public: /// \see https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC23 /// //////////////////////////////////////////////////////////// - int Volume(int volume); + int SetVolume(int volume); + + //////////////////////////////////////////////////////////// + /// \brief Get volume of a chunk + /// + /// \returns Current volume setting + /// + /// \see https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC23 + /// + //////////////////////////////////////////////////////////// + int GetVolume() const; }; }