Noatun API Documentation

PlaylistItemData Class Reference

Playlist item data. More...

#include <playlist.h>

List of all members.

Public Member Functions

 PlaylistItemData ()
virtual ~PlaylistItemData ()
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.


Constructor & Destructor Documentation

PlaylistItemData::PlaylistItemData  ) 
 

virtual PlaylistItemData::~PlaylistItemData  )  [virtual]
 


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().

Referenced by PlaylistItem::file().

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

return whether if the given key exists

Referenced by PlaylistItem::isProperty(), and streamable().

virtual int PlaylistItemData::length  )  const [virtual]
 

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

Referenced by PlaylistItem::length().

QString PlaylistItemData::lengthString  )  const
 

returns a friendly representation of the length of this file

Referenced by PlaylistItem::lengthString().

virtual QCString PlaylistItemData::mimetype  )  const [virtual]
 

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

Referenced by PlaylistItem::mimetype().

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

Referenced by PlaylistItem::playObject().

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

return a list of property keys

Referenced by PlaylistItem::properties().

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 PlaylistItem::property(), and url().

virtual void PlaylistItemData::remove  )  [pure virtual]
 

remove this item from the list

Referenced by PlaylistItem::remove().

void PlaylistItemData::removed  ) 
 

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

void PlaylistItemData::removeRef  )  [inline]
 

Definition at line 178 of file playlist.h.

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

sets the length of the song, in milliseconds

Referenced by PlaylistItem::setLength().

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().

Referenced by PlaylistItem::streamable().

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.

Referenced by PlaylistItem::title().

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(), and PlaylistItem::url().


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 Fri Oct 22 00:20:37 2004 by doxygen 1.3.8-20040913 written by Dimitri van Heesch, © 1997-2003