aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenSing.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-12-07 21:47:43 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-12-07 21:47:43 +0000
commit526ba53e63926cf2837a9e8feb7cda3ac8526300 (patch)
tree7f36d4a3baaf9725cf00b1adcce723206455add8 /src/screens/UScreenSing.pas
parentc3ddbfc1dbc470c1c52c6a3d2dea6f192aad059f (diff)
downloadusdx-526ba53e63926cf2837a9e8feb7cda3ac8526300.tar.gz
usdx-526ba53e63926cf2837a9e8feb7cda3ac8526300.tar.xz
usdx-526ba53e63926cf2837a9e8feb7cda3ac8526300.zip
add the score to db only if the song was sung to the end (last word of last sentence+length)
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2002 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens/UScreenSing.pas')
-rw-r--r--src/screens/UScreenSing.pas17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/screens/UScreenSing.pas b/src/screens/UScreenSing.pas
index 20805737..342abac1 100644
--- a/src/screens/UScreenSing.pas
+++ b/src/screens/UScreenSing.pas
@@ -98,6 +98,9 @@ type
// score manager:
Scores: TSingScores;
+ //the song was sung to the end
+ SungToEnd: boolean;
+
fShowVisualization: boolean;
fCurrentVideoPlaybackEngine: IVideoPlayback;
@@ -329,6 +332,9 @@ begin
Log.LogStatus('Begin', 'OnShow');
FadeOut := false;
+ //the song was sung to the end
+ SungToEnd := false;
+
// reset video playback engine, to play video clip ...
fCurrentVideoPlaybackEngine := VideoPlayback;
@@ -666,6 +672,8 @@ var
Sec: integer;
T: integer;
CurLyricsTime: real;
+ Line: TLyricLine;
+ LastWord: TLyricWord;
begin
Background.Draw;
@@ -751,6 +759,15 @@ begin
// Note: there is no menu and the animated background brakes the video playback
//DrawBG;
+ //the song was sung to the end?
+ Line := Lyrics.GetUpperLine();
+ if Line.LastLine then
+ begin
+ LastWord := Line.Words[Length(Line.Words)-1];
+ if CurLyricsTime >= GetTimeFromBeat(LastWord.Start+LastWord.Length) then
+ SungToEnd := true;
+ end;
+
// update and draw movie
if (ShowFinish and (VideoLoaded or fShowVisualization)) then
begin