diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-01-24 19:14:24 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-01-24 19:15:07 +0100 |
commit | b856e8b47ab2dfd393e3c2720c5647eb66393931 (patch) | |
tree | 3709cc05792d977aa36ddaa5e3874552aed9d2e4 /src/resources/music.h | |
parent | 59c5d1ef260736225ba3ba486f40532949cc293b (diff) | |
download | mana-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/resources/music.h')
-rw-r--r-- | src/resources/music.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/resources/music.h b/src/resources/music.h index 6a4cabd5..f744fcd4 100644 --- a/src/resources/music.h +++ b/src/resources/music.h @@ -51,24 +51,19 @@ class Music : public Resource /** * Plays the music. * - * @param loops Number of times to repeat the playback. + * @param loops Number of times to repeat the playback (-1 means + * forever). + * @param fadeIn Duration in milliseconds to fade in the music. * * @return <code>true</code> if the playback started properly * <code>false</code> otherwise. */ - virtual bool play(int loops); - - /** - * Stops the music. - */ - virtual void stop(); + bool play(int loops = -1, int fadeIn = 0); protected: - Music(Mix_Chunk *music); + Music(Mix_Music *music); - //Mix_Music *music; - Mix_Chunk *mChunk; - int mChannel; + Mix_Music *mMusic; }; #endif |