aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UPlaylist.pas
diff options
context:
space:
mode:
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
//----------