Noatun API Documentation

Player Class Reference

Noatun player backend. More...

#include <player.h>

Inheritance diagram for Player:

Inheritance graph
[legend]
List of all members.

Public Types

enum  LoopType { None = 0, Song, Playlist, Random }

Public Slots

void toggleListView ()
void handleButtons ()
void removeCurrent ()
void back ()
void stop ()
void play ()
void play (const PlaylistItem &item)
void playpause ()
void forward (bool allowLoop=true)
void skipTo (int msec)
void loop ()
void loop (int i)
void setVolume (int)
void playCurrent ()
void newCurrent ()

Signals

void timeout ()
void stopped ()
void playing ()
void paused ()
void loopTypeChange (int t)
void playlistShown ()
void playlistHidden ()
void newSongLen (int mins, int sec)
void newSong ()
void changed ()
void aboutToOpen (PlaylistItem item)
void volumeChanged (int)

Public Member Functions

 Player (QObject *parent=0)
 ~Player ()
QString lengthString (int _position=-1)
int loopStyle () const
int volume () const
int getTime () const
int getLength ()
bool isPlaying ()
bool isPaused ()
bool isStopped ()
PlaylistItem current () const
void openFile (const KURL &file, bool purge=true, bool autoplay=false)
void openFile (const KURL::List &files, bool purge=true, bool autoplay=false)
Engineengine () const

Detailed Description

Noatun player backend.

This class has slots for all the common media player buttons The slots are called, and it queries the Playlist for the appropriate file.

Author:
Charles Samuels
Version:
2.3

Definition at line 22 of file player.h.


Member Enumeration Documentation

enum Player::LoopType
 

"None": Plays the playlist entries sequentially until the end of the playlist. "Song": Repeats the current playlist entry indefinitely. "Playlist": Plays the playlist entries sequentially, until end of the playlist. Noatun will then restart playback at the first song. "Random": Plays the entries of the playlist in a random, non-repeating order. Playback will continue indefinitely.

Enumeration values:
None 
Song 
Playlist 
Random 

Definition at line 41 of file player.h.


Constructor & Destructor Documentation

Player::Player QObject parent = 0  ) 
 

Player::~Player  ) 
 


Member Function Documentation

void Player::aboutToOpen PlaylistItem  item  )  [signal]
 

called when we're about to load item, but it hasn't been yet

this is used for implementing new protocols

void Player::back  )  [slot]
 

go back a track

void Player::changed  )  [signal]
 

Called when a new song is about to be played, but hasn't started. player->current() is the next song

PlaylistItem Player::current  )  const [inline]
 

get the current playlist this may be null And this may not be necessarily an item allocated by playlist()

Definition at line 88 of file player.h.

Engine* Player::engine  )  const [inline]
 

Definition at line 106 of file player.h.

void Player::forward bool  allowLoop = true  )  [slot]
 

go forward a track

int Player::getLength  ) 
 

Returns:
the track-length in milliseconds

int Player::getTime  )  const [inline]
 

Returns:
the position in milliseconds

Definition at line 64 of file player.h.

void Player::handleButtons  )  [slot]
 

force the playing/paused/stopped/playlist shown signals to be sent out, also, you can send this if you want to make all the UIs re-display the current item

bool Player::isPaused  ) 
 

Returns:
true if paused

bool Player::isPlaying  ) 
 

Returns:
true if we're playing

bool Player::isStopped  ) 
 

Returns:
true if stopped

QString Player::lengthString int  _position = -1  ) 
 

Returns:
a string with the time that can be used in the UI: CC:CC/LL:LL (mm:ss)

void Player::loop int  i  )  [slot]
 

set the type of looping

void Player::loop  )  [slot]
 

goes to the next type of looping

int Player::loopStyle  )  const [inline]
 

Returns:
LoopType enum

Definition at line 55 of file player.h.

void Player::loopTypeChange int  t  )  [signal]
 

when the type of looping is changed

void Player::newCurrent  )  [slot]
 

void Player::newSong  )  [signal]
 

when a new song is currently playing

void Player::newSongLen int  mins,
int  sec
[signal]
 

called at the same time as newSong, but maybe easier to work with

void Player::openFile const KURL::List &  files,
bool  purge = true,
bool  autoplay = false
 

loads all given files

Parameters:
files list of files to load
purge true to clear the playlist on open
autoplay if true, play the first added item

void Player::openFile const KURL &  file,
bool  purge = true,
bool  autoplay = false
 

loads a file and optionally plays it

Parameters:
file the file to load
purge true to clear the playlist on open
autoplay start playing that file after loading it

void Player::paused  )  [signal]
 

void Player::play const PlaylistItem item  )  [slot]
 

play the given file

void Player::play  )  [slot]
 

start playing

void Player::playCurrent  )  [slot]
 

void Player::playing  )  [signal]
 

void Player::playlistHidden  )  [signal]
 

the playlist is hidden

void Player::playlistShown  )  [signal]
 

the playlist is made visible

void Player::playpause  )  [slot]
 

start playing, or pause if we're currently playing

void Player::removeCurrent  )  [slot]
 

remove current from playlist

void Player::setVolume int   )  [slot]
 

void Player::skipTo int  msec  )  [slot]
 

skip to the position, unit is milliseconds

void Player::stop  )  [slot]
 

stop playing

void Player::stopped  )  [signal]
 

void Player::timeout  )  [signal]
 

Tells you to update the seekbar, volume and title.

void Player::toggleListView  )  [slot]
 

show or hide the playlist

int Player::volume  )  const
 

Returns:
the volume from 0-100 use volume() instead

void Player::volumeChanged int   )  [signal]
 


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