diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-10-11 12:12:37 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-10-11 12:12:37 +0000 |
commit | 6292440f6da3c11e85bb9fc3a741a26540e429be (patch) | |
tree | af1e107a762a1f61e3b100d956d8a5cab108d4d7 /Game/Code/Classes | |
parent | 44554c7908f7e2405a249331f00a35703f5939c2 (diff) | |
download | usdx-6292440f6da3c11e85bb9fc3a741a26540e429be.tar.gz usdx-6292440f6da3c11e85bb9fc3a741a26540e429be.tar.xz usdx-6292440f6da3c11e85bb9fc3a741a26540e429be.zip |
separated IAudioPlayback in to separate "Playback" and "Input" Interfaces
( both interfaces provided by same TMusic_Bass class...
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@505 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r-- | Game/Code/Classes/UMusic.pas | 39 | ||||
-rw-r--r-- | Game/Code/Classes/UMusic_BASS.pas | 2 |
2 files changed, 31 insertions, 10 deletions
diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index 934e14e3..a2620607 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -96,7 +96,6 @@ type type IAudioPlayback = Interface procedure InitializePlayback; - procedure InitializeRecord; procedure SetVolume(Volume: integer); procedure SetMusicVolume(Volume: integer); procedure SetLoop(Enabled: boolean); @@ -121,18 +120,25 @@ type procedure PlayClap; procedure PlayShuffle; procedure StopShuffle; + + function LoadSoundFromFile(var hStream: hStream; Name: string): boolean; + + //Custom Sounds + function LoadCustomSound(const Filename: String): Cardinal; + procedure PlayCustomSound(const Index: Cardinal ); + end; + + IAudioInput = Interface + procedure InitializeRecord; + procedure CaptureStart; procedure CaptureStop; + procedure CaptureCard(RecordI, PlayerLeft, PlayerRight: byte); procedure StopCard(Card: byte); - function LoadSoundFromFile(var hStream: hStream; Name: string): boolean; //Equalizer function GetFFTData: TFFTData; - - //Custom Sounds - function LoadCustomSound(const Filename: String): Cardinal; - procedure PlayCustomSound(const Index: Cardinal ); end; @@ -147,8 +153,11 @@ var // TODO : JB --- THESE SHOULD NOT BE GLOBAL Czas: TCzas; -procedure InitializeSound; +procedure InitializeSound; + function AudioPlayback(): IAudioPlayback; +function AudioInput(): IAudioInput; + implementation @@ -158,25 +167,37 @@ uses var singleton_AudioPlayback : IAudioPlayback; + singleton_AudioInput : IAudioInput; function AudioPlayback(): IAudioPlayback; begin if singleton_AudioPlayback = nil then
begin
writeln( 'Created AudioPlayback' );
- singleton_AudioPlayback := TMusic_bass.create(); + singleton_AudioPlayback := TMusic_bass.create(); // Yes we could do this with one instance of TMusic_Bass... but I cant be bothered at this point:P end; result := singleton_AudioPlayback;
end; +function AudioInput(): IAudioInput; +begin + if singleton_AudioInput = nil then
+ begin
+ writeln( 'Created AudioInput' );
+ singleton_AudioInput := TMusic_bass.create(); // Yes we could do this with one instance of TMusic_Bass... but I cant be bothered at this point:P + end; + + result := singleton_AudioInput;
+end; + procedure InitializeSound; begin Log.LogStatus('Initializing Playback', 'InitializeSound'); AudioPlayback.InitializePlayback; Log.LogStatus('Initializing Record', 'InitializeSound'); - AudioPlayback.InitializeRecord; + AudioInput.InitializeRecord; end; end. diff --git a/Game/Code/Classes/UMusic_BASS.pas b/Game/Code/Classes/UMusic_BASS.pas index dfb6f79c..7de2d781 100644 --- a/Game/Code/Classes/UMusic_BASS.pas +++ b/Game/Code/Classes/UMusic_BASS.pas @@ -32,7 +32,7 @@ uses Classes, type - TMusic_bass = class( TInterfacedObject, IAudioPlayback ) + TMusic_bass = class( TInterfacedObject, IAudioPlayback, IAudioInput ) private BassStart: hStream; // Wait, I've replaced this with BASS BassBack: hStream; // It has almost all features we need |