From 53535919d3cf62f97bc9fee28ee31e4f577d2700 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 24 Jan 2012 22:59:25 +0300 Subject: Based on commit b856e8b47ab2dfd393e3c2720c5647eb66393931 Author: Thorbjørn Lindeijer Date: Tue Jan 24 19:14:24 2012 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/sound.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/sound.h') 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 +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; -- cgit v1.2.3-70-g09d2