ChannelUtil Class Reference

#include <channelutil.h>

List of all members.


Detailed Description

Collection of helper utilities for channel DB use.

Definition at line 66 of file channelutil.h.


Static Public Member Functions

static uint CreateMultiplex (int sourceid, QString sistandard, uint freq, QString modulation, int transport_id=-1, int network_id=-1)
static uint CreateMultiplex (int sourceid, QString sistandard, uint freq, QString modulation, int transport_id, int network_id, int symbol_rate, signed char bandwidth, signed char polarity, signed char inversion, signed char trans_mode, QString inner_FEC, QString constellation, signed char hierarchy, QString hp_code_rate, QString lp_code_rate, QString guard_interval)
static uint CreateMultiplex (uint sourceid, const DTVMultiplex &, int transport_id, int network_id)
static vector< uintCreateMultiplexes (int sourceid, const NetworkInformationTable *nit)
static uint GetMplexID (uint sourceid, const QString &channum)
static int GetMplexID (uint sourceid, uint frequency)
static int GetMplexID (uint sourceid, uint frequency, uint transport_id, uint network_id)
static int GetMplexID (uint sourceid, uint transport_id, uint network_id)
static uint GetMplexID (uint chanid)
static int GetBetterMplexID (int current_mplexid, int transport_id, int network_id)
 Returns best match multiplex ID, creating one if needed.
static bool GetTuningParams (uint mplexid, QString &modulation, uint64_t &frequency, uint &dvb_transportid, uint &dvb_networkid, QString &si_std)
static bool GetATSCChannel (uint sourceid, const QString &channum, uint &major, uint &minor)
static bool IsATSCChannel (uint sourceid, const QString &channum)
static int CreateChanID (uint sourceid, const QString &chan_num)
 Creates a unique channel ID for database use.
static bool CreateChannel (uint db_mplexid, uint db_sourceid, uint new_channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, bool hidden, bool hidden_in_guide, const QString &freqid, QString icon=QString::null, QString format="Default", QString xmltvid=QString::null, QString default_authority=QString::null)
static bool UpdateChannel (uint db_mplexid, uint source_id, uint channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, bool hidden, bool hidden_in_guide, QString freqid=QString::null, QString icon=QString::null, QString format=QString::null, QString xmltvid=QString::null, QString default_authority=QString::null)
static bool SetServiceVersion (int mplexid, int version)
static int GetChanID (int db_mplexid, int service_transport_id, int major_channel, int minor_channel, int program_number)
static int GetServiceVersion (int mplexid)
static vector< uintGetCardIDs (uint chanid)
static QString GetUnknownCallsign (void)
static uint FindChannel (uint sourceid, const QString &freqid)
static int GetChanID (uint sourceid, const QString &channum)
static bool GetChannelData (uint sourceid, const QString &channum, QString &tvformat, QString &modulation, QString &freqtable, QString &freqid, int &finetune, uint64_t &frequency, QString &dtv_si_std, int &mpeg_prog_num, uint &atsc_major, uint &atsc_minor, uint &dvb_transportid, uint &dvb_networkid, uint &mplexid, bool &commfree)
static bool GetChannelSettings (int chanid, bool &useonairguide, bool &hidden)
static uint GetSourceID (uint cardid, const QString &inputname)
static int GetProgramNumber (uint sourceid, const QString &channum)
static QString GetVideoFilters (uint sourceid, const QString &channum)
static DBChanList GetChannels (uint srcid, bool vis_only, QString grp="")
static void SortChannels (DBChanList &list, const QString &order, bool eliminate_duplicates=false)
static void EliminateDuplicateChanNum (DBChanList &list)
static uint GetNextChannel (const DBChanList &sorted, uint old_chanid, uint mplexid_restriction, int direction)
static QString GetChannelValueStr (const QString &channel_field, uint sourceid, const QString &channum)
static int GetChannelValueInt (const QString &channel_field, uint sourceid, const QString &channum)
static bool IsOnSameMultiplex (uint sourceid, const QString &new_channum, const QString &old_channum)
static QString GetChanNum (int chanid)
 Returns the channel-number string of the given channel.
static QString GetCallsign (int chanid)
 Returns the callsign of the given channel.
static QString GetServiceName (int chanid)
 Returns the service name of the given channel.
static int GetSourceID (int mplexid)
static uint GetSourceIDForChannel (uint chanid)
static int GetInputID (int sourceid, int cardid)
static bool SetChannelValue (const QString &field_name, QString value, uint sourceid, const QString &channum)

Static Private Member Functions

static QString GetChannelStringField (int chanid, const QString &field)
static QString GetChannelValueStr (const QString &channel_field, uint cardid, const QString &input, const QString &channum)
static int GetChannelValueInt (const QString &channel_field, uint cardid, const QString &input, const QString &channum)

Member Function Documentation

uint ChannelUtil::CreateMultiplex ( int  sourceid,
QString  sistandard,
uint  freq,
QString  modulation,
int  transport_id = -1,
int  network_id = -1 
) [static]

uint ChannelUtil::CreateMultiplex ( int  sourceid,
QString  sistandard,
uint  freq,
QString  modulation,
int  transport_id,
int  network_id,
int  symbol_rate,
signed char  bandwidth,
signed char  polarity,
signed char  inversion,
signed char  trans_mode,
QString  inner_FEC,
QString  constellation,
signed char  hierarchy,
QString  hp_code_rate,
QString  lp_code_rate,
QString  guard_interval 
) [static]

Definition at line 393 of file channelutil.cpp.

uint ChannelUtil::CreateMultiplex ( uint  sourceid,
const DTVMultiplex mux,
int  transport_id,
int  network_id 
) [static]

Definition at line 418 of file channelutil.cpp.

vector< uint > ChannelUtil::CreateMultiplexes ( int  sourceid,
const NetworkInformationTable nit 
) [static]

Definition at line 438 of file channelutil.cpp.

Referenced by SIScan::HandleNIT().

uint ChannelUtil::GetMplexID ( uint  sourceid,
const QString &  channum 
) [static]

int ChannelUtil::GetMplexID ( uint  sourceid,
uint  frequency 
) [static]

Definition at line 484 of file channelutil.cpp.

int ChannelUtil::GetMplexID ( uint  sourceid,
uint  frequency,
uint  transport_id,
uint  network_id 
) [static]

Definition at line 509 of file channelutil.cpp.

int ChannelUtil::GetMplexID ( uint  sourceid,
uint  transport_id,
uint  network_id 
) [static]

Definition at line 539 of file channelutil.cpp.

uint ChannelUtil::GetMplexID ( uint  chanid  )  [static]

Definition at line 567 of file channelutil.cpp.

int ChannelUtil::GetBetterMplexID ( int  current_mplexid,
int  transport_id,
int  network_id 
) [static]

Returns best match multiplex ID, creating one if needed.

First, see if you can get an exact match based on the current mplexid's sourceID and the NetworkID/TransportID.

Next, see if current one is NULL, if so update those values and return current mplexid.

Next, if values were set, see where you can find this NetworkID/TransportID. If we get an exact match just return it, since there is no question what mplexid this NetworkId/TransportId is for. If we get many matches, return CurrentMplexID.

Next, try to repeat query without currentmplexid as source id. If we get a singe match return it, if we get many matches we return the first one.

If none of these work return -1.

Returns:
mplexid on success, -1 on failure.

Definition at line 610 of file channelutil.cpp.

bool ChannelUtil::GetTuningParams ( uint  mplexid,
QString &  modulation,
uint64_t frequency,
uint dvb_transportid,
uint dvb_networkid,
QString &  si_std 
) [static]

bool ChannelUtil::GetATSCChannel ( uint  sourceid,
const QString &  channum,
uint major,
uint minor 
) [static]

Definition at line 1335 of file channelutil.cpp.

Referenced by TVRec::TuningOnSameMultiplex().

static bool ChannelUtil::IsATSCChannel ( uint  sourceid,
const QString &  channum 
) [inline, static]

Definition at line 113 of file channelutil.h.

int ChannelUtil::CreateChanID ( uint  sourceid,
const QString &  chan_num 
) [static]

Creates a unique channel ID for database use.

Returns:
chanid if successful, -1 if not

Definition at line 1102 of file channelutil.cpp.

Referenced by SIScan::HandleAllGood(), ChannelData::handleChannels(), IPTVChannelFetcher::RunScan(), update_channel_basic(), SIScan::UpdatePMTinDB(), SIScan::UpdateSDTinDB(), and SIScan::UpdateVCTinDB().

bool ChannelUtil::CreateChannel ( uint  db_mplexid,
uint  db_sourceid,
uint  new_channel_id,
const QString &  callsign,
const QString &  service_name,
const QString &  chan_num,
uint  service_id,
uint  atsc_major_channel,
uint  atsc_minor_channel,
bool  use_on_air_guide,
bool  hidden,
bool  hidden_in_guide,
const QString &  freqid,
QString  icon = QString::null,
QString  format = "Default",
QString  xmltvid = QString::null,
QString  default_authority = QString::null 
) [static]

bool ChannelUtil::UpdateChannel ( uint  db_mplexid,
uint  source_id,
uint  channel_id,
const QString &  callsign,
const QString &  service_name,
const QString &  chan_num,
uint  service_id,
uint  atsc_major_channel,
uint  atsc_minor_channel,
bool  use_on_air_guide,
bool  hidden,
bool  hidden_in_guide,
QString  freqid = QString::null,
QString  icon = QString::null,
QString  format = QString::null,
QString  xmltvid = QString::null,
QString  default_authority = QString::null 
) [static]

bool ChannelUtil::SetServiceVersion ( int  mplexid,
int  version 
) [static]

Definition at line 1296 of file channelutil.cpp.

Referenced by SIScan::UpdateSDTinDB().

int ChannelUtil::GetChanID ( int  db_mplexid,
int  service_transport_id,
int  major_channel,
int  minor_channel,
int  program_number 
) [static]

int ChannelUtil::GetServiceVersion ( int  mplexid  )  [static]

Definition at line 1313 of file channelutil.cpp.

Referenced by SIScan::UpdateSDTinDB().

static vector<uint> ChannelUtil::GetCardIDs ( uint  chanid  )  [static]

QString ChannelUtil::GetUnknownCallsign ( void   )  [static]

uint ChannelUtil::FindChannel ( uint  sourceid,
const QString &  freqid 
) [static]

Definition at line 1040 of file channelutil.cpp.

Referenced by SIScan::HandleAllGood().

static int ChannelUtil::GetChanID ( uint  sourceid,
const QString &  channum 
) [inline, static]

Definition at line 168 of file channelutil.h.

bool ChannelUtil::GetChannelData ( uint  sourceid,
const QString &  channum,
QString &  tvformat,
QString &  modulation,
QString &  freqtable,
QString &  freqid,
int &  finetune,
uint64_t frequency,
QString &  dtv_si_std,
int &  mpeg_prog_num,
uint atsc_major,
uint atsc_minor,
uint dvb_transportid,
uint dvb_networkid,
uint mplexid,
bool commfree 
) [static]

bool ChannelUtil::GetChannelSettings ( int  chanid,
bool useonairguide,
bool hidden 
) [static]

Definition at line 1425 of file channelutil.cpp.

Referenced by SIScan::UpdatePMTinDB(), and SIScan::UpdateSDTinDB().

static uint ChannelUtil::GetSourceID ( uint  cardid,
const QString &  inputname 
) [static]

static int ChannelUtil::GetProgramNumber ( uint  sourceid,
const QString &  channum 
) [inline, static]

Definition at line 182 of file channelutil.h.

Referenced by TVRec::TuningOnSameMultiplex().

static QString ChannelUtil::GetVideoFilters ( uint  sourceid,
const QString &  channum 
) [inline, static]

Definition at line 184 of file channelutil.h.

Referenced by TVRec::SetVideoFiltersForChannel().

DBChanList ChannelUtil::GetChannels ( uint  srcid,
bool  vis_only,
QString  grp = "" 
) [static]

void ChannelUtil::SortChannels ( DBChanList list,
const QString &  order,
bool  eliminate_duplicates = false 
) [static]

void ChannelUtil::EliminateDuplicateChanNum ( DBChanList list  )  [static]

Definition at line 1642 of file channelutil.cpp.

Referenced by ChannelBase::InitializeInputs().

uint ChannelUtil::GetNextChannel ( const DBChanList sorted,
uint  old_chanid,
uint  mplexid_restriction,
int  direction 
) [static]

Definition at line 1660 of file channelutil.cpp.

Referenced by ChannelBase::GetNextChannel(), and ChannelBase::Init().

QString ChannelUtil::GetChannelValueStr ( const QString &  channel_field,
uint  sourceid,
const QString &  channum 
) [static]

Definition at line 874 of file channelutil.cpp.

Referenced by GetChannelValueInt().

int ChannelUtil::GetChannelValueInt ( const QString &  channel_field,
uint  sourceid,
const QString &  channum 
) [static]

bool ChannelUtil::IsOnSameMultiplex ( uint  sourceid,
const QString &  new_channum,
const QString &  old_channum 
) [static]

Definition at line 928 of file channelutil.cpp.

Referenced by TVRec::TuningOnSameMultiplex().

QString ChannelUtil::GetChanNum ( int  chanid  )  [static]

Returns the channel-number string of the given channel.

Parameters:
chanid primary key for channel record

Definition at line 769 of file channelutil.cpp.

Referenced by DBox2Channel::EPGFinished(), DBox2Channel::RecorderAlive(), TVRec::TuningGetChanNum(), SIScan::UpdatePMTinDB(), SIScan::UpdateSDTinDB(), and SIScan::UpdateVCTinDB().

QString ChannelUtil::GetCallsign ( int  chanid  )  [static]

Returns the callsign of the given channel.

Parameters:
chanid primary key for channel record

Definition at line 774 of file channelutil.cpp.

Referenced by SIScan::UpdatePMTinDB(), and SIScan::UpdateVCTinDB().

QString ChannelUtil::GetServiceName ( int  chanid  )  [static]

Returns the service name of the given channel.

Parameters:
chanid primary key for channel record

Definition at line 779 of file channelutil.cpp.

Referenced by SIScan::UpdatePMTinDB().

int ChannelUtil::GetSourceID ( int  mplexid  )  [static]

Definition at line 784 of file channelutil.cpp.

uint ChannelUtil::GetSourceIDForChannel ( uint  chanid  )  [static]

Definition at line 806 of file channelutil.cpp.

Referenced by TV::IsTunable().

int ChannelUtil::GetInputID ( int  sourceid,
int  cardid 
) [static]

Definition at line 824 of file channelutil.cpp.

bool ChannelUtil::SetChannelValue ( const QString &  field_name,
QString  value,
uint  sourceid,
const QString &  channum 
) [static]

Definition at line 953 of file channelutil.cpp.

Referenced by Channel::ChangePictureAttribute().

QString ChannelUtil::GetChannelStringField ( int  chanid,
const QString &  field 
) [static, private]

Definition at line 749 of file channelutil.cpp.

Referenced by GetCallsign(), GetChanNum(), and GetServiceName().

QString ChannelUtil::GetChannelValueStr ( const QString &  channel_field,
uint  cardid,
const QString &  input,
const QString &  channum 
) [static, private]

Definition at line 842 of file channelutil.cpp.

int ChannelUtil::GetChannelValueInt ( const QString &  channel_field,
uint  cardid,
const QString &  input,
const QString &  channum 
) [static, private]

Definition at line 901 of file channelutil.cpp.


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