From 3de159b0d467f57967642431f96b7d675b004b8e Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Mon, 25 Apr 2011 10:53:52 +0000 Subject: added song quality check git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2829 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/ULog.pas | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'Game/Code/Classes/ULog.pas') diff --git a/Game/Code/Classes/ULog.pas b/Game/Code/Classes/ULog.pas index a3e7f156..9e6f26fb 100644 --- a/Game/Code/Classes/ULog.pas +++ b/Game/Code/Classes/ULog.pas @@ -17,6 +17,9 @@ type FileSession: TextFile; FileSessionO: boolean; // opened + FileSongQuality: TextFile; + FileSongQualityO: boolean; // opened + NumErrors: integer; NumSungSongs: integer; @@ -43,6 +46,7 @@ type function LogVoice(SoundNr: Integer; Player, Artist, Title, Points: string): string; procedure LogSession(names: array of string; points: array of string; Artist, Title, singmode: string); + procedure LogSongQuality(artist, title: string; syntax, bpm, notegaps, notejumps, score, value, goldennotes: real); // compability procedure LogStatus(Log1, Log2: string); @@ -285,7 +289,7 @@ begin // if FileAnalyzeO then CloseFile(FileAnalyze); if FileErrorO then CloseFile(FileError); if FileSessionO then CloseFile(FileSession); - + if FileSongQualityO then CloseFile(FileSongQuality); end; procedure TLog.BenchmarkStart(Number: integer); @@ -627,6 +631,43 @@ begin end; end; +procedure TLog.LogSongQuality(artist, title: string; + syntax, bpm, notegaps, notejumps, score, value, goldennotes: real); +var + FileName: string; + +begin + if not FileSongQualityO then + begin + NumSungSongs := 0; + FileName := GamePath + 'quality.csv'; + + AssignFile(FileSongQuality, FileName); + {$I-} + Rewrite(FileSongQuality); + if IOResult = 0 then FileSongQualityO := true; + {$I+} + + //If File is opened write column names to File + If (FileSongQualityO) then + begin + WriteLn(FileSongQuality, 'Artist; Title; Syntax; BPM; Note Gaps; Note Jumps; Scores; Value; Anteil Goldene Noten'); + Flush(FileSongQuality); + end; + end; + + if FileSongQualityO then + begin + try + WriteLn(FileSongQuality, artist + ';' + title + ';' + FloatToStr(syntax) + ';' + + FloatToStr(bpm) + ';' + FloatToStr(notegaps) + ';' + FloatToStr(notejumps) + ';' + + FloatToStr(score) + ';' + FloatToStr(value) + ';' + FloatToStr(goldennotes) + ';'); + except + FileSongQualityO := false; + end; + end; +end; + procedure TLog.LogStatus(Log1, Log2: string); begin //Just for Debugging -- cgit v1.2.3