aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/USong.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-04-27 10:30:11 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-04-27 10:30:11 +0000
commit019d57a35441572024cd478da08a67149a1c865f (patch)
tree8b32a8ac1c9165bab25080c5b59046fca4f57d8a /Game/Code/Classes/USong.pas
parent2202a88128ea55b4e142d169db924b9dea8a02f1 (diff)
downloadusdx-019d57a35441572024cd478da08a67149a1c865f.tar.gz
usdx-019d57a35441572024cd478da08a67149a1c865f.tar.xz
usdx-019d57a35441572024cd478da08a67149a1c865f.zip
- Fixed several bugs with tabbed browsing (Tabs: on) which occurred after TSong was changed from a record to a class.
- Replaced BubbleSort with MergeSort for song sorting (QuickSort is not applicable here because it is instable) - Added a constructor to TSong for Category-Buttons (this is a bad solution because category-buttons are not songs, a common super-class TCatItem would be nicer) - Some cleanup git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1039 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/USong.pas')
-rw-r--r--Game/Code/Classes/USong.pas34
1 files changed, 13 insertions, 21 deletions
diff --git a/Game/Code/Classes/USong.pas b/Game/Code/Classes/USong.pas
index 66169ef0..3c365720 100644
--- a/Game/Code/Classes/USong.pas
+++ b/Game/Code/Classes/USong.pas
@@ -63,10 +63,10 @@ type
FileName: widestring;
// sorting methods
- Category: array of widestring; // I think I won't need this
+ Category: array of widestring; // TODO: do we need this?
Genre: widestring;
Edition: widestring;
- Language: widestring; // 0.5.0: new
+ Language: widestring;
Title: widestring;
Artist: widestring;
@@ -80,7 +80,7 @@ type
Background: widestring;
Video: widestring;
VideoGAP: real;
- VideoLoaded: boolean; // 0.5.0: true if the video has been loaded
+ VideoLoaded: boolean; // true if the video has been loaded
NotesGAP: integer;
Start: real; // in seconds
Finish: integer; // in miliseconds
@@ -98,19 +98,20 @@ type
OrderTyp: integer; // type of sorting for this button (0=name)
CatNumber: integer; // Count of Songs in Category for Cats and Number of Song in Category for Songs
- SongFile: TextFile; // all procedures in this unit operates on this file
+ SongFile: TextFile; // all procedures in this unit operate on this file
Base : array[0..1] of integer;
Rel : array[0..1] of integer;
Mult : integer;
MultBPM : integer;
- constructor create ( const aFileName : WideString );
+ constructor Create (); overload;
+ constructor Create ( const aFileName : WideString ); overload;
function LoadSong: boolean;
function LoadXMLSong: boolean;
function Analyse(): boolean;
function AnalyseXML(): boolean;
- procedure clear();
+ procedure Clear();
end;
implementation
@@ -121,42 +122,33 @@ uses
UMusic, //needed for Lines
UMain; //needed for Player
-constructor TSong.create( const aFileName : WideString );
+constructor TSong.Create();
begin
+end;
+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 );
self.FileName := ExtractFileName( aFileName );
-
-(*
-
+ (*
if ReadTXTHeader( aFileName ) then
-
begin
-
LoadSong();
-
end
else
begin
Log.LogError('Error Loading SongHeader, abort Song Loading');
Exit;
end;
-*)
+ *)
end;
-
end;
//Load TXT Song