Ticket #9726: 0006-libmythtv-Unicable-SCR-DIN-EN-50494.patch
File 0006-libmythtv-Unicable-SCR-DIN-EN-50494.patch, 22.6 KB (added by , 12 years ago) |
---|
-
mythtv/libs/libmythtv/diseqc.cpp
diff -Naur mythtv-0.25-20120711-ge330593-old/mythtv/libs/libmythtv/diseqc.cpp mythtv-0.25-20120711-ge330593-new/mythtv/libs/libmythtv/diseqc.cpp
old new 68 68 #define DISEQC_CMD_WRITE_N0 0x38 69 69 #define DISEQC_CMD_WRITE_N1 0x39 70 70 #define DISEQC_CMD_WRITE_FREQ 0x58 71 #define DISEQC_CMD_ODU 0x5A 72 #define DISEQC_CMD_ODU_MDU 0x5C 71 73 #define DISEQC_CMD_HALT 0x60 72 74 #define DISEQC_CMD_LMT_OFF 0x63 73 75 #define DISEQC_CMD_LMT_E 0x66 … … 563 565 return lnb; 564 566 } 565 567 568 /** \fn DiSEqCDevTree::FindSCR(const DiSEqCDevSettings&) 569 * \brief Returns the SCR device object selected by the configuration chain. 570 * \param settings Configuration chain in effect. 571 * \return Pointer to SCR object if found, NULL otherwise. 572 */ 573 DiSEqCDevSCR *DiSEqCDevTree::FindSCR(const DiSEqCDevSettings &settings) 574 { 575 DiSEqCDevDevice *node = m_root; 576 DiSEqCDevSCR *scr = NULL; 577 578 while (node) 579 { 580 scr = dynamic_cast<DiSEqCDevSCR*>(node); 581 582 if (scr) 583 break; 584 585 node = node->GetSelectedChild(settings); 586 } 587 588 return scr; 589 } 590 566 591 567 592 /** \fn DiSEqCDevTree::FindDevice(uint) 568 593 * \brief Returns a device by ID. … … 784 809 * \brief Represents a node in a DVB-S device network. 785 810 */ 786 811 787 const DiSEqCDevDevice::TypeTable DiSEqCDevDevice::dvbdev_lookup[ 4] =812 const DiSEqCDevDevice::TypeTable DiSEqCDevDevice::dvbdev_lookup[5] = 788 813 { 789 814 { "switch", kTypeSwitch }, 790 815 { "rotor", kTypeRotor }, 816 { "scr", kTypeSCR }, 791 817 { "lnb", kTypeLNB }, 792 818 { QString::null, kTypeLNB }, 793 819 }; … … 891 917 if (node) 892 918 node->SetDescription("Rotor"); 893 919 break; 920 case kTypeSCR: 921 node = new DiSEqCDevSCR(tree, dev_id); 922 if (node) 923 node->SetDescription("Unicable"); 924 break; 894 925 case kTypeLNB: 895 926 node = new DiSEqCDevLNB(tree, dev_id); 896 927 if (node) … … 2052 2083 } 2053 2084 2054 2085 //////////////////////////////////////// 2086 2087 /** \class DiSEqCDevSCR 2088 * \brief Unicable / SCR Class. 2089 */ 2090 2091 const DiSEqCDevDevice::TypeTable DiSEqCDevSCR::SCRPositionTable[3] = 2092 { 2093 { "A", kTypeScrPosA }, 2094 { "B", kTypeScrPosB }, 2095 { QString::null, kTypeScrPosA }, 2096 }; 2097 2098 DiSEqCDevSCR::DiSEqCDevSCR(DiSEqCDevTree &tree, uint devid) 2099 : DiSEqCDevDevice(tree, devid) 2100 , m_scr_userband(0) 2101 , m_scr_frequency(1400) 2102 , m_scr_pin(-1) 2103 , m_child(0) 2104 { 2105 Reset(); 2106 } 2107 2108 DiSEqCDevSCR::~DiSEqCDevSCR() 2109 { 2110 if (m_child) 2111 delete m_child; 2112 } 2113 2114 void DiSEqCDevSCR::Reset(void) 2115 { 2116 if (m_child) 2117 m_child->Reset(); 2118 } 2119 2120 bool DiSEqCDevSCR::Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) 2121 { 2122 // retrieve LNB info 2123 DiSEqCDevLNB *lnb = m_tree.FindLNB(settings); 2124 if (!lnb) 2125 { 2126 LOG(VB_GENERAL, LOG_ERR, LOC + "SCR: No LNB for this configuration!"); 2127 return false; 2128 } 2129 2130 bool high_band = lnb->IsHighBand(tuning); 2131 bool horizontal = lnb->IsHorizontal(tuning); 2132 uint32_t frequency = lnb->GetIntermediateFrequency(settings, tuning); 2133 uint t = (frequency / 1000 + m_scr_frequency + 2) / 4 - 350; 2134 2135 // retrieve position settings 2136 dvbdev_pos_t scr_position = (dvbdev_pos_t) settings.GetValue(GetDeviceID()); 2137 2138 // check parameters 2139 if (m_scr_userband > 8) 2140 { 2141 LOG(VB_GENERAL, LOG_INFO, QString("SCR: Userband ID=%1 is out of standard range!") 2142 .arg(m_scr_userband)); 2143 } 2144 2145 if (t >= 1024) 2146 { 2147 LOG(VB_GENERAL, LOG_ERR, LOC + "SCR: T out of range!"); 2148 return false; 2149 } 2150 2151 LOG(VB_GENERAL, LOG_INFO, QString("SCR: Tuning to %1kHz, %2, %3 using UB=%4, FREQ=%5MHz, POS=%6%7") 2152 .arg(tuning.frequency) 2153 .arg(high_band ? "HiBand" : "LoBand") 2154 .arg(horizontal ? "H" : "V") 2155 .arg(m_scr_userband) 2156 .arg(m_scr_frequency) 2157 .arg((scr_position) ? "B" : "A") 2158 .arg((m_scr_pin >= 0 && m_scr_pin <= 255) ? 2159 QString(", PIN=%1").arg(m_scr_pin) : QString(""))); 2160 2161 // build command 2162 unsigned char data[3]; 2163 data[0] = t >> 8 | m_scr_userband << 5; 2164 data[1] = t & 0x00FF; 2165 2166 if (high_band) 2167 data[0] |= (1 << 2); 2168 2169 if (horizontal) 2170 data[0] |= (1 << 3); 2171 2172 if (scr_position) 2173 data[0] |= (1 << 4); 2174 2175 // send command 2176 if (m_scr_pin >= 0 && m_scr_pin <= 255) 2177 { 2178 data[2] = m_scr_pin; 2179 return SendCommand(DISEQC_CMD_ODU_MDU, m_repeat, 3, data); 2180 } else { 2181 return SendCommand(DISEQC_CMD_ODU, m_repeat, 2, data); 2182 } 2183 } 2184 2185 bool DiSEqCDevSCR::PowerOff(void) const 2186 { 2187 // check parameters 2188 if (m_scr_userband > 8) 2189 { 2190 LOG(VB_GENERAL, LOG_INFO, QString("SCR: Userband ID=%1 is out of standard range!") 2191 .arg(m_scr_userband)); 2192 } 2193 2194 LOG(VB_CHANNEL, LOG_INFO, LOC + QString("SCR: Power off UB=%1%7") 2195 .arg(m_scr_userband) 2196 .arg((m_scr_pin >= 0 && m_scr_pin <= 255) 2197 ? QString(", PIN=%1").arg(m_scr_pin) 2198 : QString(""))); 2199 2200 // build command 2201 unsigned char data[3]; 2202 data[0] = (uint8_t) (m_scr_userband << 5); 2203 data[1] = 0x00; 2204 2205 // send command 2206 if (m_scr_pin >= 0 && m_scr_pin <= 255) 2207 { 2208 data[2] = m_scr_pin; 2209 return SendCommand(DISEQC_CMD_ODU_MDU, m_repeat, 3, data); 2210 } else { 2211 return SendCommand(DISEQC_CMD_ODU, m_repeat, 2, data); 2212 } 2213 } 2214 2215 bool DiSEqCDevSCR::SendCommand(uint cmd, uint repeats, uint data_len, 2216 unsigned char *data) const 2217 { 2218 (void) repeats; 2219 2220 // power on bus 2221 if (!m_tree.SetVoltage(SEC_VOLTAGE_18)) 2222 return false; 2223 usleep(DISEQC_LONG_WAIT); 2224 2225 // send command 2226 bool ret = m_tree.SendCommand(DISEQC_ADR_SW_ALL, cmd, repeats, data_len, data); 2227 2228 // power off bus 2229 if (!m_tree.SetVoltage(SEC_VOLTAGE_13)) 2230 return false; 2231 2232 return ret; 2233 } 2234 2235 uint DiSEqCDevSCR::GetVoltage(const DiSEqCDevSettings &settings, 2236 const DTVMultiplex &tuning) const 2237 { 2238 return SEC_VOLTAGE_13; 2239 } 2240 2241 uint32_t DiSEqCDevSCR::GetIntermediateFrequency(const uint32_t frequency) const 2242 { 2243 uint t = (frequency / 1000 + m_scr_frequency + 2) / 4 - 350; 2244 return ((t + 350) * 4) * 1000 - frequency; 2245 } 2246 2247 bool DiSEqCDevSCR::Load(void) 2248 { 2249 // populate scr parameters from db 2250 MSqlQuery query(MSqlQuery::InitCon()); 2251 query.prepare( 2252 "SELECT scr_userband, scr_frequency, " 2253 " scr_pin, cmd_repeat " 2254 "FROM diseqc_tree " 2255 "WHERE diseqcid = :DEVID"); 2256 query.bindValue(":DEVID", GetDeviceID()); 2257 2258 if (!query.exec() || !query.isActive()) 2259 { 2260 MythDB::DBError("DiSEqCDevSCR::Load 1", query); 2261 return false; 2262 } 2263 else if (query.next()) 2264 { 2265 m_scr_userband = query.value(0).toUInt(); 2266 m_scr_frequency = query.value(1).toUInt(); 2267 m_scr_pin = query.value(2).toInt(); 2268 m_repeat = query.value(3).toUInt(); 2269 } 2270 2271 // load children from db 2272 if (m_child) 2273 { 2274 delete m_child; 2275 m_child = NULL; 2276 } 2277 2278 query.prepare( 2279 "SELECT diseqcid " 2280 "FROM diseqc_tree " 2281 "WHERE parentid = :DEVID"); 2282 query.bindValue(":DEVID", GetDeviceID()); 2283 2284 if (!query.exec() || !query.isActive()) 2285 { 2286 MythDB::DBError("DiSEqCDevSCR::Load 2", query); 2287 return false; 2288 } 2289 else if (query.next()) 2290 { 2291 uint child_dev_id = query.value(0).toUInt(); 2292 SetChild(0, CreateById(m_tree, child_dev_id)); 2293 } 2294 2295 return true; 2296 } 2297 2298 bool DiSEqCDevSCR::Store(void) const 2299 { 2300 MSqlQuery query(MSqlQuery::InitCon()); 2301 2302 // insert new or update old 2303 if (IsRealDeviceID()) 2304 { 2305 query.prepare( 2306 "UPDATE diseqc_tree " 2307 "SET parentid = :PARENT, " 2308 " ordinal = :ORDINAL, " 2309 " type = 'scr', " 2310 " description = :DESC, " 2311 " scr_userband = :USERBAND, " 2312 " scr_frequency = :FREQUENCY, " 2313 " scr_pin = :PIN, " 2314 " cmd_repeat = :REPEAT " 2315 "WHERE diseqcid = :DEVID"); 2316 query.bindValue(":DEVID", GetDeviceID()); 2317 } 2318 else 2319 { 2320 query.prepare( 2321 "INSERT INTO diseqc_tree" 2322 " ( parentid, ordinal, type, " 2323 " description, scr_userband, scr_frequency, " 2324 " scr_pin, cmd_repeat) " 2325 "VALUES " 2326 " (:PARENT, :ORDINAL, 'scr', " 2327 " :DESC, :USERBAND, :FREQUENCY," 2328 " :PIN, :REPEAT) "); 2329 } 2330 2331 if (m_parent) 2332 query.bindValue(":PARENT", m_parent->GetDeviceID()); 2333 2334 query.bindValue(":ORDINAL", m_ordinal); 2335 query.bindValue(":DESC", GetDescription()); 2336 query.bindValue(":USERBAND", m_scr_userband); 2337 query.bindValue(":FREQUENCY", m_scr_frequency); 2338 query.bindValue(":PIN", m_scr_pin); 2339 query.bindValue(":REPEAT", m_repeat); 2340 2341 // update dev_id 2342 if (!query.exec()) 2343 { 2344 MythDB::DBError("DiSEqCDevSCR::Store", query); 2345 return false; 2346 } 2347 2348 // figure out devid if we did an insert 2349 if (!IsRealDeviceID()) 2350 SetDeviceID(query.lastInsertId().toUInt()); 2351 2352 // chain to child 2353 if (m_child) 2354 return m_child->Store(); 2355 2356 return true; 2357 } 2358 2359 bool DiSEqCDevSCR::SetChild(uint ordinal, DiSEqCDevDevice *device) 2360 { 2361 if (ordinal) 2362 return false; 2363 2364 DiSEqCDevDevice *old_child = m_child; 2365 m_child = NULL; 2366 if (old_child) 2367 delete old_child; 2368 2369 m_child = device; 2370 if (m_child) 2371 { 2372 m_child->SetOrdinal(ordinal); 2373 m_child->SetParent(this); 2374 } 2375 2376 return true; 2377 } 2378 2379 //////////////////////////////////////// 2055 2380 2056 2381 /** \class DiSEqCDevLNB 2057 2382 * \brief LNB Class. -
mythtv/libs/libmythtv/diseqc.h
diff -Naur mythtv-0.25-20120711-ge330593-old/mythtv/libs/libmythtv/diseqc.h mythtv-0.25-20120711-ge330593-new/mythtv/libs/libmythtv/diseqc.h
old new 27 27 class DiSEqCDevDevice; 28 28 class DiSEqCDevRotor; 29 29 class DiSEqCDevLNB; 30 class DiSEqCDevSCR; 30 31 31 32 typedef QMap<uint, double> uint_to_dbl_t; 32 33 typedef QMap<double, uint> dbl_to_uint_t; … … 85 86 86 87 DiSEqCDevRotor *FindRotor(const DiSEqCDevSettings &settings, uint index = 0); 87 88 DiSEqCDevLNB *FindLNB(const DiSEqCDevSettings &settings); 89 DiSEqCDevSCR *FindSCR(const DiSEqCDevSettings &settings); 88 90 DiSEqCDevDevice *FindDevice(uint dev_id); 89 91 90 92 /** \brief Retrieves the root node in the tree. */ … … 142 144 virtual bool Store(void) const = 0; 143 145 144 146 // Sets 145 enum dvbdev_t { kTypeSwitch = 0, kTypeRotor = 1, kTypeLNB = 2, }; 147 enum dvbdev_t 148 { 149 kTypeSwitch = 0, 150 kTypeRotor = 1, 151 kTypeSCR = 2, 152 kTypeLNB = 3, 153 }; 146 154 void SetDeviceType(dvbdev_t type) { m_dev_type = type; } 147 155 void SetParent(DiSEqCDevDevice* parent) { m_parent = parent; } 148 156 void SetOrdinal(uint ordinal) { m_ordinal = ordinal; } … … 201 209 const TypeTable *table); 202 210 203 211 private: 204 static const TypeTable dvbdev_lookup[ 4];212 static const TypeTable dvbdev_lookup[5]; 205 213 }; 206 214 207 215 class DiSEqCDevSwitch : public DiSEqCDevDevice … … 359 367 static const TypeTable RotorTypeTable[3]; 360 368 }; 361 369 370 class DiSEqCDevSCR : public DiSEqCDevDevice 371 { 372 public: 373 DiSEqCDevSCR(DiSEqCDevTree &tree, uint devid); 374 ~DiSEqCDevSCR(); 375 376 // Commands 377 virtual void Reset(void); 378 virtual bool Execute(const DiSEqCDevSettings&, const DTVMultiplex&); 379 bool PowerOff(void) const; 380 virtual bool Load(void); 381 virtual bool Store(void) const; 382 383 // Sets 384 enum dvbdev_pos_t 385 { 386 kTypeScrPosA = 0, 387 kTypeScrPosB = 1, 388 }; 389 void SetUserBand(uint userband) { m_scr_userband = userband; } 390 void SetFrequency(uint freq) { m_scr_frequency = freq; } 391 void SetPIN(int pin) { m_scr_pin = pin; } 392 virtual bool SetChild(uint ordinal, DiSEqCDevDevice* device); 393 394 // Gets 395 uint GetUserBand(void) const { return m_scr_userband; } 396 uint GetFrequency(void) const { return m_scr_frequency; } 397 int GetPIN(void) const { return m_scr_pin; } 398 virtual uint GetChildCount(void) const { return 1; } 399 virtual bool IsCommandNeeded(const DiSEqCDevSettings&, 400 const DTVMultiplex&) const { return false; } 401 virtual uint GetVoltage(const DiSEqCDevSettings&, 402 const DTVMultiplex&) const; 403 uint32_t GetIntermediateFrequency(const uint32_t frequency) const; 404 405 // Non-const Gets 406 virtual DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings&) const 407 { return m_child; } 408 virtual DiSEqCDevDevice *GetChild(uint) { return m_child; } 409 410 // statics 411 static QString SCRPositionToString(dvbdev_pos_t pos) 412 { return TableToString((uint)pos, SCRPositionTable); } 413 414 static dvbdev_pos_t SCRPositionFromString(const QString &pos) 415 { return (dvbdev_pos_t) TableFromString(pos, SCRPositionTable); } 416 417 protected: 418 bool SendCommand(uint cmd, uint repeats, uint data_len = 0, 419 unsigned char *data = NULL) const; 420 421 private: 422 uint m_scr_userband; /* 0-7 */ 423 uint m_scr_frequency; 424 int m_scr_pin; /* 0-255, -1=disabled */ 425 426 DiSEqCDevDevice *m_child; 427 428 static const TypeTable SCRPositionTable[3]; 429 }; 430 362 431 class DiSEqCDevLNB : public DiSEqCDevDevice 363 432 { 364 433 public: -
mythtv/libs/libmythtv/diseqcsettings.cpp
diff -Naur mythtv-0.25-20120711-ge330593-old/mythtv/libs/libmythtv/diseqcsettings.cpp mythtv-0.25-20120711-ge330593-new/mythtv/libs/libmythtv/diseqcsettings.cpp
old new 49 49 QString::number((uint) DiSEqCDevDevice::kTypeSwitch)); 50 50 addSelection(DeviceTree::tr("Rotor"), 51 51 QString::number((uint) DiSEqCDevDevice::kTypeRotor)); 52 addSelection(DeviceTree::tr("Unicable"), 53 QString::number((uint) DiSEqCDevDevice::kTypeSCR)); 52 54 addSelection(DeviceTree::tr("LNB"), 53 55 QString::number((uint) DiSEqCDevDevice::kTypeLNB)); 54 56 } … … 558 560 config.Save(); 559 561 } 560 562 563 //////////////////////////////////////// SCRUserBandSetting 564 565 class SCRUserBandSetting : public SpinBoxSetting, public Storage 566 { 567 public: 568 SCRUserBandSetting(DiSEqCDevSCR &scr) : 569 SpinBoxSetting(this, 0, 8, 1), m_scr(scr) 570 { 571 setLabel(DeviceTree::tr("Userband")); 572 setHelpText(DeviceTree::tr("Unicable userband ID (0-7) or sometimes (1-8)")); 573 } 574 575 virtual void Load(void) 576 { 577 setValue(m_scr.GetUserBand()); 578 } 579 580 virtual void Save(void) 581 { 582 m_scr.SetUserBand(intValue()); 583 } 584 585 virtual void Save(QString /*destination*/) { } 586 587 private: 588 DiSEqCDevSCR &m_scr; 589 }; 590 591 //////////////////////////////////////// SCRFrequencySetting 592 593 class SCRFrequencySetting : public LineEditSetting, public Storage 594 { 595 public: 596 SCRFrequencySetting(DiSEqCDevSCR &scr) : LineEditSetting(this), m_scr(scr) 597 { 598 setLabel(DeviceTree::tr("Frequency (MHz)")); 599 setHelpText(DeviceTree::tr("Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)")); 600 } 601 602 virtual void Load(void) 603 { 604 setValue(QString::number(m_scr.GetFrequency())); 605 } 606 607 virtual void Save(void) 608 { 609 m_scr.SetFrequency(getValue().toUInt()); 610 } 611 612 virtual void Save(QString /*destination*/) { } 613 614 private: 615 DiSEqCDevSCR &m_scr; 616 }; 617 618 //////////////////////////////////////// SCRPINSetting 619 620 class SCRPINSetting : public LineEditSetting, public Storage 621 { 622 public: 623 SCRPINSetting(DiSEqCDevSCR &scr) : LineEditSetting(this), m_scr(scr) 624 { 625 setLabel(DeviceTree::tr("PIN code")); 626 setHelpText(DeviceTree::tr("Unicable PIN code (-1 disabled, 0 - 255)")); 627 } 628 629 virtual void Load(void) 630 { 631 setValue(QString::number(m_scr.GetPIN())); 632 } 633 634 virtual void Save(void) 635 { 636 m_scr.SetPIN(getValue().toInt()); 637 } 638 639 virtual void Save(QString /*destination*/) { } 640 641 private: 642 DiSEqCDevSCR &m_scr; 643 }; 644 645 //////////////////////////////////////// SCRConfig 646 647 SCRConfig::SCRConfig(DiSEqCDevSCR &scr) : m_scr(scr) 648 { 649 ConfigurationGroup *group = 650 new VerticalConfigurationGroup(false, false); 651 group->setLabel(DeviceTree::tr("Unicable Configuration")); 652 653 group->addChild(new SCRUserBandSetting(scr)); 654 group->addChild(new SCRFrequencySetting(scr)); 655 group->addChild(new SCRPINSetting(scr)); 656 group->addChild(new DeviceRepeatSetting(scr)); 657 658 addChild(group); 659 } 660 561 661 //////////////////////////////////////// LnbPresetSetting 562 662 563 663 class lnb_preset … … 948 1048 } 949 1049 break; 950 1050 1051 case DiSEqCDevDevice::kTypeSCR: 1052 { 1053 DiSEqCDevSCR *scr = dynamic_cast<DiSEqCDevSCR*>(dev); 1054 if (scr) 1055 { 1056 SCRConfig config(*scr); 1057 changed = (config.exec() == MythDialog::Accepted); 1058 } 1059 } 1060 break; 1061 951 1062 case DiSEqCDevDevice::kTypeLNB: 952 1063 { 953 1064 DiSEqCDevLNB *lnb = dynamic_cast<DiSEqCDevLNB*>(dev); … … 977 1088 MythListBox *list = new MythListBox(popup); 978 1089 list->insertItem(tr("Switch")); 979 1090 list->insertItem(tr("Rotor")); 1091 list->insertItem(tr("Unicable")); 980 1092 list->insertItem(tr("LNB")); 981 1093 list->setCurrentRow(0, QItemSelectionModel::Select); 982 1094 … … 1263 1375 DiSEqCDevSettings &m_settings; 1264 1376 }; 1265 1377 1378 //////////////////////////////////////// SCRPositionSetting 1379 1380 class SCRPositionSetting : public ComboBoxSetting, public Storage 1381 { 1382 public: 1383 SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings) 1384 : ComboBoxSetting(this), m_node(node), m_settings(settings) 1385 { 1386 setLabel("Position"); 1387 setHelpText(DeviceTree::tr("Unicable satellite position (A/B)")); 1388 addSelection(DiSEqCDevSCR::SCRPositionToString(DiSEqCDevSCR::kTypeScrPosA), 1389 QString::number((uint)DiSEqCDevSCR::kTypeScrPosA), true); 1390 addSelection(DiSEqCDevSCR::SCRPositionToString(DiSEqCDevSCR::kTypeScrPosB), 1391 QString::number((uint)DiSEqCDevSCR::kTypeScrPosB), false); 1392 } 1393 1394 virtual void Load(void) 1395 { 1396 double value = m_settings.GetValue(m_node.GetDeviceID()); 1397 setValue(getValueIndex(QString::number((uint)value))); 1398 } 1399 1400 virtual void Save(void) 1401 { 1402 m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble()); 1403 } 1404 1405 virtual void Save(QString /*destination*/) { } 1406 1407 private: 1408 DiSEqCDevDevice &m_node; 1409 DiSEqCDevSettings &m_settings; 1410 }; 1411 1266 1412 //////////////////////////////////////// DTVDeviceConfigGroup 1267 1413 1268 1414 DTVDeviceConfigGroup::DTVDeviceConfigGroup( … … 1305 1451 setting = new USALSRotorSetting(*node, m_settings); 1306 1452 break; 1307 1453 } 1454 case DiSEqCDevDevice::kTypeSCR: 1455 { 1456 setting = new SCRPositionSetting(*node, m_settings); 1457 break; 1458 } 1308 1459 default: 1309 1460 break; 1310 1461 } … … 1379 1530 DISEQC_POSITIONER_X_SWITCH_2 = 9, 1380 1531 DISEQC_SW21 = 10, 1381 1532 DISEQC_SW64 = 11, 1533 DISEQC_SCR = 12, 1382 1534 }; 1383 1535 1384 1536 // import old diseqc configuration into tree … … 1548 1700 break; 1549 1701 } 1550 1702 1703 case DISEQC_SCR: 1704 { 1705 // SCR + LNB 1706 root = DiSEqCDevDevice::CreateByType( 1707 tree, DiSEqCDevDevice::kTypeSCR); 1708 DiSEqCDevSCR *scr = dynamic_cast<DiSEqCDevSCR*>(root); 1709 if (scr) 1710 { 1711 add_lnbs = 1; 1712 } 1713 break; 1714 } 1715 1551 1716 default: 1552 1717 { 1553 1718 LOG(VB_GENERAL, LOG_ERR, "Unknown DiSEqC device type " + … … 1614 1779 1615 1780 case DISEQC_POSITIONER_1_2: 1616 1781 case DISEQC_POSITIONER_X: 1782 case DISEQC_SCR: 1617 1783 lnb = dynamic_cast<DiSEqCDevLNB*>(root->GetChild(0)); 1618 1784 set.SetValue(root->GetDeviceID(), pos); 1619 1785 break; -
mythtv/libs/libmythtv/diseqcsettings.h
diff -Naur mythtv-0.25-20120711-ge330593-old/mythtv/libs/libmythtv/diseqcsettings.h mythtv-0.25-20120711-ge330593-new/mythtv/libs/libmythtv/diseqcsettings.h
old new 73 73 TransButtonSetting *m_pos; 74 74 }; 75 75 76 class SCRConfig : public QObject, public ConfigurationWizard 77 { 78 Q_OBJECT 79 80 public: 81 SCRConfig(DiSEqCDevSCR &scr); 82 83 private: 84 DiSEqCDevSCR &m_scr; 85 }; 86 76 87 class LNBTypeSetting; 77 88 class LNBLOFSwitchSetting; 78 89 class LNBLOFLowSetting; -
mythtv/libs/libmythtv/dvbchannel.cpp
diff -Naur mythtv-0.25-20120711-ge330593-old/mythtv/libs/libmythtv/dvbchannel.cpp mythtv-0.25-20120711-ge330593-new/mythtv/libs/libmythtv/dvbchannel.cpp
old new 712 712 intermediate_freq = lnb->GetIntermediateFrequency( 713 713 diseqc_settings, tuning); 714 714 715 // retrieve scr intermediate frequency 716 DiSEqCDevSCR *scr = diseqc_tree->FindSCR(diseqc_settings); 717 if (lnb && scr) 718 { 719 intermediate_freq = scr->GetIntermediateFrequency(intermediate_freq); 720 } 721 715 722 // if card can auto-FEC, use it -- sometimes NITs are inaccurate 716 723 if (capabilities & FE_CAN_FEC_AUTO) 717 724 can_fec_auto = true;