Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Player Class Reference

#include <player.h>

Inheritance diagram for Player:

QObject 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

Friends

class PlaylistItemData
class PlaylistNotifier

Detailed Description

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

Definition at line 18 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 37 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 85 of file player.h.

Engine* Player::engine   const [inline]
 

Definition at line 99 of file player.h.

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

go forward a track

int Player::getLength  
 

the track-length in milliseconds

int Player::getTime   const [inline]
 

the position in milliseconds

Definition at line 61 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  
 

true if paused

bool Player::isPlaying  
 

true if we're playing

bool Player::isStopped  
 

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 the LoopType enum

Definition at line 52 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, if

Parameters:
purge is set, clear the list if autoplay is true, play the first added item as well

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

load the

Parameters:
file,clear the playlist if
purge is set and if autoplay is set, play the item.

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
 

the volume from 0-100 use volume() instead

void Player::volumeChanged int    [signal]
 


Friends And Related Function Documentation

friend class PlaylistItemData [friend]
 

Definition at line 22 of file player.h.

friend class PlaylistNotifier [friend]
 

Definition at line 23 of file player.h.


The documentation for this class was generated from the following file:
Generated on Sat May 24 15:10:28 2003 for Noatun by doxygen1.3-rc3