Fix #5096
This commit is contained in:
@@ -47,9 +47,13 @@
|
|||||||
'初始化,确保存在音乐
|
'初始化,确保存在音乐
|
||||||
If MusicAllList Is Nothing OrElse Not MusicAllList.Any() OrElse Not MusicWaitingList.Any() Then MusicListInit(False)
|
If MusicAllList Is Nothing OrElse Not MusicAllList.Any() OrElse Not MusicWaitingList.Any() Then MusicListInit(False)
|
||||||
'出列下一个音乐,如果出列结束则生成新列表
|
'出列下一个音乐,如果出列结束则生成新列表
|
||||||
|
If MusicWaitingList.Any() Then
|
||||||
DequeueNextMusicAddress = MusicWaitingList(0)
|
DequeueNextMusicAddress = MusicWaitingList(0)
|
||||||
MusicWaitingList.RemoveAt(0)
|
MusicWaitingList.RemoveAt(0)
|
||||||
If Not MusicWaitingList.Any() Then MusicListInit(False, DequeueNextMusicAddress)
|
If Not MusicWaitingList.Any() Then MusicListInit(False, DequeueNextMusicAddress)
|
||||||
|
Else
|
||||||
|
DequeueNextMusicAddress = ""
|
||||||
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
@@ -195,9 +199,11 @@
|
|||||||
''' 开始播放音乐。
|
''' 开始播放音乐。
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Private Sub MusicStartPlay(Address As String, Optional IsFirstLoad As Boolean = False)
|
Private Sub MusicStartPlay(Address As String, Optional IsFirstLoad As Boolean = False)
|
||||||
|
If Not Address = "" Then
|
||||||
Log("[Music] 播放开始:" & Address)
|
Log("[Music] 播放开始:" & Address)
|
||||||
MusicCurrent = Address
|
MusicCurrent = Address
|
||||||
RunInNewThread(Sub() MusicLoop(IsFirstLoad), "Music", ThreadPriority.BelowNormal)
|
RunInNewThread(Sub() MusicLoop(IsFirstLoad), "Music", ThreadPriority.BelowNormal)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'播放与暂停
|
'播放与暂停
|
||||||
@@ -293,9 +299,13 @@
|
|||||||
Log(ex, "播放音乐失败(" & GetFileNameFromPath(MusicCurrent) & ")", LogLevel.Hint)
|
Log(ex, "播放音乐失败(" & GetFileNameFromPath(MusicCurrent) & ")", LogLevel.Hint)
|
||||||
End If
|
End If
|
||||||
Thread.Sleep(1000)
|
Thread.Sleep(1000)
|
||||||
|
'将播放错误的音乐从列表中移除
|
||||||
|
MusicAllList.Remove(MusicCurrent)
|
||||||
|
MusicWaitingList.Remove(MusicCurrent)
|
||||||
If TypeOf ex Is FileNotFoundException Then
|
If TypeOf ex Is FileNotFoundException Then
|
||||||
MusicRefreshPlay(True, IsFirstLoad)
|
MusicRefreshPlay(True, IsFirstLoad)
|
||||||
ElseIf MusicAllList.Count > 1 Then
|
ElseIf MusicAllList.Count > 1 Then
|
||||||
|
Else
|
||||||
MusicStartPlay(DequeueNextMusicAddress(), IsFirstLoad)
|
MusicStartPlay(DequeueNextMusicAddress(), IsFirstLoad)
|
||||||
End If
|
End If
|
||||||
Finally
|
Finally
|
||||||
|
|||||||
Reference in New Issue
Block a user