Home

Dokumentation

Impressum

Dokumentation VDR
 

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

cDevice Class Reference

#include <device.h>

Inheritance diagram for cDevice:

Inheritance graph
[legend]
Collaboration diagram for cDevice:

Collaboration graph
[legend]

Detailed Description

The cDevice class is the base from which actual devices can be derived.

Definition at line 76 of file device.h.

Public Methods

bool IsPrimaryDevice (void) const
int CardIndex (void) const
int DeviceNumber (void) const
int ProvidesCa (int Ca) const
virtual bool HasDecoder (void) const
virtual cOsdBaseNewOsd (int x, int y)
virtual cSpuDecoderGetSpuDecoder (void)
virtual bool ProvidesSource (int Source) const
virtual bool ProvidesChannel (const cChannel *Channel, int Priority=-1, bool *NeedsDetachReceivers=NULL) const
bool SwitchChannel (const cChannel *Channel, bool LiveView)
virtual bool GrabImage (const char *FileName, bool Jpeg=true, int Quality=-1, int SizeX=-1, int SizeY=-1)
virtual void SetVideoFormat (bool VideoFormat16_9)
bool IsMute (void) const
bool ToggleMute (void)
void SetVolume (int Volume, bool Absolute=false)
int NumAudioTracks (void) const
const char ** GetAudioTracks (int *CurrentTrack=NULL) const
void SetAudioTrack (int Index)
virtual void TrickSpeed (int Speed)
virtual void Clear (void)
virtual void Play (void)
virtual void Freeze (void)
virtual void Mute (void)
virtual void StillPicture (const uchar *Data, int Length)
virtual bool Poll (cPoller &Poller, int TimeoutMs=0)
virtual int PlayVideo (const uchar *Data, int Length)
virtual void PlayAudio (const uchar *Data, int Length)
bool Replaying (void) const
void StopReplay (void)
bool AttachPlayer (cPlayer *Player)
void Detach (cPlayer *Player)
bool PlayerDetached (void)
int Ca (void) const
bool Receiving (bool CheckAny=false) const
bool AttachReceiver (cReceiver *Receiver)
void Detach (cReceiver *Receiver)

Static Public Methods

int NumDevices (void)
void SetUseDevice (int n)
bool UseDevice (int n)
bool SetPrimaryDevice (int n)
cDevice * PrimaryDevice (void)
cDevice * GetDevice (int Index)
cDevice * GetDevice (const cChannel *Channel, int Priority=-1, bool *NeedsDetachReceivers=NULL)
void SetCaCaps (int Index=-1)
void Shutdown (void)
bool SwitchChannel (int Direction)
int CurrentChannel (void)
int CurrentVolume (void)

Protected Types

enum  ePidType {
  ptAudio, ptVideo, ptTeletext, ptDolby,
  ptOther
}

Protected Methods

 cDevice (void)
virtual ~cDevice ()
virtual void MakePrimaryDevice (bool On)
virtual bool SetChannelDevice (const cChannel *Channel, bool LiveView)
bool HasPid (int Pid) const
bool AddPid (int Pid, ePidType PidType=ptOther)
void DelPid (int Pid)
virtual bool SetPid (cPidHandle *Handle, int Type, bool On)
virtual void SetVolumeDevice (int Volume)
virtual int NumAudioTracksDevice (void) const
virtual const char ** GetAudioTracksDevice (int *CurrentTrack=NULL) const
virtual void SetAudioTrackDevice (int Index)
virtual bool CanReplay (void) const
virtual bool SetPlayMode (ePlayMode PlayMode)
int Priority (void) const
virtual bool OpenDvr (void)
virtual void CloseDvr (void)
virtual bool GetTSPacket (uchar *&Data)

Static Protected Methods

int NextCardIndex (int n=0)

Protected Attributes

cPidHandle pidHandles [MAXPIDHANDLES]

Static Protected Attributes

int currentChannel = 0

Private Methods

eSetChannelResult SetChannel (const cChannel *Channel, bool LiveView)
virtual void Action (void)
int CanShift (int Ca, int Priority, int UsedCards=0) const

Private Attributes

int cardIndex
int caCaps [MAXCACAPS]
bool active
bool mute
int volume
cPlayerplayer
bool playerDetached
cReceiverreceiver [MAXRECEIVERS]

Static Private Attributes

int numDevices = 0
int useDevice = 0
cDevice * device [MAXDEVICES] = { NULL }
cDevice * primaryDevice = NULL
int nextCardIndex = 0


Member Enumeration Documentation

enum cDevice::ePidType [protected]
 

Enumeration values:
ptAudio 
ptVideo 
ptTeletext 
ptDolby 
ptOther 

Definition at line 284 of file device.h.


Constructor & Destructor Documentation

cDevice::cDevice void    [protected]
 

Definition at line 39 of file device.c.

References active, cardIndex, device, esyslog, MAXDEVICES, MAXRECEIVERS, mute, nextCardIndex, numDevices, player, playerDetached, receiver, SetCaCaps(), SetVideoFormat(), and volume.

cDevice::~cDevice   [protected, virtual]
 

Definition at line 65 of file device.c.

References Detach(), and MAXRECEIVERS.


Member Function Documentation

void cDevice::Action void    [private, virtual]
 

Implements cThread.

Definition at line 626 of file device.c.

References active, CardIndex(), CloseDvr(), dsyslog, cThread::EmergencyExit(), esyslog, GetTSPacket(), cThread::Lock(), MAXBROKENTIMEOUT, MAXRECEIVERS, OpenDvr(), receiver, uchar, cThread::Unlock(), and cReceiver::WantsPid().

bool cDevice::AddPid int    Pid,
ePidType    PidType = ptOther
[protected]
 

Adds a PID to the set of PIDs this device shall receive.

Definition at line 223 of file device.c.

References esyslog, MAXPIDHANDLES, cDevice::cPidHandle::pid, pidHandles, PRINTPIDS, ptOther, ptTeletext, SetPid(), and cDevice::cPidHandle::used.

Referenced by AttachReceiver(), and cDvbDevice::SetChannelDevice().

bool cDevice::AttachPlayer cPlayer   Player
 

Attaches the given player to this device.

Definition at line 494 of file device.c.

References cPlayer::Activate(), CanReplay(), Detach(), cPlayer::device, player, cPlayer::playMode, and SetPlayMode().

Referenced by cControl::Attach().

bool cDevice::AttachReceiver cReceiver   Receiver
 

Attaches the given receiver to this device.

Definition at line 679 of file device.c.

References cReceiver::Activate(), AddPid(), cReceiver::device, esyslog, cThread::Lock(), MAXRECEIVEPIDS, MAXRECEIVERS, cReceiver::pids, receiver, cThread::Start(), and cThread::Unlock().

Referenced by cRecordControl::cRecordControl(), and cTransferControl::cTransferControl().

int cDevice::Ca void    const
 

Returns the Ca() status of the current receiving session(s).

Definition at line 543 of file device.c.

References cReceiver::ca, MAXRECEIVERS, and receiver.

Referenced by cDvbDevice::CanReplay(), CanShift(), and cDvbDevice::NumAudioTracksDevice().

bool cDevice::CanReplay void    const [protected, virtual]
 

Returns true if this device can currently start a replay session.

Reimplemented in cDvbDevice.

Definition at line 453 of file device.c.

References HasDecoder().

Referenced by AttachPlayer(), cDvbDevice::CanReplay(), SetChannel(), and SwitchChannel().

int cDevice::CanShift int    Ca,
int    Priority,
int    UsedCards = 0
const [private]
 

Definition at line 563 of file device.c.

References Ca(), CardIndex(), device, MAXDEVICES, numDevices, Priority(), ProvidesCa(), and Receiving().

int cDevice::CardIndex void    const [inline]
 

Returns the card index of this device (0 ... MAXDEVICES - 1).

Definition at line 177 of file device.h.

Referenced by Action(), CanShift(), cDvbDevice::cDvbDevice(), cRecordControl::cRecordControl(), cDvbDevice::GetTSPacket(), cDvbDevice::GrabImage(), cDvbDevice::OpenDvr(), cEITScanner::Process(), ProvidesCa(), SetCaCaps(), cDvbDevice::SetChannelDevice(), cDvbDevice::SetPid(), cDvbDevice::SetPlayMode(), and cRecordControls::Stop().

void cDevice::Clear void    [virtual]
 

Clears all video and audio data from the device. A derived class must call the base class function to make sure all registered cAudio objects are notified.

Reimplemented in cDvbDevice.

Definition at line 467 of file device.c.

Referenced by cPlayer::DeviceClear().

void cDevice::CloseDvr void    [protected, virtual]
 

Shuts down the DVR.

Reimplemented in cDvbDevice.

Definition at line 670 of file device.c.

Referenced by Action().

int cDevice::CurrentChannel void    [inline, static]
 

Returns the number of the current channel on the primary device.

Definition at line 274 of file device.h.

Referenced by cSVDRP::CmdCHAN(), cMenuChannels::cMenuChannels(), main(), cEITScanner::Process(), cMenuSchedule::ProcessKey(), cRecordControls::Start(), and SwitchChannel().

int cDevice::CurrentVolume void    [inline, static]
 

Definition at line 414 of file device.h.

References volume.

Referenced by main(), and cDisplayVolume::Show().

void cDevice::DelPid int    Pid [protected]
 

Deletes a PID from the set of PIDs this device shall receive.

Definition at line 264 of file device.c.

References cDevice::cPidHandle::handle, MAXPIDHANDLES, cDevice::cPidHandle::pid, pidHandles, PRINTPIDS, SetPid(), and cDevice::cPidHandle::used.

Referenced by Detach(), and cDvbDevice::SetChannelDevice().

void cDevice::Detach cReceiver   Receiver
 

Detaches the given receiver from this device.

Definition at line 702 of file device.c.

References cReceiver::Activate(), active, cThread::Cancel(), DelPid(), cReceiver::device, cThread::Lock(), MAXRECEIVEPIDS, MAXRECEIVERS, cReceiver::pids, receiver, and cThread::Unlock().

void cDevice::Detach cPlayer   Player
 

Detaches the given player from this device.

Definition at line 508 of file device.c.

References player, playerDetached, and SetPlayMode().

Referenced by AttachPlayer(), cReceiver::Detach(), cPlayer::Detach(), StopReplay(), and ~cDevice().

int cDevice::DeviceNumber void    const
 

Returns the number of this device (0 ... MAXDEVICES - 1).

Definition at line 90 of file device.c.

References device, and numDevices.

Referenced by cRcuRemote::Recording().

void cDevice::Freeze void    [virtual]
 

Puts the device into "freeze frame" mode.

Reimplemented in cDvbDevice.

Definition at line 476 of file device.c.

Referenced by cPlayer::DeviceFreeze().

const char ** cDevice::GetAudioTracks int *    CurrentTrack = NULL const
 

Returns a list of currently available audio tracks. The last entry in the list is 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. By default the return value is NULL and CurrentTrack, if given, will not have any meaning.

Definition at line 440 of file device.c.

References cPlayer::GetAudioTracks(), GetAudioTracksDevice(), and player.

Referenced by cMenuMain::ProcessKey().

const char ** cDevice::GetAudioTracksDevice int *    CurrentTrack = NULL const [protected, 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 NumAudioTracksDevice(). 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 GetAudioTracksDevice()! The only time the list may change is *inside* the GetAudioTracksDevice() function. By default the return value is NULL and CurrentTrack, if given, will not have any meaning.

Reimplemented in cDvbDevice.

Definition at line 405 of file device.c.

Referenced by GetAudioTracks().

cDevice * cDevice::GetDevice const cChannel   Channel,
int    Priority = -1,
bool *    NeedsDetachReceivers = NULL
[static]
 

Returns a device that is able to receive the given Channel at the given Priority. See ProvidesChannel() for more information on how priorities are handled, and the meaning of NeedsDetachReceivers.

Definition at line 145 of file device.c.

References cChannel::Ca(), device, numDevices, Priority(), ProvidesCa(), ProvidesChannel(), and Receiving().

cDevice * cDevice::GetDevice int    Index [static]
 

Gets the device with the given Index.

Parameters:
Index must be in the range 0..numDevices-1.
Returns:
A pointer to the device, or NULL if the Index was invalid.

Definition at line 140 of file device.c.

References device, and numDevices.

Referenced by cEITScanner::Process(), SetChannel(), cRecordControls::Start(), and SwitchChannel().

cSpuDecoder * cDevice::GetSpuDecoder void    [virtual]
 

Returns a pointer to the device's SPU decoder (or NULL, if this device doesn't have an SPU decoder).

Reimplemented in cDvbDevice.

Definition at line 135 of file device.c.

bool cDevice::GetTSPacket uchar *&    Data [protected, virtual]
 

Gets exactly one TS packet from the DVR of this device and returns a pointer to it in Data. Only the first 188 bytes (TS_SIZE) Data points to are valid and may be accessed. If there is currently no new data available, Data will be set to NULL. The function returns false in case of a non recoverable error, otherwise it returns true, even if Data is NULL.

Reimplemented in cDvbDevice.

Definition at line 674 of file device.c.

Referenced by Action().

bool cDevice::GrabImage const char *    FileName,
bool    Jpeg = true,
int    Quality = -1,
int    SizeX = -1,
int    SizeY = -1
[virtual]
 

Capture a single frame as an image. Grabs the currently visible screen image into the given file, with the given parameters.

Parameters:
FileName The name of the file to write. Should include the proper extension.
Jpeg If true will write a JPEG file. Otherwise a PNM file will be written.
Quality The compression factor for JPEG. 1 will create a very blocky and small image, 70..80 will yield reasonable quality images while keeping the image file size around 50 KB for a full frame. The default will create a big but very high quality image.
SizeX The number of horizontal pixels in the frame (default is the current screen width).
SizeY The number of vertical pixels in the frame (default is the current screen height).
Returns:
True if all went well.

Reimplemented in cDvbDevice.

Definition at line 202 of file device.c.

Referenced by cSVDRP::CmdGRAB().

bool cDevice::HasDecoder void    const [virtual]
 

Tells whether this device has an MPEG decoder.

Reimplemented in cDvbDevice.

Definition at line 118 of file device.c.

Referenced by CanReplay().

bool cDevice::HasPid int    Pid const [protected]
 

Returns true if this device is currently receiving the given PID.

Definition at line 214 of file device.c.

References MAXPIDHANDLES, cDevice::cPidHandle::pid, and pidHandles.

Referenced by cDvbDevice::ProvidesChannel(), and cDvbDevice::SetChannelDevice().

bool cDevice::IsMute void    const [inline]
 

Definition at line 401 of file device.h.

Referenced by cDisplayVolume::cDisplayVolume(), cSVDRP::CmdVOLU(), cDisplayVolume::ProcessKey(), and cDisplayVolume::Show().

bool cDevice::IsPrimaryDevice void    const [inline]
 

Definition at line 172 of file device.h.

Referenced by cRcuRemote::ChannelSwitch(), cDvbDevice::GetSpuDecoder(), Priority(), cDvbDevice::ProvidesChannel(), SetChannel(), cDvbDevice::SetChannelDevice(), and StopReplay().

void cDevice::MakePrimaryDevice bool    On [protected, virtual]
 

Informs a device that it will be the primary device. If there is anything the device needs to set up when it becomes the primary device (On = true) or to shut down when it no longer is the primary device (On = false), it should do so in this function.

Reimplemented in cDvbDevice.

Definition at line 99 of file device.c.

Referenced by SetPrimaryDevice().

void cDevice::Mute void    [virtual]
 

Turns off audio while replaying. A derived class must call the base class function to make sure all registered cAudio objects are notified.

Reimplemented in cDvbDevice.

Definition at line 480 of file device.c.

Referenced by cPlayer::DeviceMute().

cOsdBase * cDevice::NewOsd int    x,
int    y
[virtual]
 

Creates a new cOsdBase object that can be used by the cOsd class to display information on the screen, with the upper left corner of the OSD at the given coordinates. If a derived cDevice doesn't implement this function, NULL will be returned by default (which means the device has no OSD capabilities).

Reimplemented in cDvbDevice.

Definition at line 130 of file device.c.

Referenced by cOsd::OpenRaw().

int cDevice::NextCardIndex int    n = 0 [static, protected]
 

Calculates the next card index. Each device in a given machine must have a unique card index, which will be used to identify the device for assigning Ca parameters and deciding whether to actually use that device in this particular instance of VDR. Every time a new cDevice is created, it will be given the current nextCardIndex, and then nextCardIndex will be automatically incremented by 1. A derived class can determine whether a given device shall be used by checking UseDevice(NextCardIndex()). If a device is skipped, or if there are possible device indexes left after a derived class has set up all its devices, NextCardIndex(n) must be called, where n is the number of card indexes to skip.

Definition at line 78 of file device.c.

References esyslog, MAXDEVICES, and nextCardIndex.

Referenced by cDvbDevice::Initialize().

int cDevice::NumAudioTracks void    const
 

Returns the number of audio tracks that are currently available on this device or a player attached to it.

Definition at line 435 of file device.c.

References cPlayer::NumAudioTracks(), NumAudioTracksDevice(), and player.

int cDevice::NumAudioTracksDevice void    const [protected, virtual]
 

Returns the number of audio tracks that are currently available on this device. The default return value is 0, meaning that this device 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 GetAudioTracksDevice(). This function is mainly called to decide whether there should be an "Audio" button in a menu.

Reimplemented in cDvbDevice.

Definition at line 400 of file device.c.

Referenced by NumAudioTracks().

int cDevice::NumDevices void    [inline, static]
 

Returns the total number of devices.

Definition at line 86 of file device.h.

Referenced by cMenuSetupCICAM::cMenuSetupCICAM(), and cEITScanner::Process().

bool cDevice::OpenDvr void    [protected, virtual]
 

Opens the DVR of this device and prepares it to deliver a Transport Stream for use in a cReceiver.

Reimplemented in cDvbDevice.

Definition at line 665 of file device.c.

Referenced by Action().

void cDevice::Play void    [virtual]
 

Sets the device into play mode (after a previous trick mode).

Reimplemented in cDvbDevice.

Definition at line 472 of file device.c.

Referenced by cPlayer::DevicePlay().

void cDevice::PlayAudio const uchar   Data,
int    Length
[virtual]
 

Plays additional audio streams, like Dolby Digital. A derived class must call the base class function to make sure data is distributed to all registered cAudio objects.

Reimplemented in cDvbDevice.

Definition at line 538 of file device.c.

Referenced by cPlayer::PlayAudio(), and cDvbDevice::PlayAudio().

bool cDevice::PlayerDetached void   
 

Returns true if a player has been detached and resets the 'playerDetached' flag.

Definition at line 123 of file device.c.

References playerDetached.

Referenced by main().

int cDevice::PlayVideo const uchar   Data,
int    Length
[virtual]
 

Actually plays the given data block as video. The data must be part of a PES (Packetized Elementary Stream) which can contain one video and one audio strem.

Reimplemented in cDvbDevice.

Definition at line 533 of file device.c.

Referenced by cPlayer::PlayVideo().

bool cDevice::Poll cPoller   Poller,
int    TimeoutMs = 0
[virtual]
 

Returns true if the device itself or any of the file handles in Poller is ready for further action. If TimeoutMs is not zero, the device will wait up to the given number of milleseconds before returning in case there is no immediate need for data.

Reimplemented in cDvbDevice.

Definition at line 528 of file device.c.

Referenced by cPlayer::DevicePoll().

cDevice* cDevice::PrimaryDevice void    [inline, static]
 

Returns the primary device.

Definition at line 111 of file device.h.

Referenced by cControl::Attach(), cDisplayVolume::cDisplayVolume(), cSVDRP::CmdCHAN(), cSVDRP::CmdGRAB(), cSVDRP::CmdVOLU(), cRecordControl::cRecordControl(), main(), cOsd::OpenRaw(), cEITScanner::Process(), cDisplayVolume::ProcessKey(), cMenuMain::ProcessKey(), cMenuSetupDVB::ProcessKey(), cMenuRecordings::Rewind(), cDisplayVolume::Show(), cRecordControls::StopPrimary(), cMenuWhatsOn::Switch(), cMenuChannels::Switch(), SwitchChannel(), and cChannels::SwitchTo().

int cDevice::Priority void    const [protected]
 

Returns the priority of the current receiving session (0..MAXPRIORITY), or -1 if no receiver is currently active. The primary device will always return at least Setup.PrimaryLimit-1.

Definition at line 553 of file device.c.

References DEFAULTPRIORITY, IsPrimaryDevice(), max(), MAXRECEIVERS, and receiver.

Referenced by CanShift(), GetDevice(), and cDvbDevice::ProvidesChannel().

int cDevice::ProvidesCa int    Ca const
 

Checks whether this device provides the given value in its caCaps. Returns 0 if the value is not provided, 1 if only this value is provided, and > 1 if this and other values are provided. If the given value is equal to the number of this device, 1 is returned. If it is 0 (FTA), 1 plus the number of other values in caCaps is returned.

Definition at line 598 of file device.c.

References caCaps, CardIndex(), MAXCACAPS, and MAXDEVICES.

Referenced by CanShift(), GetDevice(), and cDvbDevice::ProvidesChannel().

bool cDevice::ProvidesChannel const cChannel   Channel,
int    Priority = -1,
bool *    NeedsDetachReceivers = NULL
const [virtual]
 

Returns true if this device can provide the given channel. In case the device has cReceivers attached to it or it is the primary device, Priority is used to decide whether the caller's request can be honored. The special Priority value -1 will tell the caller whether this device is principally able to provide the given Channel, regardless of any attached cReceivers. If NeedsDetachReceivers is given, the resulting value in it will tell the caller whether or not it will have to detach any currently attached receivers from this device before calling SwitchChannel. Note that the return value in NeedsDetachReceivers is only meaningful if the function itself actually returns true. The default implementation always returns false, so a derived cDevice class that can provide channels must implement this function.

Reimplemented in cDvbDevice.

Definition at line 293 of file device.c.

Referenced by GetDevice(), cEITScanner::Process(), SetChannel(), and SwitchChannel().

bool cDevice::ProvidesSource int    Source const [virtual]
 

Returns true if this device can provide the given source.

Reimplemented in cDvbDevice.

Definition at line 288 of file device.c.

bool cDevice::Receiving bool    CheckAny = false const
 

Returns true if we are currently receiving.

Definition at line 617 of file device.c.

References MAXRECEIVERS, cReceiver::priority, and receiver.

Referenced by cDvbDevice::CanReplay(), CanShift(), GetDevice(), cEITScanner::Process(), cDvbDevice::ProvidesChannel(), cRcuRemote::Recording(), and cRecordControls::StopPrimary().

bool cDevice::Replaying void    const
 

Returns true if we are currently replaying.

Definition at line 489 of file device.c.

References player.

Referenced by main(), and cEITScanner::Process().

void cDevice::SetAudioTrack int    Index
 

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

Definition at line 445 of file device.c.

References player, cPlayer::SetAudioTrack(), and SetAudioTrackDevice().

Referenced by cMenuMain::ProcessKey().

void cDevice::SetAudioTrackDevice int    Index [protected, 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 GetAudioTracksDevice() (otherwise nothing will happen).

Reimplemented in cDvbDevice.

Definition at line 410 of file device.c.

Referenced by SetAudioTrack().

void cDevice::SetCaCaps int    Index = -1 [static]
 

Sets the CaCaps of the given device according to the Setup data. By default the CaCaps of all devices are set.

Definition at line 183 of file device.c.

References CardIndex(), device, MAXCACAPS, and numDevices.

Referenced by cDevice(), and cMenuSetupCICAM::ProcessKey().

eSetChannelResult cDevice::SetChannel const cChannel   Channel,
bool    LiveView
[private]
 

Sets the device to the given channel (general setup).

Definition at line 347 of file device.c.

References cChannel::Apid1(), cChannel::Apid2(), CanReplay(), currentChannel, cChannel::Dpid1(), cChannel::Dpid2(), eSetChannelResult, cChannel::GetChannelID(), GetDevice(), IsPrimaryDevice(), cControl::Launch(), cStatus::MsgChannelSwitch(), cChannel::Number(), ProvidesChannel(), scrFailed, scrNotAvailable, scrNoTransfer, scrOk, SetChannelDevice(), cSIProcessor::SetCurrentChannelID(), StopReplay(), and cChannel::Vpid().

Referenced by SwitchChannel().

bool cDevice::SetChannelDevice const cChannel   Channel,
bool    LiveView
[protected, virtual]
 

Sets the device to the given channel (actual physical setup).

Reimplemented in cDvbDevice.

Definition at line 391 of file device.c.

Referenced by SetChannel().

bool cDevice::SetPid cPidHandle   Handle,
int    Type,
bool    On
[protected, virtual]
 

Does the actual PID setting on this device. On indicates whether the PID shall be added or deleted. Handle->handle can be used by the device to store information it needs to receive this PID (for instance a file handle). Handle->used indicated how many receivers are using this PID. Type indicates some special types of PIDs, which the device may need to set in a specific way.

Reimplemented in cDvbDevice.

Definition at line 283 of file device.c.

Referenced by AddPid(), and DelPid().

bool cDevice::SetPlayMode ePlayMode    PlayMode [protected, virtual]
 

Sets the device into the given play mode.

Returns:
true if the operation was successful.

Reimplemented in cDvbDevice.

Definition at line 458 of file device.c.

Referenced by AttachPlayer(), and Detach().

bool cDevice::SetPrimaryDevice int    n [static]
 

Sets the primary device to 'n'.

Parameters:
n must be in the range 1...numDevices.
Returns:
true if this was possible.

Definition at line 103 of file device.c.

References device, esyslog, isyslog, MakePrimaryDevice(), numDevices, and primaryDevice.

Referenced by main().

void cDevice::SetUseDevice int    n [static]
 

Sets the 'useDevice' flag of the given device. If this function is not called before initializing, all devices will be used.

Definition at line 72 of file device.c.

References MAXDEVICES, and useDevice.

Referenced by main().

void cDevice::SetVideoFormat bool    VideoFormat16_9 [virtual]
 

Sets the output video format to either 16:9 or 4:3 (only useful if this device has an MPEG decoder).

Reimplemented in cDvbDevice.

Definition at line 207 of file device.c.

Referenced by cDevice(), and cMenuSetupDVB::ProcessKey().

void cDevice::SetVolume int    Volume,
bool    Absolute = false
 

Sets the volume to the given value, either absolutely or relative to the current volume.

Definition at line 424 of file device.c.

References max(), min(), cStatus::MsgSetVolume(), mute, SetVolumeDevice(), and volume.

Referenced by cSVDRP::CmdVOLU(), main(), and ToggleMute().

void cDevice::SetVolumeDevice int    Volume [protected, virtual]
 

Sets the audio volume on this device (Volume = 0...255).

Reimplemented in cDvbDevice.

Definition at line 396 of file device.c.

Referenced by SetVolume().

void cDevice::Shutdown void    [static]
 

Closes down all devices. Must be called at the end of the program.

Definition at line 193 of file device.c.

References device, numDevices, and primaryDevice.

Referenced by main().

void cDevice::StillPicture const uchar   Data,
int    Length
[virtual]
 

Displays the given I-frame as a still picture.

Reimplemented in cDvbDevice.

Definition at line 485 of file device.c.

Referenced by cPlayer::DeviceStillPicture().

void cDevice::StopReplay void   
 

Stops the current replay session (if any).

Definition at line 519 of file device.c.

References Detach(), IsPrimaryDevice(), and cControl::Shutdown().

Referenced by cMenuRecordings::Rewind(), and SetChannel().

bool cDevice::SwitchChannel int    Direction [static]
 

Switches the primary device to the next available channel in the given Direction (only the sign of Direction is evaluated, positive values switch to higher channel numbers).

Definition at line 318 of file device.c.

References CanReplay(), CurrentChannel(), dsyslog, GetDevice(), cChannel::Number(), PrimaryDevice(), ProvidesChannel(), sgn(), SwitchChannel(), and tr.

bool cDevice::SwitchChannel const cChannel   Channel,
bool    LiveView
 

Switches the device to the given Channel, initiating transfer mode if necessary.

Definition at line 298 of file device.c.

References esyslog, isyslog, cChannel::Number(), scrFailed, scrNotAvailable, scrNoTransfer, scrOk, SetChannel(), and tr.

Referenced by cSVDRP::CmdCHAN(), main(), cEITScanner::Process(), cDisplayChannel::ProcessKey(), cRecordControls::Start(), cMenuWhatsOn::Switch(), cMenuChannels::Switch(), SwitchChannel(), and cChannels::SwitchTo().

bool cDevice::ToggleMute void   
 

Turns the volume off or on and returns the new mute state.

Definition at line 414 of file device.c.

References mute, SetVolume(), and volume.

Referenced by cSVDRP::CmdVOLU(), and main().

void cDevice::TrickSpeed int    Speed [virtual]
 

Sets the device into a mode where replay is done slower. Every single frame shall then be displayed the given number of times.

Reimplemented in cDvbDevice.

Definition at line 463 of file device.c.

Referenced by cPlayer::DeviceTrickSpeed().

bool cDevice::UseDevice int    n [inline, static]
 

Tells whether the device with the given card index shall be used in this instance of VDR.

Definition at line 99 of file device.h.

Referenced by cDvbDevice::Initialize().


Field Documentation

bool cDevice::active [private]
 

PID handle facilities

Definition at line 281 of file device.h.

Referenced by Action(), cDevice(), and Detach().

int cDevice::caCaps[MAXCACAPS] [private]
 

Definition at line 143 of file device.h.

Referenced by ProvidesCa().

int cDevice::cardIndex [private]
 

Definition at line 142 of file device.h.

Referenced by cDevice().

int cDevice::currentChannel = 0 [static, protected]
 

Channel facilities

Definition at line 35 of file device.c.

Referenced by SetChannel().

cDevice * cDevice::device = { NULL } [static, private]
 

Definition at line 36 of file device.c.

Referenced by CanShift(), cDevice(), DeviceNumber(), GetDevice(), SetCaCaps(), SetPrimaryDevice(), and Shutdown().

bool cDevice::mute [private]
 

Audio facilities

Definition at line 362 of file device.h.

Referenced by cDevice(), SetVolume(), and ToggleMute().

int cDevice::nextCardIndex = 0 [static, private]
 

Definition at line 34 of file device.c.

Referenced by cDevice(), and NextCardIndex().

int cDevice::numDevices = 0 [static, private]
 

Definition at line 32 of file device.c.

Referenced by CanShift(), cDevice(), DeviceNumber(), GetDevice(), SetCaCaps(), SetPrimaryDevice(), and Shutdown().

cPidHandle cDevice::pidHandles[MAXPIDHANDLES] [protected]
 

Definition at line 292 of file device.h.

Referenced by AddPid(), DelPid(), cDvbDevice::GetAudioTracksDevice(), HasPid(), cDvbDevice::SetAudioTrackDevice(), and cDvbDevice::SetChannelDevice().

cPlayer* cDevice::player [private]
 

Player facilities

Definition at line 446 of file device.h.

Referenced by AttachPlayer(), cDevice(), Detach(), GetAudioTracks(), NumAudioTracks(), Replaying(), and SetAudioTrack().

bool cDevice::playerDetached [private]
 

Definition at line 447 of file device.h.

Referenced by cDevice(), Detach(), and PlayerDetached().

cDevice * cDevice::primaryDevice = NULL [static, private]
 

Definition at line 37 of file device.c.

Referenced by SetPrimaryDevice(), and Shutdown().

cReceiver* cDevice::receiver[MAXRECEIVERS] [private]
 

Receiver facilities

Definition at line 550 of file device.h.

Referenced by Action(), AttachReceiver(), Ca(), cDevice(), Detach(), Priority(), and Receiving().

int cDevice::useDevice = 0 [static, private]
 

Definition at line 33 of file device.c.

Referenced by SetUseDevice().

int cDevice::volume [private]
 

Definition at line 363 of file device.h.

Referenced by cDevice(), CurrentVolume(), SetVolume(), and ToggleMute().


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