MythTV
master
|
Collection of helper utilities for channel DB use. More...
#include <libmythtv/channelutil.h>
Public Types | |
enum | OrderBy : std::uint8_t { kChanOrderByChanNum, kChanOrderByName, kChanOrderByLiveTV } |
enum | GroupBy : std::uint8_t { kChanGroupByCallsign, kChanGroupByCallsignAndChannum, kChanGroupByChanid } |
Static Public Member Functions | |
static uint | CreateMultiplex (int sourceid, const QString &sistandard, uint64_t frequency, const QString &modulation, int transport_id=-1, int network_id=-1) |
static uint | CreateMultiplex (int sourceid, const QString &sistandard, uint64_t frequency, const QString &modulation, int transport_id, int network_id, int symbol_rate, signed char bandwidth, signed char polarity, signed char inversion, signed char trans_mode, const QString &inner_FEC, const QString &constellation, signed char hierarchy, const QString &hp_code_rate, const QString &lp_code_rate, const QString &guard_interval, const QString &mod_sys, const QString &rolloff) |
static uint | CreateMultiplex (uint sourceid, const DTVMultiplex &mux, int transport_id, int network_id) |
static std::vector< uint > | CreateMultiplexes (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. More... | |
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. More... | |
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, ChannelVisibleType visible, const QString &freqid, const QString &icon=QString(), QString format="Default", const QString &xmltvid=QString(), const QString &default_authority=QString(), uint service_type=0, int recpriority=0, int tmOffset=0, int commMethod=-1) |
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, ChannelVisibleType visible, const QString &freqid=QString(), const QString &icon=QString(), QString format=QString(), const QString &xmltvid=QString(), const QString &default_authority=QString(), uint service_type=0, int recpriority=INT_MIN, int tmOffset=INT_MIN, int commMethod=INT_MIN) |
static bool | CreateIPTVTuningData (uint channel_id, const IPTVTuningData &tuning) |
static bool | UpdateIPTVTuningData (uint channel_id, const IPTVTuningData &tuning) |
static void | UpdateInsertInfoFromDB (ChannelInsertInfo &chan) |
static void | UpdateChannelNumberFromDB (ChannelInsertInfo &chan) |
static bool | DeleteChannel (uint channel_id) |
static bool | SetVisible (uint channel_id, ChannelVisibleType visible) |
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. More... | |
static QString | GetIcon (uint chanid) |
static std::vector< uint > | GetInputIDs (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, uint &chanid, 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 int | GetProgramNumber (uint sourceid, const QString &channum) |
static QString | GetVideoFilters (uint sourceid, const QString &channum) |
static IPTVTuningData | GetIPTVTuningData (uint chanid) |
static ChannelInfoList | LoadChannels (uint startIndex, uint count, uint &totalAvailable, bool ignoreHidden=true, OrderBy orderBy=kChanOrderByChanNum, GroupBy groupBy=kChanGroupByChanid, uint sourceID=0, uint channelGroupID=0, bool liveTVOnly=false, const QString &callsign="", const QString &channum="", bool ignoreUntunable=true) |
Load channels from database into a list of ChannelInfo objects. More... | |
static ChannelInfoList | GetChannels (uint sourceid, bool visible_only, const QString &group_by=QString(), uint channel_groupid=0) |
static ChannelInfoList | GetAllChannels (uint sourceid) |
Returns channels that are not connected to an input and channels that are not marked as visible. More... | |
static std::vector< uint > | GetChanIDs (int sourceid=-1, bool onlyVisible=false) |
static uint | GetChannelCount (int sourceid=-1) |
static void | SortChannels (ChannelInfoList &list, const QString &order, bool eliminate_duplicates=false) |
static int | GetNearestChannel (const ChannelInfoList &list, const QString &channum) |
static uint | GetNextChannel (const ChannelInfoList &sorted, uint old_chanid, uint mplexid_restriction, uint chanid_restriction, ChannelChangeDirection direction, bool skip_non_visible=true, bool skip_same_channum_and_callsign=false, bool skip_other_sources=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 srcid, const QString &new_channum, const QString &old_channum) |
static QStringList | GetValidRecorderList (uint chanid, const QString &channum) |
Returns list of the recorders that have chanid or channum in their sources. More... | |
static bool | IsConflicting (const QString &channum, uint sourceid=0, uint excluded_chanid=0) |
static std::vector< uint > | GetConflicting (const QString &channum, uint sourceid=0) |
static QString | GetChanNum (int chan_id) |
Returns the channel-number string of the given channel. More... | |
static std::chrono::minutes | GetTimeOffset (int chan_id) |
Returns the listings time offset in minutes for given channel. More... | |
static int | GetSourceID (int mplexid) |
static uint | GetSourceIDForChannel (uint chanid) |
static QStringList | GetInputTypes (uint chanid) |
static bool | GetCachedPids (uint chanid, pid_cache_t &pid_cache) |
Returns cached MPEG PIDs when given a Channel ID. More... | |
static bool | SetChannelValue (const QString &field_name, const QString &value, uint sourceid, const QString &channum) |
static bool | SetChannelValue (const QString &field_name, const 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. More... | |
Static Public Attributes | |
static const QString | kATSCSeparators = "(_|-|#|\\.)" |
Private Member Functions | |
Q_DECLARE_TR_FUNCTIONS (ChannelUtil) | |
Static Private Member Functions | |
static ChannelInfoList | GetChannelsInternal (uint sourceid, bool visible_only, bool include_disconnected, const QString &group_by, uint channel_groupid) |
static QString | GetChannelStringField (int chan_id, const QString &field) |
Static Private Attributes | |
static QReadWriteLock | s_channelDefaultAuthorityMapLock |
static QMap< uint, QString > | s_channelDefaultAuthorityMap |
static bool | s_channelDefaultAuthority_runInit = true |
Friends | |
class | TestEITFixups |
Collection of helper utilities for channel DB use.
Definition at line 48 of file channelutil.h.
enum ChannelUtil::OrderBy : std::uint8_t |
Enumerator | |
---|---|
kChanOrderByChanNum | |
kChanOrderByName | |
kChanOrderByLiveTV |
Definition at line 206 of file channelutil.h.
enum ChannelUtil::GroupBy : std::uint8_t |
Enumerator | |
---|---|
kChanGroupByCallsign | |
kChanGroupByCallsignAndChannum | |
kChanGroupByChanid |
Definition at line 213 of file channelutil.h.
|
private |
|
static |
Definition at line 372 of file channelutil.cpp.
Referenced by handle_transport_desc(), ChannelData::handleChannels(), ChannelImporter::InsertChannels(), VBoxChannelFetcher::run(), HDHRChannelFetcher::run(), and ChannelImporter::UpdateChannels().
|
static |
Definition at line 389 of file channelutil.cpp.
|
static |
Definition at line 416 of file channelutil.cpp.
|
static |
Definition at line 437 of file channelutil.cpp.
Definition at line 462 of file channelutil.cpp.
Referenced by TransportScanItem::GetMultiplexIdFromDB(), handle_transport_desc(), TVRec::IsBusy(), IsOnSameMultiplex(), TV::IsTunableOn(), EITHelper::RescheduleRecordings(), EITScanner::run(), ScanWizard::SetPaneDefaults(), and EITScanner::StartEITEventProcessing().
|
static |
Definition at line 484 of file channelutil.cpp.
|
static |
Definition at line 509 of file channelutil.cpp.
Definition at line 539 of file channelutil.cpp.
Definition at line 567 of file channelutil.cpp.
|
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.
Definition at line 610 of file channelutil.cpp.
|
static |
Definition at line 721 of file channelutil.cpp.
Referenced by GetChannelData(), and handle_transport_desc().
|
static |
Definition at line 1876 of file channelutil.cpp.
Referenced by TVRec::TuningOnSameMultiplex().
Definition at line 100 of file channelutil.h.
|
static |
Creates a unique channel ID for database use.
Definition at line 1448 of file channelutil.cpp.
Referenced by ChannelScanSM::HandleAllGood(), ChannelData::handleChannels(), ChannelImporter::InsertChannels(), ExternRecChannelScanner::run(), VBoxChannelFetcher::run(), IPTVChannelFetcher::run(), and HDHRChannelFetcher::run().
|
static |
Definition at line 1485 of file channelutil.cpp.
Referenced by Channel::AddDBChannel(), V2Channel::AddDBChannel(), ChannelScanSM::HandleAllGood(), ChannelData::handleChannels(), ChannelImporter::InsertChannels(), ExternRecChannelScanner::run(), VBoxChannelFetcher::run(), IPTVChannelFetcher::run(), and HDHRChannelFetcher::run().
|
static |
Definition at line 1573 of file channelutil.cpp.
Referenced by ExternRecChannelScanner::run(), VBoxChannelFetcher::run(), IPTVChannelFetcher::run(), HDHRChannelFetcher::run(), ChannelImporter::UpdateChannels(), Channel::UpdateDBChannel(), and V2Channel::UpdateDBChannel().
|
inlinestatic |
Definition at line 155 of file channelutil.h.
Referenced by ChannelImporter::InsertChannels(), VBoxChannelFetcher::run(), IPTVChannelFetcher::run(), and HDHRChannelFetcher::run().
|
static |
Definition at line 1729 of file channelutil.cpp.
Referenced by VBoxChannelFetcher::run(), IPTVChannelFetcher::run(), and HDHRChannelFetcher::run().
|
static |
Definition at line 1690 of file channelutil.cpp.
Referenced by ChannelImporter::UpdateChannels().
|
static |
Definition at line 1664 of file channelutil.cpp.
Referenced by ChannelImporter::UpdateChannels().
Definition at line 1787 of file channelutil.cpp.
Referenced by ChannelEditor::customEvent(), ChannelImporter::DeleteChannels(), Channel::RemoveDBChannel(), V2Channel::RemoveDBChannel(), and ExternRecChannelScanner::run().
|
static |
Definition at line 1816 of file channelutil.cpp.
Referenced by ChannelImporter::DeleteChannels().
|
static |
Definition at line 1835 of file channelutil.cpp.
|
static |
Definition at line 1312 of file channelutil.cpp.
Referenced by get_chanid(), ChannelBase::GetNextChannel(), TVRec::GetProgramRingBufferForLiveTV(), ExternRecChannelScanner::run(), EITScanner::run(), VBoxChannelFetcher::run(), IPTVChannelFetcher::run(), HDHRChannelFetcher::run(), DTVChannel::SetChannelByString(), and TVRec::ToggleChannelFavorite().
|
static |
Definition at line 1854 of file channelutil.cpp.
|
static |
Returns the DVB default authority for the chanid given.
Definition at line 1179 of file channelutil.cpp.
Referenced by EITFixUp::AddDVBEITAuthority().
|
static |
Definition at line 1247 of file channelutil.cpp.
Referenced by Guide::GetChannelIcon(), V2Guide::GetChannelIcon(), PlayerContext::GetPlayingInfoMap(), TV::QuickRecord(), TVBrowseHelper::run(), and OSD::SetText().
|
static |
Definition at line 1307 of file channelutil.cpp.
Referenced by ChannelScanSM::HandleAllGood(), and update_info().
Definition at line 1385 of file channelutil.cpp.
Referenced by ChannelScanSM::HandleAllGood().
|
inlinestatic |
Definition at line 185 of file channelutil.h.
|
static |
Definition at line 1904 of file channelutil.cpp.
Referenced by ChannelBase::IsTunable(), DTVChannel::SetChannelByString(), and ExternalChannel::Tune().
|
inlinestatic |
Definition at line 197 of file channelutil.h.
Referenced by TVRec::TuningOnSameMultiplex().
|
inlinestatic |
Definition at line 199 of file channelutil.h.
Referenced by TVRec::SetVideoFiltersForChannel().
|
static |
Definition at line 2002 of file channelutil.cpp.
Referenced by DTVChannel::SetChannelByString().
|
static |
Load channels from database into a list of ChannelInfo objects.
Definition at line 2457 of file channelutil.cpp.
Referenced by ChannelData::channelList(), GuideGrid::fillChannelInfos(), Channel::GetChannelInfoList(), V2Channel::GetChannelInfoList(), Guide::GetProgramGuide(), V2Guide::GetProgramGuide(), and startTVNormal().
|
inlinestatic |
Definition at line 251 of file channelutil.h.
Referenced by TVBrowseHelper::BrowseInit(), ManualSchedule::Create(), ProgLister::FillViewList(), TV::InitFromDB(), ChannelBase::InitializeInput(), EditPowerSearchPopup::initLists(), GuideGrid::RunProgramGuide(), and TV::UpdateChannelList().
|
inlinestatic |
Returns channels that are not connected to an input and channels that are not marked as visible.
Definition at line 264 of file channelutil.h.
Referenced by StartingChannel::SetSourceID().
Definition at line 2179 of file channelutil.cpp.
Referenced by ProgramData::ClearDataBySource(), and ExternRecChannelScanner::run().
|
static |
Definition at line 2306 of file channelutil.cpp.
Referenced by ChannelImporter::Process().
|
static |
Definition at line 2325 of file channelutil.cpp.
Referenced by TVBrowseHelper::BrowseInit(), ManualSchedule::Create(), ProgLister::FillViewList(), TV::InitFromDB(), ChannelBase::InitializeInput(), EditPowerSearchPopup::initLists(), StartingChannel::SetSourceID(), and TV::UpdateChannelList().
|
static |
Definition at line 2358 of file channelutil.cpp.
Referenced by GuideGrid::FindChannel().
|
static |
Definition at line 2382 of file channelutil.cpp.
Referenced by TV::ChangeChannel(), ChannelBase::GetNextChannel(), TVBrowseHelper::GetNextProgramDB(), ChannelBase::Init(), and TVBrowseHelper::run().
|
static |
Definition at line 950 of file channelutil.cpp.
Referenced by GetChannelValueInt().
|
static |
Definition at line 978 of file channelutil.cpp.
Referenced by V4LChannel::ChangePictureAttribute(), V4LChannel::GetPictureAttribute(), and V4LChannel::InitPictureAttribute().
|
static |
Definition at line 991 of file channelutil.cpp.
Referenced by TVRec::TuningOnSameMultiplex().
|
static |
Returns list of the recorders that have chanid or channum in their sources.
chanid | Channel ID of channel we are querying recorders for. |
channum | Channel "number" we are querying recorders for. |
Definition at line 1092 of file channelutil.cpp.
Referenced by TV::ChangeChannel(), TV::HandleStateChange(), and TV::SwitchInputs().
|
inlinestatic |
Definition at line 299 of file channelutil.h.
Referenced by ChannelImporter::CheckChannelNumber(), ChannelImporter::ComputeSuggestedChannelNum(), ChannelImporter::InsertChannels(), and ChannelImporter::UpdateChannels().
|
static |
Definition at line 1103 of file channelutil.cpp.
|
static |
Returns the channel-number string of the given channel.
chanid | primary key for channel record |
Definition at line 777 of file channelutil.cpp.
Referenced by Dvr::AddRecordedProgram(), V2Dvr::AddRecordedProgram(), TV::ChangeChannel(), ChannelImporter::DeleteChannels(), ManualSchedule::recordClicked(), ExternRecChannelScanner::run(), TV::SwitchInputs(), and TVRec::TuningGetChanNum().
|
static |
Returns the listings time offset in minutes for given channel.
chanid | primary key for channel record |
Definition at line 782 of file channelutil.cpp.
Referenced by ProgramData::ClearDataByChannel().
|
static |
Definition at line 787 of file channelutil.cpp.
Definition at line 807 of file channelutil.cpp.
Referenced by ScheduleCommon::EditRecording(), TV::IsTunableOn(), TV::ITVRestart(), and ViewScheduleDiff::showStatus().
|
static |
Definition at line 825 of file channelutil.cpp.
Referenced by ChannelWizard::ChannelWizard().
|
static |
Returns cached MPEG PIDs when given a Channel ID.
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 858 of file channelutil.cpp.
Referenced by DTVChannel::GetCachedPids(), ChannelOptionsRawTS::Load(), SaveCachedPids(), and DTVChannel::SetChannelByString().
|
static |
Definition at line 1139 of file channelutil.cpp.
Referenced by V4LChannel::ChangePictureAttribute(), and ChannelImporter::DeleteChannels().
|
static |
Definition at line 1158 of file channelutil.cpp.
|
static |
Saves PIDs for PSIP tables to database.
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 891 of file channelutil.cpp.
Referenced by ChannelOptionsRawTS::Save(), and DTVChannel::SaveCachedPids().
|
staticprivate |
Definition at line 2078 of file channelutil.cpp.
|
staticprivate |
Definition at line 756 of file channelutil.cpp.
Referenced by GetChanNum(), and GetTimeOffset().
|
friend |
Definition at line 50 of file channelutil.h.
|
static |
Definition at line 342 of file channelutil.h.
Referenced by lt_smart().
|
staticprivate |
Definition at line 353 of file channelutil.h.
Referenced by GetDefaultAuthority().
|
staticprivate |
Definition at line 354 of file channelutil.h.
Referenced by GetDefaultAuthority().
Definition at line 355 of file channelutil.h.
Referenced by GetDefaultAuthority().