ChannelUtil Class Reference

Collection of helper utilities for channel DB use. More...

#include <channelutil.h>

List of all members.

Static Public Member Functions

static uint CreateMultiplex (int sourceid, QString sistandard, uint64_t frequency, QString modulation, int transport_id=-1, int network_id=-1)
static uint CreateMultiplex (int sourceid, QString sistandard, uint64_t frequency, 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, QString mod_sys, QString rolloff)
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, uint64_t frequency)
static int GetMplexID (uint sourceid, uint64_t 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 void UpdateInsertInfoFromDB (ChannelInsertInfo &chan)
static bool DeleteChannel (uint channel_id)
static bool SetVisible (uint channel_id, bool hidden)
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 QString GetDefaultAuthority (uint chanid)
 Returns the DVB default authority for the chanid given.
static QString GetIcon (uint chanid)
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 GetExtendedChannelData (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, bool &use_on_air_guide, bool &visible, QString &xmltvid, QString &default_authority, QString &icon)
static int GetProgramNumber (uint sourceid, const QString &channum)
static QString GetVideoFilters (uint sourceid, const QString &channum)
static DBChanList GetChannels (uint sourceid, bool visible_only, const QString &group_by=QString(), uint channel_groupid=0)
static DBChanList GetAllChannels (uint sourceid)
 Returns channels that are not connected to a capture card and channels that are not marked as visible.
static vector< uintGetChanIDs (int sourceid=-1)
static uint GetChannelCount (int sourceid=-1)
static void SortChannels (DBChanList &list, const QString &order, bool eliminate_duplicates=false)
static uint GetNextChannel (const DBChanList &sorted, uint old_chanid, uint mplexid_restriction, int direction, bool skip_non_visible=true, bool skip_same_channum_and_callsign=false)
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 QStringList GetValidRecorderList (uint chanid, const QString &channum)
static bool IsConflicting (const QString &channum, uint sourceid=0, uint excluded_chanid=0)
static vector< uintGetConflicting (const QString &channum, uint sourceid=0)
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 GetTimeOffset (int chanid)
 Returns the listings time offset in minutes for given channel.
static int GetSourceID (int mplexid)
static uint GetSourceIDForChannel (uint chanid)
static int GetInputID (int sourceid, int cardid)
static QStringList GetCardTypes (uint chandid)
static bool GetCachedPids (uint chanid, pid_cache_t &pid_cache)
 Returns cached MPEG PIDs when given a Channel ID.
static bool SetChannelValue (const QString &field_name, QString value, uint sourceid, const QString &channum)
static bool SetChannelValue (const QString &field_name, QString value, int chanid)
static bool SaveCachedPids (uint chanid, const pid_cache_t &pid_cache, bool delete_all=false)
 Saves PIDs for PSIP tables to database.

Static Public Attributes

static const QString kATSCSeparators = "(_|-|#|\\.)"

Static Private Member Functions

static DBChanList GetChannelsInternal (uint sourceid, bool visible_only, bool include_disconnected, const QString &group_by, uint channel_groupid)
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)

Detailed Description

Collection of helper utilities for channel DB use.

Definition at line 47 of file channelutil.h.


Member Function Documentation

uint ChannelUtil::CreateMultiplex ( int  sourceid,
QString  sistandard,
uint64_t  frequency,
QString  modulation,
int  transport_id = -1,
int  network_id = -1 
) [static]
uint ChannelUtil::CreateMultiplex ( int  sourceid,
QString  sistandard,
uint64_t  frequency,
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,
QString  mod_sys,
QString  rolloff 
) [static]

Definition at line 388 of file channelutil.cpp.

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

Definition at line 415 of file channelutil.cpp.

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

Definition at line 436 of file channelutil.cpp.

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

Definition at line 482 of file channelutil.cpp.

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

Definition at line 507 of file channelutil.cpp.

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

Definition at line 537 of file channelutil.cpp.

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

Definition at line 565 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 608 of file channelutil.cpp.

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

Definition at line 709 of file channelutil.cpp.

Referenced by GetChannelData(), GetExtendedChannelData(), and handle_transport_desc().

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

Definition at line 1802 of file channelutil.cpp.

Referenced by TVRec::TuningOnSameMultiplex().

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

Definition at line 95 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 1494 of file channelutil.cpp.

Referenced by ChannelScanSM::HandleAllGood(), ChannelData::handleChannels(), ChannelImporter::InsertChannels(), IPTVChannelFetcher::run(), and update_channel_basic().

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]
void ChannelUtil::UpdateInsertInfoFromDB ( ChannelInsertInfo chan  )  [static]

Definition at line 1697 of file channelutil.cpp.

Referenced by ChannelImporter::UpdateChannels().

bool ChannelUtil::DeleteChannel ( uint  channel_id  )  [static]
bool ChannelUtil::SetVisible ( uint  channel_id,
bool  hidden 
) [static]

Definition at line 1746 of file channelutil.cpp.

Referenced by ChannelImporter::DeleteChannels().

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

Definition at line 1765 of file channelutil.cpp.

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 1782 of file channelutil.cpp.

QString ChannelUtil::GetDefaultAuthority ( uint  chanid  )  [static]

Returns the DVB default authority for the chanid given.

Definition at line 1230 of file channelutil.cpp.

Referenced by EITFixUp::AddDVBEITAuthority().

QString ChannelUtil::GetIcon ( uint  chanid  )  [static]
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 1432 of file channelutil.cpp.

Referenced by ChannelScanSM::HandleAllGood().

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

Definition at line 157 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]

Definition at line 1829 of file channelutil.cpp.

Referenced by ChannelBase::IsTunable(), and DTVChannel::SetChannelByString().

bool ChannelUtil::GetExtendedChannelData ( 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,
bool use_on_air_guide,
bool visible,
QString &  xmltvid,
QString &  default_authority,
QString &  icon 
) [static]

Definition at line 1892 of file channelutil.cpp.

Referenced by Channel::GetChannelInfo(), and Channel::GetChannelInfoList().

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

Definition at line 180 of file channelutil.h.

Referenced by TVRec::TuningOnSameMultiplex().

static QString ChannelUtil::GetVideoFilters ( uint  sourceid,
const QString &  channum 
) [inline, static]
static DBChanList ChannelUtil::GetChannels ( uint  sourceid,
bool  visible_only,
const QString &  group_by = QString(),
uint  channel_groupid = 0 
) [inline, static]
static DBChanList ChannelUtil::GetAllChannels ( uint  sourceid  )  [inline, static]

Returns channels that are not connected to a capture card and channels that are not marked as visible.

Definition at line 194 of file channelutil.h.

Referenced by StartingChannel::SetSourceID().

vector< uint > ChannelUtil::GetChanIDs ( int  sourceid = -1  )  [static]
uint ChannelUtil::GetChannelCount ( int  sourceid = -1  )  [static]

Definition at line 2158 of file channelutil.cpp.

Referenced by ChannelImporter::Process().

void ChannelUtil::SortChannels ( DBChanList list,
const QString &  order,
bool  eliminate_duplicates = false 
) [static]
uint ChannelUtil::GetNextChannel ( const DBChanList sorted,
uint  old_chanid,
uint  mplexid_restriction,
int  direction,
bool  skip_non_visible = true,
bool  skip_same_channum_and_callsign = false 
) [static]
QString ChannelUtil::GetChannelValueStr ( const QString &  channel_field,
uint  sourceid,
const QString &  channum 
) [static]

Definition at line 995 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 1049 of file channelutil.cpp.

Referenced by TVRec::TuningOnSameMultiplex().

QStringList ChannelUtil::GetValidRecorderList ( uint  chanid,
const QString &  channum 
) [static]

Definition at line 1149 of file channelutil.cpp.

static bool ChannelUtil::IsConflicting ( const QString &  channum,
uint  sourceid = 0,
uint  excluded_chanid = 0 
) [inline, static]
vector< uint > ChannelUtil::GetConflicting ( const QString &  channum,
uint  sourceid = 0 
) [static]

Definition at line 1160 of file channelutil.cpp.

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 764 of file channelutil.cpp.

Referenced by TV::ChangeChannel(), ChannelImporter::DeleteChannels(), Channel::GetChannelInfo(), Channel::GetChannelInfoList(), TV::SwitchCards(), and TVRec::TuningGetChanNum().

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

Returns the callsign of the given channel.

Parameters:
chanid primary key for channel record

Definition at line 769 of file channelutil.cpp.

Referenced by Channel::GetChannelInfo(), and Channel::GetChannelInfoList().

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

Returns the service name of the given channel.

Parameters:
chanid primary key for channel record

Definition at line 774 of file channelutil.cpp.

Referenced by Channel::GetChannelInfo(), and Channel::GetChannelInfoList().

int ChannelUtil::GetTimeOffset ( int  chanid  )  [static]

Returns the listings time offset in minutes for given channel.

Parameters:
chanid primary key for channel record

Definition at line 779 of file channelutil.cpp.

Referenced by ProgramData::ClearDataByChannel().

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

Definition at line 784 of file channelutil.cpp.

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

Definition at line 822 of file channelutil.cpp.

QStringList ChannelUtil::GetCardTypes ( uint  chandid  )  [static]

Definition at line 840 of file channelutil.cpp.

Referenced by ChannelWizard::ChannelWizard().

bool ChannelUtil::GetCachedPids ( uint  chanid,
pid_cache_t pid_cache 
) [static]

Returns cached MPEG PIDs when given a Channel ID.

Parameters:
chanid Channel ID to fetch cached pids for.
pid_cache List of PIDs with their TableID types is returned in pid_cache.

Definition at line 874 of file channelutil.cpp.

Referenced by ChannelOptionsRawTS::Load(), and SaveCachedPids().

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

Definition at line 1213 of file channelutil.cpp.

bool ChannelUtil::SaveCachedPids ( uint  chanid,
const pid_cache_t _pid_cache,
bool  delete_all = false 
) [static]

Saves PIDs for PSIP tables to database.

Parameters:
chanid Channel ID to fetch cached pids for.
pid_cache List of PIDs with their TableID types to be saved.
delete_all If true delete both permanent and transient pids first.

Definition at line 905 of file channelutil.cpp.

Referenced by ChannelOptionsRawTS::Save().

DBChanList ChannelUtil::GetChannelsInternal ( uint  sourceid,
bool  visible_only,
bool  include_disconnected,
const QString &  group_by,
uint  channel_groupid 
) [static, private]

Definition at line 1966 of file channelutil.cpp.

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

Definition at line 744 of file channelutil.cpp.

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

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

Definition at line 963 of file channelutil.cpp.

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

Definition at line 1022 of file channelutil.cpp.


Member Data Documentation

const QString ChannelUtil::kATSCSeparators = "(_|-|#|\\.)" [static]

Definition at line 278 of file channelutil.h.

Referenced by GuideGrid::FindChannel(), and lt_smart().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:41:55 2012 for MythTV by  doxygen 1.6.3