1 /* songlist.h - class SongList, which holds a list of songs (collection)
2 Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 Send comments and bug fixes to larrosa@kde.org
19 or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
21 ***************************************************************************/
35 char *name
; // complete path and file name
44 Song
*it
; // Iterator, just a helper variable to make easy (and fast) reading
47 Song
*getSongid(int id
);
49 void regenerateid(Song
*song
,int id
);
53 SongList(SongList
&src
); // Copy constructor
56 int AddSong(const char *song
); // Returns the id number assigned to the song
59 int NumberOfSongs(void) { return ntotal
; }
61 void setActiveSong(int id
);
62 int getActiveSongID(void) {return ((active
!=NULL
)? (active
->id
):(-1)); }
63 char *getActiveSongName(void)
65 return ((active
!=NULL
)? (active
->name
):((char *)NULL
));
68 char *getName(int id
); // Returns the name of the song with id id
71 int next(void); // returns 1 if evrything is ok, and 0 if it was the last element
72 // (but leaves active the last element instead of NULL)
74 void iteratorStart(void);
75 void iteratorNext(void);
76 int iteratorAtEnd (void) {return (it
==NULL
);}
77 int getIteratorID(void);
78 char *getIteratorName(void);
80 void clean(void); // Clean this list
81 void copy(SongList
&src
); // Makes this object a copy of src (really copied)