aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/USong.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-10-09 17:57:10 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-10-09 17:57:10 +0000
commit528d8cd40ec3763bb3018da4829803404d1cd04b (patch)
tree74c212237f2360bdeb18b9e3e3a19dcd6748d7d8 /src/base/USong.pas
parent721776f85625ab218cff2d8156e80522f5381045 (diff)
downloadusdx-528d8cd40ec3763bb3018da4829803404d1cd04b.tar.gz
usdx-528d8cd40ec3763bb3018da4829803404d1cd04b.tar.xz
usdx-528d8cd40ec3763bb3018da4829803404d1cd04b.zip
Errormessages during songload now translatable
German and English translations updated Added four new language strings: ERROR_CORRUPT_SONG_FILE_NOT_FOUND ERROR_CORRUPT_SONG_NO_NOTES ERROR_CORRUPT_SONG_NO_BREAKS ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1443 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base/USong.pas')
-rw-r--r--src/base/USong.pas19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/base/USong.pas b/src/base/USong.pas
index 47ac0a30..6c81cecc 100644
--- a/src/base/USong.pas
+++ b/src/base/USong.pas
@@ -130,6 +130,9 @@ type
MultBPM : integer;
LastError: String;
+ Function GetErrorLineNo: Integer;
+ Property ErrorLineNo: Integer read GetErrorLineNo;
+
constructor Create (); overload;
constructor Create ( const aFileName : WideString ); overload;
@@ -203,7 +206,7 @@ begin
if not FileExists(Path + PathDelim + FileName) then
begin
- LastError := 'File not found';
+ LastError := 'ERROR_CORRUPT_SONG_FILE_NOT_FOUND';
Log.LogError('File not found: "' + Path + PathDelim + FileName + '"', 'TSong.LoadSong()');
exit;
end;
@@ -243,7 +246,7 @@ begin
begin //Song File Corrupted - No Notes
CloseFile(SongFile);
Log.LogError('Could not load txt File, no Notes found: ' + FileName);
- LastError := 'Can''t find any notes';
+ LastError := 'ERROR_CORRUPT_SONG_NO_NOTES';
Exit;
end;
Read(SongFile, TempC);
@@ -368,7 +371,7 @@ begin
begin
If (Length(Lines[I].Line) < 2) then
begin
- LastError := 'Can''t find any linebreaks';
+ LastError := 'ERROR_CORRUPT_SONG_NO_BREAKS';
Log.LogError('Error Loading File, Can''t find any Linebreaks: "' + fFileName + '"');
exit;
end;
@@ -395,7 +398,7 @@ begin
end;
- LastError := 'Error reading line ' + inttostr(FileLineNo);
+ LastError := 'ERROR_CORRUPT_SONG_ERROR_IN_LINE';
Log.LogError('Error Loading File: "' + fFileName + '" in Line ' + inttostr(FileLineNo));
exit;
end;
@@ -885,6 +888,14 @@ begin
end;
+Function TSong.GetErrorLineNo: Integer;
+begin
+ If (LastError='ERROR_CORRUPT_SONG_ERROR_IN_LINE') then
+ Result := FileLineNo
+ Else
+ Result := -1;
+end;
+
procedure TSong.ParseNote(LineNumber: integer; TypeP: char; StartP, DurationP, NoteP: integer; LyricS: string);
begin