Ticket #1211: def_input.diff
File def_input.diff, 3.9 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/channelbase.h
174 174 virtual void SetCachedATSCInfo(const QString &chan); 175 175 static void GetCachedPids(int chanid, pid_cache_t&); 176 176 static void SaveCachedPids(int chanid, const pid_cache_t&); 177 staticvoid StoreInputChannels(const InputMap&);177 virtual void StoreInputChannels(const InputMap&); 178 178 179 179 TVRec *pParent; 180 180 QString channelorder; -
libs/libmythtv/channelbase.cpp
559 559 if (!query.exec() || !query.isActive()) 560 560 MythContext::DBError("StoreInputChannels", query); 561 561 } 562 563 // Save the current Input as the default for this card 564 QString inputname = GetCurrentInput(); 565 int inputid = GetInputByName(inputname); 566 int cardid = GetInputCardID(inputid); 567 568 if (cardid && !inputname.isNull()) 569 { 570 query.prepare("UPDATE capturecard " 571 "SET defaultinput = :INNAME " 572 "WHERE cardid = :CARDID"); 573 query.bindValue(":INNAME", inputname); 574 query.bindValue(":CARDID", cardid); 575 if (!query.exec()) 576 MythContext::DBError("set_startinput", query); 577 } 562 578 } 563 579 564 580 bool ChannelBase::CheckChannel(const QString &channum, -
libs/libmythtv/tv_rec.cpp
253 253 return false; 254 254 255 255 // configure the Channel instance 256 QString startchannel = GetStartChannel(cardid , genOpt.defaultinput);256 QString startchannel = GetStartChannel(cardid); 257 257 if (!CreateChannel(startchannel)) 258 258 return false; 259 259 … … 1468 1468 return true; 1469 1469 } 1470 1470 1471 QString TVRec::GetStartChannel(int cardid, const QString & defaultinput)1471 QString TVRec::GetStartChannel(int cardid, const QString &input) 1472 1472 { 1473 QString defaultinput; 1473 1474 QString msg(""); 1474 1475 QString startchan = QString::null; 1475 1476 1477 if (input.isNull()) 1478 { 1479 // Get the last viewed input 1480 MSqlQuery query(MSqlQuery::InitCon()); 1481 query.prepare( 1482 "SELECT defaultinput " 1483 "FROM capturecard " 1484 "WHERE cardid = :CARDID"); 1485 query.bindValue(":CARDID", cardid); 1486 1487 if (!query.exec() || !query.isActive()) 1488 MythContext::DBError("getdefaultinput", query); 1489 else if (query.next()) 1490 defaultinput = query.value(0).toString(); 1491 } 1492 else 1493 defaultinput = input; 1494 1476 1495 // Get last tuned channel from database, to use as starting channel 1477 1496 MSqlQuery query(MSqlQuery::InitCon()); 1478 1497 query.prepare( … … 3023 3042 3024 3043 // If this is Live TV startup, we need a channel... 3025 3044 if (channum.isEmpty() && (request.flags & kFlagLiveTV)) 3026 { 3027 input = genOpt.defaultinput; 3028 channum = GetStartChannel(cardid, input); 3029 } 3045 channum = GetStartChannel(cardid); 3030 3046 3031 3047 if (channel && !channum.isEmpty() && (channum.find("NextChannel") >= 0)) 3032 3048 { -
libs/libmythtv/tv_rec.h
269 269 DBox2DBOptions &dbox2_opts); 270 270 271 271 272 static QString GetStartChannel(int cardid, const QString &defaultinput); 272 static QString GetStartChannel(int cardid, 273 const QString &input = QString::null); 273 274 274 275 bool SetupRecorder(RecordingProfile& profile); 275 276 void TeardownRecorder(bool killFile = false);