aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UPlaylist.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-12-28 06:46:38 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-12-28 06:46:38 +0000
commit7f0f49979ee27f76d8dff3786194df1f43d4300f (patch)
treed3bc23b5d5bb23dcea9ad59ee433899547a149dd /Game/Code/Classes/UPlaylist.pas
parent04f79c3119f156949a7f5ec5051041d7fe2bd738 (diff)
downloadusdx-7f0f49979ee27f76d8dff3786194df1f43d4300f.tar.gz
usdx-7f0f49979ee27f76d8dff3786194df1f43d4300f.tar.xz
usdx-7f0f49979ee27f76d8dff3786194df1f43d4300f.zip
don't close menu when adding songs
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2776 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UPlaylist.pas')
-rw-r--r--Game/Code/Classes/UPlaylist.pas26
1 files changed, 26 insertions, 0 deletions
diff --git a/Game/Code/Classes/UPlaylist.pas b/Game/Code/Classes/UPlaylist.pas
index 36bbf051..7fa621ae 100644
--- a/Game/Code/Classes/UPlaylist.pas
+++ b/Game/Code/Classes/UPlaylist.pas
@@ -43,6 +43,8 @@ type
Function AddPlaylist(Name: String): Cardinal;
Procedure DelPlaylist(const Index: Cardinal);
+ Function SongExists(const SongID: Cardinal; const iPlaylist: Integer): boolean;
+
Procedure AddItem(const SongID: Cardinal; const iPlaylist: Integer = -1);
Procedure DelItem(const iItem: Cardinal; const iPlaylist: Integer = -1);
@@ -342,6 +344,30 @@ begin
end;
end;
+Function TPlayListManager.SongExists(const SongID: Cardinal; const iPlaylist: Integer): boolean;
+var
+ P: Cardinal;
+ I: Cardinal;
+begin
+ Result := false;
+
+ if iPlaylist = -1 then
+ P := CurPlaylist
+ else if (iPlaylist >= 0) AND (iPlaylist <= high(Playlists)) then
+ P := iPlaylist
+ else
+ exit;
+
+ if (SongID <= High(CatSongs.Song)) AND (NOT CatSongs.Song[SongID].Main) then
+ begin
+ for I := 0 to High(Playlists[P].Items) do
+ begin
+ if (Playlists[P].Items[I].SongID = SongID) then
+ Result := true;
+ end;
+ end;
+end;
+
//----------
//AddItem - Adds an Item to a specific Playlist
//----------