diff options
author | mogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-08-25 19:46:45 +0000 |
---|---|---|
committer | mogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-08-25 19:46:45 +0000 |
commit | 59b053bc8a9e0b52168b73ca86296e6fe890f522 (patch) | |
tree | d5438c7afaf89bd33a52a18d77ad4d929af9cf99 /Game/Code/Classes/UMusic.pas | |
parent | 8bbb53fffcd1959a29b5a040c867ed371e88483b (diff) | |
download | usdx-59b053bc8a9e0b52168b73ca86296e6fe890f522.tar.gz usdx-59b053bc8a9e0b52168b73ca86296e6fe890f522.tar.xz usdx-59b053bc8a9e0b52168b73ca86296e6fe890f522.zip |
Added: Option for background music in sound options (affects UIni too)
Added: New language string SING_OPTIONS_SOUND_BACKGROUNDMUSIC
Added: CC licensed music loop
Improved: Options positions via Deluxe theme (first pass, next will follow)
Improved: Code beautified in UScreenMain
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1290 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UMusic.pas | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index f3474e30..4090bd2f 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -503,6 +503,8 @@ type procedure LoadSounds(); procedure UnloadSounds(); + procedure StartBgMusic(); + procedure PauseBgMusic(); // TODO //function AddSound(Filename: string): integer; //procedure RemoveSound(ID: integer); @@ -536,6 +538,7 @@ implementation uses sysutils, math, + UIni, UMain, UCommandLine, URecord, @@ -709,7 +712,6 @@ begin // Load in-game sounds SoundLib := TSoundLibrary.Create; - AudioPlayback.PlaySound(SoundLib.BGMusic); end; procedure InitializeVideo(); @@ -860,9 +862,6 @@ end; procedure TSoundLibrary.LoadSounds(); begin - //Log.LogStatus('Loading Sounds', 'Music Initialize'); - //Log.BenchmarkStart(4); - UnloadSounds(); Start := AudioPlayback.OpenSound(SoundPath + 'Common start.mp3'); @@ -872,11 +871,10 @@ begin Option := AudioPlayback.OpenSound(SoundPath + 'option change col.mp3'); Click := AudioPlayback.OpenSound(SoundPath + 'rimshot022b.mp3'); - //BGMusic := AudioPlayback.OpenSound(SoundPath + '18982__bebeto__Loop010_ambient.mp3'); - //BGMusic.SetLoop(true); + BGMusic := AudioPlayback.OpenSound(SoundPath + 'Bebeto_-_Loop010.mp3'); - //Log.BenchmarkEnd(4); - //Log.LogBenchmark('--> Loading Sounds', 4); + if (BGMusic <> nil) then + BGMusic.Loop := True; end; procedure TSoundLibrary.UnloadSounds(); @@ -900,6 +898,23 @@ begin end; *) +procedure TSoundLibrary.StartBgMusic(); +begin + if (TBackgroundMusicOption(Ini.BackgroundMusicOption) = bmoOn) and + (Soundlib.BGMusic <> nil) and not (Soundlib.BGMusic.Status = ssPlaying) then + begin + AudioPlayback.PlaySound(Soundlib.BGMusic); + end; +end; + +procedure TSoundLibrary.PauseBgMusic(); +begin + If (Soundlib.BGMusic <> nil) then + begin + Soundlib.BGMusic.Pause; + end; +end; + { TVoiceRemoval } procedure TVoiceRemoval.Callback(Buffer: PChar; BufSize: integer); |