#include <channel.h>

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 CHANLIST * | curList |
| 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 |
| 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.
| 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] |
| void Channel::SetFormat | ( | const QString & | format | ) |
Initializes tuner and modulator variables.
| 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 | ) |
| bool Channel::SetChannelByString | ( | const QString & | chan | ) | [virtual] |
| bool Channel::IsOpen | ( | void | ) | const [inline, virtual] |
| 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] |
| QString Channel::GetSIStandard | ( | void | ) | const [inline] |
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] |
| void Channel::SaveCachedPids | ( | const pid_cache_t & | pid_cache | ) | const [virtual] |
Saves MPEG PIDs to cache to database.
| 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.
| 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.
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().
Tunes to a specific frequency (Hz) on a particular input, using the specified modulation.
Note: This function always uses modulator zero.
| 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] |
| int Channel::GetCurrentChannelNum | ( | const QString & | channame | ) | [private] |
| QString Channel::GetFormatForChannel | ( | QString | channum, | |
| QString | inputname | |||
| ) | [private] |
| bool Channel::InitPictureAttribute | ( | const QString | db_col_name | ) | [private] |
| 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 | ) |
| Channel::display_programs | ( | $ | start_time, | |
| $ | end_time | |||
| ) |
Definition at line 87 of file Channel.php.
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] |
Definition at line 91 of file channel.h.
Referenced by ChangePictureAttribute(), Close(), GetFd(), InitializeInputs(), InitPictureAttribute(), Open(), Retune(), SetFd(), SetInputAndFormat(), and Tune().
QString Channel::device_name [private] |
QString Channel::driver_name [private] |
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] |
QString Channel::currentFormat [private] |
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().
bool Channel::usingv4l2 [private] |
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().
VidModV4L1 Channel::videomode_v4l1 [private] |
Current video mode if 'usingv4l2' is false.
Definition at line 102 of file channel.h.
Referenced by InitializeInputs().
VidModV4L2 Channel::videomode_v4l2 [private] |
Current video mode if 'usingv4l2' is true.
Definition at line 103 of file channel.h.
Referenced by InitializeInputs().
int Channel::defaultFreqTable [private] |
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.
1.5.5