diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-12-07 03:52:07 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-12-07 03:52:07 +0000 |
commit | bd04e1c76d7139287be2244d03f2b62c9d117c0a (patch) | |
tree | 0535857a52b6ad58c57da0833e8eee2862c28e42 /Game | |
parent | 0de7856abe4ca4eccd3404fc737092573c3d461d (diff) | |
download | usdx-bd04e1c76d7139287be2244d03f2b62c9d117c0a.tar.gz usdx-bd04e1c76d7139287be2244d03f2b62c9d117c0a.tar.xz usdx-bd04e1c76d7139287be2244d03f2b62c9d117c0a.zip |
getpcmdata creates fake pcm-data now
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@696 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r-- | Game/Code/Classes/UMedia_dummy.pas | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/Game/Code/Classes/UMedia_dummy.pas b/Game/Code/Classes/UMedia_dummy.pas index 12268a55..a5cc4b5a 100644 --- a/Game/Code/Classes/UMedia_dummy.pas +++ b/Game/Code/Classes/UMedia_dummy.pas @@ -22,6 +22,7 @@ implementation uses SysUtils, + math, UMusic; @@ -170,9 +171,37 @@ begin result := data; end; +var count: integer = 0; + function Tmedia_dummy.GetPCMData(var data: TPCMData): Cardinal; -begin - result := 0; +var i: integer; +begin + // Produce some fake PCM data + if ( count mod 500 = 0 ) then + begin + for i := 0 to 511 do begin + data[0][i] := 0; + data[1][i] := 0; + end; + end + else begin + for i := 0 to 511 do begin + if ( i mod 2 = 0 ) then begin + data[0][i] := floor(Random * power(2.,14)); + data[1][i] := floor(Random * power(2.,14)); + end + else begin; + data[0][i] := floor(Random * power(2.,14)); + data[1][i] := floor(Random * power(2.,14)); + end; + if ( i mod 2 = 1 ) then begin + data[0][i] := -data[0][i]; + data[1][i] := -data[1][i]; + end; + end; + end; + Inc(count); + result := 512; end; // IAudioPlayback |