aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-13 12:21:44 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-13 12:21:44 +0000
commitf87d4046cf00ea49ab83f0610018bc08cd148a6f (patch)
tree1922dd6e41a96bdf7ad7e2d657060c37908183c8 /Game/Code/Classes
parent24a6af60065764b18c863b1350bc0431316b48cd (diff)
downloadusdx-f87d4046cf00ea49ab83f0610018bc08cd148a6f.tar.gz
usdx-f87d4046cf00ea49ab83f0610018bc08cd148a6f.tar.xz
usdx-f87d4046cf00ea49ab83f0610018bc08cd148a6f.zip
Disabled threaded song-loading until it is fixed.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1258 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r--Game/Code/Classes/USongs.pas39
1 files changed, 23 insertions, 16 deletions
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index 783b1012..c036e290 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -54,16 +54,16 @@ type
end;
{$IFDEF USE_PSEUDO_THREAD}
- TSongs = class( TPseudoThread )
+ TSongs = class( TPseudoThread )
{$ELSE}
- TSongs = class( TThread )
+ TSongs = class( TThread )
{$ENDIF}
private
fNotify, fWatch : longint;
fParseSongDirectory : boolean;
fProcessing : boolean;
{$ifdef MSWINDOWS}
- fDirWatch : TDirectoryWatch;
+ fDirWatch : TDirectoryWatch;
{$endif}
procedure int_LoadSongList;
procedure DoDirChanged(Sender: TObject);
@@ -72,8 +72,8 @@ type
public
SongList : TList; // array of songs
Selected : integer; // selected song index
- constructor create();
- destructor destroy(); override;
+ constructor Create();
+ destructor Destroy(); override;
procedure LoadSongList; // load all songs
@@ -133,14 +133,17 @@ uses StrUtils,
UMain,
UIni;
-constructor TSongs.create();
+constructor TSongs.Create();
begin
// do not start thread BEFORE initialization (suspended = true)
- inherited create( true );
- self.freeonterminate := true;
+ inherited Create(true);
+ Self.FreeOnTerminate := true;
- SongList := TList.create();
+ SongList := TList.Create();
+ // FIXME: threaded loading does not work this way.
+ // It will just cause crashes but nothing else at the moment.
+ (*
{$ifdef MSWINDOWS}
fDirWatch := TDirectoryWatch.create(nil);
fDirWatch.OnChange := DoDirChanged;
@@ -151,11 +154,15 @@ begin
// now we can start the thread
Resume();
+ *)
+
+ // until it is fixed, simply load the song-list
+ int_LoadSongList();
end;
-destructor TSongs.destroy();
+destructor TSongs.Destroy();
begin
- freeandnil( SongList );
+ FreeAndNil( SongList );
inherited;
end;
@@ -173,7 +180,7 @@ begin
{$ELSE}
fParseSongDirectory := true;
- while not self.terminated do
+ while not terminated do
begin
if fParseSongDirectory then
@@ -182,7 +189,7 @@ begin
int_LoadSongList();
end;
- self.suspend;
+ Suspend();
end;
{$ENDIF}
end;
@@ -206,8 +213,8 @@ begin
if assigned( CatCovers ) then
CatCovers.Load;
- //if assigned( Covers ) then
- // Covers.Load;
+ if assigned( Covers ) then
+ Covers.Load;
if assigned(ScreenSong) then
begin
@@ -227,7 +234,7 @@ end;
procedure TSongs.LoadSongList;
begin
fParseSongDirectory := true;
- self.resume;
+ Resume();
end;
procedure TSongs.BrowseDir(Dir: widestring);