Beispiel #1
0
 /// <summary>
 /// Fades out music
 /// </summary>
 /// <param name="milliseconds">
 /// The number of milliseconds to fade out for
 /// </param>
 public static void Fadeout(int milliseconds)
 {
     if (SdlMixer.Mix_FadeOutMusic(milliseconds) != 1)
     {
         throw SdlException.Generate();
     }
 }
Beispiel #2
0
        public void FadeOutMusic()
        {
            InitAudio();
            int    result;
            IntPtr chunkPtr = SdlMixer.Mix_LoadMUS("test.wav");

            result = SdlMixer.Mix_PlayMusic(chunkPtr, -1);
            result = SdlMixer.Mix_FadeOutMusic(1000);
            Thread.Sleep(2000);
            Console.WriteLine("PlayMusic: " + result.ToString());
            Assert.IsTrue(result == 1);
            QuitAudio();
        }
Beispiel #3
0
        public void FadingMusic()
        {
            InitAudio();
            int    result;
            int    resultFading;
            IntPtr chunkPtr = SdlMixer.Mix_LoadMUS("test.wav");

            result       = SdlMixer.Mix_PlayMusic(chunkPtr, -1);
            resultFading = SdlMixer.Mix_FadingMusic();
            //Console.WriteLine("FadingMusic1: " + resultFading.ToString());
            Assert.AreEqual(resultFading, SdlMixer.MIX_NO_FADING);
            result       = SdlMixer.Mix_FadeOutMusic(1000);
            resultFading = SdlMixer.Mix_FadingMusic();
            Assert.AreEqual(resultFading, SdlMixer.MIX_FADING_OUT);
            //Console.WriteLine("FadingMusic2: " + resultFading.ToString());
            Thread.Sleep(2000);
            resultFading = SdlMixer.Mix_FadingMusic();
            Assert.AreEqual(resultFading, SdlMixer.MIX_NO_FADING);
            //Console.WriteLine("FadingMusic: " + resultFading.ToString());
            Assert.IsTrue(result == 1);
            QuitAudio();
        }
 /*
  * Fades the currentSong out
  *
  * @param ms duration of fade in ms
  */
 public void fadeSongOut(int ms)
 {
     SdlMixer.Mix_FadeOutMusic(ms);
 }