From cdddfc059e07b27b634ebc4487b46a5ac2f101cd Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Tue, 4 Jul 2017 22:48:44 +0800 Subject: [PATCH] Fix bugs in Music, MusicPlayer --- SDLWrapper/Music.cpp | 11 +++++++++++ SDLWrapper/Music.h | 1 + 2 files changed, 12 insertions(+) diff --git a/SDLWrapper/Music.cpp b/SDLWrapper/Music.cpp index 0fd8a41..8e9410b 100644 --- a/SDLWrapper/Music.cpp +++ b/SDLWrapper/Music.cpp @@ -37,6 +37,11 @@ void Music::release() _clear(); } +MusicType Music::getType() const +{ + return _internal::getMusicTypeFromMixMusicType(Mix_GetMusicType(_get())); +} + //static int MusicPlayer::GetDecoderNum() { @@ -75,6 +80,12 @@ int MusicPlayer::stop() return Mix_HaltMusic(); } +int MusicPlayer::fadeIn(Music music, int loops, int ms) +{ + m=music; + return fadeIn(loops,ms); +} + int MusicPlayer::fadeIn(int loops, int ms) { return Mix_FadeInMusic(m._get(), loops, ms); diff --git a/SDLWrapper/Music.h b/SDLWrapper/Music.h index e5cbc1e..1d870a6 100644 --- a/SDLWrapper/Music.h +++ b/SDLWrapper/Music.h @@ -42,6 +42,7 @@ public: void rewind(); int setPosition(double second); int stop(); + int fadeIn(Music music,int loops,int ms); int fadeIn(int loops, int ms); int fadeOut(int ms);