summaryrefslogtreecommitdiff
path: root/src/sound.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sound.h')
-rw-r--r--src/sound.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/sound.h b/src/sound.h
index 2e43ef37..3fce5447 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -46,11 +46,6 @@ class Sound
void init();
/**
- * Logs various info about sound device.
- */
- void info();
-
- /**
* Removes all sound functionalities.
*/
void close();
@@ -59,9 +54,8 @@ class Sound
* Starts background music.
*
* @param path The full path to the music file.
- * @param loop The number of times the song is played (-1 = infinite)
*/
- void playMusic(const std::string &path, int loop = -1);
+ void playMusic(const std::string &path);
/**
* Stops currently running background music track.
@@ -72,11 +66,9 @@ class Sound
* Fades in background music.
*
* @param path The full path to the music file.
- * @param loop The number of times the song is played (-1 = infinite)
* @param ms Duration of fade-in effect (ms)
*/
- void fadeInMusic(const std::string &path, int loop = -1,
- int ms = 2000);
+ void fadeInMusic(const std::string &path, int ms = 2000);
/**
* Fades out currently running background music track.
@@ -85,18 +77,9 @@ class Sound
*/
void fadeOutMusic(int ms);
- /**
- * Sets music volume.
- *
- * @param volume Volume value
- */
- void setMusicVolume(int volume);
+ int getMaxVolume() const;
- /**
- * Sets sfx volume.
- *
- * @param volume Volume value
- */
+ void setMusicVolume(int volume);
void setSfxVolume(int volume);
/**
@@ -107,11 +90,18 @@ class Sound
void playSfx(const std::string &path);
private:
+ /** Logs various info about sound device. */
+ void info();
+
+ /** Halts and frees currently playing music. */
+ void haltMusic();
+
bool mInstalled;
int mSfxVolume;
int mMusicVolume;
+ std::string mCurrentMusicFile;
Mix_Music *mMusic;
};