Added a debug tool for music testing

This commit is contained in:
CaptainSegis 2019-01-27 16:23:43 -05:00
parent 64b16154f5
commit 924afc2005
3 changed files with 30 additions and 1 deletions

View File

@ -49,6 +49,8 @@
Core.SpriteBatch.DrawInterfaceString(FontManager.MainFont, s, New Vector2(7, 7), Color.Black) Core.SpriteBatch.DrawInterfaceString(FontManager.MainFont, s, New Vector2(7, 7), Color.Black)
Core.SpriteBatch.DrawInterfaceString(FontManager.MainFont, s, New Vector2(5, 5), Color.White) Core.SpriteBatch.DrawInterfaceString(FontManager.MainFont, s, New Vector2(5, 5), Color.White)
' DrawMediaInfo() To test music
End If End If
End Sub End Sub
@ -83,6 +85,33 @@
End Set End Set
End Property End Property
''' <summary>
''' MediaPLayer state tracking method.
''' </summary>
Private Shared Sub DrawMediaInfo()
Dim songName = "<NO SONG PLAYING>"
If MediaPlayer.Queue IsNot Nothing AndAlso MediaPlayer.Queue.ActiveSong IsNot Nothing Then
songName = MediaPlayer.Queue.ActiveSong.Name
If MusicManager.CurrentSong IsNot Nothing Then
songName += " (" + MusicManager.CurrentSong.Name + ")"
End If
End If
Dim field = GetType(MediaPlayer).GetField("_sessionState", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Static)
Dim sessionState = field.GetValue(Nothing).ToString()
Dim str = "Song: " + songName + Environment.NewLine +
"Play position: " + MediaPlayer.PlayPosition.ToString() + Environment.NewLine +
"Session state: " + sessionState + Environment.NewLine +
"State: " + MediaPlayer.State.ToString() + Environment.NewLine +
"Volume: " + MediaPlayer.Volume.ToString() + Environment.NewLine +
"Is Muted: " + MediaPlayer.IsMuted.ToString() + Environment.NewLine +
"Is Repeating: " + MediaPlayer.IsRepeating.ToString()
Core.SpriteBatch.DrawInterfaceString(FontManager.MainFont, str, New Vector2(7, 7), Color.Black)
Core.SpriteBatch.DrawInterfaceString(FontManager.MainFont, str, New Vector2(5, 5), Color.White)
End Sub
''' <summary> ''' <summary>
''' The distance of the vertex to the camera, that is the furthest away from the camera. ''' The distance of the vertex to the camera, that is the furthest away from the camera.
''' </summary> ''' </summary>

View File

@ -13724,7 +13724,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="meta"> <Content Include="meta">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Effects\Shadow.png"> <Content Include="Content\Effects\Shadow.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

Binary file not shown.