From d08356e3b64d8738ff9672229c1bbe963b58337c Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 6 Jun 2007 20:24:29 +0000 Subject: Fixed some Bugs in Song Fading Added Ini Values to change the Fading and the Preview Volume git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@245 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UIni.pas | 26 ++++++++++++++++++++++++-- Game/Code/Classes/UMusic.pas | 6 +++--- 2 files changed, 27 insertions(+), 5 deletions(-) (limited to 'Game/Code/Classes') diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index c92a7a50..528966b3 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -38,7 +38,10 @@ type BeatClick: integer; SavePlayback: integer; Threshold: integer; - //TwoPlayerMode: integer; + + //Song Preview + PreviewVolume: integer; + PreviewFading: integer; // Lyrics LyricsFont: integer; @@ -130,7 +133,10 @@ const IBeatClick: array[0..1] of string = ('Off', 'On'); ISavePlayback: array[0..1] of string = ('Off', 'On'); IThreshold: array[0..3] of string = ('5%', '10%', '15%', '20%'); - //ITwoPlayerMode: array[0..2] of string = ('Stereo', '2 Cards', 'Advanced'); + //Song Preview + IPreviewVolume: array[0..10] of string = ('Off', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'); + IPreviewFading: array[0..5] of string = ('Off', '1 Sec', '2 Secs', '3 Secs', '4 Secs', '5 Secs'); + ILyricsFont: array[0..2] of string = ('Plain', 'OLine1', 'OLine2'); ILyricsEffect: array[0..3] of string = ('Simple', 'Zoom', 'Slide', 'Ball'); @@ -316,6 +322,15 @@ begin for Pet := 0 to High(IThreshold) do if Tekst = IThreshold[Pet] then Ini.Threshold := Pet; + //Song Preview + Tekst := IniFile.ReadString('Sound', 'PreviewVolume', IPreviewVolume[7]); + for Pet := 0 to High(IPreviewVolume) do + if Tekst = IPreviewVolume[Pet] then Ini.PreviewVolume := Pet; + + Tekst := IniFile.ReadString('Sound', 'PreviewFading', IPreviewFading[1]); + for Pet := 0 to High(IPreviewFading) do + if Tekst = IPreviewFading[Pet] then Ini.PreviewFading := Pet; + // Lyrics Font Tekst := IniFile.ReadString('Lyrics', 'LyricsFont', ILyricsFont[1]); for Pet := 0 to High(ILyricsFont) do @@ -582,6 +597,13 @@ begin Tekst := IThreshold[Ini.Threshold]; IniFile.WriteString('Sound', 'Threshold', Tekst); + // Song Preview + Tekst := IPreviewVolume[Ini.PreviewVolume]; + IniFile.WriteString('Sound', 'PreviewVolume', Tekst); + + Tekst := IPreviewFading[Ini.PreviewFading]; + IniFile.WriteString('Sound', 'PreviewFading', Tekst); + // SavePlayback Tekst := ISavePlayback[Ini.SavePlayback]; IniFile.WriteString('Sound', 'SavePlayback', Tekst); diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index 52bae3c9..3fcd2a21 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -59,7 +59,7 @@ type procedure InitializePlayback; procedure InitializeRecord; procedure SetVolume(Volume: integer); - procedure SetMusicVolume(Volume: Byte); + procedure SetMusicVolume(Volume: integer); procedure SetLoop(Enabled: boolean); function Open(Name: string): boolean; // true if succeed procedure Rewind; @@ -351,14 +351,14 @@ begin BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, Volume); end; -procedure TMusic.SetMusicVolume(Volume: Byte); +procedure TMusic.SetMusicVolume(Volume: Integer); begin //Max Volume Prevention if Volume > 100 then Volume := 100; //Set Volume - BASS_ChannelSetAttributes (Bass, -1, Integer(Volume), -101); + BASS_ChannelSetAttributes (Bass, -1, Volume, -101); end; procedure TMusic.SetLoop(Enabled: boolean); -- cgit v1.2.3