summaryrefslogtreecommitdiff
path: root/src/sound.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-24 22:59:25 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-24 22:59:25 +0300
commit53535919d3cf62f97bc9fee28ee31e4f577d2700 (patch)
tree98b8bc6b8da941b5d2c72c598756374623ad850a /src/sound.h
parentb4e47fb41a19ca09c02bcd009b28cb7c3caa2256 (diff)
downloadManaVerse-53535919d3cf62f97bc9fee28ee31e4f577d2700.tar.gz
ManaVerse-53535919d3cf62f97bc9fee28ee31e4f577d2700.tar.bz2
ManaVerse-53535919d3cf62f97bc9fee28ee31e4f577d2700.tar.xz
ManaVerse-53535919d3cf62f97bc9fee28ee31e4f577d2700.zip
Based on commit b856e8b47ab2dfd393e3c2720c5647eb66393931
Author: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> Date: Tue Jan 24 19:14:24 2012 +0100 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.
Diffstat (limited to 'src/sound.h')
-rw-r--r--src/sound.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/sound.h b/src/sound.h
index 6ac361cac..869f136da 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -29,6 +29,8 @@
#include <string>
+class Music;
+
/** Sound engine
*
* \ingroup CORE
@@ -54,9 +56,9 @@ class Sound : public ConfigListener
/**
* 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.
@@ -66,10 +68,10 @@ class Sound : public ConfigListener
/**
* 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.
@@ -81,15 +83,16 @@ class Sound : public ConfigListener
/**
* 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; }
void setMusicVolume(int volume);
+
void setSfxVolume(int volume);
/**
@@ -133,7 +136,7 @@ class Sound : public ConfigListener
* When calling fadeOutAndPlayMusic(),
* the music file below will then be played
*/
- std::string mNextMusicPath;
+ std::string mNextMusicFile;
bool mInstalled;
@@ -141,7 +144,7 @@ class Sound : public ConfigListener
int mMusicVolume;
std::string mCurrentMusicFile;
- Mix_Music *mMusic;
+ Music *mMusic;
bool mPlayBattle;
bool mPlayGui;
bool mPlayMusic;