From bca530968b6cfbabca755957f351a29bb42150e4 Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 6 Mar 2008 17:06:44 +0000 Subject: replaced some "string" parameters with "const string" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@923 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UAudioPlayback_Bass.pas | 36 +++++++++++++------------------ Game/Code/Classes/UIni.pas | 1 - Game/Code/Classes/UMedia_dummy.pas | 4 ++-- Game/Code/Classes/UMusic.pas | 2 +- Game/Code/Classes/UVideo.pas | 4 ++-- Game/Code/Classes/UVisualizer.pas | 4 ++-- 6 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Game/Code/Classes/UAudioPlayback_Bass.pas b/Game/Code/Classes/UAudioPlayback_Bass.pas index 266a5ec3..d47990a8 100644 --- a/Game/Code/Classes/UAudioPlayback_Bass.pas +++ b/Game/Code/Classes/UAudioPlayback_Bass.pas @@ -56,7 +56,7 @@ type private MusicStream: TBassPlaybackStream; - function Load(Filename: string): TBassPlaybackStream; + function Load(const Filename: string): TBassPlaybackStream; public function GetName: String; @@ -67,7 +67,7 @@ type procedure SetMusicVolume(Volume: integer); procedure SetLoop(Enabled: boolean); - function Open(Filename: string): boolean; // true if succeed + function Open(const Filename: string): boolean; // true if succeed procedure Rewind; procedure Play; @@ -241,7 +241,7 @@ begin result := true; end; -function TAudioPlayback_Bass.Load(Filename: string): TBassPlaybackStream; +function TAudioPlayback_Bass.Load(const Filename: string): TBassPlaybackStream; var L: Integer; stream: HSTREAM; @@ -282,7 +282,7 @@ begin MusicStream.Loop := Enabled; end; -function TAudioPlayback_Bass.Open(Filename: string): boolean; +function TAudioPlayback_Bass.Open(const Filename: string): boolean; var stream: HSTREAM; begin @@ -363,10 +363,10 @@ begin Result := true; end; -//Equalizer +// Equalizer procedure TAudioPlayback_Bass.GetFFTData(var data: TFFTData); begin - //Get Channel Data Mono and 256 Values + // Get Channel Data Mono and 256 Values BASS_ChannelGetData(MusicStream.Handle, @data, BASS_DATA_FFT512); end; @@ -379,23 +379,17 @@ var info: BASS_CHANNELINFO; nBytes: DWORD; begin - //Get Channel Data Mono and 256 Values + Result := 0; + + // Get Channel Data Mono and 256 Values BASS_ChannelGetInfo(MusicStream.Handle, info); FillChar(data, sizeof(TPCMData), 0); - - if (info.chans = 1) then - begin - // mono file -> add stereo channel - nBytes := 0;//BASS_ChannelGetData(Bass, @data[0], samples*sizeof(Smallint)); - // interleave data - //CopyMemory(@data[1], @data[0], samples*sizeof(Smallint)); - result := 0; - end - else - begin - // stereo file - nBytes := BASS_ChannelGetData(MusicStream.Handle, @data, sizeof(TPCMData)); - end; + + // no support for non-stereo files at the moment + if (info.chans <> 2) then + Exit; + + nBytes := BASS_ChannelGetData(MusicStream.Handle, @data, sizeof(TPCMData)); if(nBytes <= 0) then result := 0 else diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index 431ae0be..1bfea7a5 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -454,7 +454,6 @@ begin // Debug Debug := GetArrayIndex(IDebug, IniFile.ReadString('Game', 'Debug', IDebug[0])); - //if Debug = 1 then SongPath := 'E:\UltraStar 03\Songs\'; // Screens Screens := GetArrayIndex(IScreens, IniFile.ReadString('Graphics', 'Screens', IScreens[0])); diff --git a/Game/Code/Classes/UMedia_dummy.pas b/Game/Code/Classes/UMedia_dummy.pas index cd62dc51..f576400d 100644 --- a/Game/Code/Classes/UMedia_dummy.pas +++ b/Game/Code/Classes/UMedia_dummy.pas @@ -38,7 +38,7 @@ type procedure init(); - function Open( aFileName : string): boolean; // true if succeed + function Open(const aFileName : string): boolean; // true if succeed procedure Close; procedure Play; @@ -98,7 +98,7 @@ begin end; -function Tmedia_dummy.Open( aFileName : string): boolean; // true if succeed +function Tmedia_dummy.Open(const aFileName : string): boolean; // true if succeed begin result := false; end; diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index 2ffe13ce..956e0372 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -191,7 +191,7 @@ type ['{63A5EBC3-3F4D-4F23-8DFB-B5165FCE33DD}'] function GetName: String; - function Open(Filename: string): boolean; // true if succeed + function Open(const Filename: string): boolean; // true if succeed procedure Close; procedure Play; diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas index c7bf9a1a..7f595928 100644 --- a/Game/Code/Classes/UVideo.pas +++ b/Game/Code/Classes/UVideo.pas @@ -103,7 +103,7 @@ type function GetName: String; procedure init(); - function Open( aFileName : string): boolean; // true if succeed + function Open(const aFileName : string): boolean; // true if succeed procedure Close; procedure Play; @@ -433,7 +433,7 @@ begin end; -function TVideoPlayback_ffmpeg.Open( aFileName : string): boolean; // true if succeed +function TVideoPlayback_ffmpeg.Open(const aFileName : string): boolean; // true if succeed var errnum, i, x,y: Integer; lStreamsCount : Integer; diff --git a/Game/Code/Classes/UVisualizer.pas b/Game/Code/Classes/UVisualizer.pas index 51ebee31..211f1b01 100644 --- a/Game/Code/Classes/UVisualizer.pas +++ b/Game/Code/Classes/UVisualizer.pas @@ -88,7 +88,7 @@ type procedure Init(); function GetName: String; - function Open( aFileName : string): boolean; // true if succeed + function Open(const aFileName : string): boolean; // true if succeed procedure Close; procedure Play; @@ -137,7 +137,7 @@ begin end; -function TVideoPlayback_ProjectM.Open( aFileName : string): boolean; // true if succeed +function TVideoPlayback_ProjectM.Open(const aFileName : string): boolean; // true if succeed begin VisualizerStart(); result := true; -- cgit v1.2.3