aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/bass/lazarustest.lpr
diff options
context:
space:
mode:
authormogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-13 19:58:44 +0000
committermogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-13 19:58:44 +0000
commit949fea202f6c963ad6c8a40040e1e9e6f909161b (patch)
tree9f6f683d203d55e41e5b7483b4038103d471ce76 /Game/Code/lib/bass/lazarustest.lpr
parent1a7da68ae6e1368dae25821b15318bd1d2d9f88e (diff)
parentefe5b06fd5715f550334692d28c2218896b62ce1 (diff)
downloadusdx-949fea202f6c963ad6c8a40040e1e9e6f909161b.tar.gz
usdx-949fea202f6c963ad6c8a40040e1e9e6f909161b.tar.xz
usdx-949fea202f6c963ad6c8a40040e1e9e6f909161b.zip
First multi platform version, works on Linux and Windows
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.1@855 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/lib/bass/lazarustest.lpr51
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.
+