From dbe444f87b85da27a37f38e80bfd540178b8dde0 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 1 Sep 2010 14:09:58 +0000 Subject: - 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 --- Game/Code/Classes/UPlaylist.pas | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes/UPlaylist.pas') 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; @@ -428,6 +430,23 @@ begin PLNames[I] := Playlists[I].Name; 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 //---------- @@ -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. -- cgit v1.2.3