Ticket #4328: channelChange.15174.patch
File channelChange.15174.patch, 4.5 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/channelbase.h
144 144 virtual bool SwitchToInput(int newcapchannel, bool setstarting) = 0; 145 145 146 146 virtual int GetCardID(void) const; 147 virtual bool ChangeExternalChannel(const QString &newchan); 147 virtual bool ChangeExternalChannel(const QString &channum); 148 virtual bool RotateAntenna(const QString &channum, 149 const QString &channum, 150 const QString &callsign); 148 151 static void StoreInputChannels(const InputMap&); 149 152 static void StoreDefaultInput(uint cardid, const QString &input); 150 153 -
libs/libmythtv/hdhrchannel.cpp
309 309 bool isFrequency = ok && (frequency > 10000000); 310 310 311 311 // Tune to proper frequency 312 if ( (*it)->externalChanger.isEmpty())312 if (isFrequency) 313 313 { 314 if (isFrequency) 314 // Allow an antenna rotor to spin around 315 if (!(*it)->externalChanger.isEmpty()) 315 316 { 316 if (!Tune(frequency, inputName, modulation, si_std)) 317 int chanid = ChannelUtil::GetChanID((*it)->sourceid, channum); 318 QString callsign = ChannelUtil::GetCallsign(chanid); 319 if (!RotateAntenna(freqid, channum, callsign)) 317 320 return false; 318 321 } 319 else320 {321 VERBOSE(VB_IMPORTANT, LOC_ERR +322 "dtv_multiplex data is required for tuning");323 322 323 if (!Tune(frequency, inputName, modulation, si_std)) 324 324 return false; 325 }326 325 } 327 else if (!ChangeExternalChannel(freqid)) 326 else 327 { 328 VERBOSE(VB_IMPORTANT, LOC_ERR + 329 "dtv_multiplex data is required for tuning"); 330 328 331 return false; 332 } 329 333 330 334 // Set the current channum to the new channel's channum 331 335 curchannelname = QDeepCopy<QString>(channum); -
libs/libmythtv/channelbase.cpp
223 223 return GetChannels(inputid); 224 224 } 225 225 226 bool ChannelBase::ChangeExternalChannel(const QString & channum)226 bool ChannelBase::ChangeExternalChannel(const QString &freqId) 227 227 { 228 QString empty; 229 RotateAntenna(freqId, empty, empty); 230 } 231 232 bool ChannelBase::RotateAntenna(const QString &freqId, 233 const QString &channum, 234 const QString &callsign) 235 { 228 236 #ifdef USING_MINGW 229 237 VERBOSE(VB_IMPORTANT, LOC_WARN + 230 238 QString("ChangeExternalChannel is not implemented in MinGW.")); … … 236 244 if (changer.isEmpty()) 237 245 return false; 238 246 239 QString command = QString("%1 %2 ").arg(changer).arg(channum);247 QString command = QString("%1 %2 %3 %4").arg(changer).arg(freqId).arg(channum).arg(callsign); 240 248 241 249 VERBOSE(VB_CHANNEL, QString("External channel change: %1").arg(command)); 242 250 pid_t child = fork(); -
libs/libmythtv/videosource.cpp
1644 1644 }; 1645 1645 }; 1646 1646 1647 class ExternalRotateCommand : 1648 public LineEditSetting, public CardInputDBStorage 1649 { 1650 public: 1651 ExternalRotateCommand(const CardInput &parent) : 1652 LineEditSetting(this), 1653 CardInputDBStorage(this, parent, "externalcommand") 1654 { 1655 setLabel(QObject::tr("Antenna rotate command")); 1656 setValue(""); 1657 setHelpText(QObject::tr("If specified, this command will be run " 1658 "before a channel change so that an antenna can be " 1659 "rotated into position. Three arguments are passed: " 1660 "frequency, MPEG program number and channel callsign.")); 1661 }; 1662 }; 1663 1647 1664 class PresetTuner : public LineEditSetting, public CardInputDBStorage 1648 1665 { 1649 1666 public: … … 1779 1796 ConfigurationGroup *chgroup = 1780 1797 new VerticalConfigurationGroup(false, false, true, true); 1781 1798 chgroup->addChild(new QuickTune(*this)); 1799 chgroup->addChild(new ExternalRotateCommand(*this)); 1782 1800 chgroup->addChild(new FreeToAir(*this)); 1783 1801 group->addChild(chgroup); 1784 1802 }