aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r--Game/Code/Classes/USong.pas107
1 files changed, 66 insertions, 41 deletions
diff --git a/Game/Code/Classes/USong.pas b/Game/Code/Classes/USong.pas
index 728f5055..e5777c75 100644
--- a/Game/Code/Classes/USong.pas
+++ b/Game/Code/Classes/USong.pas
@@ -1,9 +1,15 @@
-unit USong;
-
-interface
-
-uses
- {$IFDEF MSWINDOWS}
+unit USong;
+
+interface
+
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+{$I switches.inc}
+
+uses
+ {$IFDEF MSWINDOWS}
Windows,
{$ifdef Delphi}
DirWatch,
@@ -29,8 +35,8 @@ uses
PseudoThread,
{$ENDIF}
UCatCovers;
-
-type
+
+type
TSingMode = ( smNormal, smPartyMode, smPlaylistRandom );
@@ -109,33 +115,43 @@ type
function Analyse(): boolean;
procedure clear();
end;
-
-implementation
-
-uses
- TextGL,
- UIni,
- UMusic, // needed for Czesci .. ( whatever that is )
- UMain; //needed for Player
-
-constructor TSong.create( const aFileName : WideString );
+
+implementation
+
+uses
+ TextGL,
+ UIni,
+ UMusic, // needed for Czesci .. ( whatever that is )
+ UMain; //needed for Player
+
+constructor TSong.create( const aFileName : WideString );
begin
- Mult := 1;
- MultBPM := 4;
-
- fFileName := aFileName;
-
- if fileexists( aFileName ) then
- begin
- self.Path := ExtractFilePath( aFileName );
- self.Folder := ExtractFilePath( aFileName );
+
+ Mult := 1;
+
+ MultBPM := 4;
+
+
+ fFileName := aFileName;
+
+
+ if fileexists( aFileName ) then
+
+ begin
+
+ self.Path := ExtractFilePath( aFileName );
+ self.Folder := ExtractFilePath( aFileName );
self.FileName := ExtractFileName( aFileName );
- (*
- if ReadTXTHeader( aFileName ) then
- begin
- LoadSong();
- end
+(*
+
+ if ReadTXTHeader( aFileName ) then
+
+ begin
+
+ LoadSong();
+
+ end
else
begin
Log.LogError('Error Loading SongHeader, abort Song Loading');
@@ -145,9 +161,11 @@ begin
end;
end;
-
- function TSong.LoadSong(): boolean;
- var
+
+
+function TSong.LoadSong(): boolean;
+
+var
TempC: char;
Tekst: string;
CP: integer; // Current Player (0 or 1)
@@ -319,9 +337,11 @@ begin
Result := true;
end;
-
- function TSong.ReadTXTHeader(const aFileName : WideString): boolean;
- var
+
+
+function TSong.ReadTXTHeader(const aFileName : WideString): boolean;
+
+var
Line, Identifier, Value: String;
Temp : word;
Done : byte;
@@ -362,6 +382,11 @@ begin
//Required Attributes
//-----------
+ {$IFDEF UTF8_FILENAMES}
+ if ((Identifier = 'MP3') or (Identifier = 'BACKGROUND') or (Identifier = 'COVER') or (Identifier = 'VIDEO')) then
+ Value := Utf8Encode(Value);
+ {$ENDIF}
+
//Title
if (Identifier = 'TITLE') then
begin
@@ -646,7 +671,7 @@ end;
procedure TSong.clear();
begin
- //Main Information
+ //Main Information
Title := '';
Artist := '';
@@ -675,7 +700,7 @@ begin
NotesGAP := 0;
Resolution := 4;
Creator := '';
-
+
end;
function TSong.Analyse(): boolean;
@@ -705,4 +730,4 @@ end;
-end.
+end.