• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Plasma

Player Class Reference

Interface for getting information from and controlling a media player. More...

#include <player.h>

Inheritance diagram for Player:

Inheritance graph
[legend]

List of all members.


Public Types

typedef KSharedPtr< Player > Ptr
enum  State { Playing, Paused, Stopped }

Public Member Functions

virtual QString album ()
virtual QString artist ()
virtual QPixmap artwork ()
virtual bool canGoNext ()
virtual bool canGoPrevious ()
virtual bool canPause ()
virtual bool canPlay ()
virtual bool canSeek ()
virtual bool canSetVolume ()
virtual bool canStop ()
virtual QString comment ()
PlayerFactory * factory () const
virtual QString genre ()
virtual bool isRunning ()=0
virtual int length ()
QString name () const
virtual void next ()
virtual void pause ()
virtual void play ()
 Player (PlayerFactory *factory=0)
virtual int position ()
virtual void previous ()
virtual void seek (int time)
virtual void setVolume (qreal volume)
virtual State state ()=0
virtual void stop ()
virtual QString title ()
virtual int trackNumber ()
virtual float volume ()
virtual ~Player ()

Protected Member Functions

void setName (const QString &name)

Detailed Description

Interface for getting information from and controlling a media player.

Definition at line 33 of file player.h.


Member Typedef Documentation

typedef KSharedPtr<Player> Player::Ptr

Definition at line 36 of file player.h.


Member Enumeration Documentation

enum Player::State

Current state of the player.

Enumerator:
Playing 
Paused 
Stopped 

Definition at line 51 of file player.h.


Constructor & Destructor Documentation

Player::Player ( PlayerFactory *  factory = 0  ) 

Definition at line 22 of file player.cpp.

Player::~Player (  )  [virtual]

Definition at line 27 of file player.cpp.


Member Function Documentation

QString Player::album (  )  [virtual]

Album for current track.

May be empty

Definition at line 47 of file player.cpp.

QString Player::artist (  )  [virtual]

Artist for current track.

May be empty

Definition at line 42 of file player.cpp.

QPixmap Player::artwork (  )  [virtual]

Album artwork.

Null (pm.isNull()) if none available

Definition at line 87 of file player.cpp.

bool Player::canGoNext (  )  [virtual]

Move to the next track.

Definition at line 128 of file player.cpp.

bool Player::canGoPrevious (  )  [virtual]

Move to the previous track.

Definition at line 119 of file player.cpp.

bool Player::canPause (  )  [virtual]

Pause the currently playing track.

Definition at line 101 of file player.cpp.

bool Player::canPlay (  )  [virtual]

Play a track.

Definition at line 92 of file player.cpp.

bool Player::canSeek (  )  [virtual]

Set the position (in seconds).

Should be <= length()

Definition at line 146 of file player.cpp.

bool Player::canSetVolume (  )  [virtual]

Set the volume.

Must be between 0 and 1

Definition at line 137 of file player.cpp.

bool Player::canStop (  )  [virtual]

Stop the currently playing track.

canStop() should usually be state() != Stopped if stop() is implemented

Definition at line 110 of file player.cpp.

QString Player::comment (  )  [virtual]

Comment for current track.

May be empty

Definition at line 62 of file player.cpp.

PlayerFactory * Player::factory (  )  const

a pointer to the factory that created this player object

Definition at line 31 of file player.cpp.

QString Player::genre (  )  [virtual]

Genre of current track.

May be empty

Definition at line 67 of file player.cpp.

virtual bool Player::isRunning (  )  [pure virtual]

Whether the player is running and accessible.

int Player::length (  )  [virtual]

Length of current track in seconds.

0 if unknown.

Definition at line 72 of file player.cpp.

QString Player::name (  )  const

The name of this player.

Definition at line 36 of file player.cpp.

void Player::next (  )  [virtual]

Definition at line 133 of file player.cpp.

void Player::pause (  )  [virtual]

Definition at line 106 of file player.cpp.

void Player::play (  )  [virtual]

Definition at line 97 of file player.cpp.

int Player::position (  )  [virtual]

Position of current track in seconds.

0 if unknown, not defined if Stopped.

Definition at line 77 of file player.cpp.

void Player::previous (  )  [virtual]

Definition at line 124 of file player.cpp.

void Player::seek ( int  time  )  [virtual]

Definition at line 151 of file player.cpp.

void Player::setName ( const QString &  name  )  [protected]

Definition at line 155 of file player.cpp.

void Player::setVolume ( qreal  volume  )  [virtual]

Definition at line 142 of file player.cpp.

virtual State Player::state (  )  [pure virtual]

Current state of the player.

Undefined if !running()

See State

void Player::stop (  )  [virtual]

Definition at line 115 of file player.cpp.

QString Player::title (  )  [virtual]

Title of current track.

May be empty

Definition at line 52 of file player.cpp.

int Player::trackNumber (  )  [virtual]

Track number of current track.

Note that this is the track on a CD or in an album, not the playlist position

0 if no track defined, or unknown.

Definition at line 57 of file player.cpp.

float Player::volume (  )  [virtual]

Current volume.

Value should be between 0 and 1

-1 if unknown

Definition at line 82 of file player.cpp.


The documentation for this class was generated from the following files:
  • player.h
  • player.cpp

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal