aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 18:51:40 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 18:51:40 +0000
commit6ca1db26350a589b5bcb3e2eac35a7965d5ab448 (patch)
tree37f4d6bef02b3bbeccefbaafa5eeb94a3942a7f8 /Game/Code/Classes
parenta5ca459937cf9f08d47ca6aca16e777153821f25 (diff)
downloadusdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.gz
usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.xz
usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.zip
Mac OS X: Added PseudoThread for debugging, because debugging of threaded code causes problems with Xcode and FreePascal.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@594 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UCommandLine.pas4
-rw-r--r--Game/Code/Classes/URecord.pas10
-rw-r--r--Game/Code/Classes/USongs.pas25
3 files changed, 36 insertions, 3 deletions
diff --git a/Game/Code/Classes/UCommandLine.pas b/Game/Code/Classes/UCommandLine.pas
index 1539ffaf..01ece795 100644
--- a/Game/Code/Classes/UCommandLine.pas
+++ b/Game/Code/Classes/UCommandLine.pas
@@ -2,6 +2,10 @@ unit UCommandLine;
interface
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
{$I switches.inc}
diff --git a/Game/Code/Classes/URecord.pas b/Game/Code/Classes/URecord.pas
index 87c35cd8..29a9d7f9 100644
--- a/Game/Code/Classes/URecord.pas
+++ b/Game/Code/Classes/URecord.pas
@@ -323,6 +323,16 @@ begin
BASS_RecordInit(SC);
InputName := BASS_RecordGetInputName(SCI);
+
+ {$IFDEF DARWIN}
+ // Under MacOSX the SingStar Mics have an empty
+ // InputName. So, we have to add a hard coded
+ // Workaround for this problem
+ if (InputName = nil) and (Pos( 'USBMIC Serial#', Descr) > 0) then
+ begin
+ InputName := 'Microphone';
+ end;
+ {$ENDIF}
SetLength(SoundCard[SC].Input, 1);
SoundCard[SC].Input[SCI].Name := InputName;
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index a04c1032..9b9ab7bb 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -8,6 +8,12 @@ interface
{$I switches.inc}
+{$IFDEF DARWIN}
+ {$IFDEF DEBUG}
+ {$DEFINE USE_PSEUDO_THREAD}
+ {$ENDIF}
+{$ENDIF}
+
uses
{$IFDEF MSWINDOWS}
Windows,
@@ -30,6 +36,9 @@ uses
{$IFDEF DARWIN}
cthreads,
{$ENDIF}
+ {$IFDEF USE_PSEUDO_THREAD}
+ PseudoThread,
+ {$ENDIF}
UCatCovers;
type
@@ -86,8 +95,13 @@ 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
end;
-
+
+
+ {$IFDEF USE_PSEUDO_THREAD}
+ TSongs = class( TPseudoThread )
+ {$ELSE}
TSongs = class( TThread )
+ {$ENDIF}
private
BrowsePos : Cardinal; //Actual Pos in Song Array
fNotify ,
@@ -204,7 +218,9 @@ begin
*)
{$endif}
- Setlength(Song, 0);
+{$IFNDEF USE_PSEUDO_THREAD}
+ Setlength(Song, 0);
+{$ENDIF}
end;
procedure TSongs.DoDirChanged(Sender: TObject);
@@ -216,6 +232,9 @@ procedure TSongs.Execute();
var
fChangeNotify : THandle;
begin
+{$IFDEF USE_PSEUDO_THREAD}
+ int_LoadSongList();
+{$ELSE}
fParseSongDirectory := true;
while not self.terminated do
@@ -229,7 +248,7 @@ begin
self.suspend;
end;
-
+{$ENDIF}
end;
procedure TSongs.int_LoadSongList;