From 839110b8abea8b835e1865c55b2f5ac3b6e17dc2 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sat, 22 May 2010 22:40:14 +0000 Subject: changing tabs or sorting in song screen: info popup with actual sorting; the focus will remain on the actual song. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2399 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UPlaylist.pas | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'Game/Code/Classes/UPlaylist.pas') diff --git a/Game/Code/Classes/UPlaylist.pas b/Game/Code/Classes/UPlaylist.pas index e3f68239..3c15e893 100644 --- a/Game/Code/Classes/UPlaylist.pas +++ b/Game/Code/Classes/UPlaylist.pas @@ -34,6 +34,7 @@ type constructor Create; Procedure LoadPlayLists; + Function FindSong(Artist, Title: String): Integer; Function LoadPlayList(Index: Cardinal; Filename: String): Boolean; Procedure SavePlayList(Index: Cardinal); @@ -93,6 +94,23 @@ begin end; end; +Function TPlayListManager.FindSong(Artist, Title: String): Integer; +var + I: Integer; + +begin + Result := -1; + + For I := low(CatSongs.Song) to high(CatSongs.Song) do + begin + if (CatSongs.Song[I].Title = Title) AND (CatSongs.Song[I].Artist = Artist) then + begin + Result := I; + Break; + end; + end; +end; + //---------- //LoadPlayList - Load a Playlist in the Array //---------- @@ -104,20 +122,6 @@ Function TPlayListManager.LoadPlayList(Index: Cardinal; Filename: String): Bo SongID: Integer; Len: Integer; - Function FindSong(Artist, Title: String): Integer; - var I: Integer; - begin - Result := -1; - - For I := low(CatSongs.Song) to high(CatSongs.Song) do - begin - if (CatSongs.Song[I].Title = Title) AND (CatSongs.Song[I].Artist = Artist) then - begin - Result := I; - Break; - end; - end; - end; begin if not FileExists(PlayListPath + Filename) then begin -- cgit v1.2.3