Show More
Commit Description:
Add missing component and message.
Commit Description:
Add missing component and message.
References:
File last commit:
Show/Diff file:
Action:
FNA/src/FrameworkDispatcher.cs
77 lines | 1.6 KiB | text/x-csharp | CSharpLexer
77 lines | 1.6 KiB | text/x-csharp | CSharpLexer
r0 | #region License | |||
/* FNA - XNA4 Reimplementation for Desktop Platforms | ||||
r690 | * Copyright 2009-2022 Ethan Lee and the MonoGame Team | |||
r0 | * | |||
* Released under the Microsoft Public License. | ||||
* See LICENSE for details. | ||||
*/ | ||||
#endregion | ||||
#region Using Statements | ||||
using System.Collections.Generic; | ||||
using Microsoft.Xna.Framework.Audio; | ||||
using Microsoft.Xna.Framework.Input.Touch; | ||||
using MediaPlayer = Microsoft.Xna.Framework.Media.MediaPlayer; | ||||
#endregion | ||||
namespace Microsoft.Xna.Framework | ||||
{ | ||||
public static class FrameworkDispatcher | ||||
{ | ||||
#region Internal Variables | ||||
internal static bool ActiveSongChanged = false; | ||||
internal static bool MediaStateChanged = false; | ||||
internal static List<DynamicSoundEffectInstance> Streams = new List<DynamicSoundEffectInstance>(); | ||||
#endregion | ||||
#region Public Methods | ||||
public static void Update() | ||||
{ | ||||
/* Updates the status of various framework components | ||||
* (such as power state and media), and raises related events. | ||||
*/ | ||||
r690 | lock (Streams) | |||
r0 | { | |||
r690 | for (int i = 0; i < Streams.Count; i += 1) | |||
r0 | { | |||
r690 | DynamicSoundEffectInstance dsfi = Streams[i]; | |||
dsfi.Update(); | ||||
if (dsfi.IsDisposed) | ||||
{ | ||||
i -= 1; | ||||
} | ||||
r0 | } | |||
} | ||||
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; | ||||
} | ||||
if (TouchPanel.TouchDeviceExists) | ||||
{ | ||||
TouchPanel.Update(); | ||||
} | ||||
} | ||||
#endregion | ||||
} | ||||
} | ||||