From b7eb867aa50a31927c0169a69e6f2ac5a786bc4a Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Mon, 7 Sep 2015 01:56:53 +0300 Subject: [PATCH] Sort out Chunk::{Get,Set}Volume --- SDL2pp/Chunk.cc | 6 +++++- SDL2pp/Chunk.hh | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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; }; }