Channel Class Reference

#include <channel.h>

Inheritance diagram for Channel:

DTVChannel ChannelBase

List of all members.


Detailed Description

Class implementing ChannelBase interface to tuning hardware when using Video4Linux based drivers.

Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.

This class supports a wide range of tuning hardware including frame grabbers (whose output requires encoding), hardware encoders, digital cameras, and non-encoding hardware which simply records pre-encoded broadcast streams.

Definition at line 28 of file channel.h.


Public Member Functions

 Channel (TVRec *parent, const QString &videodevice)
virtual ~Channel (void)
bool Init (QString &inputname, QString &startchannel, bool setchan)
bool Open (void)
 Opens the channel changing hardware for use.
void Close (void)
 Closes the channel changing hardware to use.
void SetFd (int fd)
 Sets file descriptor.
void SetFormat (const QString &format)
 Initializes tuner and modulator variables.
int SetDefaultFreqTable (const QString &name)
bool SetChannelByString (const QString &chan)
bool IsOpen (void) const
 Reports whether channel is already open.
int GetFd (void) const
 Returns file descriptor, -1 if it does not exist.
QString GetDevice (void) const
 Returns String representing device, useful for debugging.
QString GetSIStandard (void) const
 Returns PSIP table standard: MPEG, DVB, ATSC, or OpenCable.
bool SwitchToInput (int newcapchannel, bool setstarting)
 Switches to another input on hardware, and sets the channel is setstarting is true.
bool Retune (void)
 Retunes to last tuned frequency.
bool InitPictureAttributes (void)
int GetPictureAttribute (PictureAttribute) const
int ChangePictureAttribute (PictureAdjustType, PictureAttribute, bool up)
void SaveCachedPids (const pid_cache_t &) const
 Saves MPEG PIDs to cache to database.
void GetCachedPids (pid_cache_t &) const
 Returns cached MPEG PIDs for last tuned channel.
bool TuneMultiplex (uint mplexid, QString inputname)
 To be used by the channel scanner and possibly the EIT scanner.
bool Tune (const DTVMultiplex &tuning, QString inputname)
 To be used by the channel scanner and possibly the EIT scanner.
bool Tune (uint frequency, QString inputname, QString modulation, QString si_std)
 Tunes to a specific frequency (Hz) on a particular input, using the specified modulation.
 __construct ($channel_data)
 Channel ($channel_data)
 Legacy constructor /*.
 display_programs ($start_time, $end_time)

Public Attributes

 $chanid
 $channum
 $sourceid
 $callsign
 $name
 $finetune
 $videofilters
 $xmltvid
 $contrast
 $brightness
 $colour
 $visible
 $programs = array()

Private Member Functions

void SetFreqTable (const int index)
int SetFreqTable (const QString &name)
bool SetInputAndFormat (int newcapchannel, QString newFmt)
int GetCurrentChannelNum (const QString &channame)
QString GetFormatForChannel (QString channum, QString inputname)
bool InitPictureAttribute (const QString db_col_name)
bool TuneTo (const QString &chan, int finetune)
bool InitializeInputs (void)
 This enumerates the inputs, converts the format string to something the hardware understands, and if the parent pointer is valid retrieves the channels from the database.

Private Attributes

QString device
int videofd
QString device_name
QString driver_name
QMap< QString, int > pict_attr_default
struct CHANLISTcurList
int totalChannels
QString currentFormat
bool is_dtv
 Set if 'currentFormat' is a DTV format.
bool usingv4l2
 Set to true if tuner accepts v4l2 commands.
VidModV4L1 videomode_v4l1
 Current video mode if 'usingv4l2' is false.
VidModV4L2 videomode_v4l2
 Current video mode if 'usingv4l2' is true.
int defaultFreqTable

Constructor & Destructor Documentation

Channel::Channel ( TVRec parent,
const QString &  videodevice 
)

Definition at line 46 of file channel.cpp.

Channel::~Channel ( void   )  [virtual]

Definition at line 56 of file channel.cpp.

Channel::__construct ( channel_data  ) 

Definition at line 32 of file Channel.php.


Member Function Documentation

bool Channel::Init ( QString &  inputname,
QString &  startchannel,
bool  setchan 
) [virtual]

Reimplemented from ChannelBase.

Definition at line 61 of file channel.cpp.

bool Channel::Open ( void   )  [virtual]

Opens the channel changing hardware for use.

Implements ChannelBase.

Definition at line 71 of file channel.cpp.

Referenced by SetChannelByString(), and SetFormat().

void Channel::Close ( void   )  [virtual]

Closes the channel changing hardware to use.

Implements ChannelBase.

Definition at line 104 of file channel.cpp.

Referenced by Open(), SetFd(), and ~Channel().

void Channel::SetFd ( int  fd  )  [virtual]

Sets file descriptor.

Reimplemented from ChannelBase.

Definition at line 111 of file channel.cpp.

void Channel::SetFormat ( const QString &  format  ) 

Initializes tuner and modulator variables.

Parameters:
format One of twelve formats: "NTSC", "NTSC-JP", "ATSC", "SECAM", "PAL", "PAL-BG", "PAL-DK", "PAL-I", "PAL-60", "PAL-NC", "PAL-M", or "PAL-N"

Definition at line 332 of file channel.cpp.

Referenced by Init(), Open(), SetChannelByString(), and Tune().

int Channel::SetDefaultFreqTable ( const QString &  name  ) 

Definition at line 359 of file channel.cpp.

Referenced by Init().

bool Channel::SetChannelByString ( const QString &  chan  )  [virtual]

Implements ChannelBase.

Definition at line 424 of file channel.cpp.

Referenced by SwitchToInput().

bool Channel::IsOpen ( void   )  const [inline, virtual]

Reports whether channel is already open.

Implements ChannelBase.

Definition at line 46 of file channel.h.

int Channel::GetFd ( void   )  const [inline, virtual]

Returns file descriptor, -1 if it does not exist.

Reimplemented from ChannelBase.

Definition at line 47 of file channel.h.

Referenced by IsOpen().

QString Channel::GetDevice ( void   )  const [inline, virtual]

Returns String representing device, useful for debugging.

Reimplemented from ChannelBase.

Definition at line 48 of file channel.h.

QString Channel::GetSIStandard ( void   )  const [inline]

Returns PSIP table standard: MPEG, DVB, ATSC, or OpenCable.

Reimplemented from DTVChannel.

Definition at line 49 of file channel.h.

bool Channel::SwitchToInput ( int  inputNum,
bool  setstarting 
) [virtual]

Switches to another input on hardware, and sets the channel is setstarting is true.

Reimplemented from ChannelBase.

Definition at line 894 of file channel.cpp.

Referenced by Tune().

bool Channel::Retune ( void   )  [virtual]

Retunes to last tuned frequency.

NOTE: This only works for V4L2 and only for analog tuning.

Reimplemented from ChannelBase.

Definition at line 707 of file channel.cpp.

bool Channel::InitPictureAttributes ( void   )  [virtual]

Reimplemented from ChannelBase.

Definition at line 1100 of file channel.cpp.

Referenced by SetChannelByString().

int Channel::GetPictureAttribute ( PictureAttribute  attr  )  const [virtual]

Reimplemented from ChannelBase.

Definition at line 1108 of file channel.cpp.

Referenced by ChangePictureAttribute().

int Channel::ChangePictureAttribute ( PictureAdjustType  type,
PictureAttribute  attr,
bool  up 
) [virtual]

Reimplemented from ChannelBase.

Definition at line 1257 of file channel.cpp.

void Channel::SaveCachedPids ( const pid_cache_t pid_cache  )  const [virtual]

Saves MPEG PIDs to cache to database.

Parameters:
pid_cache List of PIDs with their TableID types to be saved.

Reimplemented from DTVChannel.

Definition at line 410 of file channel.cpp.

void Channel::GetCachedPids ( pid_cache_t pid_cache  )  const [virtual]

Returns cached MPEG PIDs for last tuned channel.

Parameters:
pid_cache List of PIDs with their TableID types is returned in pid_cache.

Reimplemented from DTVChannel.

Definition at line 417 of file channel.cpp.

bool Channel::TuneMultiplex ( uint  mplexid,
QString  inputname 
) [virtual]

To be used by the channel scanner and possibly the EIT scanner.

Implements DTVChannel.

Definition at line 740 of file channel.cpp.

bool Channel::Tune ( const DTVMultiplex tuning,
QString  inputname 
) [virtual]

To be used by the channel scanner and possibly the EIT scanner.

Implements DTVChannel.

Definition at line 577 of file channel.cpp.

Referenced by SetChannelByString(), TuneMultiplex(), and TuneTo().

bool Channel::Tune ( uint  frequency,
QString  inputname,
QString  modulation,
QString  si_std 
)

Tunes to a specific frequency (Hz) on a particular input, using the specified modulation.

Note: This function always uses modulator zero.

Parameters:
frequency Frequency in Hz, this is divided by 62.5 kHz or 62.5 Hz depending on the modulator and sent to the hardware.
inputname Name of the input (Television, Antenna 1, etc.)
modulation "radio", "analog", or "digital"

Definition at line 594 of file channel.cpp.

void Channel::SetFreqTable ( const int  index  )  [private]

Definition at line 365 of file channel.cpp.

Referenced by SetChannelByString(), SetDefaultFreqTable(), and SetFreqTable().

int Channel::SetFreqTable ( const QString &  name  )  [private]

Definition at line 371 of file channel.cpp.

bool Channel::SetInputAndFormat ( int  newcapchannel,
QString  newFmt 
) [private]

Definition at line 789 of file channel.cpp.

Referenced by SetFormat(), and SwitchToInput().

int Channel::GetCurrentChannelNum ( const QString &  channame  )  [private]

Definition at line 395 of file channel.cpp.

Referenced by TuneTo().

QString Channel::GetFormatForChannel ( QString  channum,
QString  inputname 
) [private]

Definition at line 767 of file channel.cpp.

Referenced by SwitchToInput().

bool Channel::InitPictureAttribute ( const QString  db_col_name  )  [private]

Definition at line 993 of file channel.cpp.

Referenced by InitPictureAttributes().

bool Channel::TuneTo ( const QString &  chan,
int  finetune 
) [private]

Definition at line 556 of file channel.cpp.

Referenced by SetChannelByString(), and SwitchToInput().

bool Channel::InitializeInputs ( void   )  [private, virtual]

This enumerates the inputs, converts the format string to something the hardware understands, and if the parent pointer is valid retrieves the channels from the database.

Reimplemented from ChannelBase.

Definition at line 276 of file channel.cpp.

Referenced by Open().

Channel::Channel ( channel_data  ) 

Legacy constructor /*.

Deprecated:

Definition at line 80 of file Channel.php.

Channel::display_programs ( start_time,
end_time 
)

Deprecated:
FIXME: this routine should get split out on its own, accepting $channel as a parameter, and put into modules/tv/list.php

Definition at line 87 of file Channel.php.


Member Data Documentation

QString Channel::device [private]

Definition at line 90 of file channel.h.

Referenced by GetDevice(), Open(), SetFreqTable(), SwitchToInput(), Tune(), and TuneTo().

int Channel::videofd [private]

QString Channel::device_name [private]

Definition at line 92 of file channel.h.

Referenced by InitPictureAttribute(), and Open().

QString Channel::driver_name [private]

Definition at line 93 of file channel.h.

Referenced by Open().

QMap<QString,int> Channel::pict_attr_default [private]

Definition at line 94 of file channel.h.

Referenced by GetPictureAttribute(), and InitPictureAttribute().

struct CHANLIST* Channel::curList [read, private]

Definition at line 96 of file channel.h.

Referenced by GetCurrentChannelNum(), SetFreqTable(), and TuneTo().

int Channel::totalChannels [private]

Definition at line 97 of file channel.h.

Referenced by GetCurrentChannelNum(), and SetFreqTable().

QString Channel::currentFormat [private]

Definition at line 99 of file channel.h.

Referenced by SetFormat(), SwitchToInput(), and Tune().

bool Channel::is_dtv [private]

Set if 'currentFormat' is a DTV format.

Definition at line 100 of file channel.h.

Referenced by ChangePictureAttribute(), InitPictureAttribute(), SetChannelByString(), SetFormat(), SwitchToInput(), and Tune().

Set to true if tuner accepts v4l2 commands.

Definition at line 101 of file channel.h.

Referenced by ChangePictureAttribute(), InitPictureAttribute(), Open(), Retune(), SetInputAndFormat(), and Tune().

Current video mode if 'usingv4l2' is false.

Definition at line 102 of file channel.h.

Referenced by InitializeInputs().

Current video mode if 'usingv4l2' is true.

Definition at line 103 of file channel.h.

Referenced by InitializeInputs().

Definition at line 105 of file channel.h.

Referenced by SetChannelByString(), and SetDefaultFreqTable().

Channel::$chanid

Definition at line 17 of file Channel.php.

Channel::$channum

Definition at line 18 of file Channel.php.

Channel::$sourceid

Definition at line 19 of file Channel.php.

Channel::$callsign

Definition at line 20 of file Channel.php.

Channel::$name

Definition at line 21 of file Channel.php.

Channel::$finetune

Definition at line 22 of file Channel.php.

Channel::$videofilters

Definition at line 23 of file Channel.php.

Channel::$xmltvid

Definition at line 24 of file Channel.php.

Channel::$contrast

Definition at line 25 of file Channel.php.

Channel::$brightness

Definition at line 26 of file Channel.php.

Channel::$colour

Definition at line 27 of file Channel.php.

Channel::$visible

Definition at line 28 of file Channel.php.

Channel::$programs = array()

Definition at line 29 of file Channel.php.


The documentation for this class was generated from the following files:

Generated on Sat Dec 18 05:16:00 2010 for MythTV by  doxygen 1.5.5