コード例 #1
0
 private void SongThread()
 {
     while (!exitThread)
     {
         if (!soundStream.Update())
         {
             if (eof)
             {
                 exitThread = true;
             }
             else
             {
                 System.Console.WriteLine(
                     "Stopped playing Song before EOF!" +
                     " Hastily rebooting playback, expect jitteriness!"
                     );
                 soundStream.Play(false);
             }
         }
         // Arbitrarily 1 frame in a 15Hz game -flibit
         Thread.Sleep(67);
     }
     if (PlayCount > 0)
     {
         /* If PlayCount is 0 at this point, then we were stopped by the
          * calling application, and this event shouldn't happen.
          * -flibit
          */
         MediaPlayer.OnSongFinishedPlaying(null, null);
     }
 }
コード例 #2
0
        public static void Update()
        {
            /* Updates the status of various framework components
             * (such as power state and media), and raises related events.
             */
            for (int i = 0; i < Streams.Count; i += 1)
            {
                DynamicSoundEffectInstance dsfi = Streams[i];
                dsfi.Update();
                if (dsfi.IsDisposed)
                {
                    i -= 1;
                }
            }
            if (Microphone.micList != null)
            {
                for (int i = 0; i < Microphone.micList.Count; i += 1)
                {
                    Microphone.micList[i].CheckBuffer();
                }
            }

            MediaPlayer.Update();
            if (ActiveSongChanged)
            {
                MediaPlayer.OnActiveSongChanged();
                ActiveSongChanged = false;
            }
            if (MediaStateChanged)
            {
                MediaPlayer.OnMediaStateChanged();
                MediaStateChanged = false;
            }
        }
コード例 #3
0
 private void SongThread()
 {
     while (!exitThread)
     {
         exitThread = !soundStream.Update();
         if (!exitThread)
         {
             // Arbitrarily 1 frame in a 15Hz game -flibit
             Thread.Sleep(67);
         }
     }
 }
コード例 #4
0
 // DISABLE_THREADS: DELETE THIS CODE WHEN USING IN XNA4!
 private void SongThread()
 {
     while (!exitThread)
     {
         soundStream.Update();
         if (eof && soundStream.PendingBufferCount == 0)
         {
             soundStream.Stop();
             exitThread = true;
         }
         // Arbitrarily 1 frame in a 15Hz game -flibit
         Thread.Sleep(67);
     }
 }
コード例 #5
0
ファイル: Song.cs プロジェクト: sethbattin/FNA
 private void SongThread()
 {
     while (!exitThread)
     {
         soundStream.Update();
         if (eof && soundStream.PendingBufferCount == 0)
         {
             soundStream.Stop();
             exitThread = true;
         }
         // Arbitrarily 1 frame in a 15Hz game -flibit
         Thread.Sleep(67);
     }
     if (PlayCount > 0)
     {
         /* If PlayCount is 0 at this point, then we were stopped by the
          * calling application, and this event shouldn't happen.
          * -flibit
          */
         MediaPlayer.OnSongFinishedPlaying(null, null);
     }
 }