MythTV  master
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
ChannelImporter Class Reference

#include <channelimporter.h>

Inheritance diagram for ChannelImporter:
Inheritance graph
[legend]
Collaboration diagram for ChannelImporter:
Collaboration graph
[legend]

Public Member Functions

 ChannelImporter (bool gui, bool interactive, bool _delete, bool insert, bool save, bool fta_only, bool lcn_only, bool complete_only, bool full_channel_search, bool remove_duplicates, ServiceRequirements service_requirements, bool success=false)
 
void Process (const ScanDTVTransportList &_transports, int sourceid=-1)
 

Protected Types

enum  DeleteAction { kDeleteAll, kDeleteManual, kDeleteIgnoreAll, kDeleteInvisibleAll }
 
enum  InsertAction { kInsertAll, kInsertManual, kInsertIgnoreAll }
 
enum  UpdateAction { kUpdateAll, kUpdateManual, kUpdateIgnoreAll }
 
enum  ChannelType {
  kChannelTypeFirst = 0, kChannelTypeNonConflictingFirst = kChannelTypeFirst, kATSCNonConflicting = kChannelTypeFirst, kDVBNonConflicting,
  kSCTENonConflicting, kMPEGNonConflicting, kNTSCNonConflicting, kChannelTypeNonConflictingLast = kNTSCNonConflicting,
  kChannelTypeConflictingFirst, kATSCConflicting = kChannelTypeConflictingFirst, kDVBConflicting, kSCTEConflicting,
  kMPEGConflicting, kNTSCConflicting, kChannelTypeConflictingLast = kNTSCConflicting, kChannelTypeLast = kChannelTypeConflictingLast
}
 

Protected Member Functions

void FilterServices (ScanDTVTransportList &transports) const
 
ScanDTVTransportList GetDBTransports (uint sourceid, ScanDTVTransportList &transports) const
 Adds found channel info to transports list, returns channels in DB which were not found in scan in another transport list. This can be the same transport if e.g. one channel is in the DB but not in the scan, but it can also contain transports that are not found in the scan. More...
 
uint DeleteChannels (ScanDTVTransportList &transports)
 
uint DeleteUnusedTransports (uint sourceid)
 
void InsertChannels (const ScanDTVTransportList &transports, const ChannelImporterBasicStats &info)
 
ScanDTVTransportList InsertChannels (const ScanDTVTransportList &transports, const ChannelImporterBasicStats &info, InsertAction action, ChannelType type, ScanDTVTransportList &inserted, ScanDTVTransportList &skipped)
 
ScanDTVTransportList UpdateChannels (const ScanDTVTransportList &transports, const ChannelImporterBasicStats &info, UpdateAction action, ChannelType type, ScanDTVTransportList &updated, ScanDTVTransportList &skipped) const
 
DeleteAction QueryUserDelete (const QString &msg)
 For multiple channels. More...
 
InsertAction QueryUserInsert (const QString &msg)
 For multiple channels. More...
 
UpdateAction QueryUserUpdate (const QString &msg)
 For multiple channels. More...
 
OkCancelType QueryUserResolve (const ScanDTVTransport &transport, ChannelInsertInfo &chan)
 For a single channel. More...
 
OkCancelType QueryUserInsert (const ScanDTVTransport &transport, ChannelInsertInfo &chan)
 For a single channel. More...
 
OkCancelType ShowManualChannelPopup (MythMainWindow *parent, const QString &title, const QString &message, QString &text)
 
OkCancelType ShowResolveChannelPopup (MythMainWindow *parent, const QString &title, const QString &message, QString &text)
 

Static Protected Member Functions

static QString toString (ChannelType type)
 
static void MergeSameFrequency (ScanDTVTransportList &transports)
 
static void RemoveDuplicates (ScanDTVTransportList &transports, ScanDTVTransportList &duplicates)
 
static void FilterRelocatedServices (ScanDTVTransportList &transports)
 
static QString ComputeSuggestedChannelNum (const ChannelInsertInfo &chan)
 
static void FixUpOpenCable (ScanDTVTransportList &transports)
 
static ChannelImporterBasicStats CollectStats (const ScanDTVTransportList &transports)
 
static ChannelImporterUniquenessStats CollectUniquenessStats (const ScanDTVTransportList &transports, const ChannelImporterBasicStats &info)
 
static QString FormatChannels (const ScanDTVTransportList &transports, const ChannelImporterBasicStats *info=nullptr)
 
static QString FormatChannel (const ScanDTVTransport &transport, const ChannelInsertInfo &chan, const ChannelImporterBasicStats *info=nullptr)
 
static QString SimpleFormatChannel (const ScanDTVTransport &transport, const ChannelInsertInfo &chan)
 
static QString FormatTransport (const ScanDTVTransport &transport)
 
static QString FormatTransports (const ScanDTVTransportList &transports_in)
 
static QString GetSummary (const ChannelImporterBasicStats &info, const ChannelImporterUniquenessStats &stats)
 
static bool IsType (const ChannelImporterBasicStats &info, const ChannelInsertInfo &chan, ChannelType type)
 
static void CountChannels (const ScanDTVTransportList &transports, const ChannelImporterBasicStats &info, ChannelType type, uint &new_chan, uint &old_chan)
 
static int SimpleCountChannels (const ScanDTVTransportList &transports)
 
static bool CheckChannelNumber (const QString &num, const ChannelInsertInfo &chan)
 
static void AddChanToCopy (ScanDTVTransport &transport_copy, const ScanDTVTransport &transport, const ChannelInsertInfo &chan)
 

Private Attributes

bool m_useGui
 
bool m_isInteractive
 
bool m_doDelete
 
bool m_doInsert
 
bool m_doSave
 
bool m_ftaOnly {true}
 
bool m_lcnOnly {false}
 
bool m_completeOnly {true}
 
bool m_keepChannelNumbers {true}
 
bool m_fullChannelSearch {false}
 
bool m_removeDuplicates {false}
 
bool m_success {false}
 
int m_functorRetval {0}
 
ServiceRequirements m_serviceRequirements
 
QEventLoop m_eventLoop
 

Detailed Description

Definition at line 69 of file channelimporter.h.

Member Enumeration Documentation

◆ DeleteAction

Enumerator
kDeleteAll 
kDeleteManual 
kDeleteIgnoreAll 
kDeleteInvisibleAll 

Definition at line 97 of file channelimporter.h.

◆ InsertAction

Enumerator
kInsertAll 
kInsertManual 
kInsertIgnoreAll 

Definition at line 104 of file channelimporter.h.

◆ UpdateAction

Enumerator
kUpdateAll 
kUpdateManual 
kUpdateIgnoreAll 

Definition at line 110 of file channelimporter.h.

◆ ChannelType

Enumerator
kChannelTypeFirst 
kChannelTypeNonConflictingFirst 
kATSCNonConflicting 
kDVBNonConflicting 
kSCTENonConflicting 
kMPEGNonConflicting 
kNTSCNonConflicting 
kChannelTypeNonConflictingLast 
kChannelTypeConflictingFirst 
kATSCConflicting 
kDVBConflicting 
kSCTEConflicting 
kMPEGConflicting 
kNTSCConflicting 
kChannelTypeConflictingLast 
kChannelTypeLast 

Definition at line 117 of file channelimporter.h.

Constructor & Destructor Documentation

◆ ChannelImporter()

ChannelImporter::ChannelImporter ( bool  gui,
bool  interactive,
bool  _delete,
bool  insert,
bool  save,
bool  fta_only,
bool  lcn_only,
bool  complete_only,
bool  full_channel_search,
bool  remove_duplicates,
ServiceRequirements  service_requirements,
bool  success = false 
)
inline

Definition at line 74 of file channelimporter.h.

Member Function Documentation

◆ Process()

void ChannelImporter::Process ( const ScanDTVTransportList _transports,
int  sourceid = -1 
)

◆ toString()

QString ChannelImporter::toString ( ChannelType  type)
staticprotected

Definition at line 215 of file channelimporter.cpp.

Referenced by InsertChannels().

◆ MergeSameFrequency()

void ChannelImporter::MergeSameFrequency ( ScanDTVTransportList transports)
staticprotected

Definition at line 879 of file channelimporter.cpp.

Referenced by Process().

◆ RemoveDuplicates()

void ChannelImporter::RemoveDuplicates ( ScanDTVTransportList transports,
ScanDTVTransportList duplicates 
)
staticprotected

Definition at line 942 of file channelimporter.cpp.

Referenced by Process().

◆ FilterServices()

void ChannelImporter::FilterServices ( ScanDTVTransportList transports) const
protected

Definition at line 1006 of file channelimporter.cpp.

Referenced by Process().

◆ FilterRelocatedServices()

void ChannelImporter::FilterRelocatedServices ( ScanDTVTransportList transports)
staticprotected

Definition at line 1082 of file channelimporter.cpp.

Referenced by Process().

◆ GetDBTransports()

ScanDTVTransportList ChannelImporter::GetDBTransports ( uint  sourceid,
ScanDTVTransportList transports 
) const
protected

Adds found channel info to transports list, returns channels in DB which were not found in scan in another transport list. This can be the same transport if e.g. one channel is in the DB but not in the scan, but it can also contain transports that are not found in the scan.

Definition at line 1125 of file channelimporter.cpp.

Referenced by Process().

◆ DeleteChannels()

uint ChannelImporter::DeleteChannels ( ScanDTVTransportList transports)
protected

Definition at line 237 of file channelimporter.cpp.

Referenced by Process().

◆ DeleteUnusedTransports()

uint ChannelImporter::DeleteUnusedTransports ( uint  sourceid)
protected

Definition at line 334 of file channelimporter.cpp.

Referenced by Process().

◆ InsertChannels() [1/2]

void ChannelImporter::InsertChannels ( const ScanDTVTransportList transports,
const ChannelImporterBasicStats info 
)
protected

Definition at line 388 of file channelimporter.cpp.

Referenced by Process().

◆ InsertChannels() [2/2]

ScanDTVTransportList ChannelImporter::InsertChannels ( const ScanDTVTransportList transports,
const ChannelImporterBasicStats info,
InsertAction  action,
ChannelType  type,
ScanDTVTransportList inserted,
ScanDTVTransportList skipped 
)
protected

Definition at line 524 of file channelimporter.cpp.

◆ UpdateChannels()

ScanDTVTransportList ChannelImporter::UpdateChannels ( const ScanDTVTransportList transports,
const ChannelImporterBasicStats info,
UpdateAction  action,
ChannelType  type,
ScanDTVTransportList updated,
ScanDTVTransportList skipped 
) const
protected

Definition at line 726 of file channelimporter.cpp.

Referenced by InsertChannels().

◆ QueryUserDelete()

ChannelImporter::DeleteAction ChannelImporter::QueryUserDelete ( const QString &  msg)
protected

For multiple channels.

Definition at line 1730 of file channelimporter.cpp.

Referenced by DeleteChannels(), and DeleteUnusedTransports().

◆ QueryUserInsert() [1/2]

ChannelImporter::InsertAction ChannelImporter::QueryUserInsert ( const QString &  msg)
protected

For multiple channels.

Definition at line 1806 of file channelimporter.cpp.

Referenced by InsertChannels().

◆ QueryUserUpdate()

ChannelImporter::UpdateAction ChannelImporter::QueryUserUpdate ( const QString &  msg)
protected

For multiple channels.

Definition at line 1879 of file channelimporter.cpp.

Referenced by InsertChannels().

◆ QueryUserResolve()

OkCancelType ChannelImporter::QueryUserResolve ( const ScanDTVTransport transport,
ChannelInsertInfo chan 
)
protected

For a single channel.

Definition at line 2091 of file channelimporter.cpp.

Referenced by InsertChannels().

◆ QueryUserInsert() [2/2]

OkCancelType ChannelImporter::QueryUserInsert ( const ScanDTVTransport transport,
ChannelInsertInfo chan 
)
protected

For a single channel.

Definition at line 2169 of file channelimporter.cpp.

◆ ComputeSuggestedChannelNum()

QString ChannelImporter::ComputeSuggestedChannelNum ( const ChannelInsertInfo chan)
staticprotected

Compute a suggested channel number that is unique in the video source. Check first to see if the existing channel number conflicts with an existing channel number. If so, try adding a suffix starting with 'A' to make the number unique while still being recognizable. For instance, the second "7-2" channel will be called "7-2A". If this fails then fall back to incrementing a per-source number to find an unused value.

Parameters
chanInfo describing a channel
Returns
Returns a simple name for the channel.

Definition at line 1696 of file channelimporter.cpp.

Referenced by InsertChannels(), QueryUserInsert(), and QueryUserResolve().

◆ ShowManualChannelPopup()

OkCancelType ChannelImporter::ShowManualChannelPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
QString &  text 
)
protected

Definition at line 1949 of file channelimporter.cpp.

Referenced by QueryUserInsert().

◆ ShowResolveChannelPopup()

OkCancelType ChannelImporter::ShowResolveChannelPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
QString &  text 
)
protected

Definition at line 2019 of file channelimporter.cpp.

Referenced by QueryUserResolve().

◆ FixUpOpenCable()

void ChannelImporter::FixUpOpenCable ( ScanDTVTransportList transports)
staticprotected

Definition at line 1275 of file channelimporter.cpp.

Referenced by Process().

◆ CollectStats()

ChannelImporterBasicStats ChannelImporter::CollectStats ( const ScanDTVTransportList transports)
staticprotected

Definition at line 1291 of file channelimporter.cpp.

Referenced by DeleteChannels(), InsertChannels(), and Process().

◆ CollectUniquenessStats()

ChannelImporterUniquenessStats ChannelImporter::CollectUniquenessStats ( const ScanDTVTransportList transports,
const ChannelImporterBasicStats info 
)
staticprotected

Definition at line 1329 of file channelimporter.cpp.

Referenced by InsertChannels(), and Process().

◆ FormatChannels()

QString ChannelImporter::FormatChannels ( const ScanDTVTransportList transports,
const ChannelImporterBasicStats info = nullptr 
)
staticprotected

Definition at line 1505 of file channelimporter.cpp.

Referenced by DeleteChannels(), InsertChannels(), and Process().

◆ FormatChannel()

QString ChannelImporter::FormatChannel ( const ScanDTVTransport transport,
const ChannelInsertInfo chan,
const ChannelImporterBasicStats info = nullptr 
)
staticprotected

Definition at line 1365 of file channelimporter.cpp.

Referenced by FilterRelocatedServices(), FilterServices(), and FormatChannels().

◆ SimpleFormatChannel()

QString ChannelImporter::SimpleFormatChannel ( const ScanDTVTransport transport,
const ChannelInsertInfo chan 
)
staticprotected

Format channel information into a simple string. The format of this string will depend on the type of standard used for the channels (atsc/scte/opencable/dvb).

Parameters
transportUnused.
chanInfo describing a channel
Returns
Returns a simple name for the channel.

Definition at line 1448 of file channelimporter.cpp.

Referenced by QueryUserInsert(), and QueryUserResolve().

◆ FormatTransport()

QString ChannelImporter::FormatTransport ( const ScanDTVTransport transport)
staticprotected

Definition at line 1533 of file channelimporter.cpp.

Referenced by FormatTransports(), MergeSameFrequency(), and RemoveDuplicates().

◆ FormatTransports()

QString ChannelImporter::FormatTransports ( const ScanDTVTransportList transports_in)
staticprotected

Definition at line 1545 of file channelimporter.cpp.

Referenced by InsertChannels(), and Process().

◆ GetSummary()

QString ChannelImporter::GetSummary ( const ChannelImporterBasicStats info,
const ChannelImporterUniquenessStats stats 
)
staticprotected

Definition at line 1565 of file channelimporter.cpp.

Referenced by InsertChannels(), and Process().

◆ IsType()

bool ChannelImporter::IsType ( const ChannelImporterBasicStats info,
const ChannelInsertInfo chan,
ChannelType  type 
)
staticprotected

Definition at line 1597 of file channelimporter.cpp.

Referenced by CountChannels(), InsertChannels(), and UpdateChannels().

◆ CountChannels()

void ChannelImporter::CountChannels ( const ScanDTVTransportList transports,
const ChannelImporterBasicStats info,
ChannelType  type,
uint new_chan,
uint old_chan 
)
staticprotected

Definition at line 1652 of file channelimporter.cpp.

Referenced by InsertChannels().

◆ SimpleCountChannels()

int ChannelImporter::SimpleCountChannels ( const ScanDTVTransportList transports)
staticprotected

Definition at line 1673 of file channelimporter.cpp.

Referenced by DeleteChannels(), InsertChannels(), and Process().

◆ CheckChannelNumber()

bool ChannelImporter::CheckChannelNumber ( const QString &  num,
const ChannelInsertInfo chan 
)
staticprotected

Definition at line 2253 of file channelimporter.cpp.

Referenced by InsertChannels(), QueryUserInsert(), and QueryUserResolve().

◆ AddChanToCopy()

void ChannelImporter::AddChanToCopy ( ScanDTVTransport transport_copy,
const ScanDTVTransport transport,
const ChannelInsertInfo chan 
)
staticprotected

Definition at line 860 of file channelimporter.cpp.

Referenced by DeleteChannels(), InsertChannels(), and UpdateChannels().

Member Data Documentation

◆ m_useGui

bool ChannelImporter::m_useGui
private

◆ m_isInteractive

bool ChannelImporter::m_isInteractive
private

◆ m_doDelete

bool ChannelImporter::m_doDelete
private

Definition at line 257 of file channelimporter.h.

Referenced by Process().

◆ m_doInsert

bool ChannelImporter::m_doInsert
private

Definition at line 258 of file channelimporter.h.

Referenced by Process().

◆ m_doSave

bool ChannelImporter::m_doSave
private

Definition at line 259 of file channelimporter.h.

Referenced by Process().

◆ m_ftaOnly

bool ChannelImporter::m_ftaOnly {true}
private

Definition at line 260 of file channelimporter.h.

Referenced by FilterServices(), and Process().

◆ m_lcnOnly

bool ChannelImporter::m_lcnOnly {false}
private

Definition at line 261 of file channelimporter.h.

Referenced by FilterServices(), and Process().

◆ m_completeOnly

bool ChannelImporter::m_completeOnly {true}
private

Definition at line 262 of file channelimporter.h.

Referenced by FilterServices(), and Process().

◆ m_keepChannelNumbers

bool ChannelImporter::m_keepChannelNumbers {true}
private

Definition at line 263 of file channelimporter.h.

Referenced by UpdateChannels().

◆ m_fullChannelSearch

bool ChannelImporter::m_fullChannelSearch {false}
private

Definition at line 264 of file channelimporter.h.

Referenced by GetDBTransports(), and Process().

◆ m_removeDuplicates

bool ChannelImporter::m_removeDuplicates {false}
private

Definition at line 265 of file channelimporter.h.

Referenced by Process().

◆ m_success

bool ChannelImporter::m_success {false}
private

Definition at line 266 of file channelimporter.h.

Referenced by Process().

◆ m_functorRetval

int ChannelImporter::m_functorRetval {0}
private

◆ m_serviceRequirements

ServiceRequirements ChannelImporter::m_serviceRequirements
private

Definition at line 269 of file channelimporter.h.

Referenced by FilterServices(), and Process().

◆ m_eventLoop

QEventLoop ChannelImporter::m_eventLoop
private

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