aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenSing.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-21 19:17:12 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-21 19:17:12 +0000
commitdeba59815a59cc6857c72872b7ae5d6d332bcb48 (patch)
tree835297b43ba21579b7487a41c3f43be5cf8b8b54 /src/screens/UScreenSing.pas
parent8be69a4b6a53c84e0e19c7c0ec8dde9a96f03bc0 (diff)
downloadusdx-deba59815a59cc6857c72872b7ae5d6d332bcb48.tar.gz
usdx-deba59815a59cc6857c72872b7ae5d6d332bcb48.tar.xz
usdx-deba59815a59cc6857c72872b7ae5d6d332bcb48.zip
major bug-fix:
- TScreenSong.OnHide() interfered with TScreenSing.OnShow() method as the changes of AudioPlayback in TScreenSing.OnShow() were overwritten by TScreenSong.OnHide() which is called later. -> moved AudioPlayback initialization to OnShowFinish - The audio file was opened in TScreenSong, mainly that caused the interference. Now the audio file is opened in TScreenSing. This looks more cleaner too. - this patch fixes: - some race conditions - Dead Smiling Pirates song (and others) were not played from the beginning (especially on linux) cleanup: - removed unused MusicPreviewTimer git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2262 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens/UScreenSing.pas')
-rw-r--r--src/screens/UScreenSing.pas17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/screens/UScreenSing.pas b/src/screens/UScreenSing.pas
index 5f39ec49..5000d096 100644
--- a/src/screens/UScreenSing.pas
+++ b/src/screens/UScreenSing.pas
@@ -564,12 +564,6 @@ begin
LyricsState.TotalTime := AudioPlayback.Length;
LyricsState.UpdateBeats();
- // prepare music
- AudioPlayback.Stop();
- AudioPlayback.Position := CurrentSong.Start;
- // synchronize music to the lyrics
- AudioPlayback.SetSyncSource(LyricsSync);
-
// prepare and start voice-capture
AudioInput.CaptureStart;
@@ -666,7 +660,16 @@ procedure TScreenSing.onShowFinish;
begin
// hide cursor on singscreen show
Display.SetCursor;
-
+
+ // prepare music
+ // Important: AudioPlayback must not be initialized in onShow() as TScreenSong
+ // uses stops AudioPlayback in onHide() which interferes with TScreenSings onShow.
+ AudioPlayback.Open(CurrentSong.Path.Append(CurrentSong.Mp3));
+ AudioPlayback.SetVolume(1.0);
+ AudioPlayback.Position := CurrentSong.Start;
+ // synchronize music to the lyrics
+ AudioPlayback.SetSyncSource(LyricsSync);
+
// start lyrics
LyricsState.Resume();