Noatun API Documentation

PlaylistItemData Class Reference

Playlist item data. More...

#include <playlist.h>

List of all members.

Public Member Functions

virtual QString property (const QString &key, const QString &def=0) const =0
virtual void setProperty (const QString &key, const QString &property)=0
virtual void clearProperty (const QString &key)=0
virtual QStringList properties () const =0
virtual bool isProperty (const QString &key) const =0
virtual QString title () const
virtual KURL url () const
virtual void setUrl (const KURL &url)
virtual QCString mimetype () const
virtual QCString playObject () const
virtual QString file () const
virtual int length () const
virtual void setLength (int ms)
QString lengthString () const
virtual bool operator== (const PlaylistItemData &d) const
virtual bool operator!= (const PlaylistItemData &d) const
virtual void remove ()=0
bool streamable () const
void added ()
void removed ()
void modified ()
void addRef ()
void removeRef ()


Detailed Description

Playlist item data.

If you're not coding a playlist, ignore this class.

The backend. Since PlaylistItemData is refcounted, this contains the data, the PlaylistItem is the "reference"

 PlaylistItem m=new PlaylistItemData;
 
Of course, you're supposed to inherit from PlaylistItemData in your Playlist, since there are pure virtuals.

You can create these objects on demand.

Author:
Charles Samuels
Version:
2.3

Definition at line 29 of file playlist.h.


Member Function Documentation

void PlaylistItemData::added  ) 
 

Call this when you want to signal the given item has been added to the list

void PlaylistItemData::addRef  )  [inline]
 

Have the reference counter never delete this

This is useful for when you want to keep all your items hanging around

Definition at line 177 of file playlist.h.

virtual void PlaylistItemData::clearProperty const QString &  key  )  [pure virtual]
 

remove the item with given key

virtual QString PlaylistItemData::file  )  const [inline, virtual]
 

return the filename to send to the playobject

Definition at line 106 of file playlist.h.

References url().

virtual bool PlaylistItemData::isProperty const QString &  key  )  const [pure virtual]
 

return whether if the given key exists

Referenced by streamable().

virtual int PlaylistItemData::length  )  const [virtual]
 

what's the length of the song, in milliseconds?

QString PlaylistItemData::lengthString  )  const
 

returns a friendly representation of the length of this file

virtual QCString PlaylistItemData::mimetype  )  const [virtual]
 

first, this checks for the property "mimetype", else it'l ask KMimeType based on file()

void PlaylistItemData::modified  ) 
 

Your playlist must call this when the file is modified

virtual bool PlaylistItemData::operator!= const PlaylistItemData d  )  const [virtual]
 

this is implemented as !(*this==d), you may have a faster way to implement this

virtual bool PlaylistItemData::operator== const PlaylistItemData d  )  const [virtual]
 

compare yourself with the given PlaylistItemData This is implemented in the slow fashion of comparing all the properties. You may have a much faster way of implementing this if this==&d, this will not be called, normally

virtual QCString PlaylistItemData::playObject  )  const [virtual]
 

first, checks for the property "playObject", else, it'l ask aRts

virtual QStringList PlaylistItemData::properties  )  const [pure virtual]
 

return a list of property keys

virtual QString PlaylistItemData::property const QString &  key,
const QString &  def = 0
const [pure virtual]
 

Noatun asks your playlist for properties. It is your responsiblity to store the information. But usually a QMap<QString,QString> is enough.

If you return the default value, the default should not be written.

This returns the property, or def if such a property doesn't exist

Referenced by url().

virtual void PlaylistItemData::remove  )  [pure virtual]
 

remove this item from the list

void PlaylistItemData::removed  ) 
 

Your playlist must call this when the file is removed from the playlist

virtual void PlaylistItemData::setLength int  ms  )  [virtual]
 

sets the length of the song, in milliseconds

virtual void PlaylistItemData::setProperty const QString &  key,
const QString &  property
[pure virtual]
 

This sets the property with the given key and value.

Important: If you use a QMap, you'll have to remove the current item before adding a new one

Referenced by setUrl().

virtual void PlaylistItemData::setUrl const KURL &  url  )  [inline, virtual]
 

set the true filename of the song, remote or local

Definition at line 89 of file playlist.h.

References setProperty().

bool PlaylistItemData::streamable  )  const [inline]
 

Playlists should not download files if this is true

Definition at line 148 of file playlist.h.

References isProperty().

virtual QString PlaylistItemData::title  )  const [virtual]
 

return the title of the song. By default, this will use the following by default, in order of priority

property("realtitle") property("title") url().filename()

you shouldn't need to override this.

virtual KURL PlaylistItemData::url  )  const [inline, virtual]
 

the true filename of the song, remote or local

Definition at line 85 of file playlist.h.

References property().

Referenced by file().


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