From 019d57a35441572024cd478da08a67149a1c865f Mon Sep 17 00:00:00 2001 From: tobigun Date: Sun, 27 Apr 2008 10:30:11 +0000 Subject: - 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 --- Game/Code/Classes/USong.pas | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'Game/Code/Classes/USong.pas') 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 -- cgit v1.2.3