Ejemplo n.º 1
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();
        }