aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UPlaylist.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-09-01 14:09:58 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-09-01 14:09:58 +0000
commitdbe444f87b85da27a37f38e80bfd540178b8dde0 (patch)
treed81b4c09d5de05b6304b1952192d1feef34beeb8 /Game/Code/Classes/UPlaylist.pas
parent22581815288ed2462063a8ac36e3818f95adfda2 (diff)
downloadusdx-dbe444f87b85da27a37f38e80bfd540178b8dde0.tar.gz
usdx-dbe444f87b85da27a37f38e80bfd540178b8dde0.tar.xz
usdx-dbe444f87b85da27a37f38e80bfd540178b8dde0.zip
- fix: position of player 3 and 4 in 4-player-mode on one screen in singscreen
- fix: scorescreen for 4-player-mode on one screen - add: tag #CALCMEDLEY:Off => disable calculation of medley for that song - add: sorting RANDOM for party-modes - add: ShuffleMode FULL (play whole file) in fullscreen if video available - add: it possible to select the 2 songs left and right of the random selected song in party mode - add: num song in in party options (in the selected folder/playlist) - fix: dont change line in editor while playing only one line - removed option solmization from lyric option screen - add: play last sung song in party score screen - added some plugins (thx to MasterPhW) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2629 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UPlaylist.pas')
-rw-r--r--Game/Code/Classes/UPlaylist.pas38
1 files changed, 36 insertions, 2 deletions
diff --git a/Game/Code/Classes/UPlaylist.pas b/Game/Code/Classes/UPlaylist.pas
index 66bd8189..36bbf051 100644
--- a/Game/Code/Classes/UPlaylist.pas
+++ b/Game/Code/Classes/UPlaylist.pas
@@ -47,7 +47,9 @@ type
Procedure DelItem(const iItem: Cardinal; const iPlaylist: Integer = -1);
Procedure GetNames(var PLNames: array of String);
+ Procedure GetNamesAndNumSongs(var PLNames: array of String);
Function GetIndexbySongID(const SongID: Cardinal; const iPlaylist: Integer = -1): Integer;
+ Function GetNumSongs(Index: Cardinal): integer;
end;
{Modes:
@@ -414,13 +416,13 @@ end;
//----------
//GetNames - Writes Playlist Names in a Array
//----------
-Procedure TPlayListManager.GetNames(var PLNames: array of String);
+Procedure TPlayListManager.GetNames(var PLNames: array of String);
var
I: Integer;
Len: Integer;
begin
Len := High(Playlists);
-
+
if (Length(PLNames) <> Len + 1) then
exit;
@@ -429,6 +431,23 @@ begin
end;
//----------
+//GetNamesAndNumSongs - Writes Playlist Names + Num Songs in an Array
+//----------
+Procedure TPlayListManager.GetNamesAndNumSongs(var PLNames: array of String);
+var
+ I: Integer;
+ Len: Integer;
+begin
+ Len := High(Playlists);
+
+ if (Length(PLNames) <> Len + 1) then
+ exit;
+
+ For I := 0 to Len do
+ PLNames[I] := Playlists[I].Name + ' ( ' + IntToStr(GetNumSongs(I)) + ' Songs)';
+end;
+
+//----------
//GetIndexbySongID - Returns Index in the specified Playlist of the given Song
//----------
Function TPlayListManager.GetIndexbySongID(const SongID: Cardinal; const iPlaylist: Integer): Integer;
@@ -455,4 +474,19 @@ begin
end;
end;
+function TPlayListManager.GetNumSongs(Index: Cardinal): integer;
+var
+ I: integer;
+
+begin
+ Result := 0;
+
+ //Count Songs in Playlist
+ For I := 0 to high(PlayLists[Index].Items) do
+ begin
+ if (ScreenSong.Mode=smNormal) or not CatSongs.Song[PlayLists[Index].Items[I].SongID].isDuet then
+ Inc(Result);
+ end;
+end;
+
end.