mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 15:54:25 +02:00
hatch music fix
This commit is contained in:
parent
1a1c935714
commit
b58d3411b3
@ -188,7 +188,7 @@ Public Class MusicManager
|
|||||||
If Date.Now >= _pausedUntil Then
|
If Date.Now >= _pausedUntil Then
|
||||||
If MusicManager.Paused = True Then
|
If MusicManager.Paused = True Then
|
||||||
_isPausedForSound = False
|
_isPausedForSound = False
|
||||||
ResumePlayback()
|
Paused = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@ -304,7 +304,6 @@ Public Class MusicManager
|
|||||||
_introEndTime = _introEndTime + pauseTime
|
_introEndTime = _introEndTime + pauseTime
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Paused = False
|
|
||||||
outputDevice.Play()
|
outputDevice.Play()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@ -312,51 +311,26 @@ Public Class MusicManager
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Play(song As SongContainer)
|
Private Shared Sub Play(song As SongContainer)
|
||||||
If _isLooping = True Then
|
If Not song Is Nothing Then
|
||||||
If Not song Is Nothing Then
|
Logger.Debug($"Play song [{song.Name}]")
|
||||||
Logger.Debug($"Play song [{song.Name}]")
|
If Not outputDevice Is Nothing Then
|
||||||
If Not outputDevice Is Nothing Then
|
outputDevice.Dispose()
|
||||||
outputDevice.Dispose()
|
|
||||||
End If
|
|
||||||
outputDevice = New WaveOutEvent()
|
|
||||||
audioFile = New VorbisWaveReader(song.Song)
|
|
||||||
_loop = New LoopStream(audioFile)
|
|
||||||
outputDevice.Init(_loop)
|
|
||||||
If Paused = False Then
|
|
||||||
outputDevice.Play()
|
|
||||||
End If
|
|
||||||
outputDevice.Volume = Volume * MasterVolume
|
|
||||||
_currentSongExists = True
|
|
||||||
_currentSongName = song.Name
|
|
||||||
_currentSong = song
|
|
||||||
Else
|
|
||||||
_currentSongExists = False
|
|
||||||
_currentSongName = NO_MUSIC
|
|
||||||
_currentSong = Nothing
|
|
||||||
End If
|
End If
|
||||||
|
outputDevice = New WaveOutEvent()
|
||||||
|
audioFile = New VorbisWaveReader(song.Song)
|
||||||
|
_loop = New LoopStream(audioFile, _isLooping)
|
||||||
|
outputDevice.Init(_loop)
|
||||||
|
If Paused = False Then
|
||||||
|
outputDevice.Play()
|
||||||
|
End If
|
||||||
|
outputDevice.Volume = Volume * MasterVolume
|
||||||
|
_currentSongExists = True
|
||||||
|
_currentSongName = song.Name
|
||||||
|
_currentSong = song
|
||||||
Else
|
Else
|
||||||
If Not song Is Nothing Then
|
_currentSongExists = False
|
||||||
Logger.Debug($"Play song [{song.Name}]")
|
_currentSongName = NO_MUSIC
|
||||||
If Not outputDevice Is Nothing Then
|
_currentSong = Nothing
|
||||||
outputDevice.Dispose()
|
|
||||||
End If
|
|
||||||
|
|
||||||
outputDevice = New WaveOutEvent()
|
|
||||||
audioFile = New VorbisWaveReader(song.Song)
|
|
||||||
_loop = New LoopStream(audioFile, False)
|
|
||||||
outputDevice.Init(_loop)
|
|
||||||
If Paused = False Then
|
|
||||||
outputDevice.Play()
|
|
||||||
End If
|
|
||||||
outputDevice.Volume = Volume * MasterVolume
|
|
||||||
_currentSongExists = True
|
|
||||||
_currentSongName = song.Name
|
|
||||||
_currentSong = song
|
|
||||||
Else
|
|
||||||
_currentSongExists = False
|
|
||||||
_currentSongName = NO_MUSIC
|
|
||||||
_currentSong = Nothing
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
Loading…
x
Reference in New Issue
Block a user