diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-09-13 11:39:57 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-09-13 11:39:57 +0000 |
commit | 5a778181e947cfb883f85d3239f6d1f1714dacc8 (patch) | |
tree | e9483aab9464d34d4d1171aa97504c6a283d54b0 /Game/Code/lib/bass/lazarustest.lpr | |
parent | f0bf8c49eadf2656bf91a4b24a6ce5106b887b0a (diff) | |
download | usdx-5a778181e947cfb883f85d3239f6d1f1714dacc8.tar.gz usdx-5a778181e947cfb883f85d3239f6d1f1714dacc8.tar.xz usdx-5a778181e947cfb883f85d3239f6d1f1714dacc8.zip |
changes to make 3rd party libraries compile / work
in lazarus.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@387 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/lib/bass/lazarustest.lpr')
-rw-r--r-- | Game/Code/lib/bass/lazarustest.lpr | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Game/Code/lib/bass/lazarustest.lpr b/Game/Code/lib/bass/lazarustest.lpr new file mode 100644 index 00000000..6faee86d --- /dev/null +++ b/Game/Code/lib/bass/lazarustest.lpr @@ -0,0 +1,51 @@ +program lazarustest;
+
+{$mode objfpc}{$H+}
+
+uses
+ sysutils,
+ bass in 'delphi\bass.pas'
+ { add your units here };
+
+var
+ chan : HSTREAM;
+
+begin
+ // check the correct BASS was loaded
+ if (hi(BASS_GetVersion) <> BASSVERSION) then
+ begin
+ writeln('An incorrect version of BASS.DLL was loaded');
+ Halt;
+ end;
+
+ //init BASS
+ if not BASS_Init(0,44100,0,0,nil) then
+ writeln('Can''t initialize device');
+
+ //creating stream
+ if fileexists( 'music.mp3 ') then
+ begin
+ chan := BASS_StreamCreateFile(FALSE,pchar('music.mp3'),0,0,0);
+ if chan = 0 then
+ begin
+ chan := BASS_MusicLoad(False, pchar('music.mp3'), 0, 0, BASS_MUSIC_RAMPS or BASS_MUSIC_POSRESET or BASS_MUSIC_PRESCAN, 0);
+ if (chan = 0) then
+ begin
+ writeln('Can''t play file');
+ Exit;
+ end;
+ end;
+
+ BASS_ChannelPlay(chan,FALSE); // start playing
+ end
+ else
+ begin
+ writeln( 'music.mp3 not found.. could not test mp3 playback');
+ end;
+
+ BASS_Free();
+ writeln( 'Seems BASS is compatible with lazarus :) ');
+
+
+end.
+
|