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>

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, ServiceRequirements service_requirements, bool success=false)
 
void Process (const ScanDTVTransportList &, 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 &) const
 Adds found channel info to transports list, returns channels in DB which were not found in scan in another transport list. More...
 
uint DeleteChannels (ScanDTVTransportList &)
 
uint DeleteUnusedTransports (uint sourceid)
 
void InsertChannels (const ScanDTVTransportList &, const ChannelImporterBasicStats &)
 
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)
 
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 CleanupDuplicates (ScanDTVTransportList &transports)
 
static QString ComputeSuggestedChannelNum (const ChannelInsertInfo &chan)
 Compute a suggested channel number based on various aspects of the channel information. More...
 
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)
 Format channel information into a simple string. More...
 
static QString FormatTransport (const ScanDTVTransport &transport)
 
static QString FormatTransports (const ScanDTVTransportList &transports_in)
 
static QString GetSummary (uint transport_count, 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_use_gui
 
bool m_is_interactive
 
bool m_do_delete
 
bool m_do_insert
 
bool m_do_save
 
bool m_fta_only
 Only FreeToAir (non-encrypted) channels desired post scan? More...
 
bool m_lcn_only
 Only services with logical channel numbers desired post scan? More...
 
bool m_complete_only
 Only services with complete scandata desired post scan? More...
 
bool m_keep_channel_numbers {true}
 Keep existing channel numbers on channel update. More...
 
bool m_full_channel_search {false}
 Full search for old channels. More...
 
bool m_success {false}
 To pass information IPTV channel scan succeeded. More...
 
ServiceRequirements m_service_requirements
 Services desired post scan. More...
 
QEventLoop m_eventLoop
 

Detailed Description

Definition at line 73 of file channelimporter.h.

Member Enumeration Documentation

◆ DeleteAction

Enumerator
kDeleteAll 
kDeleteManual 
kDeleteIgnoreAll 
kDeleteInvisibleAll 

Definition at line 99 of file channelimporter.h.

◆ InsertAction

Enumerator
kInsertAll 
kInsertManual 
kInsertIgnoreAll 

Definition at line 106 of file channelimporter.h.

◆ UpdateAction

Enumerator
kUpdateAll 
kUpdateManual 
kUpdateIgnoreAll 

Definition at line 112 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 119 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,
ServiceRequirements  service_requirements,
bool  success = false 
)
inline

Definition at line 78 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 164 of file channelimporter.cpp.

◆ CleanupDuplicates()

void ChannelImporter::CleanupDuplicates ( ScanDTVTransportList transports)
staticprotected

Definition at line 884 of file channelimporter.cpp.

◆ FilterServices()

void ChannelImporter::FilterServices ( ScanDTVTransportList transports) const
protected

Definition at line 936 of file channelimporter.cpp.

◆ 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 1019 of file channelimporter.cpp.

◆ DeleteChannels()

uint ChannelImporter::DeleteChannels ( ScanDTVTransportList transports)
protected

Definition at line 186 of file channelimporter.cpp.

◆ DeleteUnusedTransports()

uint ChannelImporter::DeleteUnusedTransports ( uint  sourceid)
protected

Definition at line 281 of file channelimporter.cpp.

◆ InsertChannels() [1/2]

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

Definition at line 335 of file channelimporter.cpp.

◆ InsertChannels() [2/2]

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

Definition at line 461 of file channelimporter.cpp.

◆ UpdateChannels()

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

Definition at line 707 of file channelimporter.cpp.

◆ QueryUserDelete()

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

For multiple channels.

Definition at line 1635 of file channelimporter.cpp.

◆ QueryUserInsert() [1/2]

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

For multiple channels.

Definition at line 1710 of file channelimporter.cpp.

◆ QueryUserUpdate()

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

For multiple channels.

Definition at line 1779 of file channelimporter.cpp.

◆ QueryUserResolve()

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

For a single channel.

Definition at line 1986 of file channelimporter.cpp.

◆ QueryUserInsert() [2/2]

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

For a single channel.

Definition at line 2064 of file channelimporter.cpp.

◆ ComputeSuggestedChannelNum()

QString ChannelImporter::ComputeSuggestedChannelNum ( const ChannelInsertInfo chan)
staticprotected

Compute a suggested channel number based on various aspects of the channel information.

Check to see if this channel number conflicts with an existing channel number. If so, 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 1565 of file channelimporter.cpp.

◆ ShowManualChannelPopup()

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

Definition at line 1846 of file channelimporter.cpp.

◆ ShowResolveChannelPopup()

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

Definition at line 1915 of file channelimporter.cpp.

◆ FixUpOpenCable()

void ChannelImporter::FixUpOpenCable ( ScanDTVTransportList transports)
staticprotected

Definition at line 1161 of file channelimporter.cpp.

◆ CollectStats()

ChannelImporterBasicStats ChannelImporter::CollectStats ( const ScanDTVTransportList transports)
staticprotected

Definition at line 1178 of file channelimporter.cpp.

◆ CollectUniquenessStats()

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

Definition at line 1217 of file channelimporter.cpp.

◆ FormatChannels()

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

Definition at line 1380 of file channelimporter.cpp.

◆ FormatChannel()

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

Definition at line 1254 of file channelimporter.cpp.

◆ 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 1334 of file channelimporter.cpp.

◆ FormatTransport()

QString ChannelImporter::FormatTransport ( const ScanDTVTransport transport)
staticprotected

Definition at line 1405 of file channelimporter.cpp.

◆ FormatTransports()

QString ChannelImporter::FormatTransports ( const ScanDTVTransportList transports_in)
staticprotected

Definition at line 1414 of file channelimporter.cpp.

◆ GetSummary()

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

Definition at line 1436 of file channelimporter.cpp.

◆ IsType()

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

Definition at line 1466 of file channelimporter.cpp.

◆ CountChannels()

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

Definition at line 1521 of file channelimporter.cpp.

◆ SimpleCountChannels()

int ChannelImporter::SimpleCountChannels ( const ScanDTVTransportList transports)
staticprotected

Definition at line 1543 of file channelimporter.cpp.

◆ CheckChannelNumber()

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

Definition at line 2148 of file channelimporter.cpp.

◆ AddChanToCopy()

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

Definition at line 870 of file channelimporter.cpp.

Member Data Documentation

◆ m_use_gui

bool ChannelImporter::m_use_gui
private

Definition at line 255 of file channelimporter.h.

◆ m_is_interactive

bool ChannelImporter::m_is_interactive
private

Definition at line 256 of file channelimporter.h.

◆ m_do_delete

bool ChannelImporter::m_do_delete
private

Definition at line 257 of file channelimporter.h.

◆ m_do_insert

bool ChannelImporter::m_do_insert
private

Definition at line 258 of file channelimporter.h.

◆ m_do_save

bool ChannelImporter::m_do_save
private

Definition at line 259 of file channelimporter.h.

◆ m_fta_only

bool ChannelImporter::m_fta_only
private

Only FreeToAir (non-encrypted) channels desired post scan?

Definition at line 261 of file channelimporter.h.

◆ m_lcn_only

bool ChannelImporter::m_lcn_only
private

Only services with logical channel numbers desired post scan?

Definition at line 263 of file channelimporter.h.

◆ m_complete_only

bool ChannelImporter::m_complete_only
private

Only services with complete scandata desired post scan?

Definition at line 265 of file channelimporter.h.

◆ m_keep_channel_numbers

bool ChannelImporter::m_keep_channel_numbers {true}
private

Keep existing channel numbers on channel update.

Definition at line 267 of file channelimporter.h.

◆ m_full_channel_search

bool ChannelImporter::m_full_channel_search {false}
private

Full search for old channels.

Definition at line 269 of file channelimporter.h.

◆ m_success

bool ChannelImporter::m_success {false}
private

To pass information IPTV channel scan succeeded.

Definition at line 271 of file channelimporter.h.

◆ m_service_requirements

ServiceRequirements ChannelImporter::m_service_requirements
private

Services desired post scan.

Definition at line 273 of file channelimporter.h.

◆ m_eventLoop

QEventLoop ChannelImporter::m_eventLoop
private

Definition at line 275 of file channelimporter.h.


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