diff --git a/mythtv/libs/libmythtv/channelscan/channelimporter.cpp b/mythtv/libs/libmythtv/channelscan/channelimporter.cpp
index 0553d149ee..a597f3e470 100644
a
|
b
|
|
6 | 6 | * |
7 | 7 | */ |
8 | 8 | |
9 | | #include <QTextStream> |
| 9 | // C++ includes |
10 | 10 | #include <iostream> |
11 | 11 | #include <utility> |
12 | 12 | |
| 13 | // Qt includes |
| 14 | #include <QTextStream> |
| 15 | |
13 | 16 | using namespace std; |
14 | 17 | |
15 | 18 | // MythTV headers |
… |
… |
void ChannelImporter::Process(const ScanDTVTransportList &_transports, |
79 | 82 | |
80 | 83 | FilterServices(transports); |
81 | 84 | |
| 85 | if (m_lcn_only) |
| 86 | FilterChannelNumber(transports); |
| 87 | |
82 | 88 | // Pull in DB info |
83 | 89 | sourceid = transports[0].m_channels[0].m_source_id; |
84 | 90 | ScanDTVTransportList db_trans = GetDBTransports(sourceid, transports); |
… |
… |
void ChannelImporter::FilterServices(ScanDTVTransportList &transports) const |
824 | 830 | } |
825 | 831 | } |
826 | 832 | |
| 833 | // Remove the channels that do not have a logical channel number |
| 834 | void ChannelImporter::FilterChannelNumber(ScanDTVTransportList &transports) const |
| 835 | { |
| 836 | for (size_t i = 0; i < transports.size(); ++i) |
| 837 | { |
| 838 | ChannelInsertInfoList filtered; |
| 839 | for (size_t k = 0; k < transports[i].m_channels.size(); ++k) |
| 840 | { |
| 841 | if (transports[i].m_channels[k].m_chan_num.isEmpty()) |
| 842 | { |
| 843 | QString msg = FormatChannel(transports[i], transports[i].m_channels[k]); |
| 844 | LOG(VB_GENERAL, LOG_DEBUG, QString("No LCN: %1").arg(msg)); |
| 845 | continue; |
| 846 | } |
| 847 | filtered.push_back(transports[i].m_channels[k]); |
| 848 | } |
| 849 | transports[i].m_channels = filtered; |
| 850 | } |
| 851 | } |
| 852 | |
827 | 853 | /** \fn ChannelImporter::GetDBTransports(uint,ScanDTVTransportList&) const |
828 | 854 | * \brief Adds found channel info to transports list, |
829 | 855 | * returns channels in DB which were not found in scan |
diff --git a/mythtv/libs/libmythtv/channelscan/channelimporter.h b/mythtv/libs/libmythtv/channelscan/channelimporter.h
index dbb3097c4e..171757280e 100644
a
|
b
|
class MTV_PUBLIC ChannelImporter |
76 | 76 | public: |
77 | 77 | ChannelImporter(bool gui, bool interactive, |
78 | 78 | bool _delete, bool insert, bool save, |
79 | | bool fta_only, ServiceRequirements service_requirements, |
| 79 | bool fta_only, bool lcn_only, |
| 80 | ServiceRequirements service_requirements, |
80 | 81 | bool success = false) : |
81 | | m_use_gui(gui), m_is_interactive(interactive), |
| 82 | m_use_gui(gui), |
| 83 | m_is_interactive(interactive), |
82 | 84 | m_do_delete(_delete), |
83 | | m_do_insert(insert), m_do_save(save), m_fta_only(fta_only), |
| 85 | m_do_insert(insert), |
| 86 | m_do_save(save), |
| 87 | m_fta_only(fta_only), |
| 88 | m_lcn_only(lcn_only), |
84 | 89 | m_success(success), |
85 | 90 | m_service_requirements(service_requirements) { } |
86 | 91 | |
… |
… |
class MTV_PUBLIC ChannelImporter |
133 | 138 | |
134 | 139 | void CleanupDuplicates(ScanDTVTransportList &transports) const; |
135 | 140 | void FilterServices(ScanDTVTransportList &transports) const; |
| 141 | void FilterChannelNumber(ScanDTVTransportList &transports) const; |
136 | 142 | ScanDTVTransportList GetDBTransports( |
137 | 143 | uint sourceid, ScanDTVTransportList&) const; |
138 | 144 | |
… |
… |
class MTV_PUBLIC ChannelImporter |
228 | 234 | bool m_do_save; |
229 | 235 | /// Only FreeToAir (non-encrypted) channels desired post scan? |
230 | 236 | bool m_fta_only; |
| 237 | /// Only services with logical channel numbers desired post scan? |
| 238 | bool m_lcn_only; |
231 | 239 | /// To pass information IPTV channel scan succeeded |
232 | 240 | bool m_success {false}; |
233 | 241 | /// Services desired post scan |
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanmiscsettings.h b/mythtv/libs/libmythtv/channelscan/channelscanmiscsettings.h
index 61104fc76a..505db30e45 100644
a
|
b
|
class FreeToAirOnly : public TransMythUICheckBoxSetting |
120 | 120 | }; |
121 | 121 | }; |
122 | 122 | |
| 123 | class ChannelNumbersOnly : public TransMythUICheckBoxSetting |
| 124 | { |
| 125 | public: |
| 126 | ChannelNumbersOnly() |
| 127 | { |
| 128 | setValue(false); |
| 129 | setLabel(QObject::tr("Logical Channel Numbers required")); |
| 130 | setHelpText( |
| 131 | QObject::tr( |
| 132 | "If set, only services with a Logical Channel Number will " |
| 133 | "be added during the scan. This will filter out services " |
| 134 | "for set-top-box firmware download and video-on-demand " |
| 135 | "that can be present on DVB-C networks.")); |
| 136 | }; |
| 137 | }; |
| 138 | |
123 | 139 | class AddFullTS : public TransMythUICheckBoxSetting |
124 | 140 | { |
125 | 141 | public: |
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner.cpp
index 691fd13f9d..955c595b8c 100644
a
|
b
|
void ChannelScanner::Scan( |
115 | 115 | bool do_follow_nit, |
116 | 116 | bool do_test_decryption, |
117 | 117 | bool do_fta_only, |
| 118 | bool do_lcn_only, |
118 | 119 | bool do_add_full_ts, |
119 | 120 | ServiceRequirements service_requirements, |
120 | 121 | // stuff needed for particular scans |
… |
… |
void ChannelScanner::Scan( |
127 | 128 | const QString &tbl_end /* FullScan optional */) |
128 | 129 | { |
129 | 130 | m_freeToAirOnly = do_fta_only; |
| 131 | m_channelNumbersOnly = do_lcn_only; |
130 | 132 | m_addFullTS = do_add_full_ts; |
131 | 133 | m_serviceRequirements = service_requirements; |
132 | 134 | m_sourceid = sourceid; |
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner.h b/mythtv/libs/libmythtv/channelscan/channelscanner.h
index 4433e1247a..859a8f3533 100644
a
|
b
|
class MTV_PUBLIC ChannelScanner |
76 | 76 | bool do_follow_nit, |
77 | 77 | bool do_test_decryption, |
78 | 78 | bool do_fta_only, |
| 79 | bool do_lcn_only, |
79 | 80 | bool do_add_full_ts, |
80 | 81 | ServiceRequirements service_requirements, |
81 | 82 | // stuff needed for particular scans |
… |
… |
class MTV_PUBLIC ChannelScanner |
135 | 136 | /// Only fta channels desired post scan? |
136 | 137 | bool m_freeToAirOnly {false}; |
137 | 138 | |
| 139 | /// Only channels with logical channel numbers desired post scan? |
| 140 | bool m_channelNumbersOnly {false}; |
| 141 | |
138 | 142 | /// Add MPTS "full transport stream" channels |
139 | 143 | bool m_addFullTS {false}; |
140 | 144 | |
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner_cli.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner_cli.cpp
index aadddeef95..ad79ed0190 100644
a
|
b
|
void ChannelScannerCLI::InformUser(const QString &error) |
136 | 136 | void ChannelScannerCLI::Process(const ScanDTVTransportList &_transports) |
137 | 137 | { |
138 | 138 | ChannelImporter ci(false, m_interactive, !m_onlysavescan, !m_onlysavescan, true, |
139 | | m_freeToAirOnly, m_serviceRequirements); |
| 139 | m_freeToAirOnly, m_channelNumbersOnly, m_serviceRequirements); |
140 | 140 | ci.Process(_transports, m_sourceid); |
141 | 141 | } |
142 | 142 | |
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner_gui.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner_gui.cpp
index 25be3def5c..cf4f448aad 100644
a
|
b
|
void ChannelScannerGUI::Process(const ScanDTVTransportList &_transports, |
135 | 135 | bool success) |
136 | 136 | { |
137 | 137 | ChannelImporter ci(true, true, true, true, true, |
138 | | m_freeToAirOnly, m_serviceRequirements, success); |
| 138 | m_freeToAirOnly, m_channelNumbersOnly, m_serviceRequirements, success); |
139 | 139 | ci.Process(_transports, m_sourceid); |
140 | 140 | } |
141 | 141 | |
diff --git a/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp b/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp
index 48140d4519..5a3953477f 100644
a
|
b
|
void ScanWizard::SetupConfig( |
31 | 31 | m_scanConfig = new ScanOptionalConfig(m_scanType); |
32 | 32 | m_services = new DesiredServices(); |
33 | 33 | m_ftaOnly = new FreeToAirOnly(); |
| 34 | m_lcnOnly = new ChannelNumbersOnly(); |
34 | 35 | m_addFullTS = new AddFullTS(); |
35 | 36 | m_trustEncSI = new TrustEncSISetting(); |
36 | 37 | |
37 | 38 | addChild(m_services); |
38 | 39 | addChild(m_ftaOnly); |
| 40 | addChild(m_lcnOnly); |
39 | 41 | addChild(m_addFullTS); |
40 | 42 | addChild(m_trustEncSI); |
41 | 43 | |
… |
… |
bool ScanWizard::DoFreeToAirOnly(void) const |
72 | 74 | return m_ftaOnly->boolValue(); |
73 | 75 | } |
74 | 76 | |
| 77 | bool ScanWizard::DoChannelNumbersOnly(void) const |
| 78 | { |
| 79 | return m_lcnOnly->boolValue(); |
| 80 | } |
| 81 | |
75 | 82 | bool ScanWizard::DoAddFullTS(void) const |
76 | 83 | { |
77 | 84 | return m_addFullTS->boolValue(); |
diff --git a/mythtv/libs/libmythtv/channelscan/scanwizardconfig.h b/mythtv/libs/libmythtv/channelscan/scanwizardconfig.h
index ab0115281c..6b0a692d59 100644
a
|
b
|
class ScanNetwork; |
43 | 43 | class IgnoreSignalTimeout; |
44 | 44 | class DesiredServices; |
45 | 45 | class FreeToAirOnly; |
| 46 | class ChannelNumbersOnly; |
46 | 47 | class AddFullTS; |
47 | 48 | class TrustEncSISetting; |
48 | 49 | |
diff --git a/mythtv/libs/libmythtv/scanwizard.cpp b/mythtv/libs/libmythtv/scanwizard.cpp
index c1d80172af..bf5e2d4863 100644
a
|
b
|
void ScanWizard::Scan() |
137 | 137 | ScanDTVTransportList transports = LoadScan(scanid); |
138 | 138 | ChannelImporter ci(true, true, true, true, false, |
139 | 139 | DoFreeToAirOnly(), |
| 140 | DoChannelNumbersOnly(), |
140 | 141 | GetServiceRequirements()); |
141 | 142 | ci.Process(transports, sourceid); |
142 | 143 | } |
… |
… |
void ScanWizard::Scan() |
179 | 180 | GetInputName(), GetSourceID(), |
180 | 181 | DoIgnoreSignalTimeout(), DoFollowNIT(), |
181 | 182 | DoTestDecryption(), DoFreeToAirOnly(), |
| 183 | DoChannelNumbersOnly(), |
182 | 184 | DoAddFullTS(), GetServiceRequirements(), |
183 | 185 | // stuff needed for particular scans |
184 | 186 | GetMultiplex(), start_chan, |
diff --git a/mythtv/libs/libmythtv/scanwizard.h b/mythtv/libs/libmythtv/scanwizard.h
index 074a10e708..5cda624e87 100644
a
|
b
|
class MTV_PUBLIC ScanWizard : public GroupSetting |
87 | 87 | { return m_scanConfig->DoIgnoreSignalTimeout(); } |
88 | 88 | bool DoFollowNIT(void) const |
89 | 89 | { return m_scanConfig->DoFollowNIT(); } |
90 | | bool DoFreeToAirOnly(void) const; |
91 | | bool DoAddFullTS(void) const; |
92 | | bool DoTestDecryption(void) const; |
| 90 | bool DoFreeToAirOnly(void) const; |
| 91 | bool DoChannelNumbersOnly(void) const; |
| 92 | bool DoAddFullTS(void) const; |
| 93 | bool DoTestDecryption(void) const; |
93 | 94 | |
94 | 95 | protected: |
95 | 96 | VideoSourceSelector *m_videoSource {nullptr}; |
… |
… |
class MTV_PUBLIC ScanWizard : public GroupSetting |
98 | 99 | ScanOptionalConfig *m_scanConfig {nullptr}; |
99 | 100 | DesiredServices *m_services {nullptr}; |
100 | 101 | FreeToAirOnly *m_ftaOnly {nullptr}; |
| 102 | ChannelNumbersOnly *m_lcnOnly {nullptr}; |
101 | 103 | AddFullTS *m_addFullTS {nullptr}; |
102 | 104 | TrustEncSISetting *m_trustEncSI {nullptr}; |
103 | 105 | // End of members moved from ScanWizardConfig |
diff --git a/mythtv/programs/mythtv-setup/main.cpp b/mythtv/programs/mythtv-setup/main.cpp
index d112a15d44..b040bb6680 100644
a
|
b
|
int main(int argc, char *argv[]) |
274 | 274 | bool expertMode = false; |
275 | 275 | uint scanImport = 0; |
276 | 276 | bool scanFTAOnly = false; |
| 277 | bool scanLCNOnly = false; |
277 | 278 | bool addFullTS = false; |
278 | 279 | ServiceRequirements scanServiceRequirements = kRequireAV; |
279 | 280 | uint scanCardId = 0; |
… |
… |
int main(int argc, char *argv[]) |
363 | 364 | scanImport = cmdline.toUInt("importscan"); |
364 | 365 | if (cmdline.toBool("ftaonly")) |
365 | 366 | scanFTAOnly = true; |
| 367 | if (cmdline.toBool("lcnonly")) |
| 368 | scanLCNOnly = true; |
366 | 369 | if (cmdline.toBool("addfullts")) |
367 | 370 | addFullTS = true; |
368 | 371 | if (cmdline.toBool("servicetype")) |
… |
… |
int main(int argc, char *argv[]) |
518 | 521 | /* follow_nit */ true, |
519 | 522 | /* test decryption */ true, |
520 | 523 | scanFTAOnly, |
| 524 | scanLCNOnly, |
521 | 525 | addFullTS, |
522 | 526 | scanServiceRequirements, |
523 | 527 | // stuff needed for particular scans |
… |
… |
int main(int argc, char *argv[]) |
552 | 556 | { |
553 | 557 | ScanDTVTransportList list = LoadScan(scanImport); |
554 | 558 | ChannelImporter ci(false, true, true, true, false, |
555 | | scanFTAOnly, scanServiceRequirements); |
| 559 | scanFTAOnly, scanLCNOnly, scanServiceRequirements); |
556 | 560 | ci.Process(list); |
557 | 561 | } |
558 | 562 | cout<<"*** SCAN IMPORT END ***"<<endl; |