Exemplo n.º 1
0
 /// <summary>
 /// Plays the music sample and fades it in
 /// </summary>
 /// <param name="numberOfTimes">
 /// The number of times to play.
 /// Specify 1 to play a single time, -1 to loop forever.
 /// </param>
 /// <param name="milliseconds">
 /// The number of milliseconds to fade in for
 /// </param>
 public static void FadeIn(int numberOfTimes, int milliseconds)
 {
     if (SdlMixer.Mix_FadeInMusic(m_CurrentMusic.Handle, numberOfTimes, milliseconds) != 0)
     {
         throw SdlException.Generate();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Plays the music sample and fades it in
 /// </summary>
 /// <param name="numberOfTimes">
 /// The number of times to play.
 /// Specify 1 to play a single time, -1 to loop forever.
 /// </param>
 /// <param name="milliseconds">
 /// The number of milliseconds to fade in for
 /// </param>
 public void FadeIn(int numberOfTimes, int milliseconds)
 {
     MusicPlayer.CurrentMusic = this;
     if (SdlMixer.Mix_FadeInMusic(this.Handle, numberOfTimes, milliseconds) != 0)
     {
         throw SdlException.Generate();
     }
 }
Exemplo n.º 3
0
        public void FadeInMusic()
        {
            InitAudio();
            int    result;
            IntPtr chunkPtr = SdlMixer.Mix_LoadMUS("test.wav");

            result = SdlMixer.Mix_FadeInMusic(chunkPtr, -1, 2);
            Console.WriteLine("PlayMusic: " + result.ToString());
            Assert.IsTrue(result != -1);
            Thread.Sleep(5000);
            QuitAudio();
        }
        /**
         * Fades a Handle to an ogg file in.
         *
         * @param song The song to fade in. Providing no argument will fade the currentSong in.
         *
         * @param loop whether or not to loop music
         *
         * @param ms duration of fade in ms
         */
        public void fadeSongIn(bool loop, int ms, Handle song = null)
        {
            if (song == null)
            {
                song = currentSong;
            }
            if (song == null)
            {
                return;
            }

            SdlMixer.Mix_FadeInMusic(currentSong.getResource <SongSample>().handle, loop ? -1 : 1, ms);
        }