diff --git a/dists/lazarus/ultrastardx-unix.lpi b/dists/lazarus/ultrastardx-unix.lpi
index 4160f8500..4c137ab73 100644
--- a/dists/lazarus/ultrastardx-unix.lpi
+++ b/dists/lazarus/ultrastardx-unix.lpi
@@ -555,6 +555,10 @@
+
+
+
+
diff --git a/dists/lazarus/ultrastardx-win.lpi b/dists/lazarus/ultrastardx-win.lpi
index 20d7c3d8b..a17a786bf 100644
--- a/dists/lazarus/ultrastardx-win.lpi
+++ b/dists/lazarus/ultrastardx-win.lpi
@@ -559,6 +559,10 @@
+
+
+
+
diff --git a/src/base/UMain.pas b/src/base/UMain.pas
index 08ea4aae0..f5065396c 100644
--- a/src/base/UMain.pas
+++ b/src/base/UMain.pas
@@ -100,6 +100,7 @@ implementation
ULuaTextGL,
ULuaParty,
ULuaScreenSing,
+ ULuaMusic,
UTime,
UWebcam;
//UVideoAcinerella;
@@ -231,6 +232,7 @@ procedure Main;
LuaCore.RegisterModule('TextGl', ULuaTextGl_Lib_f);
LuaCore.RegisterModule('Party', ULuaParty_Lib_f);
LuaCore.RegisterModule('ScreenSing', ULuaScreenSing_Lib_f);
+ LuaCore.RegisterModule('Music', ULuaMusic_Lib_f);
LuaCore.LoadPlugins;
diff --git a/src/base/UMusic.pas b/src/base/UMusic.pas
index 1ce41323e..81eb24a30 100644
--- a/src/base/UMusic.pas
+++ b/src/base/UMusic.pas
@@ -317,6 +317,8 @@ TAudioPlaybackStream = class(TAudioProcessingStream)
function Synchronize(BufferSize: integer; FormatInfo: TAudioFormatInfo): integer;
procedure FillBufferWithFrame(Buffer: PByteArray; BufferSize: integer; Frame: PByteArray; FrameSize: integer);
public
+ SourceName: string; // identifier (usually the source file path)
+
(**
* Opens a SourceStream for playback.
* Note that the caller (not the TAudioPlaybackStream) is responsible to
@@ -571,62 +573,41 @@ TAudioConverter = class
property DstFormatInfo: TAudioFormatInfo read fDstFormatInfo;
end;
-(* TODO
+// list of sound file names which are going to be used in the library for "one-shot" playbacks
const
- SOUNDID_START = 0;
- SOUNDID_BACK = 1;
- SOUNDID_SWOOSH = 2;
- SOUNDID_CHANGE = 3;
- SOUNDID_OPTION = 4;
- SOUNDID_CLICK = 5;
- LAST_SOUNDID = SOUNDID_CLICK;
-
- BaseSoundFilenames: array[0..LAST_SOUNDID] of IPath = (
- '%SOUNDPATH%/Common start.mp3', // Start
- '%SOUNDPATH%/Common back.mp3', // Back
- '%SOUNDPATH%/menu swoosh.mp3', // Swoosh
- '%SOUNDPATH%/select music change music 50.mp3', // Change
- '%SOUNDPATH%/option change col.mp3', // Option
- '%SOUNDPATH%/rimshot022b.mp3' // Click
- {
- '%SOUNDPATH%/bassdrumhard076b.mp3', // Drum (unused)
- '%SOUNDPATH%/hihatclosed068b.mp3', // Hihat (unused)
- '%SOUNDPATH%/claps050b.mp3', // Clap (unused)
- '%SOUNDPATH%/Shuffle.mp3' // Shuffle (unused)
- }
- );
-*)
+ SOUNDNAME_START = 'Common start.mp3';
+ SOUNDNAME_BACK = 'Common back.mp3';
+ SOUNDNAME_SWOOSH = 'menu swoosh.mp3';
+ SOUNDNAME_CHANGE = 'select music change music 50.mp3';
+ SOUNDNAME_OPTION = 'option change col.mp3';
+ SOUNDNAME_CLICK = 'rimshot022b.mp3';
+ SOUNDNAME_APPLAUSE = 'Applause.mp3';
type
TSoundLibrary = class
private
- // TODO
- //Sounds: array of TAudioPlaybackStream;
+ Sounds: array of TAudioPlaybackStream;
+
+ function SoundFilenameToPath(Filename: string): IPath;
public
- // TODO: move sounds to the private section
- // and provide IDs instead.
- Start: TAudioPlaybackStream;
- Back: TAudioPlaybackStream;
- Swoosh: TAudioPlaybackStream;
- Change: TAudioPlaybackStream;
- Option: TAudioPlaybackStream;
- Click: TAudioPlaybackStream;
- Applause:TAudioPlaybackStream;
+ // the background music is a special case since it loops and is referenced by specific procedures
BGMusic: TAudioPlaybackStream;
+ procedure StartBgMusic();
+ procedure PauseBgMusic();
constructor Create();
destructor Destroy(); override;
procedure LoadSounds();
procedure UnloadSounds();
-
- procedure StartBgMusic();
- procedure PauseBgMusic();
- // TODO
- //function AddSound(Filename: IPath): integer;
- //procedure RemoveSound(ID: integer);
- //function GetSound(ID: integer): TAudioPlaybackStream;
- //property Sound[ID: integer]: TAudioPlaybackStream read GetSound; default;
+
+ function AddSound(Soundname: string): integer;
+ function GetSound(ID: integer): TAudioPlaybackStream overload;
+ function GetSound(Soundname: string): TAudioPlaybackStream overload;
+ procedure RemoveSound(ID: integer);
+ function LookupSoundID(Soundname: string): integer;
+
+ property Sound[ID: integer]: TAudioPlaybackStream read GetSound; default;
end;
var
@@ -985,33 +966,84 @@ procedure TSoundLibrary.LoadSounds();
begin
UnloadSounds();
- Start := AudioPlayback.OpenSound(SoundPath.Append('Common start.mp3'));
- Back := AudioPlayback.OpenSound(SoundPath.Append('Common back.mp3'));
- Swoosh := AudioPlayback.OpenSound(SoundPath.Append('menu swoosh.mp3'));
- Change := AudioPlayback.OpenSound(SoundPath.Append('select music change music 50.mp3'));
- Option := AudioPlayback.OpenSound(SoundPath.Append('option change col.mp3'));
- Click := AudioPlayback.OpenSound(SoundPath.Append('rimshot022b.mp3'));
- Applause:= AudioPlayback.OpenSound(SoundPath.Append('Applause.mp3'));
+ // load common "one-shot" sounds
+ AddSound(SOUNDNAME_START);
+ AddSound(SOUNDNAME_BACK);
+ AddSound(SOUNDNAME_SWOOSH);
+ AddSound(SOUNDNAME_CHANGE);
+ AddSound(SOUNDNAME_OPTION);
+ AddSound(SOUNDNAME_CLICK);
+ AddSound(SOUNDNAME_APPLAUSE);
+ // the background music is a special case since it loops and is referenced by specific procedures
BGMusic := AudioPlayback.OpenSound(SoundPath.Append('background track.mp3'));
-
if (BGMusic <> nil) then
BGMusic.Loop := True;
end;
procedure TSoundLibrary.UnloadSounds();
+var
+ i: integer;
begin
- FreeAndNil(Start);
- FreeAndNil(Back);
- FreeAndNil(Swoosh);
- FreeAndNil(Change);
- FreeAndNil(Option);
- FreeAndNil(Click);
- FreeAndNil(Applause);
+ for i := High(Sounds) downto Low(Sounds) do
+ begin
+ RemoveSound(i);
+ end;
+
+ // the background music is a special case since it loops and is referenced by specific procedures
FreeAndNil(BGMusic);
end;
-(* TODO
+procedure TSoundLibrary.RemoveSound(ID: integer);
+begin
+ if ((ID >= 0) and (ID < Length(Sounds))) then begin
+ FreeAndNil(Sounds[ID]);
+ Delete(Sounds, ID, 1);
+ end else begin
+ Log.LogStatus('RemoveSound called with ID out of range.', 'TSoundLibrary');
+ end;
+end;
+
+{
+ Adds a sound file to the library.
+ See SoundFilenameToPath on how the Soundname parameter is handled.
+ Returns -1 if loading file fails
+ Otherwise returns index for access via GetSound
+}
+function TSoundLibrary.AddSound(Soundname: string): integer;
+var
+ PlaybackStream: TAudioPlaybackStream;
+begin
+ PlaybackStream := AudioPlayback.OpenSound(SoundFilenameToPath(Soundname));
+ if PlaybackStream <> nil then begin
+ SetLength(Sounds, Length(Sounds) + 1);
+ Sounds[High(Sounds)] := PlaybackStream;
+ result := High(Sounds);
+ end else begin
+ result := -1; // indicate failure to load sound
+ end;
+end;
+
+{
+ Takes a string which may represent a file name (this plays nice with Lua).
+ In case the string contains no path delimiter (\ on Windows, / on unixoid systems),
+ the string is assumed to be a plain name of a file in the game's "sounds" directory
+ (such as 'menu swoosh.mp3').
+ In case the string contains a path delimiter, it is converted to a Path.
+ './…' will be a path relative to the working directory. Absolute paths are possible, too.
+}
+function TSoundLibrary.SoundFilenameToPath(Filename: string): IPath;
+begin
+ Result := SoundPath.Append(Filename); // assume plain filename (relative to sound directory)
+ if pos(SysUtils.PathDelim, Filename) > 0 then begin
+ // user already seems to be using a file path (relative or absolute), let him do that
+ Result := Path(Filename);
+ end;
+end;
+
+{
+ Gets a sound by id (index).
+}
function TSoundLibrary.GetSound(ID: integer): TAudioPlaybackStream;
begin
if ((ID >= 0) and (ID < Length(Sounds))) then
@@ -1019,7 +1051,48 @@ function TSoundLibrary.GetSound(ID: integer): TAudioPlaybackStream;
else
Result := nil;
end;
-*)
+
+{
+ Looks up a sound by file name, giving the ID (index).
+ Returns -1 in case there is no matching sound in the library.
+ Otherwise returns index of the sound in the library.
+ Can be used to check whether a sound is in the library.
+}
+function TSoundLibrary.LookupSoundID(Soundname: string): integer;
+var
+ i: integer;
+ FilePath: string;
+begin
+ Result := -1;
+ FilePath := SoundFilenameToPath(Soundname).ToNative;
+ for i := Low(Sounds) to High(Sounds) do
+ begin
+ if Sounds[i].SourceName = FilePath then
+ begin
+ Result := i;
+ break;
+ end;
+ end;
+end;
+
+{
+ Convenience function for GetSound.
+ In case the sound file is not yet in the library,
+ the function tries to add the sound to the library automatically, see AddSound.
+ In case of failure, result may be nil.
+}
+function TSoundLibrary.GetSound(Soundname: string): TAudioPlaybackStream;
+var
+ ID: integer;
+begin
+ Result := nil;
+ ID := LookupSoundID(Soundname);
+ if ID = -1 then
+ begin
+ ID := AddSound(Soundname)
+ end;
+ Result := GetSound(ID);
+end;
procedure TSoundLibrary.StartBgMusic();
begin
diff --git a/src/base/UNote.pas b/src/base/UNote.pas
index 816f866d2..baa62169c 100644
--- a/src/base/UNote.pas
+++ b/src/base/UNote.pas
@@ -399,7 +399,7 @@ procedure NewBeatClick;
if ((Ini.BeatClick = 1) and
((LyricsState.CurrentBeatC + Tracks[0].Resolution + Tracks[0].NotesGAP) mod Tracks[0].Resolution = 0)) then
begin
- AudioPlayback.PlaySound(SoundLib.Click);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CLICK));
end;
for Count := 0 to Tracks[0].Lines[Tracks[0].CurrentLine].HighNote do
@@ -409,7 +409,7 @@ procedure NewBeatClick;
begin
// click assist
if Ini.ClickAssist = 1 then
- AudioPlayback.PlaySound(SoundLib.Click);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CLICK));
// drum machine
(*
diff --git a/src/lua/ULuaMusic.pas b/src/lua/ULuaMusic.pas
new file mode 100644
index 000000000..0cb6b66db
--- /dev/null
+++ b/src/lua/ULuaMusic.pas
@@ -0,0 +1,123 @@
+{* UltraStar Deluxe - Karaoke Game
+ *
+ * UltraStar Deluxe is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *}
+
+unit ULuaMusic;
+
+interface
+
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+{$I switches.inc}
+
+uses ULua, UMusic, UPathUtils, UPath, SysUtils;
+
+function luaopen_Music (L: Plua_State): Integer; cdecl;
+
+function ULuaMusic_OpenSound(L: Plua_State): Integer; cdecl;
+function ULuaMusic_PlaySound(L: Plua_State): Integer; cdecl;
+function ULuaMusic_UnloadSound(L: Plua_State): Integer; cdecl;
+
+const
+ ULuaMusic_Lib_f: array [0..3] of lual_reg = (
+ (name:'OpenSound';func:ULuaMusic_OpenSound),
+ (name:'PlaySound';func:ULuaMusic_PlaySound),
+ (name:'UnloadSound';func:ULuaMusic_UnloadSound),
+ (name:nil;func:nil)
+ );
+
+implementation
+
+{
+ Add a sound to the game's sound library, obtaining the sound ID to use with PlaySound.
+ The sound should be a short sound-effect.
+ In case the sound ID is -1, loading the sound file has failed.
+}
+function ULuaMusic_OpenSound(L: Plua_State): Integer; cdecl;
+ var
+ SoundId: integer;
+begin
+ // do not return anything to lua by default
+ result := 0;
+ if (lua_IsString(L, 1)) then begin
+ // add the sound
+ SoundId := SoundLib.AddSound(lua_toString(L, 1));
+ if SoundId = -1 then begin
+ luaL_error(L, PChar('Unable to open sound file.'));
+ end;
+ // return the sound id (index)
+ result := 1;
+ lua_pushinteger(L, SoundId);
+ end else begin
+ luaL_argerror(L, 1, PChar('Filename (string) expected.'));
+ end;
+end;
+
+{
+ Play a game sound once.
+ Expects a sound ID obtained by OpenSound.
+}
+function ULuaMusic_PlaySound(L: Plua_State): Integer; cdecl;
+ var
+ PlaybackStream: TAudioPlaybackStream;
+begin
+ result := 0; // never return anything to lua
+ if lua_IsInteger(L, 1) then begin
+ PlaybackStream := SoundLib.GetSound(lua_tointeger(L, 1));
+ if PlaybackStream <> nil then begin
+ AudioPlayback.PlaySound(PlaybackStream);
+ end else begin
+ luaL_argerror(L, 1, PChar('Failed to get sound by ID.'));
+ end;
+ end else begin
+ luaL_argerror(L, 1, PChar('Sound ID (integer) expected.'));
+ end;
+end;
+
+{
+ Unloads a sound.
+ Only use this function with an ID you previously obtained via OpenSound.
+ Only then it is "your" sound. Removing a sound that is not yours can induce unexpected behaviour.
+}
+function ULuaMusic_UnloadSound(L: Plua_State): Integer; cdecl;
+ var
+ PlaybackStream: TAudioPlaybackStream;
+begin
+ result := 0; // never return anything to lua
+ if lua_IsInteger(L, 1) then begin
+ SoundLib.RemoveSound(lua_tointeger(L, 1));
+ end else begin
+ luaL_argerror(L, 1, PChar('Sound ID (integer) expected.'));
+ end;
+end;
+
+function luaopen_Music (L: Plua_State): Integer; cdecl;
+begin
+ luaL_register(L, 'Music', @ULuaMusic_Lib_f[0]);
+ result := 1;
+end;
+
+end.
diff --git a/src/media/UAudioPlaybackBase.pas b/src/media/UAudioPlaybackBase.pas
index 87f698f85..fcd0b2d5e 100644
--- a/src/media/UAudioPlaybackBase.pas
+++ b/src/media/UAudioPlaybackBase.pas
@@ -219,6 +219,7 @@ function TAudioPlaybackBase.OpenStream(const Filename: IPath): TAudioPlaybackStr
FreeAndNil(DecodeStream);
Exit;
end;
+ PlaybackStream.SourceName := Filename.ToNative;
PlaybackStream.AddOnCloseHandler(OnClosePlaybackStream);
diff --git a/src/screens/UScreenAbout.pas b/src/screens/UScreenAbout.pas
index 584d99d98..496d03be8 100644
--- a/src/screens/UScreenAbout.pas
+++ b/src/screens/UScreenAbout.pas
@@ -80,7 +80,7 @@ function TScreenAbout.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
case PressedKey of
SDLK_C:
begin
- FadeTo(@ScreenCredits, SoundLib.Start);
+ FadeTo(@ScreenCredits, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
@@ -97,7 +97,7 @@ function TScreenAbout.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
SDLK_TAB:
@@ -109,14 +109,14 @@ function TScreenAbout.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
//Exit Button Pressed
if Interaction = 1 then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
// ultrastar deluxe team credits
if Interaction = 0 then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenCredits);
end;
end;
diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas
index 9db1102f7..4b5d56c19 100644
--- a/src/screens/UScreenCredits.pas
+++ b/src/screens/UScreenCredits.pas
@@ -284,7 +284,7 @@ function TScreenCredits.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
SDLK_RETURN:
begin
FadeTo(@ScreenMain);
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
end;
SDLK_TAB:
begin
diff --git a/src/screens/UScreenEdit.pas b/src/screens/UScreenEdit.pas
index 9725812d1..686299f1a 100644
--- a/src/screens/UScreenEdit.pas
+++ b/src/screens/UScreenEdit.pas
@@ -90,7 +90,7 @@ function TScreenEdit.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
SDLK_ESCAPE,
SDLK_BACKSPACE:
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
SDLK_TAB:
@@ -101,13 +101,13 @@ function TScreenEdit.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
if Interaction = 0 then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenEditConvert);
end;
if Interaction = 1 then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
end;
diff --git a/src/screens/UScreenEditConvert.pas b/src/screens/UScreenEditConvert.pas
index ba444e6c0..132e7c2c9 100644
--- a/src/screens/UScreenEditConvert.pas
+++ b/src/screens/UScreenEditConvert.pas
@@ -249,7 +249,7 @@ function TScreenEditConvert.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
if (MidiFile <> nil) then
MidiFile.StopPlaying;
{$ENDIF}
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenEdit);
end;
@@ -258,7 +258,7 @@ function TScreenEditConvert.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
if Interaction = 0 then // open
begin
IsFileOpen := true;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
ScreenOpen.Filename := GamePath.Append('file.mid');
ScreenOpen.BackScreen := @ScreenEditConvert;
FadeTo(@ScreenOpen);
diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas
index 5f0ac3439..8322e7a65 100644
--- a/src/screens/UScreenEditSub.pas
+++ b/src/screens/UScreenEditSub.pas
@@ -5120,8 +5120,8 @@ function TScreenEditSub.Draw: boolean;
for NoteIndex := 0 to Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote do
if (Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[NoteIndex].StartBeat = CurrentBeat) then
begin
- SoundLib.Click.Volume := SelectsS[VolumeClickSlideId].SelectedOption / 100;
- AudioPlayback.PlaySound(SoundLib.Click);
+ SoundLib.GetSound(SOUNDNAME_CLICK).Volume := SelectsS[VolumeClickSlideId].SelectedOption / 100;
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CLICK));
LastClick := CurrentBeat;
end;
end;
diff --git a/src/screens/UScreenJukebox.pas b/src/screens/UScreenJukebox.pas
index 4383605a6..ffe9a801f 100644
--- a/src/screens/UScreenJukebox.pas
+++ b/src/screens/UScreenJukebox.pas
@@ -728,7 +728,7 @@ procedure OnEscapeJukebox(Value: boolean; Data: Pointer);
ScreenJukebox.Finish;
ScreenJukebox.FadeOut := true;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
end;
end;
diff --git a/src/screens/UScreenJukeboxPlaylist.pas b/src/screens/UScreenJukeboxPlaylist.pas
index 8cb3338e7..1d410e554 100644
--- a/src/screens/UScreenJukeboxPlaylist.pas
+++ b/src/screens/UScreenJukeboxPlaylist.pas
@@ -106,7 +106,7 @@ function TScreenJukeboxPlaylist.ParseInput(PressedKey: cardinal; CharCode: UCS4C
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
@@ -149,7 +149,7 @@ function TScreenJukeboxPlaylist.ParseInput(PressedKey: cardinal; CharCode: UCS4C
SDLK_UP: InteractPrev;
SDLK_RIGHT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
//Change Playlist2 if Playlist is Changed
@@ -161,7 +161,7 @@ function TScreenJukeboxPlaylist.ParseInput(PressedKey: cardinal; CharCode: UCS4C
end;
SDLK_LEFT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
//Change Playlist2 if Playlist is Changed
@@ -274,7 +274,7 @@ procedure TScreenJukeboxPlaylist.InitJukebox;
I, J: integer;
begin
ScreenSong.Mode := smJukebox;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
SetLength(ScreenJukebox.JukeboxSongsList, 0);
SetLength(ScreenJukebox.JukeboxVisibleSongs, 0);
diff --git a/src/screens/UScreenLevel.pas b/src/screens/UScreenLevel.pas
index b9cee9e7a..b2b8856b7 100644
--- a/src/screens/UScreenLevel.pas
+++ b/src/screens/UScreenLevel.pas
@@ -85,7 +85,7 @@ function TScreenLevel.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
if Ini.OnSongClick = sSelectPlayer then
FadeTo(@ScreenMain)
@@ -97,7 +97,7 @@ function TScreenLevel.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
begin
Ini.Difficulty := Interaction;
Ini.SaveLevel;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
//Set Standard Mode
ScreenSong.Mode := smNormal;
FadeTo(@ScreenSong);
diff --git a/src/screens/UScreenMain.pas b/src/screens/UScreenMain.pas
index 43eaccbac..a9a729ad6 100644
--- a/src/screens/UScreenMain.pas
+++ b/src/screens/UScreenMain.pas
@@ -99,20 +99,20 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
// check normal keys
case PressedKey of
SDLK_S: begin
- FadeTo(@ScreenName, SoundLib.Start);
+ FadeTo(@ScreenName, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_P: begin
if (Ini.Players >= 1) and (Party.ModesAvailable) then
begin
- FadeTo(@ScreenPartyOptions, SoundLib.Start);
+ FadeTo(@ScreenPartyOptions, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
end;
SDLK_J: begin
- FadeTo(@ScreenJukeboxPlaylist, SoundLib.Start);
+ FadeTo(@ScreenJukeboxPlaylist, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
@@ -123,27 +123,27 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
end;
SDLK_T: begin
- FadeTo(@ScreenStatMain, SoundLib.Start);
+ FadeTo(@ScreenStatMain, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_E: begin
- FadeTo(@ScreenEdit, SoundLib.Start);
+ FadeTo(@ScreenEdit, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_O: begin
- FadeTo(@ScreenOptions, SoundLib.Start);
+ FadeTo(@ScreenOptions, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_A: begin
- FadeTo(@ScreenAbout, SoundLib.Start);
+ FadeTo(@ScreenAbout, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_C: begin
- FadeTo(@ScreenCredits, SoundLib.Start);
+ FadeTo(@ScreenCredits, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
@@ -186,7 +186,7 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
else
begin
ScreenName.Goto_SingScreen := false;
- FadeTo(@ScreenName, SoundLib.Start);
+ FadeTo(@ScreenName, SoundLib.GetSound(SOUNDNAME_START));
end;
end
else //show error message
@@ -200,7 +200,7 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
begin
Party.bPartyGame := true;
- FadeTo(@ScreenPartyOptions, SoundLib.Start);
+ FadeTo(@ScreenPartyOptions, SoundLib.GetSound(SOUNDNAME_START));
end
else //show error message, No Songs Loaded
ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_SONGS'));
@@ -211,7 +211,7 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
begin
if (Songs.SongList.Count >= 1) then
begin
- FadeTo(@ScreenJukeboxPlaylist, SoundLib.Start);
+ FadeTo(@ScreenJukeboxPlaylist, SoundLib.GetSound(SOUNDNAME_START));
end
else //show error message, No Songs Loaded
ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_SONGS'));
@@ -220,14 +220,14 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
//Stats
if Interaction = 3 then
begin
- FadeTo(@ScreenStatMain, SoundLib.Start);
+ FadeTo(@ScreenStatMain, SoundLib.GetSound(SOUNDNAME_START));
end;
//Editor
if Interaction = 4 then
begin
{$IFDEF UseMIDIPort}
- FadeTo(@ScreenEdit, SoundLib.Start);
+ FadeTo(@ScreenEdit, SoundLib.GetSound(SOUNDNAME_START));
{$ELSE}
ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_EDITOR'));
{$ENDIF}
@@ -236,13 +236,13 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
//Options
if Interaction = 5 then
begin
- FadeTo(@ScreenOptions, SoundLib.Start);
+ FadeTo(@ScreenOptions, SoundLib.GetSound(SOUNDNAME_START));
end;
//About
if Interaction = 6 then
begin
- FadeTo(@ScreenAbout, SoundLib.Start);
+ FadeTo(@ScreenAbout, SoundLib.GetSound(SOUNDNAME_START));
end;
//Exit
diff --git a/src/screens/UScreenName.pas b/src/screens/UScreenName.pas
index 2ff5971a0..146439ab6 100644
--- a/src/screens/UScreenName.pas
+++ b/src/screens/UScreenName.pas
@@ -351,7 +351,7 @@ function TScreenName.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
StopTextInput;
Ini.SaveNames;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
if GoTo_SingScreen then
FadeTo(@ScreenSong)
else
@@ -409,7 +409,7 @@ function TScreenName.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
ScreenSing := TScreenSingController.Create;
//
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
if GoTo_SingScreen then
begin
@@ -442,7 +442,7 @@ function TScreenName.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
SDLK_RIGHT:
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
if (Interaction in [0, 4, 5]) then
InteractInc;
@@ -485,7 +485,7 @@ function TScreenName.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
end;
SDLK_LEFT:
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
if (Interaction in [0, 4, 5]) then
InteractDec;
diff --git a/src/screens/UScreenOpen.pas b/src/screens/UScreenOpen.pas
index 97022a2e8..5f48985a5 100644
--- a/src/screens/UScreenOpen.pas
+++ b/src/screens/UScreenOpen.pas
@@ -118,7 +118,7 @@ function TScreenOpen.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
//Empty Filename and go to last Screen
fFileName := PATH_NONE;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(fBackScreen);
end;
@@ -132,14 +132,14 @@ function TScreenOpen.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
//Update Filename and go to last Screen
fFileName := Path(Button[0].Text[0].Text);
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(fBackScreen);
end
else if (Interaction = 2) then
begin
//Empty Filename and go to last Screen
fFileName := PATH_NONE;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(fBackScreen);
end;
end;
diff --git a/src/screens/UScreenOptions.pas b/src/screens/UScreenOptions.pas
index cd2e5ceeb..8f41953cc 100644
--- a/src/screens/UScreenOptions.pas
+++ b/src/screens/UScreenOptions.pas
@@ -96,49 +96,49 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
case PressedKey of
SDLK_G:
begin
- FadeTo(@ScreenOptionsGame, SoundLib.Start);
+ FadeTo(@ScreenOptionsGame, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_H:
begin
- FadeTo(@ScreenOptionsGraphics, SoundLib.Start);
+ FadeTo(@ScreenOptionsGraphics, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_S:
begin
- FadeTo(@ScreenOptionsSound, SoundLib.Start);
+ FadeTo(@ScreenOptionsSound, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_I:
begin
- FadeTo(@ScreenOptionsInput, SoundLib.Start);
+ FadeTo(@ScreenOptionsInput, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_L:
begin
- FadeTo(@ScreenOptionsLyrics, SoundLib.Start);
+ FadeTo(@ScreenOptionsLyrics, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_T:
begin
- FadeTo(@ScreenOptionsThemes, SoundLib.Start);
+ FadeTo(@ScreenOptionsThemes, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_R:
begin
- FadeTo(@ScreenOptionsRecord, SoundLib.Start);
+ FadeTo(@ScreenOptionsRecord, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_A:
begin
- FadeTo(@ScreenOptionsAdvanced, SoundLib.Start);
+ FadeTo(@ScreenOptionsAdvanced, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
@@ -148,7 +148,7 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
ScreenPopupError.ShowPopup(Language.Translate('SING_OPTIONS_NETWORK_NO_DLL'))
else
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptionsNetwork);
end;
Exit;
@@ -156,13 +156,13 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
SDLK_W:
begin
- FadeTo(@ScreenOptionsWebcam, SoundLib.Start);
+ FadeTo(@ScreenOptionsWebcam, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
SDLK_J:
begin
- FadeTo(@ScreenOptionsJukebox, SoundLib.Start);
+ FadeTo(@ScreenOptionsJukebox, SoundLib.GetSound(SOUNDNAME_START));
Exit;
end;
@@ -179,7 +179,7 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
@@ -192,49 +192,49 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
begin
if Interaction = ButtonGameIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsGame);
end;
if Interaction = ButtonGraphicsIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsGraphics);
end;
if Interaction = ButtonSoundIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsSound);
end;
if Interaction = ButtonInputIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsInput);
end;
if Interaction = ButtonLyricsIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsLyrics);
end;
if Interaction = ButtonThemesIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsThemes);
end;
if Interaction = ButtonRecordIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsRecord);
end;
if Interaction = ButtonAdvancedIID then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsAdvanced);
end;
@@ -244,14 +244,14 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
ScreenPopupError.ShowPopup(Language.Translate('SING_OPTIONS_NETWORK_NO_DLL'))
else
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptionsNetwork);
end;
end;
if Interaction = ButtonWebcamIID then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptionsWebcam);
end;
@@ -259,7 +259,7 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
begin
if (Songs.SongList.Count >= 1) then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenOptionsJukebox);
end
else //show error message, No Songs Loaded
@@ -269,7 +269,7 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
if Interaction = ButtonExitIID then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
end;
diff --git a/src/screens/UScreenOptionsAdvanced.pas b/src/screens/UScreenOptionsAdvanced.pas
index 2c6d6aa16..db6763a4d 100644
--- a/src/screens/UScreenOptionsAdvanced.pas
+++ b/src/screens/UScreenOptionsAdvanced.pas
@@ -82,7 +82,7 @@ function TScreenOptionsAdvanced.ParseInput(PressedKey: cardinal; CharCode: UCS4C
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -94,7 +94,7 @@ function TScreenOptionsAdvanced.ParseInput(PressedKey: cardinal; CharCode: UCS4C
if SelInteraction = 8 then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -106,7 +106,7 @@ function TScreenOptionsAdvanced.ParseInput(PressedKey: cardinal; CharCode: UCS4C
begin
if (SelInteraction >= 0) and (SelInteraction <= 7) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
end;
@@ -114,7 +114,7 @@ function TScreenOptionsAdvanced.ParseInput(PressedKey: cardinal; CharCode: UCS4C
begin
if (SelInteraction >= 0) and (SelInteraction <= 7) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
end;
diff --git a/src/screens/UScreenOptionsGame.pas b/src/screens/UScreenOptionsGame.pas
index b4abaf49d..49b549455 100644
--- a/src/screens/UScreenOptionsGame.pas
+++ b/src/screens/UScreenOptionsGame.pas
@@ -122,7 +122,7 @@ function TScreenOptionsGame.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
begin
if (SelInteraction >= 0) and (SelInteraction <= 7) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
UpdateCalculatedSelectSlides(false);
@@ -135,7 +135,7 @@ function TScreenOptionsGame.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
begin
if (SelInteraction >= 0) and (SelInteraction <= 7) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
UpdateCalculatedSelectSlides(false);
@@ -285,7 +285,7 @@ procedure TScreenOptionsGame.Leave;
ReloadAllScreens;
ReloadSongMenu;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
diff --git a/src/screens/UScreenOptionsGraphics.pas b/src/screens/UScreenOptionsGraphics.pas
index 7c8c6b0ac..0197dbc4d 100644
--- a/src/screens/UScreenOptionsGraphics.pas
+++ b/src/screens/UScreenOptionsGraphics.pas
@@ -96,7 +96,7 @@ function TScreenOptionsGraphics.ParseInput(PressedKey: cardinal; CharCode: UCS4C
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -108,7 +108,7 @@ function TScreenOptionsGraphics.ParseInput(PressedKey: cardinal; CharCode: UCS4C
if SelInteraction = 6 then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
if OldWindowMode <> Ini.FullScreen then UGraphic.UpdateVideoMode()
else UGraphic.UpdateResolution();
@@ -124,7 +124,7 @@ function TScreenOptionsGraphics.ParseInput(PressedKey: cardinal; CharCode: UCS4C
begin
if (SelInteraction >= 0) and (SelInteraction < 6) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
@@ -138,7 +138,7 @@ function TScreenOptionsGraphics.ParseInput(PressedKey: cardinal; CharCode: UCS4C
begin
if (SelInteraction >= 0) and (SelInteraction < 6) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
diff --git a/src/screens/UScreenOptionsInput.pas b/src/screens/UScreenOptionsInput.pas
index f404cb66e..f945636f4 100644
--- a/src/screens/UScreenOptionsInput.pas
+++ b/src/screens/UScreenOptionsInput.pas
@@ -106,7 +106,7 @@ function TScreenOptionsInput.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -118,7 +118,7 @@ function TScreenOptionsInput.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
if Interaction = ButtonExitIID then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -130,7 +130,7 @@ function TScreenOptionsInput.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
begin
if (Interaction in SoundInteractions) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
CheckOption;
@@ -139,7 +139,7 @@ function TScreenOptionsInput.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
begin
if (Interaction in SoundInteractions) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
CheckOption;
diff --git a/src/screens/UScreenOptionsJukebox.pas b/src/screens/UScreenOptionsJukebox.pas
index 7fc1c6686..affd70614 100644
--- a/src/screens/UScreenOptionsJukebox.pas
+++ b/src/screens/UScreenOptionsJukebox.pas
@@ -145,7 +145,7 @@ function TScreenOptionsJukebox.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -157,7 +157,7 @@ function TScreenOptionsJukebox.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
if SelInteraction = 10 then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -169,7 +169,7 @@ function TScreenOptionsJukebox.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
begin
if (SelInteraction >= 0) and (SelInteraction <= 9) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
if (SelInteraction >= 7) and (SelInteraction <= 9) then
begin
@@ -224,7 +224,7 @@ function TScreenOptionsJukebox.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
begin
if (SelInteraction >= 0) and (SelInteraction <= 9) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
if (SelInteraction >= 7) and (SelInteraction <= 9) then
begin
diff --git a/src/screens/UScreenOptionsLyrics.pas b/src/screens/UScreenOptionsLyrics.pas
index f699dc4c9..3367c091b 100644
--- a/src/screens/UScreenOptionsLyrics.pas
+++ b/src/screens/UScreenOptionsLyrics.pas
@@ -91,7 +91,7 @@ function TScreenOptionsLyrics.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -103,7 +103,7 @@ function TScreenOptionsLyrics.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
if SelInteraction = 4 then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -115,7 +115,7 @@ function TScreenOptionsLyrics.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction <= 3) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
end;
@@ -123,7 +123,7 @@ function TScreenOptionsLyrics.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction <= 3) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
end;
diff --git a/src/screens/UScreenOptionsNetwork.pas b/src/screens/UScreenOptionsNetwork.pas
index 26a779271..489e61b08 100644
--- a/src/screens/UScreenOptionsNetwork.pas
+++ b/src/screens/UScreenOptionsNetwork.pas
@@ -258,7 +258,7 @@ function TScreenOptionsNetwork.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
SDLK_BACKSPACE:
begin
DataBase.UpdateUsers;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -279,7 +279,7 @@ function TScreenOptionsNetwork.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
if (SelInteraction = 8) then
begin
DataBase.UpdateUsers;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
@@ -307,7 +307,7 @@ function TScreenOptionsNetwork.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
if (SelInteraction >= 0) and (SelInteraction < 5) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
@@ -361,7 +361,7 @@ function TScreenOptionsNetwork.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch
if (SelInteraction >= 0) and (SelInteraction < 5) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
diff --git a/src/screens/UScreenOptionsRecord.pas b/src/screens/UScreenOptionsRecord.pas
index f3c6690d7..1af184c49 100644
--- a/src/screens/UScreenOptionsRecord.pas
+++ b/src/screens/UScreenOptionsRecord.pas
@@ -176,7 +176,7 @@ function TScreenOptionsRecord.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
if (ValidateSettings()) then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -191,7 +191,7 @@ function TScreenOptionsRecord.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
if (ValidateSettings()) then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -204,7 +204,7 @@ function TScreenOptionsRecord.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction < ExitButtonIID) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
UpdateInputDevice;
@@ -213,7 +213,7 @@ function TScreenOptionsRecord.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction < ExitButtonIID) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
UpdateInputDevice;
diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas
index 072618388..4af6b6a05 100644
--- a/src/screens/UScreenOptionsSound.pas
+++ b/src/screens/UScreenOptionsSound.pas
@@ -84,7 +84,7 @@ function TScreenOptionsSound.ParseInput(PressedKey: cardinal;
SDLK_BACKSPACE:
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
SDLK_TAB:
@@ -96,7 +96,7 @@ function TScreenOptionsSound.ParseInput(PressedKey: cardinal;
if SelInteraction = 7 then
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
end;
end;
@@ -108,7 +108,7 @@ function TScreenOptionsSound.ParseInput(PressedKey: cardinal;
begin
if (SelInteraction >= 0) and (SelInteraction < 8) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
end;
@@ -116,7 +116,7 @@ function TScreenOptionsSound.ParseInput(PressedKey: cardinal;
begin
if (SelInteraction >= 0) and (SelInteraction < 8) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
end;
diff --git a/src/screens/UScreenOptionsThemes.pas b/src/screens/UScreenOptionsThemes.pas
index 20f4c67c8..407765555 100644
--- a/src/screens/UScreenOptionsThemes.pas
+++ b/src/screens/UScreenOptionsThemes.pas
@@ -101,7 +101,7 @@ function TScreenOptionsThemes.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
ReloadScreens;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
// select theme button in new created options screen
ScreenOptions.Interaction := 4;
@@ -120,7 +120,7 @@ function TScreenOptionsThemes.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
ReloadScreens;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
// select theme button in new created options screen
ScreenOptions.Interaction := 4;
@@ -136,7 +136,7 @@ function TScreenOptionsThemes.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction <= 2) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
end;
@@ -144,7 +144,7 @@ function TScreenOptionsThemes.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction <= 2) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
end;
diff --git a/src/screens/UScreenOptionsWebcam.pas b/src/screens/UScreenOptionsWebcam.pas
index 6ed3aee61..76626e906 100644
--- a/src/screens/UScreenOptionsWebcam.pas
+++ b/src/screens/UScreenOptionsWebcam.pas
@@ -101,7 +101,7 @@ function TScreenOptionsWebcam.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (PreVisualization) then Webcam.Release;
//Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
Ini.SaveWebcamSettings;
end;
@@ -142,7 +142,7 @@ function TScreenOptionsWebcam.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
if SelInteraction = 9 then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenOptions);
Ini.SaveWebcamSettings;
if (PreVisualization) then Webcam.Release;
@@ -156,7 +156,7 @@ function TScreenOptionsWebcam.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction <= 7) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
@@ -172,7 +172,7 @@ function TScreenOptionsWebcam.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
begin
if (SelInteraction >= 0) and (SelInteraction <= 7) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
diff --git a/src/screens/UScreenPartyNewRound.pas b/src/screens/UScreenPartyNewRound.pas
index 30bf6a6c0..08013f381 100644
--- a/src/screens/UScreenPartyNewRound.pas
+++ b/src/screens/UScreenPartyNewRound.pas
@@ -126,7 +126,7 @@ function TScreenPartyNewRound.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
CheckFadeTo(@ScreenMain,'MSG_END_PARTY');
end;
@@ -137,7 +137,7 @@ function TScreenPartyNewRound.ParseInput(PressedKey: cardinal; CharCode: UCS4Cha
SDLK_RETURN:
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
Party.CallBeforeSongSelect;
end;
diff --git a/src/screens/UScreenPartyOptions.pas b/src/screens/UScreenPartyOptions.pas
index 8db5b12b8..3f12197cc 100644
--- a/src/screens/UScreenPartyOptions.pas
+++ b/src/screens/UScreenPartyOptions.pas
@@ -116,7 +116,7 @@ function TScreenPartyOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
@@ -154,7 +154,7 @@ function TScreenPartyOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
SDLK_UP: InteractPrev;
SDLK_RIGHT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
//Change Playlist2 if Playlist is Changed
@@ -171,7 +171,7 @@ function TScreenPartyOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char
end;
SDLK_LEFT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
//Change Playlist2 if Playlist is Changed
@@ -406,7 +406,7 @@ procedure TScreenPartyOptions.InitClassic;
ScreenSong.Mode := smPartyClassic;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
//Go to Player Screen
FadeTo(@ScreenPartyPlayer);
end;
@@ -414,7 +414,7 @@ procedure TScreenPartyOptions.InitClassic;
procedure TScreenPartyOptions.InitFree;
begin
ScreenSong.Mode := smPartyFree;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenPartyPlayer);
end;
@@ -427,7 +427,7 @@ procedure TScreenPartyOptions.InitChallenge;
procedure TScreenPartyOptions.InitTournament;
begin
ScreenSong.Mode := smPartyTournament;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenPartyTournamentPlayer);
end;
diff --git a/src/screens/UScreenPartyPlayer.pas b/src/screens/UScreenPartyPlayer.pas
index fa05e64f3..9c2e0060b 100644
--- a/src/screens/UScreenPartyPlayer.pas
+++ b/src/screens/UScreenPartyPlayer.pas
@@ -210,7 +210,7 @@ procedure TScreenPartyPlayer.UpdateParty;
if (Party.ModesAvailable) then
begin //mode for current playersetup available
- FadeTo(@ScreenPartyRounds, SoundLib.Start);
+ FadeTo(@ScreenPartyRounds, SoundLib.GetSound(SOUNDNAME_START));
end
else
begin
@@ -332,7 +332,7 @@ function TScreenPartyPlayer.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
SDLK_ESCAPE:
begin
Ini.SaveNames;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenPartyOptions);
end;
@@ -388,7 +388,7 @@ function TScreenPartyPlayer.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
begin
if (Interaction in [0,2,8,14]) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
UpdateInterface;
@@ -411,7 +411,7 @@ function TScreenPartyPlayer.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
begin
if (Interaction in [0,2,8,14]) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
UpdateInterface;
end;
@@ -428,7 +428,7 @@ function TScreenPartyPlayer.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
begin
if (SDL_ModState = KMOD_LCTRL) then
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
//InteractDec;
//UpdateInterface;
diff --git a/src/screens/UScreenPartyRounds.pas b/src/screens/UScreenPartyRounds.pas
index 71ecb700e..5e1f54ef2 100644
--- a/src/screens/UScreenPartyRounds.pas
+++ b/src/screens/UScreenPartyRounds.pas
@@ -157,7 +157,7 @@ procedure TScreenPartyRounds.StartParty;
// start party game
if (Party.StartGame(GameRounds)) then
begin
- FadeTo(@ScreenPartyNewRound, SoundLib.Start);
+ FadeTo(@ScreenPartyNewRound, SoundLib.GetSound(SOUNDNAME_START));
end
else
begin
@@ -185,7 +185,7 @@ function TScreenPartyRounds.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
SDLK_ESCAPE,
SDLK_BACKSPACE:
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenPartyPlayer);
end;
@@ -203,7 +203,7 @@ function TScreenPartyRounds.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
SDLK_UP: InteractPrev;
SDLK_RIGHT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
if Interaction = 0 then
@@ -213,7 +213,7 @@ function TScreenPartyRounds.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
end;
SDLK_LEFT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
if Interaction = 0 then
diff --git a/src/screens/UScreenPartyScore.pas b/src/screens/UScreenPartyScore.pas
index ffb9cbff5..1b8d5c7fd 100644
--- a/src/screens/UScreenPartyScore.pas
+++ b/src/screens/UScreenPartyScore.pas
@@ -112,7 +112,7 @@ function TScreenPartyScore.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
SDLK_BACKSPACE,
SDLK_RETURN:
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
Party.NextRound; //< go to next round
diff --git a/src/screens/UScreenPartyTournamentOptions.pas b/src/screens/UScreenPartyTournamentOptions.pas
index d45f48954..f3b4b3bc6 100644
--- a/src/screens/UScreenPartyTournamentOptions.pas
+++ b/src/screens/UScreenPartyTournamentOptions.pas
@@ -121,7 +121,7 @@ function TScreenPartyTournamentOptions.ParseInput(PressedKey: cardinal; CharCode
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenPartyTournamentPlayer);
end;
@@ -133,7 +133,7 @@ function TScreenPartyTournamentOptions.ParseInput(PressedKey: cardinal; CharCode
SDLK_RETURN:
begin
UpdateTournament;
- FadeTo(@ScreenPartyTournamentRounds, SoundLib.Start);
+ FadeTo(@ScreenPartyTournamentRounds, SoundLib.GetSound(SOUNDNAME_START));
end;
// Up and Down could be done at the same time,
@@ -143,12 +143,12 @@ function TScreenPartyTournamentOptions.ParseInput(PressedKey: cardinal; CharCode
SDLK_UP: InteractPrev;
SDLK_RIGHT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
end;
SDLK_LEFT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
end;
end;
diff --git a/src/screens/UScreenPartyTournamentPlayer.pas b/src/screens/UScreenPartyTournamentPlayer.pas
index 4c4c21833..861e64463 100644
--- a/src/screens/UScreenPartyTournamentPlayer.pas
+++ b/src/screens/UScreenPartyTournamentPlayer.pas
@@ -346,7 +346,7 @@ function TScreenPartyTournamentPlayer.ParseInput(PressedKey: cardinal; CharCode:
SDLK_ESCAPE:
begin
Ini.SaveNames;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenPartyOptions);
end;
@@ -358,7 +358,7 @@ function TScreenPartyTournamentPlayer.ParseInput(PressedKey: cardinal; CharCode:
SDLK_RETURN:
begin
UpdatePartyTournament;
- FadeTo(@ScreenPartyTournamentOptions, SoundLib.Start);
+ FadeTo(@ScreenPartyTournamentOptions, SoundLib.GetSound(SOUNDNAME_START));
end;
// Up and Down could be done at the same time,
// but I don't want to declare variables inside
@@ -367,14 +367,14 @@ function TScreenPartyTournamentPlayer.ParseInput(PressedKey: cardinal; CharCode:
SDLK_UP: IntPrev;
SDLK_RIGHT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractInc;
UpdateInterface;
end;
SDLK_LEFT:
begin
- AudioPlayback.PlaySound(SoundLib.Option);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_OPTION));
InteractDec;
UpdateInterface;
diff --git a/src/screens/UScreenPartyTournamentRounds.pas b/src/screens/UScreenPartyTournamentRounds.pas
index 8ad8eddd9..b3d16c7c6 100644
--- a/src/screens/UScreenPartyTournamentRounds.pas
+++ b/src/screens/UScreenPartyTournamentRounds.pas
@@ -133,7 +133,7 @@ procedure OnFinish(Value: boolean; Data: Pointer);
begin
if (Value) then
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
Display.FadeTo(@ScreenMain);
end;
end;
@@ -188,7 +188,7 @@ function TScreenPartyTournamentRounds.ParseInput(PressedKey: cardinal; CharCode:
freeandnil(ScreenSing);
ScreenSing := TScreenSingController.Create;
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenSong);
end;
diff --git a/src/screens/UScreenPartyTournamentWin.pas b/src/screens/UScreenPartyTournamentWin.pas
index 8168af0dd..e44e262be 100644
--- a/src/screens/UScreenPartyTournamentWin.pas
+++ b/src/screens/UScreenPartyTournamentWin.pas
@@ -98,7 +98,7 @@ function TScreenPartyTournamentWin.ParseInput(PressedKey: cardinal; CharCode: UC
SDLK_BACKSPACE,
SDLK_RETURN :
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
if ((StrToInt(Text[TextScorePlayer1].Text) > PartyTournament.Rounds[PartyTournament.Phase] / 2) or (StrToInt(Text[TextScorePlayer2].Text) > PartyTournament.Rounds[PartyTournament.Phase] / 2)) then
begin
diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas
index 0660db32d..c5b0c271e 100644
--- a/src/screens/UScreenPartyWin.pas
+++ b/src/screens/UScreenPartyWin.pas
@@ -101,7 +101,7 @@ function TScreenPartyWin.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr
SDLK_BACKSPACE,
SDLK_RETURN:
begin
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
FadeTo(@ScreenMain);
end;
SDLK_TAB:
diff --git a/src/screens/UScreenScore.pas b/src/screens/UScreenScore.pas
index 60dce71a1..2081763d2 100644
--- a/src/screens/UScreenScore.pas
+++ b/src/screens/UScreenScore.pas
@@ -429,7 +429,7 @@ function TScreenScore.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
else
CurrentRound := 0;
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
RefreshTexts;
if not (Ini.SavePlayback=1) then
@@ -455,7 +455,7 @@ function TScreenScore.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press
else
CurrentRound := Length(PlaylistMedley.Stats)-1;
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
RefreshTexts;
if not (Ini.SavePlayback=1) then
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas
index d403684a0..c529c8dd2 100644
--- a/src/screens/UScreenSong.pas
+++ b/src/screens/UScreenSong.pas
@@ -449,7 +449,7 @@ procedure TScreenSong.ParseInputNextHorizontal(PressedKey: cardinal; CharCode: U
begin
if (TSongMenuMode(Ini.SongMenu) <> smList) then
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SelectNext(false);
SetScrollRefresh;
end
@@ -487,7 +487,7 @@ procedure TScreenSong.ParseInputPrevHorizontal(PressedKey: cardinal; CharCode: U
begin
if (TSongMenuMode(Ini.SongMenu) <> smList) then
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SelectPrev;
SetScrollRefresh;
end
@@ -539,7 +539,7 @@ procedure TScreenSong.ParseInputNextVertical(PressedKey: cardinal; CharCode: UCS
FixSelected;
//Play Music:
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
end;
//Cat Change Hack End}
end
@@ -605,7 +605,7 @@ procedure TScreenSong.ParseInputPrevVertical(PressedKey: cardinal; CharCode: UCS
FixSelected;
//Play Music:
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
end;
//Cat Change Hack End}
end
@@ -694,7 +694,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2), (I + Interaction) mod I2, VS);
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SetScrollRefresh;
//Break and Exit
@@ -721,7 +721,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2), (I + Interaction) mod I2, VS);
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SetScrollRefresh;
@@ -751,7 +751,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
(UCS4UpperCase(UTF8ToUCS4String(TempStr)[0]) <> UpperLetter) then
begin
SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2), (I + Interaction) mod I2, VS);
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SetScrollRefresh;
Exit;
end;
@@ -769,7 +769,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
(UCS4UpperCase(UTF8ToUCS4String(TempStr)[0]) <> UpperLetter) then
begin
SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2), (I + Interaction) mod I2, VS);
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SetScrollRefresh;
Exit;
end;
@@ -989,7 +989,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
begin
SkipTo(Random(CatSongs.VisibleSongs));
end;
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SetScrollRefresh;
end;
@@ -1107,7 +1107,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
else
begin
StopMusicPreview();
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
//if (Mode = smPartyTournament) then
// CurrentPartyTime := MAX_TIME - StrToInt(Text[TextPartyTime].Text);
@@ -1126,7 +1126,7 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse
//When in party Mode then Ask before Close
else if (Mode = smPartyClassic) then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
CheckFadeTo(@ScreenMain,'MSG_END_PARTY');
end;
@@ -3585,7 +3585,7 @@ procedure TScreenSong.SelectNextRow;
begin
VS := CatSongs.VisibleSongs;
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
if VS > 0 then
begin
@@ -3633,7 +3633,7 @@ procedure TScreenSong.SelectPrevRow;
begin
VS := CatSongs.VisibleSongs;
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
if (VS > 0) then
begin
@@ -3681,7 +3681,7 @@ procedure TScreenSong.SelectNextListRow;
NrMiddleSong: integer;
MaxListLineTmp: real;
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SelectNext;
if (not Button[Interaction].Visible) then
@@ -3693,7 +3693,7 @@ procedure TScreenSong.SelectNextListRow;
procedure TScreenSong.SelectPrevListRow;
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SelectPrev;
if (not Button[Interaction].Visible) then
@@ -4068,7 +4068,7 @@ procedure TScreenSong.SelectRandomSong;
end;
end;
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
SetScroll;
end;
@@ -4245,7 +4245,7 @@ procedure TScreenSong.OpenEditor;
(Mode = smNormal) then
begin
StopMusicPreview();
- AudioPlayback.PlaySound(SoundLib.Start);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_START));
CurrentSong := CatSongs.Song[Interaction];
FadeTo(@ScreenEditSub);
end
diff --git a/src/screens/UScreenSongJumpto.pas b/src/screens/UScreenSongJumpto.pas
index dc758b814..9ee573df2 100644
--- a/src/screens/UScreenSongJumpto.pas
+++ b/src/screens/UScreenSongJumpto.pas
@@ -124,7 +124,7 @@ function TScreenSongJumpto.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
SDLK_ESCAPE:
begin
Visible := false;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
if (fVisSongs = 0) and (Length(Button[0].Text[0].Text) > 0) then
begin
//ScreenSong.UnLoadDetailedCover;
diff --git a/src/screens/UScreenSongMenu.pas b/src/screens/UScreenSongMenu.pas
index 030643267..40e343c72 100644
--- a/src/screens/UScreenSongMenu.pas
+++ b/src/screens/UScreenSongMenu.pas
@@ -160,7 +160,7 @@ function TScreenSongMenu.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr
SDLK_BACKSPACE:
begin
StopTextInput;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
Visible := false;
end;
@@ -198,7 +198,7 @@ function TScreenSongMenu.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr
end
else
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
ScreenSong.SelectNext;
ScreenSong.SetScrollRefresh;
end;
@@ -213,7 +213,7 @@ function TScreenSongMenu.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr
end
else
begin
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_CHANGE));
ScreenSong.SelectPrev;
ScreenSong.SetScrollRefresh;
end;
diff --git a/src/screens/UScreenStatDetail.pas b/src/screens/UScreenStatDetail.pas
index 2e84787e1..e93d5f4be 100644
--- a/src/screens/UScreenStatDetail.pas
+++ b/src/screens/UScreenStatDetail.pas
@@ -96,7 +96,7 @@ function TScreenStatDetail.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenStatMain);
end;
SDLK_TAB:
@@ -127,7 +127,7 @@ function TScreenStatDetail.ParseInput(PressedKey: cardinal; CharCode: UCS4Char;
if Interaction = 3 then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenStatMain);
end;
end;
diff --git a/src/screens/UScreenStatMain.pas b/src/screens/UScreenStatMain.pas
index 8c016b2c0..1012e86f3 100644
--- a/src/screens/UScreenStatMain.pas
+++ b/src/screens/UScreenStatMain.pas
@@ -97,7 +97,7 @@ function TScreenStatMain.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr
SDLK_BACKSPACE :
begin
Ini.Save;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end;
SDLK_TAB:
@@ -109,12 +109,12 @@ function TScreenStatMain.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr
//Exit Button Pressed
if Interaction = 4 then
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
FadeTo(@ScreenMain);
end
else //One of the Stats Buttons Pressed
begin
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
ScreenStatDetail.Typ := TStatType(Interaction);
FadeTo(@ScreenStatDetail);
end;
diff --git a/src/screens/controllers/UScreenSingController.pas b/src/screens/controllers/UScreenSingController.pas
index af2fccb1c..1bbb3bacc 100644
--- a/src/screens/controllers/UScreenSingController.pas
+++ b/src/screens/controllers/UScreenSingController.pas
@@ -530,7 +530,7 @@ function TScreenSingController.ParseInput(PressedKey: Cardinal; CharCode: UCS4Ch
Finish;
FadeOut := true;
- AudioPlayback.PlaySound(SoundLib.Back);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_BACK));
end;
SDLK_SPACE:
@@ -1821,7 +1821,7 @@ procedure TScreenSingController.UpdateMedleyStats(medley_end: boolean); //TODO
PlaylistMedley.ApplausePlayed:=true;
AudioPlayback.Fade(CurrentSong.Medley.FadeOut_time, 0.1);
- AudioPlayback.PlaySound(SoundLib.Applause);
+ AudioPlayback.PlaySound(SoundLib.GetSound(SOUNDNAME_APPLAUSE));
end;
end;
diff --git a/src/ultrastardx-travis.lpi b/src/ultrastardx-travis.lpi
index 99ae450e2..466248807 100644
--- a/src/ultrastardx-travis.lpi
+++ b/src/ultrastardx-travis.lpi
@@ -564,6 +564,10 @@
+
+
+
+
diff --git a/src/ultrastardx-unix.lpi b/src/ultrastardx-unix.lpi
index 649279c62..c171f416b 100644
--- a/src/ultrastardx-unix.lpi
+++ b/src/ultrastardx-unix.lpi
@@ -551,6 +551,11 @@
+
+
+
+
+
diff --git a/src/ultrastardx-win.lpi b/src/ultrastardx-win.lpi
index 6f1da647b..4e084dc82 100644
--- a/src/ultrastardx-win.lpi
+++ b/src/ultrastardx-win.lpi
@@ -568,6 +568,10 @@
+
+
+
+
diff --git a/src/ultrastardx.dpr b/src/ultrastardx.dpr
index 9ce433f9e..037888f9f 100644
--- a/src/ultrastardx.dpr
+++ b/src/ultrastardx.dpr
@@ -177,6 +177,7 @@ uses
ULuaUsdx in 'lua\ULuaUsdx.pas',
ULuaParty in 'lua\ULuaParty.pas',
ULuaScreenSing in 'lua\ULuaScreenSing.pas',
+ ULuaMusic in 'lua\ULuaMusic.pas',
//------------------------------
//Includes - Menu System