Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

cPlayer Class Reference

#include <player.h>

Inheritance diagram for cPlayer:

Inheritance graph
[legend]
Collaboration diagram for cPlayer:

Collaboration graph
[legend]

Detailed Description

Interface to device.

player.h: The basic player interface

See the main source file 'vdr.c' for copyright information and how to reach the author.

Id
player.h 1.10 2002/11/03 11:27:30 kls Exp

Definition at line 18 of file player.h.

Public Methods

 cPlayer (ePlayMode PlayMode=pmAudioVideo)
virtual ~cPlayer ()
bool IsAttached (void)
virtual bool GetIndex (int &Current, int &Total, bool SnapToIFrame=false)
virtual bool GetReplayMode (bool &Play, bool &Forward, int &Speed)
virtual int NumAudioTracks (void) const
virtual const char ** GetAudioTracks (int *CurrentTrack=NULL) const
virtual void SetAudioTrack (int Index)

Protected Methods

bool DevicePoll (cPoller &Poller, int TimeoutMs=0)
void DeviceTrickSpeed (int Speed)
void DeviceClear (void)
void DevicePlay (void)
void DeviceFreeze (void)
void DeviceMute (void)
void DeviceStillPicture (const uchar *Data, int Length)
void Detach (void)
virtual void Activate (bool On)
int PlayVideo (const uchar *Data, int Length)
void PlayAudio (const uchar *Data, int Length)

Private Attributes

cDevicedevice
ePlayMode playMode

Friends

class cDevice


Constructor & Destructor Documentation

cPlayer::cPlayer ePlayMode    PlayMode = pmAudioVideo
 

Definition at line 15 of file player.c.

References device, and playMode.

cPlayer::~cPlayer   [virtual]
 

Definition at line 21 of file player.c.

References Detach().


Member Function Documentation

virtual void cPlayer::Activate bool    On [inline, protected, virtual]
 

This function is called right after the cPlayer has been attached to (On == true) or before it gets detached from (On == false) a cDevice. It can be used to do things like starting/stopping a thread.

Reimplemented in cDvbPlayer, and cTransfer.

Definition at line 38 of file player.h.

Referenced by cDevice::AttachPlayer().

void cPlayer::Detach void    [protected]
 

Definition at line 43 of file player.c.

References cDevice::Detach(), and device.

Referenced by cDvbPlayer::~cDvbPlayer(), ~cPlayer(), and cTransfer::~cTransfer().

void cPlayer::DeviceClear void    [inline, protected]
 

Definition at line 26 of file player.h.

References cDevice::Clear().

Referenced by cDvbPlayer::Empty(), and cTransfer::SetAudioTrack().

void cPlayer::DeviceFreeze void    [inline, protected]
 

Definition at line 28 of file player.h.

References cDevice::Freeze().

Referenced by cDvbPlayer::Pause().

void cPlayer::DeviceMute void    [inline, protected]
 

Definition at line 29 of file player.h.

References cDevice::Mute().

Referenced by cDvbPlayer::Backward(), and cDvbPlayer::Forward().

void cPlayer::DevicePlay void    [inline, protected]
 

Definition at line 27 of file player.h.

References cDevice::Play().

Referenced by cDvbPlayer::Action(), cDvbPlayer::Goto(), and cDvbPlayer::Play().

bool cPlayer::DevicePoll cPoller   Poller,
int    TimeoutMs = 0
[inline, protected]
 

Definition at line 24 of file player.h.

References cDevice::Poll().

Referenced by cDvbPlayer::Action().

void cPlayer::DeviceStillPicture const uchar   Data,
int    Length
[inline, protected]
 

Definition at line 30 of file player.h.

References cDevice::StillPicture().

Referenced by cDvbPlayer::Goto().

void cPlayer::DeviceTrickSpeed int    Speed [inline, protected]
 

Definition at line 25 of file player.h.

References cDevice::TrickSpeed().

Referenced by cDvbPlayer::TrickSpeed().

virtual const char** cPlayer::GetAudioTracks int *    CurrentTrack = NULL const [inline, virtual]
 

Returns a list of currently available audio tracks. The last entry in the list must be NULL. The number of entries does not necessarily have to be the same as returned by a previous call to NumAudioTracks(). If CurrentTrack is given, it will be set to the index of the current track in the returned list. Note that the list must not be changed after it has been returned by a call to GetAudioTracks()! The only time the list may change is *inside* the GetAudioTracks() function. By default the return value is NULL and CurrentTrack, if given, will not have any meaning.

Reimplemented in cDvbPlayer, and cTransfer.

Definition at line 93 of file player.h.

Referenced by cDevice::GetAudioTracks().

virtual bool cPlayer::GetIndex int &    Current,
int &    Total,
bool    SnapToIFrame = false
[inline, virtual]
 

Returns the current and total frame index, optionally snapped to the nearest I-frame.

Reimplemented in cDvbPlayer.

Definition at line 61 of file player.h.

Referenced by cControl::GetIndex().

virtual bool cPlayer::GetReplayMode bool &    Play,
bool &    Forward,
int &    Speed
[inline, virtual]
 

Returns the current replay mode (if applicable). 'Play' tells whether we are playing or pausing, 'Forward' tells whether we are going forward or backward and 'Speed' is -1 if this is normal play/pause mode, 0 if it is single speed fast/slow forward/back mode and >0 if this is multi speed mode.

Reimplemented in cDvbPlayer.

Definition at line 70 of file player.h.

Referenced by cControl::GetReplayMode().

bool cPlayer::IsAttached void    [inline]
 

Definition at line 55 of file player.h.

Referenced by cControl::Attach(), and cTransfer::Receive().

virtual int cPlayer::NumAudioTracks void    const [inline, virtual]
 

Returns the number of audio tracks that are currently available on this player. The default return value is 0, meaning that this player doesn't have multiple audio track capabilities. The return value may change with every call and need not necessarily be the number of list entries returned by GetAudioTracks(). This function is mainly called to decide whether there should be an "Audio" button in a menu.

Reimplemented in cDvbPlayer, and cTransfer.

Definition at line 80 of file player.h.

Referenced by cDevice::NumAudioTracks().

void cPlayer::PlayAudio const uchar   Data,
int    Length
[protected]
 

Plays additional audio streams, like Dolby Digital.

Definition at line 34 of file player.c.

References device, esyslog, and cDevice::PlayAudio().

Referenced by cTransfer::StripAudioPackets(), and cDvbPlayer::StripAudioPackets().

int cPlayer::PlayVideo const uchar   Data,
int    Length
[protected]
 

Sends the given Data to the video device and returns the number of bytes that have actually been accepted by the video device (or a negative value in case of an error).

Definition at line 26 of file player.c.

References device, esyslog, and cDevice::PlayVideo().

Referenced by cTransfer::Action(), and cDvbPlayer::Action().

virtual void cPlayer::SetAudioTrack int    Index [inline, virtual]
 

Sets the current audio track to the given value, which should be within the range of the list returned by a previous call to GetAudioTracks() (otherwise nothing will happen).

Reimplemented in cDvbPlayer, and cTransfer.

Definition at line 100 of file player.h.

Referenced by cDevice::SetAudioTrack().


Friends And Related Function Documentation

friend class cDevice [friend]
 

Definition at line 19 of file player.h.


Field Documentation

cDevice* cPlayer::device [private]
 

Definition at line 21 of file player.h.

Referenced by cDevice::AttachPlayer(), cPlayer(), Detach(), PlayAudio(), and PlayVideo().

ePlayMode cPlayer::playMode [private]
 

Reimplemented in cDvbPlayer.

Definition at line 22 of file player.h.

Referenced by cDevice::AttachPlayer(), and cPlayer().


The documentation for this class was generated from the following files:
Generated on Wed Feb 5 23:31:47 2003 for VDR by doxygen1.3-rc2