summaryrefslogtreecommitdiff
path: root/src/sound.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-01-24 19:14:24 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-01-24 19:15:07 +0100
commitb856e8b47ab2dfd393e3c2720c5647eb66393931 (patch)
tree3709cc05792d977aa36ddaa5e3874552aed9d2e4 /src/sound.h
parent59c5d1ef260736225ba3ba486f40532949cc293b (diff)
downloadmana-b856e8b47ab2dfd393e3c2720c5647eb66393931.tar.gz
mana-b856e8b47ab2dfd393e3c2720c5647eb66393931.tar.bz2
mana-b856e8b47ab2dfd393e3c2720c5647eb66393931.tar.xz
mana-b856e8b47ab2dfd393e3c2720c5647eb66393931.zip
Stream music files directly from the archives
Use Mix_LoadMUS_RW to stream music files directly from PhysFS. I kept around ResourceManager:copyFile for now, since it may have other uses. Also cleaned up some initialization of configuration defaults. Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/sound.h')
-rw-r--r--src/sound.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/sound.h b/src/sound.h
index dbec3fc9..05caa1ed 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -30,6 +30,8 @@
#include <string>
+class Music;
+
/** Sound engine
*
* \ingroup CORE
@@ -53,9 +55,9 @@ class Sound
/**
* Starts background music.
*
- * @param path The full path to the music file.
+ * @param fileName The name of the music file.
*/
- void playMusic(const std::string &path);
+ void playMusic(const std::string &fileName);
/**
* Stops currently running background music track.
@@ -65,10 +67,10 @@ class Sound
/**
* Fades in background music.
*
- * @param path The full path to the music file.
- * @param ms Duration of fade-in effect (ms)
+ * @param fileName The name of the music file.
+ * @param ms Duration of fade-in effect (ms)
*/
- void fadeInMusic(const std::string &path, int ms = 1000);
+ void fadeInMusic(const std::string &fileName, int ms = 1000);
/**
* Fades out currently running background music track.
@@ -80,10 +82,10 @@ class Sound
/**
* Fades out a background music and play a new one.
*
- * @param path The full path to the fade in music file.
- * @param ms Duration of fade-out effect (ms)
+ * @param fileName The name of the music file.
+ * @param ms Duration of fade-out effect (ms)
*/
- void fadeOutAndPlayMusic(const std::string &path, int ms = 1000);
+ void fadeOutAndPlayMusic(const std::string &fileName, int ms = 1000);
int getMaxVolume() const
{ return MIX_MAX_VOLUME; }
@@ -118,7 +120,7 @@ class Sound
* When calling fadeOutAndPlayMusic(),
* the music file below will then be played
*/
- std::string mNextMusicPath;
+ std::string mNextMusicFile;
bool mInstalled;
@@ -126,7 +128,7 @@ class Sound
int mMusicVolume;
std::string mCurrentMusicFile;
- Mix_Music *mMusic;
+ Music *mMusic;
};
extern Sound sound;