1
0
Files
applications
bindings
components
Comba_Animation
aboutcomponent
acs
beepfp
callite
captcha
chelper
chemtext
cmdline
cmdlinecfg
colorpalette
cryptini
csvdocument
epiktimer
everettrandom
examplecomponent
exctrls
extrasyn
fpexif
fpsound
example
mainform.lfm
mainform.pas
soundtest.ico
soundtest.lpi
soundtest.lpr
soundtest.res
testsounds
OpenAL_NT.pas
fpsound.pas
fpsound_openal.pas
fpsound_pkg.lpk
fpsound_pkg.pas
fpsound_wav.pas
fpspreadsheet
fractions
freetypepascal
geckoport
gradcontrols
grid_semaphor
gridprinter
industrialstuff
iosdesigner
iphonelazext
jujiboutils
jvcllaz
kcontrols
lazautoupdate
lazbarcodes
lazmapviewer
lclextensions
longtimer
manualdock
mbColorLib
mplayer
multithreadprocs
nvidia-widgets
onguard
orpheus
playsoundpackage
poweredby
powerpdf
rgbgraphics
richmemo
richview
rtfview
rx
scrolltext
smnetgradient
spktoolbar
splashabout
svn
systools
tdi
thtmlport
tparadoxdataset
tvplanit
xdev_toolkit
zlibar
zmsql
examples
image_sources
lclbindings
wst
lazarus-ccr/components/fpsound/example/mainform.pas
sekelsenmat bd2c3feb49 fpsound: develops further, still only noise
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2271 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2012-01-25 15:03:16 +00:00

58 lines
1.1 KiB
ObjectPascal

unit mainform;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
EditBtn;
type
{ TForm1 }
TForm1 = class(TForm)
btnOpenPlayAndClose: TButton;
pathEdit: TFileNameEdit;
procedure btnOpenPlayAndCloseClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
uses fpsound, fpsound_wav, fpsound_openal;
{$R *.lfm}
{ TForm1 }
procedure TForm1.btnOpenPlayAndCloseClick(Sender: TObject);
begin
SoundPlayer.LoadFromFile(pathEdit.FileName);
SoundPlayer.SetSoundPlayer(spOpenAL);
SoundPlayer.Play;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
{$ifdef Windows}
pathEdit.FileName := ExtractFilePath(Application.ExeName) + '..\testsounds\test.wav';
pathEdit.FileName := SysUtils.ExpandFileName(pathEdit.FileName);
{$endif}
{$ifdef Darwin}
pathEdit.FileName := ExtractFilePath(Application.ExeName) + '..\..\..\..\testsounds\test.wav';
pathEdit.FileName := SysUtils.ExpandFileName(pathEdit.FileName);
{$endif}
end;
end.