aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-06-03 19:45:43 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-06-03 19:45:43 +0000
commit49ada15c935658c5d90416e26acfb360f1e7c047 (patch)
tree61ac50be9f3000fb1e259b14f33137d433544008 /Game/Code/Classes
parent514ece97aaeb8eaa8bf56e224826bc5e6169ce8b (diff)
downloadusdx-49ada15c935658c5d90416e26acfb360f1e7c047.tar.gz
usdx-49ada15c935658c5d90416e26acfb360f1e7c047.tar.xz
usdx-49ada15c935658c5d90416e26acfb360f1e7c047.zip
Added SongPreview Fading
Song Preview Max Volume is now 70 % Need Testing because of timing git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@243 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UMusic.pas13
1 files changed, 13 insertions, 0 deletions
diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas
index 6e997c11..52bae3c9 100644
--- a/Game/Code/Classes/UMusic.pas
+++ b/Game/Code/Classes/UMusic.pas
@@ -59,6 +59,7 @@ type
procedure InitializePlayback;
procedure InitializeRecord;
procedure SetVolume(Volume: integer);
+ procedure SetMusicVolume(Volume: Byte);
procedure SetLoop(Enabled: boolean);
function Open(Name: string): boolean; // true if succeed
procedure Rewind;
@@ -350,6 +351,16 @@ begin
BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, Volume);
end;
+procedure TMusic.SetMusicVolume(Volume: Byte);
+begin
+ //Max Volume Prevention
+ if Volume > 100 then
+ Volume := 100;
+
+ //Set Volume
+ BASS_ChannelSetAttributes (Bass, -1, Integer(Volume), -101);
+end;
+
procedure TMusic.SetLoop(Enabled: boolean);
begin
Loop := Enabled;
@@ -364,6 +375,8 @@ begin
Bass := Bass_StreamCreateFile(false, pchar(Name), 0, 0, 0);
Loaded := true;
+ //Set Max Volume
+ SetMusicVolume (100);
end;
Result := Loaded;