Ticket #3301: mythtv-0.20-scanfixes.patch
File mythtv-0.20-scanfixes.patch, 108.5 KB (added by , 17 years ago) |
---|
-
libs/libmyth/dbsettings.cpp
diff -Naurp mythtv-0.20.orig/libs/libmyth/dbsettings.cpp mythtv-0.20/libs/libmyth/dbsettings.cpp
old new 4 4 #include <qfile.h> 5 5 #include <qdir.h> 6 6 7 class TransientSetting: public TransientStorage, virtual public Configurable {8 public:9 TransientSetting() { };10 };11 12 class TransientSpinBox: public SpinBoxSetting, public TransientSetting {13 public:14 TransientSpinBox(int min, int max, int step,15 bool allow_single_step = false) :16 SpinBoxSetting(min, max, step, allow_single_step) { };17 };18 19 class TransientCheckBox: public CheckBoxSetting, public TransientSetting {20 public:21 TransientCheckBox() { };22 };23 24 class TransientLineEdit: public LineEditSetting, public TransientSetting {25 public:26 TransientLineEdit(bool rw = true) :27 LineEditSetting(rw) { };28 };29 30 class TransientComboBox: public ComboBoxSetting, public TransientSetting {31 public:32 TransientComboBox(bool rw = true) :33 ComboBoxSetting(rw) { };34 };35 36 class TransientLabel: public LabelSetting, public TransientSetting {37 public:38 TransientLabel() { };39 };40 41 7 class MythDbSettings1: public VerticalConfigurationGroup { 42 8 public: 43 9 MythDbSettings1(); … … public: 46 12 void save(); 47 13 48 14 protected: 49 Trans ientLabel*info;50 Trans ientLineEdit*dbHostName;51 Trans ientLineEdit*dbName;52 Trans ientLineEdit*dbUserName;53 Trans ientLineEdit*dbPassword;54 Trans ientComboBox*dbType;15 TransLabelSetting *info; 16 TransLineEditSetting *dbHostName; 17 TransLineEditSetting *dbName; 18 TransLineEditSetting *dbUserName; 19 TransLineEditSetting *dbPassword; 20 TransComboBoxSetting *dbType; 55 21 }; 56 22 57 23 class MythDbSettings2: public VerticalConfigurationGroup { … … public: 62 28 void save(); 63 29 64 30 protected: 65 Trans ientCheckBox*localEnabled;66 Trans ientLineEdit*localHostName;67 Trans ientCheckBox*wolEnabled;68 Trans ientSpinBox*wolReconnect;69 Trans ientSpinBox*wolRetry;70 Trans ientLineEdit*wolCommand;31 TransCheckBoxSetting *localEnabled; 32 TransLineEditSetting *localHostName; 33 TransCheckBoxSetting *wolEnabled; 34 TransSpinBoxSetting *wolReconnect; 35 TransSpinBoxSetting *wolRetry; 36 TransLineEditSetting *wolCommand; 71 37 }; 72 38 73 39 … … MythDbSettings1::MythDbSettings1() : 115 81 setLabel(QObject::tr("Database Configuration") + " 1/2"); 116 82 setUseLabel(false); 117 83 118 info = new Trans ientLabel();84 info = new TransLabelSetting(); 119 85 120 86 MSqlQuery query(MSqlQuery::InitCon()); 121 87 if (query.isConnected()) … … MythDbSettings1::MythDbSettings1() : 127 93 "below.")); 128 94 addChild(info); 129 95 130 dbHostName = new Trans ientLineEdit(true);96 dbHostName = new TransLineEditSetting(true); 131 97 dbHostName->setLabel(QObject::tr("Host name")); 132 98 dbHostName->setHelpText(QObject::tr("The host name or IP address of " 133 99 "the machine hosting the database. " 134 100 "This information is required.")); 135 101 addChild(dbHostName); 136 137 dbName = new TransientLineEdit(true); 102 dbName = new TransLineEditSetting(true); 138 103 dbName->setLabel(QObject::tr("Database")); 139 104 dbName->setHelpText(QObject::tr("The name of the database. " 140 105 "This information is required.")); 141 106 addChild(dbName); 142 107 143 dbUserName = new Trans ientLineEdit(true);108 dbUserName = new TransLineEditSetting(true); 144 109 dbUserName->setLabel(QObject::tr("User")); 145 110 dbUserName->setHelpText(QObject::tr("The user name to use while " 146 111 "connecting to the database. " 147 112 "This information is required.")); 148 113 addChild(dbUserName); 149 114 150 dbPassword = new Trans ientLineEdit(true);115 dbPassword = new TransLineEditSetting(true); 151 116 dbPassword->setLabel(QObject::tr("Password")); 152 117 dbPassword->setHelpText(QObject::tr("The password to use while " 153 118 "connecting to the database. " 154 119 "This information is required.")); 155 120 addChild(dbPassword); 156 121 157 dbType = new Trans ientComboBox(false);122 dbType = new TransComboBoxSetting(false); 158 123 dbType->setLabel(QObject::tr("Database type")); 159 124 dbType->addSelection(QObject::tr("MySQL"), "QMYSQL3"); 160 125 //dbType->addSelection(QObject::tr("PostgreSQL"), "QPSQL7"); … … MythDbSettings2::MythDbSettings2(void) : 171 136 setLabel(QObject::tr("Database Configuration") + " 2/2"); 172 137 setUseLabel(false); 173 138 174 localEnabled = new Trans ientCheckBox();139 localEnabled = new TransCheckBoxSetting(); 175 140 localEnabled->setLabel(QObject::tr("Use custom identifier for frontend " 176 141 "preferences")); 177 142 localEnabled->setHelpText(QObject::tr("If this frontend's host name " … … MythDbSettings2::MythDbSettings2(void) : 183 148 "be used to save preferences in " 184 149 "the database.")); 185 150 186 localHostName = new Trans ientLineEdit(true);151 localHostName = new TransLineEditSetting(true); 187 152 localHostName->setLabel(QObject::tr("Custom identifier")); 188 153 localHostName->setHelpText(QObject::tr("An identifier to use while " 189 154 "saving the settings for this " … … MythDbSettings2::MythDbSettings2(void) : 197 162 new LocalHostNameSettings(localEnabled, group1); 198 163 addChild(sub3); 199 164 200 wolEnabled = new Trans ientCheckBox();165 wolEnabled = new TransCheckBoxSetting(); 201 166 wolEnabled->setLabel(QObject::tr("Use Wake-On-LAN to wake database")); 202 167 wolEnabled->setHelpText(QObject::tr("If checked, the frontend will use " 203 168 "Wake-On-LAN parameters to " 204 169 "reconnect to the database server.")); 205 170 206 wolReconnect = new Trans ientSpinBox(0, 60, 1, true);171 wolReconnect = new TransSpinBoxSetting(0, 60, 1, true); 207 172 wolReconnect->setLabel(QObject::tr("Reconnect time")); 208 173 wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for " 209 174 "the server to wake up.")); 210 175 211 wolRetry = new Trans ientSpinBox(1, 10, 1, true);176 wolRetry = new TransSpinBoxSetting(1, 10, 1, true); 212 177 wolRetry->setLabel(QObject::tr("Retry attempts")); 213 178 wolRetry->setHelpText(QObject::tr("The number of retries to wake the " 214 179 "server before the frontend gives " 215 180 "up.")); 216 181 217 wolCommand = new Trans ientLineEdit(true);182 wolCommand = new TransLineEditSetting(true); 218 183 wolCommand->setLabel(QObject::tr("Wake command")); 219 184 wolCommand->setHelpText(QObject::tr("The command executed on this " 220 185 "frontend to wake up the database " -
libs/libmyth/mythcontext.h
diff -Naurp mythtv-0.20.orig/libs/libmyth/mythcontext.h mythtv-0.20/libs/libmyth/mythcontext.h
old new class MythPrivRequest 224 224 225 225 /// Update this whenever the plug-in API changes. 226 226 /// Including changes in the libmythtv class methods used by plug-ins. 227 #define MYTH_BINARY_VERSION "0.20.20060828- 3"227 #define MYTH_BINARY_VERSION "0.20.20060828-4" 228 228 229 229 /** \brief Increment this whenever the MythTV network protocol changes. 230 230 * -
libs/libmyth/settings.h
diff -Naurp mythtv-0.20.orig/libs/libmyth/settings.h mythtv-0.20/libs/libmyth/settings.h
old new protected: 719 719 MythPushButton *button; 720 720 }; 721 721 722 class TransButtonSetting: public ButtonSetting, public TransientStorage {723 public:724 TransButtonSetting(QString name = "button") : ButtonSetting(name) {}725 };726 727 722 class ConfigPopupDialogWidget: public MythPopupBox { 728 723 Q_OBJECT 729 724 public: … … private: 767 762 int totalSteps; 768 763 }; 769 764 770 class TransLabelSetting: public LabelSetting, public TransientStorage {771 public:772 TransLabelSetting() {};773 };774 775 class TransCheckBoxSetting: public CheckBoxSetting, public TransientStorage {776 public:777 TransCheckBoxSetting() {};778 };779 780 765 class HostSetting: public SimpleDBStorage, virtual public Configurable { 781 766 public: 782 767 HostSetting(QString name): … … protected: 802 787 virtual QString setClause(MSqlBindings& bindings); 803 788 }; 804 789 790 /////////////////////////////////////////////////////////////////////////////// 791 792 class TransButtonSetting : 793 public ButtonSetting, public TransientStorage 794 { 795 public: 796 TransButtonSetting(QString name = "button") : ButtonSetting(name) { } 797 }; 798 799 class TransLabelSetting : 800 public LabelSetting, public TransientStorage 801 { 802 public: 803 TransLabelSetting() { } 804 }; 805 806 class TransLineEditSetting : 807 public LineEditSetting, public TransientStorage 808 { 809 public: 810 TransLineEditSetting(bool rw = true) : LineEditSetting(rw) { } 811 }; 812 813 class TransCheckBoxSetting : 814 public CheckBoxSetting, public TransientStorage 815 { 816 public: 817 TransCheckBoxSetting() { } 818 }; 819 820 class TransComboBoxSetting : 821 public ComboBoxSetting, public TransientStorage 822 { 823 public: 824 TransComboBoxSetting(bool rw = true, int _step = 1) : 825 ComboBoxSetting(rw, _step) { } 826 }; 827 828 class TransSpinBoxSetting : 829 public SpinBoxSetting, public TransientStorage 830 { 831 public: 832 TransSpinBoxSetting(int min, int max, int step, 833 bool allow_single_step = false, 834 QString special_value_text = "") : 835 SpinBoxSetting(min, max, step, allow_single_step, 836 special_value_text) { } 837 }; 838 839 /////////////////////////////////////////////////////////////////////////////// 840 805 841 class HostSlider: public SliderSetting, public HostSetting { 806 842 public: 807 843 HostSlider(const QString &name, int min, int max, int step) : -
libs/libmythtv/dtvconfparserhelpers.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/dtvconfparserhelpers.cpp mythtv-0.20/libs/libmythtv/dtvconfparserhelpers.cpp
old new 1 #include "mythcontext.h" 2 #include "dtvconfparserhelpers.h" 3 4 bool DTVParamHelper::ParseParam(const QString &symbol, int &value, 5 const DTVParamHelperStruct *table) 6 { 7 const DTVParamHelperStruct *p = table; 8 9 while (p->symbol != NULL) 10 { 11 if (p->symbol == symbol.left(p->symbol.length())) 12 { 13 //symbol = symbol.mid(p->symbol.length()); 14 value = p->value; 15 return true; 16 } 17 p++; 18 } 19 20 return false; 21 } 22 23 QString DTVParamHelper::toString(const char *strings[], int index, 24 uint strings_size) 25 { 26 if ((index < 0) || ((uint)index >= strings_size)) 27 { 28 VERBOSE(VB_IMPORTANT, 29 "DTVParamHelper::toString() index out of bounds"); 30 31 return QString::null; 32 } 33 34 return strings[index]; 35 } 36 37 const DTVParamHelperStruct DTVInversion::confTable[] = 38 { 39 { "INVERSION_AUTO", kInversionAuto }, 40 { "INVERSION_OFF", kInversionOff }, 41 { "INVERSION_ON", kInversionOn }, 42 { NULL, kInversionAuto }, 43 }; 44 45 const DTVParamHelperStruct DTVInversion::vdrTable[] = 46 { 47 { "999", kInversionAuto }, 48 { "0", kInversionOff }, 49 { "1", kInversionOn }, 50 { NULL, kInversionAuto }, 51 }; 52 53 const DTVParamHelperStruct DTVInversion::parseTable[] = 54 { 55 { "a", kInversionAuto }, 56 { "0", kInversionOff }, 57 { "1", kInversionOn }, 58 { NULL, kInversionAuto }, 59 }; 60 61 const char *DTVInversion::dbStr[DTVInversion::kDBStrCnt] = 62 { 63 "0", ///< kInversionOff 64 "1", ///< kInversionOn 65 "a" ///< kInversionAuto 66 }; 67 68 const DTVParamHelperStruct DTVBandwidth::confTable[] = 69 { 70 { "BANDWIDTH_AUTO", kBandwidthAuto }, 71 { "BANDWIDTH_8_MHZ", kBandwidth8Mhz }, 72 { "BANDWIDTH_7_MHZ", kBandwidth7Mhz }, 73 { "BANDWIDTH_6_MHZ", kBandwidth6Mhz }, 74 { NULL, kBandwidthAuto }, 75 }; 76 77 const DTVParamHelperStruct DTVBandwidth::vdrTable[] = 78 { 79 { "999", kBandwidthAuto }, 80 { "8", kBandwidth8Mhz }, 81 { "7", kBandwidth7Mhz }, 82 { "6", kBandwidth6Mhz }, 83 { NULL, kBandwidthAuto }, 84 }; 85 86 const DTVParamHelperStruct DTVBandwidth::parseTable[] = 87 { 88 { "auto", kBandwidthAuto }, 89 { "8", kBandwidth8Mhz }, 90 { "7", kBandwidth7Mhz }, 91 { "6", kBandwidth6Mhz }, 92 { NULL, kBandwidthAuto }, 93 }; 94 95 const char *DTVBandwidth::dbStr[DTVBandwidth::kDBStrCnt] = 96 { 97 "8", ///< kBandwidth8Mhz 98 "7", ///< kBandwidth7Mhz 99 "6", ///< kBandwidth6Mhz 100 "auto" ///< kBandwidthAUTO 101 }; 102 103 const DTVParamHelperStruct DTVCodeRate::confTable[] = 104 { 105 { "FEC_AUTO", kFECAuto }, 106 { "FEC_1_2", kFEC_1_2 }, 107 { "FEC_2_3", kFEC_2_3 }, 108 { "FEC_3_4", kFEC_3_4 }, 109 { "FEC_4_5", kFEC_4_5 }, 110 { "FEC_5_6", kFEC_5_6 }, 111 { "FEC_6_7", kFEC_6_7 }, 112 { "FEC_7_8", kFEC_7_8 }, 113 { "FEC_8_9", kFEC_8_9 }, 114 { "FEC_NONE", kFECNone }, 115 { NULL, kFECAuto }, 116 }; 117 118 const DTVParamHelperStruct DTVCodeRate::vdrTable[] = 119 { 120 { "999", kFECAuto }, 121 { "12", kFEC_1_2 }, 122 { "23", kFEC_2_3 }, 123 { "34", kFEC_3_4 }, 124 { "45", kFEC_4_5 }, 125 { "56", kFEC_5_6 }, 126 { "67", kFEC_6_7 }, 127 { "78", kFEC_7_8 }, 128 { "89", kFEC_8_9 }, 129 { "0", kFECNone }, 130 { NULL, kFECAuto } 131 }; 132 133 const DTVParamHelperStruct DTVCodeRate::parseTable[] = 134 { 135 { "auto", kFECAuto }, 136 { "1/2", kFEC_1_2 }, 137 { "2/3", kFEC_2_3 }, 138 { "3/4", kFEC_3_4 }, 139 { "4/5", kFEC_4_5 }, 140 { "5/6", kFEC_5_6 }, 141 { "6/7", kFEC_6_7 }, 142 { "7/8", kFEC_7_8 }, 143 { "8/9", kFEC_8_9 }, 144 { "none", kFECNone }, 145 { NULL, kFECAuto } 146 }; 147 148 const char *DTVCodeRate::dbStr[DTVCodeRate::kDBStrCnt] = 149 { 150 "none", ///< kFECNone 151 "1/2", ///< kFEC_1_2 152 "2/3", ///< kFEC_2_3 153 "3/4", ///< kFEC_3_4 154 "4/5", ///< kFEC_4_5 155 "5/6", ///< kFEC_5_6 156 "6/7", ///< kFEC_6_7 157 "7/8", ///< kFEC_7_8 158 "8/9", ///< kFEC_8_9 159 "auto" ///< kFECAuto 160 }; 161 162 const DTVParamHelperStruct DTVModulation::confTable[] = 163 { 164 { "QAM_AUTO", kModulationQAMAuto }, 165 { "QAM_16", kModulationQAM16 }, 166 { "QAM_32", kModulationQAM32 }, 167 { "QAM_64", kModulationQAM64 }, 168 { "QAM_128", kModulationQAM128 }, 169 { "QAM_256", kModulationQAM256 }, 170 { "QPSK", kModulationQPSK }, 171 { "8PSK", kModulation8PSK }, 172 { NULL, kModulationQAMAuto }, 173 }; 174 175 const DTVParamHelperStruct DTVModulation::vdrTable[] = 176 { 177 { "999", kModulationQAMAuto }, 178 { "16", kModulationQAM16 }, 179 { "32", kModulationQAM32 }, 180 { "64", kModulationQAM64 }, 181 { "128", kModulationQAM128 }, 182 { "256", kModulationQAM256 }, 183 { "0", kModulationQPSK }, 184 { NULL, kModulationQAMAuto }, 185 }; 186 187 const DTVParamHelperStruct DTVModulation::parseTable[] = 188 { 189 { "auto", kModulationQAMAuto }, 190 { "qam_16", kModulationQAM16 }, 191 { "qam_32", kModulationQAM32 }, 192 { "qam_64", kModulationQAM64 }, 193 { "qam_128", kModulationQAM128 }, 194 { "qam_256", kModulationQAM256 }, 195 { "qpsk", kModulationQPSK }, 196 { "8vsb", kModulation8VSB }, 197 { "16vsb", kModulation16VSB }, 198 { "8psk", kModulation8PSK }, 199 // alternates from dvbtypes 200 { "a", kModulationQAMAuto }, 201 { "qam_auto", kModulationQAMAuto }, 202 { "qam-16", kModulationQAM16 }, 203 { "qam-32", kModulationQAM32 }, 204 { "qam-64", kModulationQAM64 }, 205 { "qam-128", kModulationQAM128 }, 206 { "qam-256", kModulationQAM256 }, 207 { "8-vsb", kModulation8VSB }, 208 { "16-vsb", kModulation16VSB }, 209 { "8-psk", kModulation8PSK }, 210 { NULL, kModulationQAMAuto }, 211 }; 212 213 const char *DTVModulation::dbStr[DTVModulation::kDBStrCnt] = 214 { 215 "qpsk", ///< kModulationQPSK, 216 "qam_16", ///< kModulationQAM16 217 "qam_32", ///< kModulationQAM32 218 "qam_64", ///< kModulationQAM64 219 "qam_128", ///< kModulationQAM128 220 "qam_256", ///< kModulationQAM256 221 "auto", ///< kModulationQAMAuto 222 "8vsb", ///< kModulation8VSB 223 "16vsb", ///< kModulation16VSB 224 "8psk", ///< kModulation8PSK 225 }; 226 227 const DTVParamHelperStruct DTVTransmitMode::confTable[] = 228 { 229 { "TRANSMISSION_MODE_AUTO", kTransmissionModeAuto }, 230 { "TRANSMISSION_MODE_2K", kTransmissionMode2K }, 231 { "TRANSMISSION_MODE_8K", kTransmissionMode8K }, 232 { NULL, kTransmissionModeAuto }, 233 }; 234 235 const DTVParamHelperStruct DTVTransmitMode::vdrTable[] = 236 { 237 { "999", kTransmissionModeAuto }, 238 { "2", kTransmissionMode2K }, 239 { "8", kTransmissionMode8K }, 240 { NULL, kTransmissionModeAuto }, 241 }; 242 243 const DTVParamHelperStruct DTVTransmitMode::parseTable[] = 244 { 245 { "auto", kTransmissionModeAuto }, 246 { "2", kTransmissionMode2K }, 247 { "8", kTransmissionMode8K }, 248 { NULL, kTransmissionModeAuto }, 249 }; 250 251 const char *DTVTransmitMode::dbStr[DTVTransmitMode::kDBStrCnt] = 252 { 253 "2", ///< kTransmissionMode2K 254 "8", ///< kTransmissionMode8K 255 "auto" ///< kTransmissionModeAuto 256 }; 257 258 const DTVParamHelperStruct DTVGuardInterval::confTable[] = 259 { 260 { "GUARD_INTERVAL_AUTO", kGuardIntervalAuto }, 261 { "GUARD_INTERVAL_1_32", kGuardInterval_1_32 }, 262 { "GUARD_INTERVAL_1_16", kGuardInterval_1_16 }, 263 { "GUARD_INTERVAL_1_8", kGuardInterval_1_8 }, 264 { "GUARD_INTERVAL_1_4", kGuardInterval_1_4 }, 265 { NULL, kGuardIntervalAuto }, 266 }; 267 268 const DTVParamHelperStruct DTVGuardInterval::vdrTable[] = 269 { 270 { "999", kGuardIntervalAuto }, 271 { "32", kGuardInterval_1_32 }, 272 { "16", kGuardInterval_1_16 }, 273 { "8", kGuardInterval_1_8 }, 274 { "4", kGuardInterval_1_4 }, 275 { NULL, kGuardIntervalAuto }, 276 }; 277 278 const DTVParamHelperStruct DTVGuardInterval::parseTable[] = 279 { 280 { "auto", kGuardIntervalAuto }, 281 { "1/32", kGuardInterval_1_32 }, 282 { "1/16", kGuardInterval_1_16 }, 283 { "1/8", kGuardInterval_1_8 }, 284 { "1/4", kGuardInterval_1_4 }, 285 { NULL, kGuardIntervalAuto }, 286 }; 287 288 const char *DTVGuardInterval::dbStr[DTVGuardInterval::kDBStrCnt] = 289 { 290 "1/32", ///< kGuardInterval_1_32 291 "1/16", ///< kGuardInterval_1_16 292 "1/8", ///< kGuardInterval_1_8 293 "1/4", ///< kGuardInterval_1_4 294 "auto" ///< kGuardIntervalAuto 295 }; 296 297 const DTVParamHelperStruct DTVHierarchy::confTable[] = 298 { 299 { "HIERARCHY_NONE", kHierarchyNone }, 300 { "HIERARCHY_1", kHierarchy1 }, 301 { "HIERARCHY_2", kHierarchy2 }, 302 { "HIERARCHY_4", kHierarchy4 }, 303 { "HIERARCHY_AUTO", kHierarchyAuto }, 304 { NULL, kHierarchyAuto }, 305 }; 306 307 const DTVParamHelperStruct DTVHierarchy::vdrTable[] = 308 { 309 { "0", kHierarchyNone }, 310 { "1", kHierarchy1 }, 311 { "2", kHierarchy2 }, 312 { "4", kHierarchy4 }, 313 { "999", kHierarchyAuto }, 314 { NULL, kHierarchyAuto }, 315 }; 316 317 const DTVParamHelperStruct DTVHierarchy::parseTable[] = 318 { 319 { "n", kHierarchyNone }, 320 { "1", kHierarchy1 }, 321 { "2", kHierarchy2 }, 322 { "4", kHierarchy4 }, 323 { "a", kHierarchyAuto }, 324 { NULL, kHierarchyAuto }, 325 }; 326 327 const char *DTVHierarchy::dbStr[DTVHierarchy::kDBStrCnt] = 328 { 329 "n", ///< kHierarchyNone 330 "1", ///< kHierarchy1 331 "2", ///< kHierarchy2 332 "4", ///< kHierarchy4 333 "a" ///< kHierarchyAuto 334 }; 335 336 const DTVParamHelperStruct DTVPolarity::parseTable[] = 337 { 338 { "v", kPolarityVertical }, 339 { "h", kPolarityHorizontal }, 340 { "r", kPolarityRight }, 341 { "l", kPolarityLeft }, 342 { NULL, kPolarityVertical }, 343 }; 344 345 const char *DTVPolarity::dbStr[DTVPolarity::kDBStrCnt] = 346 { 347 "v", ///< kPolarityVertical 348 "h", ///< kPolarityHorizontal 349 "r", ///< kPolarityRight 350 "l" ///< kPolarityLeft 351 }; -
libs/libmythtv/dtvconfparserhelpers.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/dtvconfparserhelpers.h mythtv-0.20/libs/libmythtv/dtvconfparserhelpers.h
old new 1 /* -*- Mode: c++ -*- 2 * vim: set expandtab tabstop=4 shiftwidth=4: 3 * 4 * Original Project 5 * MythTV http://www.mythtv.org 6 * 7 * Author(s): 8 * John Pullan (john@pullan.org) 9 * 10 * Description: 11 * Collection of classes to provide dvb channel scanning 12 * functionallity 13 * 14 * 15 * This program is free software; you can redistribute it and/or 16 * modify it under the terms of the GNU General Public License 17 * as published by the Free Software Foundation; either version 2 18 * of the License, or (at your option) any later version. 19 * 20 * This program is distributed in the hope that it will be useful, 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 * GNU General Public License for more details. 24 * 25 * You should have received a copy of the GNU General Public License 26 * along with this program; if not, write to the Free Software 27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 29 * 30 */ 31 32 #ifndef _DTVCONFPARSERHELPERS_H_ 33 #define _DTVCONFPARSERHELPERS_H_ 34 35 #include <qstring.h> 36 37 // The following are a set of helper classes to allow easy translation 38 // between the different string representations of various tuning params. 39 40 struct DTVParamHelperStruct 41 { 42 QString symbol; 43 int value; 44 }; 45 46 /** \class DTVParamHelper 47 * \brief Helper abstract template to do some of the mundane portions 48 * of translating and comparing the paramater strings. 49 */ 50 class DTVParamHelper 51 { 52 public: 53 DTVParamHelper(int _value) : value(_value) { } 54 55 operator int() const { return value; } 56 int operator=(int _value) { return value = _value; } 57 bool operator==(const int& v) const { return value == v; } 58 59 protected: 60 static bool ParseParam(const QString &symbol, int &value, 61 const DTVParamHelperStruct *table); 62 63 static QString toString(const char *strings[], int index, 64 uint strings_size); 65 66 protected: 67 int value; 68 }; 69 70 class DTVInversion : public DTVParamHelper 71 { 72 protected: 73 static const DTVParamHelperStruct confTable[]; 74 static const DTVParamHelperStruct vdrTable[]; 75 static const DTVParamHelperStruct parseTable[]; 76 static const uint kDBStrCnt = 3; 77 static const char *dbStr[kDBStrCnt]; 78 79 public: 80 enum 81 { 82 kInversionOff, 83 kInversionOn, 84 kInversionAuto, 85 }; 86 87 DTVInversion(int _default = kInversionAuto) 88 : DTVParamHelper(_default) { } 89 90 bool ParseConf(const QString &_value) 91 { return ParseParam(_value, value, confTable); } 92 bool ParseVDR(const QString &_value) 93 { return ParseParam(_value, value, vdrTable); } 94 bool Parse(const QString &_value) 95 { return ParseParam(_value, value, parseTable); } 96 97 QString toString() const { return toString(value); } 98 99 static QString toString(int _value) 100 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 101 }; 102 103 class DTVBandwidth : public DTVParamHelper 104 { 105 protected: 106 static const DTVParamHelperStruct confTable[]; 107 static const DTVParamHelperStruct vdrTable[]; 108 static const DTVParamHelperStruct parseTable[]; 109 static const uint kDBStrCnt = 4; 110 static const char *dbStr[kDBStrCnt]; 111 112 public: 113 enum 114 { 115 kBandwidth8Mhz, 116 kBandwidth7Mhz, 117 kBandwidth6Mhz, 118 kBandwidthAuto, 119 }; 120 121 DTVBandwidth(int _default = kBandwidthAuto) : DTVParamHelper(_default) { } 122 123 bool ParseConf(const QString &_value) 124 { return ParseParam(_value, value, confTable); } 125 bool ParseVDR(const QString &_value) 126 { return ParseParam(_value, value, vdrTable); } 127 bool Parse(const QString &_value) 128 { return ParseParam(_value, value, parseTable); } 129 130 QString toString() const { return toString(value); } 131 132 static QString toString(int _value) 133 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 134 }; 135 136 class DTVCodeRate : public DTVParamHelper 137 { 138 protected: 139 static const DTVParamHelperStruct confTable[]; 140 static const DTVParamHelperStruct vdrTable[]; 141 static const DTVParamHelperStruct parseTable[]; 142 static const uint kDBStrCnt = 10; 143 static const char *dbStr[kDBStrCnt]; 144 145 public: 146 enum 147 { 148 kFECNone, 149 kFEC_1_2, 150 kFEC_2_3, 151 kFEC_3_4, 152 kFEC_4_5, 153 kFEC_5_6, 154 kFEC_6_7, 155 kFEC_7_8, 156 kFEC_8_9, 157 kFECAuto, 158 }; 159 160 DTVCodeRate(int _default = kFECAuto) : DTVParamHelper(_default) { } 161 162 bool ParseConf(const QString &_value) 163 { return ParseParam(_value, value, confTable); } 164 bool ParseVDR(const QString &_value) 165 { return ParseParam(_value, value, vdrTable); } 166 bool Parse(const QString &_value) 167 { return ParseParam(_value, value, parseTable); } 168 169 QString toString() const { return toString(value); } 170 171 static QString toString(int _value) 172 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 173 }; 174 175 class DTVModulation : public DTVParamHelper 176 { 177 protected: 178 static const DTVParamHelperStruct confTable[]; 179 static const DTVParamHelperStruct vdrTable[]; 180 static const DTVParamHelperStruct parseTable[]; 181 static const uint kDBStrCnt = 10; 182 static const char *dbStr[kDBStrCnt]; 183 184 public: 185 enum 186 { 187 kModulationQPSK, 188 kModulationQAM16, 189 kModulationQAM32, 190 kModulationQAM64, 191 kModulationQAM128, 192 kModulationQAM256, 193 kModulationQAMAuto, 194 kModulation8VSB, 195 kModulation16VSB, 196 kModulation8PSK, 197 }; 198 199 DTVModulation(int _default = kModulationQAMAuto) 200 : DTVParamHelper(_default) { } 201 202 bool ParseConf(const QString &_value) 203 { return ParseParam(_value, value, confTable); } 204 bool ParseVDR(const QString &_value) 205 { return ParseParam(_value, value, vdrTable); } 206 bool Parse(const QString &_value) 207 { return ParseParam(_value, value, parseTable); } 208 209 QString toString() const { return toString(value); } 210 211 static QString toString(int _value) 212 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 213 }; 214 215 class DTVTransmitMode : public DTVParamHelper 216 { 217 protected: 218 static const DTVParamHelperStruct confTable[]; 219 static const DTVParamHelperStruct vdrTable[]; 220 static const DTVParamHelperStruct parseTable[]; 221 static const uint kDBStrCnt = 3; 222 static const char *dbStr[kDBStrCnt]; 223 224 public: 225 enum 226 { 227 kTransmissionMode2K, 228 kTransmissionMode8K, 229 kTransmissionModeAuto, 230 }; 231 232 DTVTransmitMode(int _default = kTransmissionModeAuto) 233 : DTVParamHelper(_default) { } 234 235 bool ParseConf(const QString &_value) 236 { return ParseParam(_value, value, confTable); } 237 bool ParseVDR(const QString &_value) 238 { return ParseParam(_value, value, vdrTable); } 239 bool Parse(const QString &_value) 240 { return ParseParam(_value, value, parseTable); } 241 242 QString toString() const { return toString(value); } 243 static QString toString(int _value) 244 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 245 }; 246 247 class DTVGuardInterval : public DTVParamHelper 248 { 249 protected: 250 static const DTVParamHelperStruct confTable[]; 251 static const DTVParamHelperStruct vdrTable[]; 252 static const DTVParamHelperStruct parseTable[]; 253 static const uint kDBStrCnt = 5; 254 static const char *dbStr[kDBStrCnt]; 255 256 public: 257 enum 258 { 259 kGuardInterval_1_32, 260 kGuardInterval_1_16, 261 kGuardInterval_1_8, 262 kGuardInterval_1_4, 263 kGuardIntervalAuto, 264 }; 265 266 DTVGuardInterval(int _default = kGuardIntervalAuto) 267 : DTVParamHelper(_default) { } 268 269 bool ParseConf(const QString &_value) 270 { return ParseParam(_value, value, confTable); } 271 bool ParseVDR(const QString &_value) 272 { return ParseParam(_value, value, vdrTable); } 273 bool Parse(const QString &_value) 274 { return ParseParam(_value, value, parseTable); } 275 276 QString toString() const { return toString(value); } 277 278 static QString toString(int _value) 279 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 280 }; 281 282 class DTVHierarchy : public DTVParamHelper 283 { 284 protected: 285 static const DTVParamHelperStruct confTable[]; 286 static const DTVParamHelperStruct vdrTable[]; 287 static const DTVParamHelperStruct parseTable[]; 288 static const uint kDBStrCnt = 5; 289 static const char *dbStr[kDBStrCnt]; 290 291 public: 292 enum 293 { 294 kHierarchyNone, 295 kHierarchy1, 296 kHierarchy2, 297 kHierarchy4, 298 kHierarchyAuto, 299 }; 300 301 DTVHierarchy(int _default = kHierarchyAuto) : DTVParamHelper(_default) { } 302 303 bool ParseConf(const QString &_value) 304 { return ParseParam(_value, value, confTable); } 305 bool ParseVDR(const QString &_value) 306 { return ParseParam(_value, value, vdrTable); } 307 bool Parse(const QString &_value) 308 { return ParseParam(_value, value, parseTable); } 309 310 QString toString() const { return toString(value); } 311 312 static QString toString(int _value) 313 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 314 }; 315 316 class DTVPolarity : public DTVParamHelper 317 { 318 protected: 319 static const DTVParamHelperStruct parseTable[]; 320 static const uint kDBStrCnt = 4; 321 static const char *dbStr[kDBStrCnt]; 322 323 public: 324 enum PolarityValues 325 { 326 kPolarityVertical, 327 kPolarityHorizontal, 328 kPolarityRight, 329 kPolarityLeft 330 }; 331 332 DTVPolarity(int _default = kPolarityVertical) 333 : DTVParamHelper(_default) { } 334 335 bool ParseConf(const QString &_value) 336 { return ParseParam(_value, value, parseTable); } 337 bool ParseVDR(const QString &_value) 338 { return ParseParam(_value, value, parseTable); } 339 bool Parse(const QString &_value) 340 { return ParseParam(_value, value, parseTable); } 341 342 QString toString() const { return toString(value); } 343 344 static QString toString(int _value) 345 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 346 }; 347 348 #endif // _DTVCONFPARSERHELPERS_H_ -
libs/libmythtv/dvbconfparser.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/dvbconfparser.cpp mythtv-0.20/libs/libmythtv/dvbconfparser.cpp
old new 29 29 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 30 30 * 31 31 */ 32 #include <qobject.h> 32 33 // Qt headers 34 #include <qstringlist.h> 35 #include <qdeepcopy.h> 33 36 #include <qfile.h> 34 #include <qapplication.h> 37 38 // MythTV headers 35 39 #include "mythcontext.h" 36 #include "dvbtypes.h"37 #include "dvbconfparser.h"38 40 #include "mythdbcon.h" 41 #include "dvbconfparser.h" 39 42 #include "channelutil.h" 40 43 41 void DVBConfParser::Multiplex::dump() 44 #define PARSE_SKIP(VAR) do { \ 45 if (it == tokens.end()) return false; else it++; } while(0) 46 47 #define PARSE_CONF(VAR) do { \ 48 if (it == tokens.end() || !VAR.ParseConf(*it++)) \ 49 return false; } while(0) 50 51 #define PARSE_STR(VAR) do { \ 52 if (it != tokens.end()) VAR = *it++; else return false; } while(0) 53 54 #define PARSE_UINT(VAR) do { \ 55 if (it != tokens.end()) \ 56 VAR = (*it++).toUInt(); else return false; } while(0) 57 58 #define PARSE_UINT_1000(VAR) do { \ 59 if (it != tokens.end()) \ 60 VAR = (*it++).toUInt() * 1000ULL; else return false; } while(0) 61 62 63 QString DTVMultiplex::toString() const 42 64 { 43 cerr << frequency<<" "<<inversion.toString()<<" "<<bandwidth.toString()<<" "<<coderate_hp.toString()<<" "<<coderate_lp.toString()<<" "<<constellation.toString()<<" "<<modulation.toString()<<" "<<transmit_mode.toString()<<" "<<guard_interval.toString()<<" "<<hierarchy.toString()<<" "<<polarity.toString()<<" "<<mplexid<<endl; 65 QString ret = QString("%1 %2 %3 ") 66 .arg(frequency).arg(modulation.toString()).arg(inversion.toString()); 67 68 ret += QString("%1 %2 %3 %4 %5 %6 %7 %8") 69 .arg(hp_code_rate.toString()).arg(lp_code_rate.toString()) 70 .arg(constellation.toString()).arg(bandwidth.toString()) 71 .arg(trans_mode.toString()).arg(guard_interval.toString()) 72 .arg(hierarchy.toString()).arg(polarity.toString()); 73 74 return ret; 44 75 } 45 46 void DVBConfParser::Channel::dump() 76 77 bool DTVMultiplex::operator==(const DTVMultiplex &m) const 47 78 { 48 cerr<<lcn<<" "<<mplexnumber<<" "<<name<<" "<<frequency<<" "<<inversion.toString()<<" "<<bandwidth.toString()<<" "<<coderate_hp.toString()<<" "<<coderate_lp.toString()<<" "<<constellation.toString()<<" "<<transmit_mode.toString()<<" "<<guard_interval.toString()<<" "<<hierarchy.toString()<<" "<<polarity.toString()<<" "<<serviceid<<endl; 79 return ((frequency == m.frequency) && 80 (modulation == m.modulation) && 81 (inversion == m.inversion) && 82 (bandwidth == m.bandwidth) && 83 (hp_code_rate == m.hp_code_rate) && 84 (lp_code_rate == m.lp_code_rate) && 85 (constellation == m.constellation) && 86 (trans_mode == m.trans_mode) && 87 (guard_interval == m.guard_interval) && 88 (fec == m.fec) && 89 (polarity == m.polarity) && 90 (hierarchy == m.hierarchy)); 49 91 } 50 92 51 bool DVBConfParser::Multiplex::operator==(const Multiplex& m) const 52 { 53 if ((frequency == m.frequency) && 54 (inversion == m.inversion) && 55 (bandwidth == m.bandwidth) && 56 (coderate_hp == m.coderate_hp) && 57 (coderate_lp == m.coderate_lp) && 58 (constellation == m.constellation) && 59 (transmit_mode == m.transmit_mode) && 60 (guard_interval == m.guard_interval) && 61 (fec == m.fec) && 62 (polarity == m.polarity) && 63 (hierarchy == m.hierarchy)) 64 return true; 65 else 66 return false; 93 QString DTVChannelInfo::toString() const 94 { 95 return QString("%1 %2 %3 ").arg(name).arg(serviceid).arg(lcn); 67 96 } 68 97 69 DVBConfParser::DVBConfParser(enum TYPE _type,unsigned _sourceid, 70 const QString& _file) 98 DTVConfParser::DTVConfParser(enum cardtype_t _type, uint _sourceid, 99 const QString &_file) 100 : type(_type), sourceid(_sourceid), filename(QDeepCopy<QString>(_file)) 71 101 { 72 type=_type;73 filename = _file;74 sourceid=_sourceid;75 102 } 76 103 77 int DVBConfParser::parse()104 DTVConfParser::return_t DTVConfParser::Parse(void) 78 105 { 79 QFile file( filename ); 80 if (file.open( IO_ReadOnly ) ) 106 channels.clear(); 107 108 QFile file(filename); 109 if (!file.open(IO_ReadOnly)) 110 return ERROR_OPEN; 111 112 bool ok = true; 113 QTextStream stream(&file); 114 QString line; 115 while (!stream.atEnd()) 81 116 { 82 QTextStream stream( &file ); 83 QString line; 84 while ( !stream.atEnd() ) 117 line = stream.readLine(); // line of text excluding '\n' 118 line.stripWhiteSpace(); 119 if (line.startsWith("#")) 120 continue; 121 122 QStringList list = QStringList::split(":", line); 123 QString str = *list.at(0); 124 int channelNo = -1; 125 126 if (str.at(0) == '@') 85 127 { 86 line = stream.readLine(); // line of text excluding '\n' 87 line.stripWhiteSpace(); 88 if (line.startsWith("#")) 89 continue; 90 QStringList list=QStringList::split(":",line); 91 QString str = *list.at(0); 92 int channelNo = -1; 93 if (str.at(0)=='@') 94 { 95 channelNo=str.mid(1).toInt(); 96 line = stream.readLine(); 97 list=QStringList::split(":",line); 98 } 99 str = *list.at(3); 100 if ((str == "T") || (str == "C") || (str=="S")) 101 { 102 if ((type == OFDM) && (str=="T")) 103 parseVDR(list,channelNo); 104 else if ((type == QPSK) && (str=="S")) 105 parseVDR(list,channelNo); 106 else if ((type == QAM) && (str=="C")) 107 parseVDR(list,channelNo); 108 } 109 else if (type==OFDM) 110 parseConfOFDM(list); 111 else if (type==ATSC) 112 parseConfATSC(list); 113 else if (type==QPSK) 114 parseConfQPSK(list); 115 else if (type==QAM) 116 parseConfQAM(list); 128 channelNo = str.mid(1).toInt(); 129 line = stream.readLine(); 130 list = QStringList::split(":", line); 117 131 } 118 file.close();119 132 120 processChannels(); 121 return OK; 133 str = *list.at(3); 134 135 if ((str == "T") || (str == "C") || (str == "S")) 136 { 137 if ((type == OFDM) && (str == "T")) 138 ok &= ParseVDR(list, channelNo); 139 else if ((type == QPSK) && (str == "S")) 140 ok &= ParseVDR(list, channelNo); 141 else if ((type == QAM) && (str == "C")) 142 ok &= ParseVDR(list, channelNo); 143 } 144 else if (type == OFDM) 145 ok &= ParseConfOFDM(list); 146 else if (type == ATSC) 147 ok &= ParseConfATSC(list); 148 else if (type == QPSK) 149 ok &= ParseConfQPSK(list); 150 else if (type == QAM) 151 ok &= ParseConfQAM(list); 122 152 } 123 return ERROR_OPEN; 153 file.close(); 154 155 return (ok) ? OK : ERROR_PARSE; 124 156 } 125 157 126 bool D VBConfParser::parseConfOFDM(QStringList&tokens)158 bool DTVConfParser::ParseConfOFDM(const QStringList &tokens) 127 159 { 128 Channel c; 129 QStringList::Iterator i = tokens.begin(); 130 QStringList::Iterator end = tokens.end(); 131 if (i != end) c.name = *i++; else return false; 132 if (i != end) c.frequency = (*i++).toInt(); else return false; 133 if (i == end || !c.inversion.parseConf(*i++)) return false; 134 if (i == end || !c.bandwidth.parseConf(*i++)) return false; 135 if (i == end || !c.coderate_hp.parseConf(*i++)) return false; 136 if (i == end || !c.coderate_lp.parseConf(*i++)) return false; 137 if (i == end || !c.constellation.parseConf(*i++)) return false; 138 if (i == end || !c.transmit_mode.parseConf(*i++)) return false; 139 if (i == end || !c.guard_interval.parseConf(*i++)) return false; 140 if (i == end || !c.hierarchy.parseConf(*i++)) return false; 141 if (i == end ) return false; else i++; 142 if (i == end ) return false; else i++; 143 if (i != end) c.serviceid = (*i++).toInt(); else return false; 160 DTVChannelInfo chan; 161 DTVMultiplex mux; 162 163 QStringList::const_iterator it = tokens.begin(); 164 165 PARSE_SKIP(unknown); 166 PARSE_UINT(mux.frequency); 167 PARSE_CONF(mux.inversion); 168 PARSE_CONF(mux.bandwidth); 169 PARSE_CONF(mux.hp_code_rate); 170 PARSE_CONF(mux.lp_code_rate); 171 PARSE_CONF(mux.constellation); 172 PARSE_CONF(mux.trans_mode); 173 PARSE_CONF(mux.guard_interval); 174 PARSE_CONF(mux.hierarchy); 175 PARSE_SKIP(unknown); 176 PARSE_SKIP(unknown); 177 PARSE_UINT(chan.serviceid); 144 178 145 channels.append(c);179 AddChannel(mux, chan); 146 180 147 181 return true; 148 182 } 149 183 150 bool D VBConfParser::parseConfATSC(QStringList&tokens)184 bool DTVConfParser::ParseConfATSC(const QStringList &tokens) 151 185 { 152 Channel c; 153 QStringList::Iterator i = tokens.begin(); 154 QStringList::Iterator end = tokens.end(); 155 if (i != end) c.name = *i++; else return false; 156 if (i != end) c.frequency = (*i++).toInt(); else return false; 157 if (i == end || !c.modulation.parseConf(*i++)) return false; 158 // We need the program number in the transport stream, 159 // otherwise we cannot "tune" to the program. 160 if (i == end ) return false; else i++; // Ignore video pid 161 if (i == end ) return false; else i++; // Ignore audio pid 162 if (i != end) c.serviceid = (*i++).toInt(); else return false; 186 DTVChannelInfo chan; 187 DTVMultiplex mux; 163 188 164 channels.append(c);189 QStringList::const_iterator it = tokens.begin(); 165 190 166 return true; 167 } 191 PARSE_STR(chan.name); 192 PARSE_UINT(mux.frequency); 193 PARSE_CONF(mux.modulation); 194 PARSE_SKIP(Ignore_Video_PID); 195 PARSE_SKIP(Ignore_Audio_PID); 196 PARSE_UINT(chan.serviceid); 197 198 AddChannel(mux, chan); 168 199 169 bool DVBConfParser::parseConfQAM(QStringList& tokens)170 {171 Channel c;172 QStringList::Iterator i = tokens.begin();173 QStringList::Iterator end = tokens.end();174 175 if (i != end) c.name = *i++; else return false;176 if (i != end) c.frequency = (*i++).toInt(); else return false;177 if (i == end || !c.inversion.parseConf(*i++)) return false;178 if (i != end) c.symbolrate = (*i++).toInt(); else return false;179 if (i == end || !c.fec.parseConf(*i++)) return false;180 if (i == end || !c.modulation.parseConf(*i++)) return false;181 if (i == end ) return false; else i++;182 if (i == end ) return false; else i++;183 if (i != end) c.serviceid = (*i++).toInt(); else return false;184 185 channels.append(c);186 200 return true; 187 201 } 188 202 189 bool D VBConfParser::parseConfQPSK(QStringList&tokens)203 bool DTVConfParser::ParseConfQAM(const QStringList &tokens) 190 204 { 191 Channel c; 192 QStringList::iterator it = tokens.begin(); 193 194 if (it != tokens.end()) 195 c.name = *it++; 196 else 197 return false; 198 199 if (it != tokens.end()) 200 c.frequency = (*it++).toUInt() * 1000; 201 else 202 return false; 203 204 if (it == tokens.end() || !c.polarity.parseConf(*it++)) 205 return false; 205 DTVChannelInfo chan; 206 DTVMultiplex mux; 206 207 207 if (it == tokens.end()) 208 return false; 209 else 210 it++; //Sat num 208 QStringList::const_iterator it = tokens.begin(); 211 209 212 if (it != tokens.end()) 213 c.symbolrate = (*it++).toUInt() * 1000; 214 else 215 return false; 210 PARSE_SKIP(unknown); 211 PARSE_UINT(mux.frequency); 212 PARSE_CONF(mux.inversion); 213 PARSE_UINT(mux.symbolrate); 214 PARSE_CONF(mux.fec); 215 PARSE_CONF(mux.modulation); 216 PARSE_SKIP(unknown); 217 PARSE_SKIP(unknown); 218 PARSE_UINT(chan.serviceid); 216 219 217 if (it == tokens.end()) 218 return false; 219 else 220 it++; 220 AddChannel(mux, chan); 221 221 222 if (it == tokens.end())223 return false;224 else225 it++;226 227 if (it != tokens.end())228 c.serviceid = (*it++).toInt();229 else230 return false;231 232 channels.append(c);233 222 return true; 234 223 } 235 224 236 bool D VBConfParser::parseVDR(QStringList& tokens, int channelNo)225 bool DTVConfParser::ParseConfQPSK(const QStringList &tokens) 237 226 { 238 Channel c; 239 QStringList::Iterator i = tokens.begin(); 240 QStringList::Iterator end = tokens.end(); 241 c.lcn = channelNo; 242 243 //BBC ONE:754166:I999B8C34D34M16T2G32Y0:T:27500:600:601,602:0:0:4168:0:0:0 244 if (i != end) c.name = *i++; else return false; 245 if (i != end) c.frequency = (*i++).toInt()*1000; else return false; 246 if (i == end) return false; 247 QString params = (*i++); 248 while (!params.isEmpty()) 249 { 250 QString ori = params; 251 int s = *(const char*)params; 252 params=params.mid(1); 253 switch(s) 254 { 255 case 'I': 256 c.inversion.parseVDR(params); 257 break; 258 case 'B': 259 c.bandwidth.parseVDR(params); 260 break; 261 case 'C': 262 c.coderate_hp.parseVDR(params); 263 break; 264 case 'D': 265 c.coderate_lp.parseVDR(params); 266 break; 267 case 'M': 268 c.constellation.parseVDR(params); 269 break; 270 case 'T': 271 c.transmit_mode.parseVDR(params); 272 break; 273 case 'G': 274 c.guard_interval.parseVDR(params); 275 break; 276 case 'Y': 277 c.hierarchy.parseVDR(params); 278 break; 279 case 'V': 280 case 'H': 281 case 'R': 282 case 'L': 283 c.polarity.parseVDR(ori); 284 break; 285 default: 286 return false; 287 } 288 } 289 290 if (i == end ) return false; else i++; 291 if (i == end ) return false; else i++; 292 if (i == end ) return false; else i++; 293 if (i == end ) return false; else i++; 294 if (i == end ) return false; else i++; 295 if (i == end ) return false; else i++; 296 if (i != end) c.serviceid = (*i++).toInt(); else return false; 227 DTVChannelInfo chan; 228 DTVMultiplex mux; 229 230 QStringList::const_iterator it = tokens.begin(); 231 232 PARSE_STR(chan.name); 233 PARSE_UINT_1000(mux.frequency); 234 PARSE_CONF(mux.polarity); 235 PARSE_SKIP(Satelite_Number); 236 PARSE_UINT_1000(mux.symbolrate); 237 PARSE_SKIP(unknown); 238 PARSE_SKIP(unknown); 239 PARSE_UINT(chan.serviceid); 240 241 AddChannel(mux, chan); 297 242 298 channels.append(c);299 243 return true; 300 244 } 301 245 302 int DVBConfParser::generateNewChanID(int sourceID)246 bool DTVConfParser::ParseVDR(const QStringList &tokens, int channelNo) 303 247 { 304 MSqlQuery query(MSqlQuery::InitCon()); 305 306 QString theQuery = 307 QString("SELECT max(chanid) as maxchan " 308 "FROM channel WHERE sourceid=%1").arg(sourceID); 309 query.prepare(theQuery); 248 DTVChannelInfo chan; 249 DTVMultiplex mux; 310 250 311 if (!query.exec()) 312 MythContext::DBError("Calculating new ChanID", query); 251 QStringList::const_iterator it = tokens.begin(); 313 252 314 if (!query.isActive()) 315 MythContext::DBError("Calculating new ChanID for Analog Channel",query); 253 chan.lcn = channelNo; 316 254 317 query.next(); 255 // BBC ONE:754166:I999B8C34D34M16T2G32Y0:T:27500:600:601, 602:0:0:4168:0:0:0 318 256 319 // If transport not present add it, and move on to the next 320 if (query.size() <= 0) 321 return sourceID * 1000; 257 PARSE_SKIP(unknown); 322 258 323 int MaxChanID = query.value(0).toInt();259 PARSE_UINT_1000(mux.frequency); 324 260 325 if (MaxChanID == 0) 326 return sourceID * 1000; 327 else 328 return MaxChanID + 1; 329 } 330 331 int DVBConfParser::findMultiplex(const DVBConfParser::Multiplex& m) 332 { 333 MSqlQuery query(MSqlQuery::InitCon()); 334 QString queryStr=QString("SELECT mplexid FROM dtv_multiplex WHERE " 335 "sourceid= %1 AND frequency=%2 AND inversion=\"%3\" AND ") 336 .arg(sourceid).arg(m.frequency).arg(m.inversion.toString()); 261 if (it == tokens.end()) 262 return false; 337 263 338 switch (type) 339 { 340 case OFDM: 341 queryStr+=QString("sistandard=\"dvb\" AND bandwidth=\"%1\" AND " 342 "hp_code_rate=\"%2\" AND " 343 "lp_code_rate=\"%3\" AND constellation=\"%4\" AND " 344 "transmission_mode=\"%5\" AND guard_interval=\"%6\" AND " 345 "hierarchy=\"%7\";") 346 .arg(m.bandwidth.toString()) 347 .arg(m.coderate_hp.toString()) 348 .arg(m.coderate_lp.toString()) 349 .arg(m.constellation.toString()) 350 .arg(m.transmit_mode.toString()) 351 .arg(m.guard_interval.toString()) 352 .arg(m.hierarchy.toString()); 353 break; 354 case QPSK: 355 queryStr+=QString("sistandard=\"dvb\" AND symbolrate=%1 AND " 356 "polarity=\"%2\";").arg(m.symbolrate) 357 .arg(m.polarity.toString()); 358 break; 359 case QAM: 360 queryStr+=QString("symbolrate=%1 AND modulation=\"%2\" AND fec=\"%3\";") 361 .arg(m.symbolrate) 362 .arg(m.modulation.toString()) 363 .arg(m.fec.toString()); 364 break; 365 case ATSC: 366 queryStr+=QString("modulation=\"%1\";") 367 .arg(m.modulation.toString()); 368 break; 369 } 370 query.prepare(queryStr); 371 if (!query.exec()) 372 MythContext::DBError("searching for transport", query); 373 if (!query.isActive()) 374 MythContext::DBError("searching for transport.", query); 375 if (query.size() > 0) 264 QString params = (*it++); 265 while (!params.isEmpty()) 376 266 { 377 query.next(); 378 return query.value(0).toInt(); 267 QString ori = params; 268 int s = *((const char*)params); 269 params = params.mid(1); 270 switch (s) 271 { 272 case 'I': 273 mux.inversion.ParseVDR(params); 274 break; 275 case 'B': 276 mux.bandwidth.ParseVDR(params); 277 break; 278 case 'C': 279 mux.hp_code_rate.ParseVDR(params); 280 break; 281 case 'D': 282 mux.lp_code_rate.ParseVDR(params); 283 break; 284 case 'M': 285 mux.constellation.ParseVDR(params); 286 break; 287 case 'T': 288 mux.trans_mode.ParseVDR(params); 289 break; 290 case 'G': 291 mux.guard_interval.ParseVDR(params); 292 break; 293 case 'Y': 294 mux.hierarchy.ParseVDR(params); 295 break; 296 case 'V': 297 case 'H': 298 case 'R': 299 case 'L': 300 mux.polarity.ParseVDR(ori); 301 break; 302 default: 303 return false; 304 } 379 305 } 380 return -1;381 }382 306 383 int DVBConfParser::findChannel(const DVBConfParser::Channel &c, int &mplexid) 384 { 385 MSqlQuery query(MSqlQuery::InitCon()); 307 for (uint i = 0; i < 6; i++) 308 PARSE_SKIP(unknown); 386 309 387 // try to find exact match first 388 query.prepare("SELECT chanid " 389 "FROM channel " 390 "WHERE callsign = :CALLSIGN AND " 391 " mplexid = :MPLEXID AND " 392 " sourceid = :SOURCEID"); 393 query.bindValue(":MPLEXID", multiplexes[c.mplexnumber].mplexid); 394 query.bindValue(":SOURCEID", sourceid); 395 query.bindValue(":CALLSIGN", c.name.utf8()); 396 397 if (!query.exec() || !query.isActive()) 398 MythContext::DBError("searching for channel", query); 399 else if (query.next()) 400 { 401 mplexid = multiplexes[c.mplexnumber].mplexid; 402 return query.value(0).toInt(); 403 } 310 PARSE_UINT(chan.serviceid); 404 311 405 // if we didn't find exact match, try to match just the source & callsign 406 query.prepare("SELECT chanid, mplexid " 407 "FROM channel " 408 "WHERE callsign = :CALLSIGN AND " 409 " sourceid = :SOURCEID"); 410 query.bindValue(":SOURCEID", sourceid); 411 query.bindValue(":CALLSIGN", c.name.utf8()); 412 413 if (!query.exec() || !query.isActive()) 414 MythContext::DBError("searching for channel", query); 415 else if (query.next()) 416 { 417 mplexid = query.value(1).toInt(); 418 return query.value(0).toInt(); 419 } 312 AddChannel(mux, chan); 420 313 421 return -1;422 } 314 return true; 315 } 423 316 424 void D VBConfParser::processChannels()317 void DTVConfParser::AddChannel(const DTVMultiplex &mux, DTVChannelInfo &chan) 425 318 { 426 ListChannels::iterator iter; 427 for (iter=channels.begin();iter!=channels.end();iter++) 319 for (uint i = 0; i < channels.size(); i++) 428 320 { 429 bool fFound = false; 430 for (unsigned i=0;i<multiplexes.size() && !fFound;i++ ) 321 if (channels[i] == mux) 431 322 { 432 if (multiplexes[i] == (Multiplex)(*iter)) 433 { 434 (*iter).mplexnumber = i; 435 fFound = true; 436 } 437 } 438 if (!fFound) 439 { 440 (*iter).mplexnumber = multiplexes.size(); 441 multiplexes.append((Multiplex)(*iter)); 323 channels[i].channels.push_back(chan); 324 325 VERBOSE(VB_IMPORTANT, "Imported channel: "<<chan.toString() 326 <<" on "<<mux.toString()); 327 return; 442 328 } 443 }444 /*445 for (iter=channels.begin();iter!=channels.end();iter++)446 (*iter).dump();447 for (unsigned i=0;i<multiplexes.size() ;i++ )448 multiplexes[i].dump();449 */450 QString standard = (type == ATSC) ? "atsc" : "dvb";451 //create the multiplexes452 MSqlQuery query(MSqlQuery::InitCon());453 for (unsigned i=0;i<multiplexes.size() ;i++ )454 {455 int mplexid = findMultiplex(multiplexes[i]);456 if (mplexid < 0)457 {458 query.prepare("INSERT into dtv_multiplex (frequency, "459 "sistandard, sourceid,inversion,bandwidth,hp_code_rate,"460 "lp_code_rate,constellation,transmission_mode,guard_interval,"461 "hierarchy,modulation,symbolrate,fec,polarity) "462 "VALUES (:FREQUENCY,:STANDARD,:SOURCEID,:INVERSION,:BANDWIDTH,"463 ":CODERATE_HP,:CODERATE_LP,:CONSTELLATION,:TRANS_MODE,"464 ":GUARD_INTERVAL,:HIERARCHY,:MODULATION,:SYMBOLRATE,"465 ":FEC,:POLARITY);");466 query.bindValue(":STANDARD",standard);467 query.bindValue(":SOURCEID",sourceid);468 query.bindValue(":FREQUENCY",multiplexes[i].frequency);469 query.bindValue(":INVERSION",multiplexes[i].inversion.toString());470 query.bindValue(":BANDWIDTH",multiplexes[i].bandwidth.toString());471 query.bindValue(":CODERATE_HP",multiplexes[i].coderate_hp.toString());472 query.bindValue(":CODERATE_LP",multiplexes[i].coderate_lp.toString());473 query.bindValue(":CONSTELLATION",multiplexes[i].constellation.toString());474 query.bindValue(":TRANS_MODE",multiplexes[i].transmit_mode.toString());475 query.bindValue(":GUARD_INTERVAL",multiplexes[i].guard_interval.toString());476 query.bindValue(":HIERARCHY",multiplexes[i].hierarchy.toString());477 query.bindValue(":MODULATION",multiplexes[i].modulation.toString());478 query.bindValue(":SYMBOLRATE",multiplexes[i].symbolrate);479 query.bindValue(":FEC",multiplexes[i].fec.toString());480 query.bindValue(":POLARITY",multiplexes[i].polarity.toString());481 482 if (!query.exec())483 MythContext::DBError("Inserting new transport", query);484 if (!query.isActive())485 MythContext::DBError("Adding transport to Database.", query);486 query.prepare("select max(mplexid) from dtv_multiplex;");487 if (!query.exec())488 MythContext::DBError("Getting ID of new Transport", query);489 if (!query.isActive())490 MythContext::DBError("Getting ID of new Transport.", query);491 if (query.size() > 0)492 {493 query.next();494 multiplexes[i].mplexid = query.value(0).toInt();495 }496 }497 else498 multiplexes[i].mplexid = mplexid;499 329 } 500 330 501 // If the channel number cannot be determined from the config 502 // file, assign temporary unique numbers. First determine the 503 // highest channel number already assigned. This will likely 504 // fail if there are any ATSC channels, since channum is not 505 // really an integer. But in that case 501 is a generally safe 506 // offset for the first unknown channel. 507 int maxchannum = 500; 508 query.prepare("SELECT MAX(channum) FROM channel"); 509 if (!query.exec() || !query.isActive()) 510 MythContext::DBError("Getting highest channel number.", query); 511 else if (query.next()) 512 maxchannum = max(maxchannum, query.value(0).toInt()); 513 for (iter = channels.begin(); iter != channels.end(); ++iter) 514 maxchannum = max(maxchannum, (*iter).lcn); 331 channels.push_back(mux); 332 channels.back().channels.push_back(chan); 515 333 516 // Now insert the channels 517 for (iter=channels.begin();iter!=channels.end();iter++) 518 { 519 int mplexid = multiplexes[(*iter).mplexnumber].mplexid; 520 int db_mplexid = 0; 521 int chanid = findChannel(*iter, db_mplexid); 522 if (chanid < 0) 523 { 524 // The channel does not exist in the DB at all, insert it. 525 query.prepare("INSERT INTO channel (chanid, channum, " 526 "sourceid, callsign, name, mplexid, " 527 "serviceid) " 528 "VALUES (:CHANID,:CHANNUM,:SOURCEID,:CALLSIGN," 529 ":NAME,:MPLEXID,:SERVICEID);"); 530 531 // If the channel number is unknown, get next unique number 532 int channum = (*iter).lcn; 533 if (-1 == channum) 534 channum = ++maxchannum; 535 536 int chanid = ChannelUtil::CreateChanID( 537 sourceid, QString::number(channum)); 538 539 query.bindValue(":CHANID", chanid); 540 query.bindValue(":CHANNUM", channum); 541 query.bindValue(":SOURCEID", sourceid); 542 query.bindValue(":CALLSIGN", (*iter).name.utf8()); 543 query.bindValue(":NAME", (*iter).name.utf8()); 544 query.bindValue(":MPLEXID", mplexid); 545 query.bindValue(":SERVICEID", (*iter).serviceid); 546 if (!query.exec() || !query.isActive()) 547 { 548 MythContext::DBError("Adding new DVB Channel", query); 549 emit updateText(QObject::tr("Failed to add %1: DB error") 550 .arg((*iter).name)); 551 } 552 else 553 { 554 emit updateText(QObject::tr("Adding %1").arg((*iter).name)); 555 } 556 } 557 else if (db_mplexid == 32767) 558 { 559 // The channel in the database if from the listings provider amd 560 // does not have tuning information. Just fill in the tuning info. 561 query.prepare("UPDATE channel " 562 "SET mplexid = :MPLEXID, " 563 " serviceid = :SERVICEID " 564 "WHERE chanid = :CHANID AND " 565 " sourceid = :SOURCEID "); 566 567 query.bindValue(":MPLEXID", mplexid); 568 query.bindValue(":SERVICEID", (*iter).serviceid); 569 query.bindValue(":CHANID", chanid); 570 query.bindValue(":SOURCEID", sourceid); 571 572 if (!query.exec() || !query.isActive()) 573 { 574 MythContext::DBError("Updating DVB Channel", query); 575 emit updateText(QObject::tr("Failed to add %1: DB error") 576 .arg((*iter).name)); 577 } 578 else 579 { 580 emit updateText(QObject::tr("Updating %1").arg((*iter).name)); 581 } 582 } 583 else 584 emit updateText(QObject::tr("Skipping %1").arg((*iter).name)); 585 } 334 VERBOSE(VB_IMPORTANT, "Imported channel: "<<chan.toString() 335 <<" on "<<mux.toString()); 586 336 } -
libs/libmythtv/dvbconfparser.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/dvbconfparser.h mythtv-0.20/libs/libmythtv/dvbconfparser.h
old new 30 30 * 31 31 */ 32 32 33 #ifndef DVBCONFPARSER_H34 #define DVBCONFPARSER_H33 #ifndef _DTVCONFPARSER_H_ 34 #define _DTVCONFPARSER_H_ 35 35 36 #include <qobject.h> 37 #include <qvaluevector.h> 36 // POSIX headers 37 #include <stdint.h> 38 #include <unistd.h> 39 40 // C++ headers 41 #include <vector> 42 using namespace std; 43 44 // Qt headers 38 45 #include <qstring.h> 39 #include <dvbtypes.h>40 46 41 /** 42 * class DVBConfParser 43 * @brief parses channels.conf files into the mythtv structure 47 // MythTV headers 48 #include "dtvconfparserhelpers.h" 49 50 class QStringList; 51 52 class DTVMultiplex 53 { 54 public: 55 DTVMultiplex() : frequency(0), symbolrate(0) { } 56 57 bool operator==(const DTVMultiplex &m) const; 58 59 QString toString() const; 60 61 public: 62 uint64_t frequency; 63 uint symbolrate; 64 DTVInversion inversion; 65 DTVBandwidth bandwidth; 66 DTVCodeRate hp_code_rate; 67 DTVCodeRate lp_code_rate; 68 DTVModulation constellation; 69 DTVModulation modulation; 70 DTVTransmitMode trans_mode; 71 DTVGuardInterval guard_interval; 72 DTVHierarchy hierarchy; 73 DTVPolarity polarity; 74 DTVCodeRate fec; 75 }; 76 77 class DTVChannelInfo 78 { 79 public: 80 DTVChannelInfo() : 81 name(QString::null), serviceid(0), lcn(-1) {} 82 83 QString toString() const; 84 85 public: 86 QString name; 87 uint serviceid; 88 int lcn; 89 }; 90 typedef vector<DTVChannelInfo> DTVChannelInfoList; 91 92 class DTVTransport : public DTVMultiplex 93 { 94 public: 95 DTVTransport(const DTVMultiplex &other) : DTVMultiplex(other) { } 96 97 public: 98 DTVChannelInfoList channels; 99 }; 100 typedef vector<DTVTransport> DTVChannelList; 101 102 /** \class DTVConfParser 103 * \brief Parses dvb-utils channel scanner output files. 44 104 */ 45 class D VBConfParser : public QObject105 class DTVConfParser 46 106 { 47 Q_OBJECT 48 protected: 49 class Multiplex 50 { 51 public: 52 Multiplex() : frequency(0),symbolrate(0),mplexid(0) {} 53 bool operator==(const Multiplex& m) const; 54 55 unsigned frequency; 56 unsigned symbolrate; 57 DVBInversion inversion; 58 DVBBandwidth bandwidth; 59 DVBCodeRate coderate_hp; 60 DVBCodeRate coderate_lp; 61 DVBModulation constellation; 62 DVBModulation modulation; 63 DVBTransmitMode transmit_mode; 64 DVBGuardInterval guard_interval; 65 DVBHierarchy hierarchy; 66 DVBPolarity polarity; 67 DVBCodeRate fec; 68 unsigned mplexid; 69 70 void dump(); 71 }; 72 73 class Channel : public Multiplex 74 { 75 public: 76 Channel() : serviceid(0),mplexnumber(0), lcn(-1) {} 77 78 QString name; 79 unsigned serviceid; 80 unsigned mplexnumber; 81 int lcn; 82 83 void dump(); 84 }; 85 86 typedef QValueList<Channel> ListChannels; 87 88 ListChannels channels; 89 QValueVector<Multiplex> multiplexes; 90 91 public: 92 enum RETURN {ERROR_OPEN,ERROR_PARSE,OK}; 93 enum TYPE {ATSC,OFDM,QPSK,QAM}; 94 95 DVBConfParser(enum TYPE _type,unsigned sourceid, const QString& _file); 96 virtual ~DVBConfParser() {}; 97 int parse(); 98 99 signals: 100 /** @brief Status message from the scan engine 101 @param status the message 102 */ 103 void updateText(const QString& status); 104 protected: 105 QString filename; 106 TYPE type; 107 unsigned sourceid; 108 bool parseVDR(QStringList& tokens, int channelNo = -1); 109 bool parseConf(QStringList& tokens); 110 bool parseConfOFDM(QStringList& tokens); 111 bool parseConfQPSK(QStringList& tokens); 112 bool parseConfQAM(QStringList& tokens); 113 bool parseConfATSC(QStringList& tokens); 114 void processChannels(); 115 int findMultiplex(const Multiplex& m); 116 int findChannel(const Channel& c, int& mplexid); 117 int generateNewChanID(int sourceID); 107 public: 108 enum return_t { ERROR_OPEN, ERROR_PARSE, OK }; 109 enum cardtype_t { ATSC, OFDM, QPSK, QAM, UNKNOWN }; 110 111 DTVConfParser(enum cardtype_t _type, uint sourceid, const QString &_file); 112 virtual ~DTVConfParser() { } 113 114 return_t Parse(void); 115 116 DTVChannelList GetChannels(void) const { return channels; } 117 118 private: 119 bool ParseVDR( const QStringList &tokens, int channelNo = -1); 120 bool ParseConf( const QStringList &tokens); 121 bool ParseConfOFDM(const QStringList &tokens); 122 bool ParseConfQPSK(const QStringList &tokens); 123 bool ParseConfQAM( const QStringList &tokens); 124 bool ParseConfATSC(const QStringList &tokens); 125 126 private: 127 cardtype_t type; 128 uint sourceid; 129 QString filename; 130 131 void AddChannel(const DTVMultiplex &mux, DTVChannelInfo &chan); 132 133 DTVChannelList channels; 118 134 }; 119 135 120 #endif 136 #endif // _DTVCONFPARSER_H_ -
libs/libmythtv/dvbtypes.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/dvbtypes.cpp mythtv-0.20/libs/libmythtv/dvbtypes.cpp
old new static QString mod2str(fe_modulation mod 8 8 static QString mod2dbstr(fe_modulation mod); 9 9 static QString coderate(fe_code_rate_t coderate); 10 10 11 DVBParamHelper<PolarityValues>::Table DVBPolarity::parseTable[] =12 {13 {"v",Vertical},14 {"h",Horizontal},15 {"r",Right},16 {"l",Left},17 {NULL,Vertical}18 };19 20 char *DVBPolarity::stringLookup[] =21 {22 "v", // Vertical23 "h", // Horizontal24 "r", // Right25 "l" // Left26 };27 28 DVBParamHelper<fe_spectral_inversion_t>::Table DVBInversion::confTable[] =29 {30 {"INVERSION_AUTO",INVERSION_AUTO},31 {"INVERSION_OFF",INVERSION_OFF},32 {"INVERSION_ON",INVERSION_ON},33 {NULL,INVERSION_AUTO}34 };35 36 DVBParamHelper<fe_spectral_inversion_t>::Table DVBInversion::vdrTable[] =37 {38 {"999",INVERSION_AUTO},39 {"0",INVERSION_OFF},40 {"1",INVERSION_ON},41 {NULL,INVERSION_AUTO}42 };43 44 DVBParamHelper<fe_spectral_inversion_t>::Table DVBInversion::parseTable[] =45 {46 {"a",INVERSION_AUTO},47 {"0",INVERSION_OFF},48 {"1",INVERSION_ON},49 {NULL,INVERSION_AUTO}50 };51 52 char* DVBInversion::stringLookup[] =53 {54 "0", // INVERSION_OFF,55 "1", // INVERSION_ON,56 "a" //INVERSION_AUTO57 };58 59 DVBParamHelper<fe_bandwidth_t>::Table DVBBandwidth::confTable[] =60 {61 {"BANDWIDTH_AUTO",BANDWIDTH_AUTO},62 {"BANDWIDTH_8_MHZ",BANDWIDTH_8_MHZ},63 {"BANDWIDTH_7_MHZ",BANDWIDTH_7_MHZ},64 {"BANDWIDTH_6_MHZ",BANDWIDTH_6_MHZ},65 {NULL,BANDWIDTH_AUTO}66 };67 68 DVBParamHelper<fe_bandwidth_t>::Table DVBBandwidth::vdrTable[] =69 {70 {"999",BANDWIDTH_AUTO},71 {"8",BANDWIDTH_8_MHZ},72 {"7",BANDWIDTH_7_MHZ},73 {"6",BANDWIDTH_6_MHZ},74 {NULL,BANDWIDTH_AUTO},75 };76 77 DVBParamHelper<fe_bandwidth_t>::Table DVBBandwidth::parseTable[] =78 {79 {"auto",BANDWIDTH_AUTO},80 {"8",BANDWIDTH_8_MHZ},81 {"7",BANDWIDTH_7_MHZ},82 {"6",BANDWIDTH_6_MHZ},83 {NULL,BANDWIDTH_AUTO}84 };85 86 char *DVBBandwidth::stringLookup[]=87 {88 "8", //BANDWIDTH_8_MHZ,89 "7", //BANDWIDTH_7_MHZ,90 "6", //BANDWIDTH_6_MHZ,91 "auto" //BANDWIDTH_AUTO92 };93 94 DVBParamHelper<fe_code_rate_t>::Table DVBCodeRate::confTable[] =95 {96 {"FEC_AUTO",FEC_AUTO},97 {"FEC_1_2",FEC_1_2},98 {"FEC_2_3",FEC_2_3},99 {"FEC_3_4",FEC_3_4},100 {"FEC_4_5",FEC_4_5},101 {"FEC_5_6",FEC_5_6},102 {"FEC_6_7",FEC_6_7},103 {"FEC_7_8",FEC_7_8},104 {"FEC_8_9",FEC_8_9},105 {"FEC_NONE",FEC_NONE},106 {NULL,FEC_AUTO}107 };108 109 DVBParamHelper<fe_code_rate_t>::Table DVBCodeRate::vdrTable[] =110 {111 {"999",FEC_AUTO},112 {"12",FEC_1_2},113 {"23",FEC_2_3},114 {"34",FEC_3_4},115 {"45",FEC_4_5},116 {"56",FEC_5_6},117 {"67",FEC_6_7},118 {"78",FEC_7_8},119 {"89",FEC_8_9},120 {"0",FEC_NONE},121 {NULL,FEC_AUTO}122 };123 124 DVBParamHelper<fe_code_rate_t>::Table DVBCodeRate::parseTable[] =125 {126 {"auto",FEC_AUTO},127 {"1/2",FEC_1_2},128 {"2/3",FEC_2_3},129 {"3/4",FEC_3_4},130 {"4/5",FEC_4_5},131 {"5/6",FEC_5_6},132 {"6/7",FEC_6_7},133 {"7/8",FEC_7_8},134 {"8/9",FEC_8_9},135 {"none",FEC_NONE},136 {NULL,FEC_AUTO}137 };138 139 char *DVBCodeRate::stringLookup[] =140 {141 "none", //FEC_NONE,142 "1/2", //FEC_1_2,143 "2/3", //FEC_2_3,144 "3/4", //FEC_3_4,145 "4/5", //FEC_4_5,146 "5/6", //FEC_5_6,147 "6/7", //FEC_6_7,148 "7/8", //FEC_7_8,149 "8/9", //FEC_8_9,150 "auto" //FEC_AUTO151 };152 153 DVBParamHelper<fe_modulation_t>::Table DVBModulation::confTable[] =154 {155 {"QAM_AUTO",QAM_AUTO},156 {"QAM_16",QAM_16},157 {"QAM_32",QAM_32},158 {"QAM_64",QAM_64},159 {"QAM_128",QAM_128},160 {"QAM_256",QAM_256},161 {"QPSK",QPSK},162 #ifdef FE_GET_EXTENDED_INFO163 {"8PSK", MOD_8PSK},164 #endif165 {NULL,QAM_AUTO},166 };167 168 DVBParamHelper<fe_modulation_t>::Table DVBModulation::vdrTable[] =169 {170 {"999",QAM_AUTO},171 {"16",QAM_16},172 {"32",QAM_32},173 {"64",QAM_64},174 {"128",QAM_128},175 {"256",QAM_256},176 {"0",QPSK},177 {NULL,QAM_AUTO},178 };179 180 DVBParamHelper<fe_modulation_t>::Table DVBModulation::parseTable[] =181 {182 {"auto",QAM_AUTO},183 {"qam_16",QAM_16},184 {"qam_32",QAM_32},185 {"qam_64",QAM_64},186 {"qam_128",QAM_128},187 {"qam_256",QAM_256},188 {"qpsk",QPSK},189 {"8vsb",VSB_8},190 {"16vsb",VSB_16},191 #ifdef FE_GET_EXTENDED_INFO192 {"8psk", MOD_8PSK},193 #endif194 {NULL,QAM_AUTO},195 };196 197 char *DVBModulation::stringLookup[] =198 {199 "qpsk", //QPSK,200 "qam_16", //QAM_16,201 "qam_32", //QAM_32,202 "qam_64", //QAM_64,203 "qam_128", //QAM_128,204 "qam_256", //QAM_256,205 "auto", //QAM_AUTO,206 "8vsb", //VSB_8,207 "16vsb", //VSB_16208 #ifdef FE_GET_EXTENDED_INFO209 "8psk", //MOD_8PSK210 #endif211 };212 213 DVBParamHelper<fe_transmit_mode_t>::Table DVBTransmitMode::confTable[] =214 {215 {"TRANSMISSION_MODE_AUTO",TRANSMISSION_MODE_AUTO},216 {"TRANSMISSION_MODE_2K",TRANSMISSION_MODE_2K},217 {"TRANSMISSION_MODE_8K",TRANSMISSION_MODE_8K},218 {NULL,TRANSMISSION_MODE_AUTO},219 };220 221 DVBParamHelper<fe_transmit_mode_t>::Table DVBTransmitMode::vdrTable[] =222 {223 {"999",TRANSMISSION_MODE_AUTO},224 {"2",TRANSMISSION_MODE_2K},225 {"8",TRANSMISSION_MODE_8K},226 {NULL,TRANSMISSION_MODE_AUTO},227 };228 229 DVBParamHelper<fe_transmit_mode_t>::Table DVBTransmitMode::parseTable[] =230 {231 {"auto",TRANSMISSION_MODE_AUTO},232 {"2",TRANSMISSION_MODE_2K},233 {"8",TRANSMISSION_MODE_8K},234 {NULL,TRANSMISSION_MODE_AUTO},235 };236 237 char *DVBTransmitMode::stringLookup[] =238 {239 "2", //TRANSMISSION_MODE_2K,240 "8", //TRANSMISSION_MODE_8K,241 "auto" //TRANSMISSION_MODE_AUTO242 };243 244 DVBParamHelper<fe_guard_interval_t>::Table DVBGuardInterval::confTable[] =245 {246 {"GUARD_INTERVAL_AUTO",GUARD_INTERVAL_AUTO},247 {"GUARD_INTERVAL_1_32",GUARD_INTERVAL_1_32},248 {"GUARD_INTERVAL_1_16",GUARD_INTERVAL_1_16},249 {"GUARD_INTERVAL_1_8",GUARD_INTERVAL_1_8},250 {"GUARD_INTERVAL_1_4",GUARD_INTERVAL_1_4},251 {NULL,GUARD_INTERVAL_AUTO},252 };253 254 DVBParamHelper<fe_guard_interval_t>::Table DVBGuardInterval::vdrTable[] =255 {256 {"999",GUARD_INTERVAL_AUTO},257 {"32",GUARD_INTERVAL_1_32},258 {"16",GUARD_INTERVAL_1_16},259 {"8",GUARD_INTERVAL_1_8},260 {"4",GUARD_INTERVAL_1_4},261 {NULL,GUARD_INTERVAL_AUTO},262 };263 264 DVBParamHelper<fe_guard_interval_t>::Table DVBGuardInterval::parseTable[] =265 {266 {"auto",GUARD_INTERVAL_AUTO},267 {"1/32",GUARD_INTERVAL_1_32},268 {"1/16",GUARD_INTERVAL_1_16},269 {"1/8",GUARD_INTERVAL_1_8},270 {"1/4",GUARD_INTERVAL_1_4},271 {NULL,GUARD_INTERVAL_AUTO},272 };273 274 char *DVBGuardInterval::stringLookup[] =275 {276 "1/32", // GUARD_INTERVAL_1_32,277 "1/16", // GUARD_INTERVAL_1_16,278 "1/8", // GUARD_INTERVAL_1_8,279 "1/4", // GUARD_INTERVAL_1_4,280 "auto" // GUARD_INTERVAL_AUTO281 };282 283 DVBParamHelper<fe_hierarchy_t>::Table DVBHierarchy::confTable[] =284 {285 {"HIERARCHY_NONE",HIERARCHY_NONE},286 {"HIERARCHY_1",HIERARCHY_1},287 {"HIERARCHY_2",HIERARCHY_2},288 {"HIERARCHY_4",HIERARCHY_4},289 {"HIERARCHY_AUTO",HIERARCHY_AUTO},290 {NULL,HIERARCHY_AUTO},291 };292 293 DVBParamHelper<fe_hierarchy_t>::Table DVBHierarchy::vdrTable[] =294 {295 {"0",HIERARCHY_NONE},296 {"1",HIERARCHY_1},297 {"2",HIERARCHY_2},298 {"4",HIERARCHY_4},299 {"999",HIERARCHY_AUTO},300 {NULL,HIERARCHY_AUTO},301 };302 303 DVBParamHelper<fe_hierarchy_t>::Table DVBHierarchy::parseTable[] =304 {305 {"n",HIERARCHY_NONE},306 {"1",HIERARCHY_1},307 {"2",HIERARCHY_2},308 {"4",HIERARCHY_4},309 {"a",HIERARCHY_AUTO},310 {NULL,HIERARCHY_AUTO},311 };312 313 char *DVBHierarchy::stringLookup[] =314 {315 "n", //HIERARCHY_NONE,316 "1", //HIERARCHY_1,317 "2", //HIERARCHY_2,318 "4", //HIERARCHY_4,319 "a" //HIERARCHY_AUTO320 };321 322 11 bool equal_qpsk(const struct dvb_fe_params &p, 323 12 const struct dvb_fe_params &op, uint range) 324 13 { -
libs/libmythtv/dvbtypes.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/dvbtypes.h mythtv-0.20/libs/libmythtv/dvbtypes.h
old new QString toString(const struct dvb_fe_par 67 67 QString toString(fe_status); 68 68 QString toString(const struct dvb_frontend_event&, const fe_type_t); 69 69 70 //The following are a set of helper classes to allow easy translation71 //between the actual dvb enums and db strings.72 73 //Helper abstract template to do some of the mundain bits74 //of translating the DVBParamHelpers75 template <typename V> class DVBParamHelper76 {77 protected:78 V value;79 80 struct Table81 {82 QString symbol;83 V value;84 };85 86 static bool parseParam(QString& symbol, V& value, Table *table)87 {88 Table *p = table;89 while (p->symbol!=NULL)90 {91 if (p->symbol==symbol.left(p->symbol.length()))92 {93 symbol=symbol.mid(p->symbol.length());94 value = p->value;95 return true;96 }97 p++;98 }99 return false;100 }101 102 public:103 DVBParamHelper(V _value) : value(_value) {}104 105 operator V() const { return value; }106 V operator=(V _value) {return value = _value;}107 bool operator==(const V& v) const {return value == v;}108 };109 110 class DVBInversion : public DVBParamHelper<fe_spectral_inversion_t>111 {112 protected:113 static Table confTable[];114 static Table vdrTable[];115 static Table parseTable[];116 static char* stringLookup[];117 118 public:119 DVBInversion() : DVBParamHelper<fe_spectral_inversion_t>(INVERSION_AUTO) {}120 bool parseConf(QString& _value)121 {return parseParam(_value,value,confTable);}122 bool parseVDR(QString& _value)123 {return parseParam(_value,value,vdrTable);}124 bool parse(QString& _value)125 {return parseParam(_value,value,parseTable);}126 127 QString toString() const {return toString(value);}128 static QString toString(fe_spectral_inversion_t _value)129 {return stringLookup[_value];}130 };131 132 class DVBBandwidth : public DVBParamHelper<fe_bandwidth_t>133 {134 protected:135 static Table confTable[];136 static Table vdrTable[];137 static Table parseTable[];138 static char* stringLookup[];139 140 public:141 DVBBandwidth() : DVBParamHelper<fe_bandwidth_t>(BANDWIDTH_AUTO) {}142 bool parseConf(QString& _value)143 {return parseParam(_value,value,confTable);}144 bool parseVDR(QString& _value)145 {return parseParam(_value,value,vdrTable);}146 bool parse(QString& _value)147 {return parseParam(_value,value,parseTable);}148 149 QString toString() const {return toString(value);}150 static QString toString(fe_bandwidth_t _value)151 {return stringLookup[_value];}152 };153 154 class DVBCodeRate : public DVBParamHelper<fe_code_rate_t>155 {156 protected:157 static Table confTable[];158 static Table vdrTable[];159 static Table parseTable[];160 static char* stringLookup[];161 162 public:163 DVBCodeRate() : DVBParamHelper<fe_code_rate_t>(FEC_AUTO) {}164 165 bool parseConf(QString& _value)166 {return parseParam(_value,value,confTable);}167 bool parseVDR(QString& _value)168 {return parseParam(_value,value,vdrTable);}169 bool parse(QString& _value)170 {return parseParam(_value,value,parseTable);}171 172 QString toString() const {return toString(value);}173 static QString toString(fe_code_rate_t _value)174 {return stringLookup[_value];}175 };176 177 class DVBModulation : public DVBParamHelper<fe_modulation_t>178 {179 protected:180 static Table confTable[];181 static Table vdrTable[];182 static Table parseTable[];183 static char* stringLookup[];184 185 public:186 DVBModulation() : DVBParamHelper<fe_modulation_t>(QAM_AUTO) {}187 188 bool parseConf(QString& _value)189 {return parseParam(_value,value,confTable);}190 bool parseVDR(QString& _value)191 {return parseParam(_value,value,vdrTable);}192 bool parse(QString& _value)193 {return parseParam(_value,value,parseTable);}194 195 QString toString() const {return toString(value);}196 static QString toString(fe_modulation_t _value)197 {return stringLookup[_value];}198 };199 200 class DVBTransmitMode : public DVBParamHelper<fe_transmit_mode_t>201 {202 protected:203 static Table confTable[];204 static Table vdrTable[];205 static Table parseTable[];206 static char* stringLookup[];207 208 public:209 DVBTransmitMode() : DVBParamHelper<fe_transmit_mode_t>(TRANSMISSION_MODE_AUTO) {}210 211 bool parseConf(QString& _value)212 {return parseParam(_value,value,confTable);}213 bool parseVDR(QString& _value)214 {return parseParam(_value,value,vdrTable);}215 bool parse(QString& _value)216 {return parseParam(_value,value,parseTable);}217 218 QString toString() const {return toString(value);}219 static QString toString(fe_transmit_mode_t _value)220 {return stringLookup[_value];}221 };222 223 class DVBGuardInterval : public DVBParamHelper<fe_guard_interval_t>224 {225 protected:226 static Table confTable[];227 static Table vdrTable[];228 static Table parseTable[];229 static char* stringLookup[];230 231 public:232 DVBGuardInterval() : DVBParamHelper<fe_guard_interval_t>(GUARD_INTERVAL_AUTO) {}233 234 bool parseConf(QString& _value)235 {return parseParam(_value,value,confTable);}236 bool parseVDR(QString& _value)237 {return parseParam(_value,value,vdrTable);}238 bool parse(QString& _value)239 {return parseParam(_value,value,parseTable);}240 241 QString toString() const {return toString(value);}242 static QString toString(fe_guard_interval_t _value)243 {return stringLookup[_value];}244 };245 246 class DVBHierarchy : public DVBParamHelper<fe_hierarchy_t>247 {248 protected:249 static Table confTable[];250 static Table vdrTable[];251 static Table parseTable[];252 static char* stringLookup[];253 254 public:255 DVBHierarchy() : DVBParamHelper<fe_hierarchy_t>(HIERARCHY_AUTO) {}256 257 bool parseConf(QString& _value)258 {return parseParam(_value,value,confTable);}259 bool parseVDR(QString& _value)260 {return parseParam(_value,value,vdrTable);}261 bool parse(QString& _value)262 {return parseParam(_value,value,parseTable);}263 264 QString toString() const {return toString(value);}265 static QString toString(fe_hierarchy_t _value)266 {return stringLookup[_value];}267 };268 269 enum PolarityValues {Vertical,Horizontal,Right,Left};270 class DVBPolarity : public DVBParamHelper<PolarityValues>271 {272 protected:273 static Table parseTable[];274 static char* stringLookup[];275 public:276 DVBPolarity() : DVBParamHelper<PolarityValues>(Vertical) { }277 278 bool parseConf(QString& _value)279 {return parseParam(_value,value,parseTable);}280 bool parseVDR(QString& _value)281 {return parseParam(_value,value,parseTable);}282 bool parse(QString& _value)283 {return parseParam(_value,value,parseTable);}284 285 QString toString() const {return toString(value);}286 static QString toString(PolarityValues _value)287 {return stringLookup[_value];}288 };289 70 290 71 typedef vector<uint16_t> dvb_pid_t; 291 72 // needs to add provider id so dvbcam doesnt require parsing … … class DVBTuning 398 179 const QString& pol, const QString& modulation); 399 180 #endif 400 181 401 private:402 182 bool ParseTuningParams( 403 183 fe_type_t type, 404 184 QString frequency, QString inversion, QString symbolrate, -
libs/libmythtv/frequencytables.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/frequencytables.cpp mythtv-0.20/libs/libmythtv/frequencytables.cpp
old new TransportScanItem::TransportScanItem(int 55 55 } 56 56 #endif // USING_DVB 57 57 58 59 TransportScanItem::TransportScanItem(int _sourceid, 60 const QString &_std, 61 const QString &_name, 62 const QString &_cardtype, 63 const DTVTransport &_tuning, 64 uint _timeoutTune) 65 : mplexid(-1), standard(_std), 66 FriendlyName(_name), friendlyNum(0), 67 SourceID(_sourceid), UseTimer(false), 68 scanning(false), timeoutTune(_timeoutTune) 69 { 70 (void) _cardtype; 71 72 bzero(freq_offsets, sizeof(int) * 3); 73 expectedChannels = _tuning.channels; 74 75 #ifdef USING_DVB 76 bzero(&tuning, sizeof(DVBTuning)); 77 78 fe_type type = FE_QPSK; 79 80 type = (_cardtype.upper() == "QAM") ? FE_QAM : type; 81 type = (_cardtype.upper() == "OFDM") ? FE_OFDM : type; 82 type = (_cardtype.upper() == "ATSC") ? FE_ATSC : type; 83 #ifdef FE_GET_EXTENDED_INFO 84 type = (_cardtype.upper() == "DVB_S2") ? FE_DVB_S2 : type; 85 #endif 86 87 tuning.ParseTuningParams( 88 type, 89 QString::number(_tuning.frequency), _tuning.inversion.toString(), 90 QString::number(_tuning.symbolrate), _tuning.fec.toString(), 91 _tuning.polarity.toString(), _tuning.hp_code_rate.toString(), 92 _tuning.lp_code_rate.toString(), _tuning.constellation.toString(), 93 _tuning.trans_mode.toString(), _tuning.guard_interval.toString(), 94 _tuning.hierarchy.toString(), _tuning.modulation.toString(), 95 _tuning.bandwidth.toString()); 96 97 #else 98 frequency = _tuning.frequency; 99 modulation = _tuning.modulation; 100 #endif 101 } 102 58 103 TransportScanItem::TransportScanItem(int sourceid, 59 104 const QString &std, 60 105 const QString &fn, -
libs/libmythtv/frequencytables.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/frequencytables.h mythtv-0.20/libs/libmythtv/frequencytables.h
old new using namespace std; 29 29 #endif // USING_DVB 30 30 31 31 class FrequencyTable; 32 #include "dvbconfparser.h" 32 33 class TransportScanItem; 33 34 34 35 typedef QMap<QString, const FrequencyTable*> freq_table_map_t; … … class TransportScanItem 130 131 uint _timeoutTune); 131 132 #endif // USING_DVB 132 133 134 TransportScanItem(int _sourceid, 135 const QString &_std, 136 const QString &_name, 137 const QString &_cardtype, 138 const DTVTransport &_tuning, 139 uint _timeoutTune); 140 133 141 TransportScanItem(int sourceid, /* source id in DB */ 134 142 const QString &std, /* atsc/dvb */ 135 143 const QString &strFmt, /* fmt for info shown to user */ … … class TransportScanItem 144 152 uint freq_offset(uint i) const; 145 153 146 154 QString ModulationDB(void) const; 155 QString toString() const; 147 156 148 157 private: 149 158 int GetMultiplexIdFromDB() const; … … class TransportScanItem 168 177 uint frequency; ///< Tuning frequency if mplexid == -1 169 178 uint modulation; ///< Tuning frequency if mplexid == -1 170 179 #endif 171 QString toString() const; 180 181 DTVChannelInfoList expectedChannels; 172 182 }; 173 183 174 184 class transport_scan_items_it_t -
libs/libmythtv/libmythtv.pro
diff -Naurp mythtv-0.20.orig/libs/libmythtv/libmythtv.pro mythtv-0.20/libs/libmythtv/libmythtv.pro
old new using_backend { 322 322 323 323 # Channel scanner stuff 324 324 HEADERS += scanwizard.h scanwizardhelpers.h 325 HEADERS += dvbconfparser.h dtvconfparserhelpers.h 325 326 HEADERS += siscan.h 326 327 HEADERS += scanwizardscanner.h 327 328 SOURCES += scanwizard.cpp scanwizardhelpers.cpp 328 329 SOURCES += siscan.cpp 330 SOURCES += dvbconfparser.cpp dtvconfparserhelpers.cpp 329 331 SOURCES += scanwizardscanner.cpp 330 332 331 333 # EIT stuff … … using_backend { 449 451 SOURCES += dvbrecorder.cpp 450 452 451 453 # Misc 452 HEADERS += dvb confparser.h dvbdev/dvbci.h453 SOURCES += dvb confparser.cpp dvbdev/dvbci.cpp454 HEADERS += dvbdev/dvbci.h 455 SOURCES += dvbdev/dvbci.cpp 454 456 455 457 DEFINES += USING_DVB 456 458 } -
libs/libmythtv/scanwizard.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/scanwizard.cpp mythtv-0.20/libs/libmythtv/scanwizard.cpp
old new ScanWizard::ScanWizard(int sourceid) 39 39 : paneOFDM(new OFDMPane()), paneQPSK(new QPSKPane()), 40 40 paneATSC(new ATSCPane()), paneQAM(new QAMPane()), 41 41 paneSingle(new STPane()), 42 paneDVBUtilsImport(new DVBUtilsImportPane()), 42 43 #ifdef FE_GET_EXTENDED_INFO 43 44 paneDVBS2(new DVBS2Pane()), 44 45 #endif … … bool ScanWizard::ignoreSignalTimeout(voi 111 112 bool vl1 = (configPane->scanConfig-> 112 113 ignoreSignalTimeoutAll->getValue().toInt()); 113 114 114 return (ts0) ? vl0 : ((ts1) ? vl1 : false); 115 bool ts2 = (ScanTypeSetting::DVBUtilsImport == scanType()); 116 bool vl2 = paneDVBUtilsImport->DoIgnoreSignalTimeout(); 117 118 return (ts0) ? vl0 : ((ts1) ? vl1 : (ts2) ? vl2 : false); 115 119 } 116 120 117 121 QString ScanWizard::country(void) const … … QString ScanWizard::country(void) const 121 125 122 126 QString ScanWizard::filename(void) const 123 127 { 124 return configPane->scanConfig->filename->getValue();128 return paneDVBUtilsImport->GetFilename(); 125 129 } -
libs/libmythtv/scanwizard.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/scanwizard.h mythtv-0.20/libs/libmythtv/scanwizard.h
old new class QPSKPane; 42 42 class ATSCPane; 43 43 class QAMPane; 44 44 class STPane; 45 class DVBUtilsImportPane; 45 46 class ScanWizardScanType; 46 47 class ScanWizardScanner; 47 48 … … class ScanWizard : public ConfigurationW 77 78 ATSCPane *paneATSC; 78 79 QAMPane *paneQAM; 79 80 STPane *paneSingle; 81 DVBUtilsImportPane *paneDVBUtilsImport; 82 80 83 int nVideoDev; 81 84 unsigned nCardType; 82 85 int nCaptureCard; -
libs/libmythtv/scanwizardhelpers.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/scanwizardhelpers.cpp mythtv-0.20/libs/libmythtv/scanwizardhelpers.cpp
old new void ScanTypeSetting::refresh(const QStr 315 315 addSelection(tr("Full Scan (Tuned)"), 316 316 QString::number(NITAddScan_OFDM)); 317 317 addSelection(tr("Import channels.conf"), 318 QString::number( Import));318 QString::number(DVBUtilsImport)); 319 319 break; 320 320 case CardUtil::QPSK: 321 321 addSelection(tr("Full Scan (Tuned)"), 322 322 QString::number(NITAddScan_QPSK)); 323 323 addSelection(tr("Import channels.conf"), 324 QString::number( Import));324 QString::number(DVBUtilsImport)); 325 325 break; 326 326 case CardUtil::QAM: 327 327 addSelection(tr("Full Scan (Tuned)"), 328 328 QString::number(NITAddScan_QAM)); 329 329 addSelection(tr("Import channels.conf"), 330 QString::number( Import));330 QString::number(DVBUtilsImport)); 331 331 break; 332 332 case CardUtil::ATSC: 333 333 case CardUtil::HDTV: 334 334 case CardUtil::HDHOMERUN: 335 335 addSelection(tr("Full Scan"), 336 336 QString::number(FullScan_ATSC), true); 337 #ifdef USING_DVB338 337 addSelection(tr("Import channels.conf"), 339 QString::number(Import)); 340 #endif 338 QString::number(DVBUtilsImport)); 341 339 break; 342 340 case CardUtil::FREEBOX: 343 341 addSelection(tr("M3U Import"), … … ScanOptionalConfig::ScanOptionalConfig(S 393 391 ConfigurationGroup(false, false, true, true), 394 392 VerticalConfigurationGroup(false, false, true, true), 395 393 country(new ScanCountry()), 396 ignoreSignalTimeoutAll(new IgnoreSignalTimeout()), 397 filename(new ScanFileImport()) 394 ignoreSignalTimeoutAll(new IgnoreSignalTimeout()) 398 395 { 399 396 setTrigger(scanType); 400 397 … … ScanOptionalConfig::ScanOptionalConfig(S 432 429 scanAllTransports); 433 430 addTarget(QString::number(ScanTypeSetting::FreeBoxImport), 434 431 new BlankSetting()); 435 addTarget(QString::number(ScanTypeSetting:: Import),436 filename);432 addTarget(QString::number(ScanTypeSetting::DVBUtilsImport), 433 wizard->paneDVBUtilsImport); 437 434 } 438 435 439 436 void ScanOptionalConfig::triggerChanged(const QString& value) -
libs/libmythtv/scanwizardhelpers.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/scanwizardhelpers.h mythtv-0.20/libs/libmythtv/scanwizardhelpers.h
old new class ScanCountry: public ComboBoxSettin 188 188 ScanCountry(); 189 189 }; 190 190 191 class ScanFileImport : public LineEditSetting, public TransientStorage192 {193 public:194 ScanFileImport() : LineEditSetting()195 {196 setLabel(QObject::tr("File location"));197 setHelpText(QObject::tr("Location of the channels.conf file."));198 }199 };200 201 191 class ScanTypeSetting : public ComboBoxSetting, public TransientStorage 202 192 { 203 193 Q_OBJECT … … class ScanTypeSetting : public ComboBoxS 222 212 // Freebox import of channels from M3U URL 223 213 FreeBoxImport, 224 214 // Imports lists from dvb-utils scanners 225 Import215 DVBUtilsImport, 226 216 }; 227 217 ScanTypeSetting() : nCaptureCard(-1) 228 218 { … … class ScanOptionalConfig: public Vertica 244 234 245 235 ScanCountry *country; 246 236 IgnoreSignalTimeout *ignoreSignalTimeoutAll; 247 ScanFileImport *filename; 237 248 238 protected slots: 249 239 void triggerChanged(const QString&); 250 240 }; … … class STPane : public VerticalConfigurat 781 771 IgnoreSignalTimeout *ignore_signal_timeout; 782 772 }; 783 773 774 class DVBUtilsImportPane : public VerticalConfigurationGroup 775 { 776 public: 777 DVBUtilsImportPane() : 778 ConfigurationGroup(false,false,true,false), 779 VerticalConfigurationGroup(false,false,true,false), 780 filename(new TransLineEditSetting()), 781 atsc_format(new ScanATSCChannelFormat()), 782 old_channel_treatment(new ScanOldChannelTreatment()), 783 ignore_signal_timeout(new IgnoreSignalTimeout()) 784 { 785 filename->setLabel(tr("File location")); 786 filename->setHelpText(tr("Location of the channels.conf file.")); 787 addChild(filename); 788 789 addChild(atsc_format); 790 addChild(old_channel_treatment); 791 addChild(ignore_signal_timeout); 792 } 793 794 QString GetFilename(void) const { return filename->getValue(); } 795 QString GetATSCFormat(void) const { return atsc_format->getValue(); } 796 797 bool DoDeleteChannels(void) const 798 { return old_channel_treatment->getValue() == "delete"; } 799 bool DoRenameChannels(void) const 800 { return old_channel_treatment->getValue() == "rename"; } 801 bool DoIgnoreSignalTimeout(void) const 802 { return ignore_signal_timeout->getValue().toInt(); } 803 804 private: 805 TransLineEditSetting *filename; 806 ScanATSCChannelFormat *atsc_format; 807 ScanOldChannelTreatment *old_channel_treatment; 808 IgnoreSignalTimeout *ignore_signal_timeout; 809 }; 810 784 811 class ErrorPane : public HorizontalConfigurationGroup 785 812 { 786 813 public: -
libs/libmythtv/scanwizardscanner.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/scanwizardscanner.cpp mythtv-0.20/libs/libmythtv/scanwizardscanner.cpp
old new 43 43 #include "channelbase.h" 44 44 #include "dtvsignalmonitor.h" 45 45 #include "siscan.h" 46 #include "dvbconfparser.h" 46 47 47 48 #ifdef USING_V4L 48 49 #include "channel.h" … … 53 54 #ifdef USING_DVB 54 55 #include "dvbchannel.h" 55 56 #include "dvbsignalmonitor.h" 56 #include "dvbconfparser.h"57 57 #endif 58 58 59 59 #ifdef USING_HDHOMERUN … … void ScanWizardScanner::scan() 302 302 do_scan = false; 303 303 ScanAnalog(cardid, nVideoSource); 304 304 } 305 else if (nScanType == ScanTypeSetting:: Import)305 else if (nScanType == ScanTypeSetting::DVBUtilsImport) 306 306 { 307 do_scan = false; 308 Import(nVideoSource, parent->nCardType, parent->filename()); 307 ImportDVBUtils(nVideoSource, parent->nCardType, parent->filename()); 309 308 } 310 309 else if ((nScanType == ScanTypeSetting::FullScan_ATSC) || 311 310 (nScanType == ScanTypeSetting::FullTransportScan) || … … void ScanWizardScanner::scan() 416 415 } 417 416 } 418 417 419 void ScanWizardScanner::Import (uint sourceid, int cardtype,420 const QString &file)418 void ScanWizardScanner::ImportDVBUtils(uint sourceid, int cardtype, 419 const QString &file) 421 420 { 422 (void) sourceid; 423 (void) cardtype; 424 (void) file; 421 channels.clear(); 425 422 426 #ifdef USING_DVB 427 DVBConfParser *parser = NULL; 428 429 if (CardUtil::OFDM == cardtype) 430 parser = new DVBConfParser(DVBConfParser::OFDM, sourceid, file); 431 else if (CardUtil::QPSK == cardtype) 432 parser = new DVBConfParser(DVBConfParser::QPSK, sourceid, file); 433 else if (CardUtil::QAM == cardtype) 434 parser = new DVBConfParser(DVBConfParser::QAM, sourceid, file); 435 else if ((CardUtil::ATSC == cardtype) || 436 (CardUtil::HDTV == cardtype)) 437 parser = new DVBConfParser(DVBConfParser::ATSC, sourceid, file); 423 DTVConfParser::cardtype_t type = DTVConfParser::UNKNOWN; 424 type = (CardUtil::OFDM == cardtype) ? DTVConfParser::OFDM : type; 425 type = (CardUtil::QPSK == cardtype) ? DTVConfParser::QPSK : type; 426 type = (CardUtil::QAM == cardtype) ? DTVConfParser::QAM : type; 427 type = ((CardUtil::ATSC == cardtype) || (CardUtil::HDTV == cardtype) || 428 (CardUtil::HDHOMERUN == cardtype)) ? DTVConfParser::ATSC : type; 438 429 439 if ( !parser)430 if (type == DTVConfParser::UNKNOWN) 440 431 return; 441 432 442 connect(parser, SIGNAL(updateText(const QString&)), 443 this, SLOT( updateText(const QString&))); 444 445 int ret = parser->parse(); 446 parser->deleteLater(); 433 DTVConfParser parser(type, sourceid, file); 447 434 448 if (DVBConfParser::ERROR_OPEN == ret) 435 DTVConfParser::return_t ret = parser.Parse(); 436 if (DTVConfParser::OK != ret) 449 437 { 450 MythPopupBox::showOkPopup( 451 gContext->GetMainWindow(), tr("ScanWizard"), 452 tr("Failed to open '%1'").arg(file)); 453 } 438 QString msg = (DTVConfParser::ERROR_PARSE == ret) ? 439 tr("Failed to parse '%1'") : tr("Failed to open '%1'"); 454 440 455 if (DVBConfParser::ERROR_PARSE == ret) 441 MythPopupBox::showOkPopup(gContext->GetMainWindow(), 442 tr("ScanWizard"), msg.arg(file)); 443 } 444 else 456 445 { 457 MythPopupBox::showOkPopup( 458 gContext->GetMainWindow(), tr("ScanWizard"), 459 tr("Failed to parse '%1'").arg(file)); 446 channels = parser.GetChannels(); 460 447 } 461 #endif // USING_DVB462 448 } 463 449 464 450 void ScanWizardScanner::PreScanCommon(uint cardid, uint sourceid) … … void ScanWizardScanner::HandleTuneComple 734 720 ScannerEvent::ERROR_TUNE); 735 721 } 736 722 } 723 else if (nScanType == ScanTypeSetting::DVBUtilsImport && channels.size()) 724 { 725 ok = true; 726 727 VERBOSE(VB_SIPARSER, LOC + "ScanForChannels("<<nVideoSource<<")"); 728 729 scanner->SetChannelFormat(parent->paneDVBUtilsImport->GetATSCFormat()); 730 731 if (parent->paneDVBUtilsImport->DoDeleteChannels()) 732 { 733 MSqlQuery query(MSqlQuery::InitCon()); 734 query.prepare("DELETE FROM channel " 735 "WHERE sourceid = :SOURCEID"); 736 query.bindValue(":SOURCEID", nVideoSource); 737 query.exec(); 738 } 739 740 scanner->SetRenameChannels( 741 parent->paneDVBUtilsImport->DoRenameChannels()); 742 743 int ccardid = parent->captureCard(); 744 int pcardid = CardUtil::GetParentCardID(ccardid); 745 int cardid = (pcardid) ? pcardid : ccardid; 746 QString card_type = CardUtil::GetRawCardType(cardid, nVideoSource); 747 QString sub_type = card_type; 748 if (card_type == "DVB") 749 { 750 QString device = CardUtil::GetVideoDevice(cardid, nVideoSource); 751 ok = !device.isEmpty(); 752 if (ok) 753 sub_type = CardUtil::ProbeDVBType(device.toUInt()).upper(); 754 } 755 756 if (ok) 757 { 758 ok = scanner->ScanForChannels(nVideoSource, std, 759 sub_type, channels); 760 } 761 if (ok) 762 { 763 post_event(this, ScannerEvent::ServicePct, 764 TRANSPORT_PCT); 765 } 766 else 767 { 768 post_event(this, ScannerEvent::TuneComplete, 769 ScannerEvent::ERROR_TUNE); 770 } 771 } 737 772 else if (nScanType == ScanTypeSetting::TransportScan) 738 773 { 739 774 VERBOSE(VB_SIPARSER, LOC + "ScanTransport("<<nMultiplexToTuneTo<<")"); -
libs/libmythtv/scanwizardscanner.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/scanwizardscanner.h mythtv-0.20/libs/libmythtv/scanwizardscanner.h
old new 40 40 41 41 // MythTV headers 42 42 #include "settings.h" 43 #include "dvbconfparser.h" 43 44 44 45 class ScanWizard; 45 46 class AnalogScan; … … class ScanWizardScanner : public Vertica 79 80 void serviceScanPctComplete(int pct); 80 81 81 82 protected: 82 void Import (uint sourceid, int cardtype, const QString &file);83 void ImportDVBUtils(uint sourceid, int cardtype, const QString &file); 83 84 void PreScanCommon(uint cardid, uint sourceid); 84 85 void TunedScanCommon(uint cardid, uint sourceid, bool ok); 85 86 void ScanAnalog(uint cardid, uint sourceid); … … class ScanWizardScanner : public Vertica 113 114 uint frequency; 114 115 QString modulation; 115 116 QMap<QString,QString> startChan; 117 118 // dvb-utils imported channels 119 DTVChannelList channels; 116 120 }; 117 121 118 122 #endif // _SCANWIZARDSCANNER_H_ -
libs/libmythtv/siscan.cpp
diff -Naurp mythtv-0.20.orig/libs/libmythtv/siscan.cpp mythtv-0.20/libs/libmythtv/siscan.cpp
old new void SIScan::HandleMPEGDBInsertion(const 322 322 pat_vec_t pats = sd->GetCachedPATs(); 323 323 pmt_map_t pmt_map = sd->GetCachedPMTMap(); 324 324 for (uint i = 0; i < pats.size(); i++) 325 UpdatePATinDB(mplexid, fn, freqid, pats[i], pmt_map, true); 325 { 326 UpdatePATinDB(mplexid, fn, freqid, pats[i], pmt_map, 327 (*current).expectedChannels, true); 328 } 326 329 sd->ReturnCachedPMTTables(pmt_map); 327 330 sd->ReturnCachedPATTables(pats); 328 331 … … void SIScan::HandleATSCDBInsertion(const 354 357 // Insert Terrestrial VCTs 355 358 tvct_vec_t tvcts = sd->GetAllCachedTVCTs(); 356 359 for (uint i = 0; i < tvcts.size(); i++) 357 UpdateVCTinDB(mplexid, fn, freqid, tvcts[i], true); 360 { 361 UpdateVCTinDB(mplexid, fn, freqid, tvcts[i], 362 (*current).expectedChannels, true); 363 } 358 364 sd->ReturnCachedTVCTTables(tvcts); 359 365 360 366 // Insert Cable VCTs 361 367 cvct_vec_t cvcts = sd->GetAllCachedCVCTs(); 362 368 for (uint i = 0; i < cvcts.size(); i++) 363 UpdateVCTinDB(mplexid, fn, freqid, cvcts[i], true); 369 { 370 UpdateVCTinDB(mplexid, fn, freqid, cvcts[i], 371 (*current).expectedChannels, true); 372 } 364 373 sd->ReturnCachedCVCTTables(cvcts); 365 374 366 375 // tell UI we are done with these channels … … void SIScan::HandleDVBDBInsertion(const 386 395 387 396 vector<const ServiceDescriptionTable*> sdts = sd->GetAllCachedSDTs(); 388 397 for (uint i = 0; i < sdts.size(); i++) 389 UpdateSDTinDB((*current).mplexid, sdts[i], forceUpdate); 398 { 399 UpdateSDTinDB((*current).mplexid, sdts[i], 400 (*current).expectedChannels, forceUpdate); 401 } 390 402 sd->ReturnCachedSDTTables(sdts); 391 403 392 404 emit ServiceScanUpdateText(tr("Finished processing Services")); … … bool SIScan::ScanTransports(int SourceID 787 799 return true; 788 800 } 789 801 802 bool SIScan::ScanForChannels(uint sourceid, 803 const QString &std, 804 const QString &cardtype, 805 const DTVChannelList &channels) 806 { 807 scanTransports.clear(); 808 nextIt = scanTransports.end(); 809 810 DTVChannelList::const_iterator it = channels.begin(); 811 for (uint i = 0; it != channels.end(); ++it, i++) 812 { 813 TransportScanItem item(sourceid, std, QString::number(i), 814 cardtype, *it, signalTimeout); 815 816 scanTransports += item; 817 818 VERBOSE(VB_SIPARSER, LOC + item.toString()); 819 } 820 821 if (scanTransports.empty()) 822 { 823 VERBOSE(VB_IMPORTANT, LOC_ERR + "ScanForChannels() no transports"); 824 return false; 825 } 826 827 timer.start(); 828 waitingForTables = false; 829 830 nextIt = scanTransports.begin(); 831 transportsScanned = 0; 832 scanMode = TRANSPORT_LIST; 833 834 return true; 835 } 836 790 837 /** \fn SIScan::ScanTransportsStartingOn(int,const QMap<QString,QString>&) 791 838 * \brief Generates a list of frequencies to scan and adds it to the 792 839 * scanTransport list, and then sets the scanMode to TRANSPORT_LIST. … … void SIScan::OptimizeNITFrequencies(Netw 953 1000 #endif // USING_DVB 954 1001 } 955 1002 1003 /** \fn SIScan::CheckImportedList(const DTVChannelInfoList&,uint,QString&,QString&,QString&) 1004 * \brief If we as scanning a dvb-utils import verify channel is in list.. 1005 */ 1006 bool SIScan::CheckImportedList(const DTVChannelInfoList &channels, 1007 uint mpeg_program_num, 1008 QString &service_name, 1009 QString &callsign, 1010 QString &common_status_info) 1011 { 1012 if (channels.empty()) 1013 return true; 1014 1015 bool found = false; 1016 for (uint i = 0; i < channels.size(); i++) 1017 { 1018 VERBOSE(VB_IMPORTANT, 1019 QString("comparing %1 %2 against %3 %4") 1020 .arg(channels[i].serviceid).arg(channels[i].name) 1021 .arg(mpeg_program_num).arg(common_status_info)); 1022 1023 if (channels[i].serviceid == mpeg_program_num) 1024 { 1025 found = true; 1026 if (!channels[i].name.isEmpty()) 1027 { 1028 service_name = QDeepCopy<QString>(channels[i].name); 1029 callsign = QDeepCopy<QString>(channels[i].name); 1030 } 1031 } 1032 } 1033 1034 if (found) 1035 { 1036 common_status_info += QString(" %1 %2") 1037 .arg(tr("as")).arg(service_name); 1038 } 1039 else 1040 { 1041 emit ServiceScanUpdateText( 1042 tr("Skipping %1, not in imported channel map") 1043 .arg(common_status_info)); 1044 } 1045 1046 return found; 1047 } 1048 956 1049 // ///////////////////// DB STUFF ///////////////////// 957 1050 // ///////////////////// DB STUFF ///////////////////// 958 1051 // ///////////////////// DB STUFF ///////////////////// … … void SIScan::OptimizeNITFrequencies(Netw 962 1055 void SIScan::UpdatePMTinDB( 963 1056 int db_source_id, 964 1057 int db_mplexid, const QString &friendlyName, int freqid, 965 int pmt_indx, const ProgramMapTable *pmt, bool /*force_update*/) 1058 int pmt_indx, const ProgramMapTable *pmt, 1059 const DTVChannelInfoList &channels, bool /*force_update*/) 966 1060 { 967 1061 // See if service already in database based on program number 968 1062 int chanid = ChannelUtil::GetChanID( … … void SIScan::UpdatePMTinDB( 988 1082 989 1083 QString common_status_info = tr("%1%2%3 on %4 (%5)") 990 1084 .arg(service_name) 991 .arg(service_name.isEmpty() ? "" : " as ")1085 .arg(service_name.isEmpty() ? "" : QString(" %1 ").arg(tr("as"))) 992 1086 .arg(chan_num) 993 1087 .arg(friendlyName).arg(freqid); 994 1088 1089 if (!CheckImportedList(channels, pmt->ProgramNumber(), 1090 service_name, chan_num, common_status_info)) 1091 { 1092 return; 1093 } 1094 995 1095 if (chanid < 0) 996 1096 { // The service is not in database, add it 997 1097 emit ServiceScanUpdateText( … … void SIScan::UpdatePMTinDB( 1028 1128 void SIScan::UpdatePATinDB( 1029 1129 int db_mplexid, const QString &friendlyName, int freqid, 1030 1130 const ProgramAssociationTable *pat, const pmt_map_t &pmt_map, 1031 bool force_update)1131 const DTVChannelInfoList &channels, bool force_update) 1032 1132 { 1033 1133 VERBOSE(VB_SIPARSER, LOC + 1034 1134 QString("UpdatePATinDB(): tsid: 0x%1 mplex: %2") … … void SIScan::UpdatePATinDB( 1066 1166 continue; 1067 1167 1068 1168 UpdatePMTinDB(db_source_id, db_mplexid, friendlyName, freqid, 1069 i, *vit, force_update);1169 i, *vit, channels, force_update); 1070 1170 } 1071 1171 } 1072 1172 } … … void SIScan::UpdatePATinDB( 1076 1176 void SIScan::UpdateVCTinDB(int db_mplexid, 1077 1177 const QString &friendlyName, int freqid, 1078 1178 const VirtualChannelTable *vct, 1179 const DTVChannelInfoList &channels, 1079 1180 bool force_update) 1080 1181 { 1081 1182 (void) force_update; … … void SIScan::UpdateVCTinDB(int db_mplexi 1142 1243 .arg(vct->MajorChannel(i)).arg(vct->MinorChannel(i)) 1143 1244 .arg(chan_num).arg(friendlyName).arg(freqid); 1144 1245 1246 QString callsign = vct->ShortChannelName(i); 1247 1248 if (!CheckImportedList(channels, vct->ProgramNumber(i), 1249 longName, callsign, common_status_info)) 1250 { 1251 continue; 1252 } 1145 1253 QString msg = ""; 1146 1254 if (chanid < 0) 1147 1255 { // The service is not in database, add it … … void SIScan::UpdateVCTinDB(int db_mplexi 1153 1261 db_mplexid, 1154 1262 db_source_id, 1155 1263 chanid, 1156 vct->ShortChannelName(i),1264 callsign, 1157 1265 longName, 1158 1266 chan_num, 1159 1267 vct->ProgramNumber(i), … … void SIScan::UpdateVCTinDB(int db_mplexi 1170 1278 db_mplexid, 1171 1279 db_source_id, 1172 1280 chanid, 1173 vct->ShortChannelName(i),1281 callsign, 1174 1282 longName, 1175 1283 chan_num, 1176 1284 vct->ProgramNumber(i), … … void SIScan::UpdateVCTinDB(int db_mplexi 1186 1294 * \brief Inserts channels from service description table. 1187 1295 */ 1188 1296 void SIScan::UpdateSDTinDB(int /*mplexid*/, const ServiceDescriptionTable *sdt, 1297 const DTVChannelInfoList &channels, 1189 1298 bool force_update) 1190 1299 { 1191 1300 if (!sdt->ServiceCount()) … … void SIScan::UpdateSDTinDB(int /*mplexid 1261 1370 continue; 1262 1371 } 1263 1372 1373 QString common_status_info = service_name; 1374 1375 if (!CheckImportedList(channels, sdt->ServiceID(i), 1376 service_name, service_name, common_status_info)) 1377 { 1378 continue; 1379 } 1380 1264 1381 // See if service already in database based on service ID 1265 1382 int chanid = ChannelUtil::GetChanID(db_mplexid, -1, -1, -1, 1266 1383 sdt->ServiceID(i)); -
libs/libmythtv/siscan.h
diff -Naurp mythtv-0.20.orig/libs/libmythtv/siscan.h mythtv-0.20/libs/libmythtv/siscan.h
old new 14 14 // MythTV includes 15 15 #include "frequencytables.h" 16 16 #include "streamlisteners.h" 17 #include "dvbconfparser.h" 17 18 18 19 class MSqlQuery; 19 20 … … class SIScan : public QObject, 54 55 bool ScanTransportsStartingOn( 55 56 int sourceid, const QMap<QString,QString> &valueMap); 56 57 bool ScanTransport(int mplexid); 58 bool ScanForChannels( 59 uint sourceid, const QString &std, const QString &cardtype, 60 const DTVChannelList&); 57 61 58 62 bool ScanServicesSourceID(int SourceID); 59 63 … … class SIScan : public QObject, 119 123 /// \brief Updates Transport Scan progress bar 120 124 inline void UpdateScanPercentCompleted(void); 121 125 126 bool CheckImportedList(const DTVChannelInfoList&, 127 uint mpeg_program_num, 128 QString &service_name, 129 QString &callsign, 130 QString &common_status_info); 131 122 132 void HandleMPEGDBInsertion(const ScanStreamData *sd, bool wait); 123 133 void UpdatePATinDB(int mplexid, const QString &friendlyName, int freqid, 124 134 const ProgramAssociationTable*, const pmt_map_t&, 135 const DTVChannelInfoList&, 125 136 bool force_update); 126 137 127 138 void UpdatePMTinDB(int sourceid, 128 139 int mplexid, const QString &friendlyName, int freqid, 129 140 int pmt_indx, const ProgramMapTable*, 141 const DTVChannelInfoList&, 130 142 bool force_update); 131 143 132 144 void HandleATSCDBInsertion(const ScanStreamData *sd, bool wait); 133 145 void UpdateVCTinDB(int mplexid, const QString &friendlyName, int freqid, 134 146 const VirtualChannelTable*, 147 const DTVChannelInfoList&, 135 148 bool force_update); 136 149 137 150 void HandleDVBDBInsertion(const ScanStreamData *sd, bool wait); 138 151 void UpdateSDTinDB(int mplexid, 139 152 const ServiceDescriptionTable*, 153 const DTVChannelInfoList&, 140 154 bool force_update); 141 155 142 156 bool HandlePostInsertion(void);