Noatun API Documentation

Playlist Class Reference

#include <playlist.h>

Inheritance diagram for Playlist:

Inheritance graph
[legend]
List of all members.

Public Slots

virtual void showList ()=0
virtual void hideList ()=0
virtual void toggleList ()

Signals

void playCurrent ()
void listHidden ()
void listShown ()

Public Member Functions

 Playlist (QObject *parent, const char *name)
virtual ~Playlist ()
virtual void reset ()=0
virtual void clear ()=0
virtual void addFile (const KURL &, bool play=false)=0
virtual PlaylistItem next ()=0
virtual PlaylistItem nextSection ()
virtual PlaylistItem previous ()=0
virtual PlaylistItem previousSection ()
virtual PlaylistItem current ()=0
virtual void setCurrent (const PlaylistItem &)=0
virtual PlaylistItem getFirst () const =0
virtual PlaylistItem getAfter (const PlaylistItem &item) const =0
virtual bool listVisible () const =0
int handleArguments ()
virtual QValueList< PlaylistItemselect (const QStringList &keys, const QStringList &values, int limit=-1, bool exact=false, bool caseSensitive=false)
virtual QValueList< PlaylistItemselect (const QString &key, const QString &value, int limit=-1, bool exact=false, bool caseSensitive=false)
QValueList< PlaylistItemselect (const char *key, const char *value, int limit=-1, bool exact=false, bool caseSensitive=false)

Detailed Description

The playlist, which you derive from when creating your own playlist.

Do not, under any circumstances, call a Playlist method when you can call a Player method, unless, of course, you ARE the playlist.

Definition at line 328 of file playlist.h.


Constructor & Destructor Documentation

virtual Playlist::~Playlist  )  [virtual]
 

on playlist unload, your playlist must have current()==0 and emit playCurrent


Member Function Documentation

virtual void Playlist::addFile const KURL &  ,
bool  play = false
[pure virtual]
 

add a file

virtual void Playlist::clear  )  [pure virtual]
 

empty the list

virtual PlaylistItem Playlist::current  )  [pure virtual]
 

current item

virtual PlaylistItem Playlist::getAfter const PlaylistItem item  )  const [pure virtual]
 

get the item after item, note that getFirst and getAfter do not have to follow play order since they are used solely to iterate over the entire collection in some order. Duplicating the play order (by looking into the future) is not necessary.

virtual PlaylistItem Playlist::getFirst  )  const [pure virtual]
 

get the first item

int Playlist::handleArguments  ) 
 

do the KCmdLineArgs stuff

virtual void Playlist::hideList  )  [pure virtual, slot]
 

hide it

void Playlist::listHidden  )  [signal]
 

when the list is hidden

void Playlist::listShown  )  [signal]
 

when the list is shown

virtual bool Playlist::listVisible  )  const [pure virtual]
 

is the view visible?

virtual PlaylistItem Playlist::next  )  [pure virtual]
 

cycle forward, return that

virtual PlaylistItem Playlist::nextSection  )  [virtual]
 

cycle to next section, return that defaults to return next()

void Playlist::playCurrent  )  [signal]
 

when you want the engine to reload current() This is how your playlist forces noatun to play a new song

virtual PlaylistItem Playlist::previous  )  [pure virtual]
 

cycle back, return that

virtual PlaylistItem Playlist::previousSection  )  [virtual]
 

cycle to previous section, return that defaults to return previous()

virtual void Playlist::reset  )  [pure virtual]
 

go to the front

QValueList<PlaylistItem> Playlist::select const char *  key,
const char *  value,
int  limit = -1,
bool  exact = false,
bool  caseSensitive = false
[inline]
 

exactly the same as the above, except converts the const char* to QString (utf8)

Definition at line 453 of file playlist.h.

References select().

virtual QValueList<PlaylistItem> Playlist::select const QString &  key,
const QString &  value,
int  limit = -1,
bool  exact = false,
bool  caseSensitive = false
[virtual]
 

The default implementation will just call the above select. Of course, you're free to implement both of these (with different mechanisms if need be) for speed

virtual QValueList<PlaylistItem> Playlist::select const QStringList &  keys,
const QStringList &  values,
int  limit = -1,
bool  exact = false,
bool  caseSensitive = false
[virtual]
 

return a list of songs in which at least one of the keys matches at least one of the values

the default implementation will call getFirst() and getAfter() which could be potentially slow, depending how your playlist is designed. So you're free to reimplement this if you could do better

A value of "" is equal to an unset value

limit is the maximum amount of items to return, or -1 if you want as many as possible

if exact is true, a match is only made if the string is identical to a value. if false a match is made if the string contains a value

caseSensitive, if false, means that the given values are compared case insensitively to to the items in the playlist. The keys are always compared with case sensitivity

Referenced by select().

virtual void Playlist::setCurrent const PlaylistItem  )  [pure virtual]
 

set the current item

virtual void Playlist::showList  )  [pure virtual, slot]
 

show the list!

virtual void Playlist::toggleList  )  [virtual, slot]
 

toggle visibility


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for Noatun 2.6.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 21 23:49:48 2004 by doxygen 1.3.8-20040913 written by Dimitri van Heesch, © 1997-2003