예제 #1
0
        public void FadingChannel()
        {
            InitAudio();
            int    result;
            int    resultFading;
            IntPtr chunkPtr = SdlMixer.Mix_LoadMUS("test.wav");

            result       = SdlMixer.Mix_PlayChannel(1, chunkPtr, -1);
            resultFading = SdlMixer.Mix_FadingChannel(1);
            //Console.WriteLine("FadingMusic1: " + resultFading.ToString());
            Assert.AreEqual(resultFading, SdlMixer.MIX_NO_FADING);
            result       = SdlMixer.Mix_FadeOutChannel(1, 1000);
            resultFading = SdlMixer.Mix_FadingChannel(1);
            Assert.AreEqual(resultFading, SdlMixer.MIX_FADING_OUT);
            //Console.WriteLine("FadingMusic2: " + resultFading.ToString());
            Thread.Sleep(2000);
            resultFading = SdlMixer.Mix_FadingChannel(1);
            Assert.AreEqual(resultFading, SdlMixer.MIX_NO_FADING);
            //Console.WriteLine("FadingMusic: " + resultFading.ToString());
            Assert.IsTrue(result == 1);
            QuitAudio();
        }
예제 #2
0
 /// <summary>
 /// Returns the current fading status of a channel
 /// </summary>
 /// <returns>The current fading status of the channel</returns>
 /// <remarks></remarks>
 public FadingStatus FadingStatus()
 {
     return((FadingStatus)SdlMixer.Mix_FadingChannel(this.index));
 }