Ticket #13: tune2startchannel.1.patch
File tune2startchannel.1.patch, 7.4 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/firewirechannel.cpp
89 89 90 90 } 91 91 92 voidFirewireChannel::SwitchToInput(const QString &input, const QString &chan)92 bool FirewireChannel::SwitchToInput(const QString &input, const QString &chan) 93 93 { 94 94 currentcapchannel = 0; 95 95 if (channelnames.empty()) 96 96 channelnames[currentcapchannel] = input; 97 97 98 SetChannelByString(chan);98 return SetChannelByString(chan); 99 99 } 100 100 101 101 void FirewireChannel::SetExternalChanger(void) { -
libs/libmythtv/dvbchannel.h
58 58 bool IsPMTSet() const { return chan_opts.IsPMTSet(); } 59 59 60 60 // Commands 61 voidSwitchToInput(const QString &inputname, const QString &chan);61 bool SwitchToInput(const QString &inputname, const QString &chan); 62 62 void SwitchToInput(int newcapchannel, bool setstarting) 63 63 { (void)newcapchannel; (void)setstarting; } 64 64 bool Tune(const dvb_channel_t& channel, bool force_reset=false); -
libs/libmythtv/dvbchannel.cpp
246 246 } 247 247 curchannelname = chan; 248 248 249 GENERAL(QString("Successfully tuned to channel %1.").arg(chan));250 251 249 if (!chan_opts.pmt.OnAir()) 252 250 { 253 251 ERROR(QString("Channel #%1 is off air.").arg(chan)); 254 252 return false; 255 253 } 256 254 255 GENERAL(QString("Successfully tuned to channel %1.").arg(chan)); 256 257 257 inputChannel[currentcapchannel] = curchannelname; 258 258 259 259 #if (DVB_API_VERSION_MINOR == 1) … … 271 271 emit ChannelChanged(chan_opts); 272 272 } 273 273 274 voidDVBChannel::SwitchToInput(const QString &input, const QString &chan)274 bool DVBChannel::SwitchToInput(const QString &input, const QString &chan) 275 275 { 276 276 currentcapchannel = 0; 277 277 if (channelnames.empty()) 278 278 channelnames[currentcapchannel] = input; 279 279 280 SetChannelByString(chan);280 return SetChannelByString(chan); 281 281 } 282 282 283 283 /** \fn DVBChannel::GetChannelOptions(const QString&) -
libs/libmythtv/firewirechannel.h
44 44 { return QString("%1:%2").arg(fw_opts.port).arg(fw_opts.node); } 45 45 46 46 // Commands 47 voidSwitchToInput(const QString &inputname, const QString &chan);47 bool SwitchToInput(const QString &inputname, const QString &chan); 48 48 void SwitchToInput(int newcapchannel, bool setstarting) 49 49 { (void)newcapchannel; (void)setstarting; } 50 50 -
libs/libmythtv/tv_rec.cpp
960 960 gContext->dispatch(me); 961 961 } 962 962 963 void TVRec::InitChannel(const QString &inputname, constQString &startchannel)963 void TVRec::InitChannel(const QString &inputname, QString &startchannel) 964 964 { 965 bool tuneSuccess; 965 966 if (!channel) 966 967 return; 967 968 … … 976 977 977 978 QString chanorder = gContext->GetSetting("ChannelOrdering", "channum + 0"); 978 979 if (inputname.isEmpty()) 979 channel->SetChannelByString(startchannel);980 tuneSuccess=channel->SetChannelByString(startchannel); 980 981 else 981 channel->SwitchToInput(inputname, startchannel); 982 tuneSuccess=channel->SwitchToInput(inputname, startchannel); 983 984 if (!tuneSuccess) 985 { 986 startchannel=gContext->GetSetting("DefaultTVChannel"); 987 if (inputname.isEmpty()) 988 tuneSuccess=channel->SetChannelByString(startchannel); 989 else 990 tuneSuccess=channel->SwitchToInput(inputname, startchannel); 991 } 992 993 if (!tuneSuccess) 994 VERBOSE(VB_IMPORTANT,"Utter failuer to tune to a channel"); 995 982 996 channel->SetChannelOrdering(chanorder); 983 997 } 984 998 … … 3164 3178 } 3165 3179 3166 3180 } 3167 -
libs/libmythtv/channelbase.h
78 78 // Input toggling convenience methods 79 79 virtual void ToggleInputs(void); 80 80 virtual void SwitchToInput(const QString &input); 81 virtual voidSwitchToInput(const QString &input, const QString &chan);81 virtual bool SwitchToInput(const QString &input, const QString &chan); 82 82 83 83 /// Saves current channel as the default channel for the current input. 84 84 virtual void StoreInputChannels(void); -
libs/libmythtv/tv_rec.h
193 193 void SetupRecorder(class RecordingProfile& profile); 194 194 void TeardownRecorder(bool killFile = false); 195 195 196 void InitChannel(const QString &inputname, constQString &startchannel);196 void InitChannel(const QString &inputname, QString &startchannel); 197 197 void CloseChannel(void); 198 198 199 199 void SetupSignalMonitor(void); -
libs/libmythtv/channelbase.cpp
90 90 "%1 on card\n").arg(inputname)); 91 91 } 92 92 93 voidChannelBase::SwitchToInput(const QString &inputname, const QString &chan)93 bool ChannelBase::SwitchToInput(const QString &inputname, const QString &chan) 94 94 { 95 95 int input = GetInputByName(inputname); 96 96 97 97 if (input >= 0) 98 98 { 99 99 SwitchToInput(input, false); 100 SetChannelByString(chan);100 return SetChannelByString(chan); 101 101 } 102 102 else 103 { 103 104 VERBOSE(VB_IMPORTANT, 104 105 QString("ChannelBase: Could not find input: %1 on card when " 105 106 "setting channel %2\n").arg(inputname).arg(chan)); 107 return false; 108 } 106 109 } 107 110 108 111 bool ChannelBase::ChangeExternalChannel(const QString &channum) -
libs/libmythtv/channel.cpp
463 463 // and return, since the act of changing inputs will change the channel as well. 464 464 if (!inputName.isEmpty()) 465 465 { 466 ChannelBase::SwitchToInput(inputName, chan); 467 SetCachedATSCInfo(atsc_chan); 468 return true; 466 if(ChannelBase::SwitchToInput(inputName, chan)) 467 { 468 SetCachedATSCInfo(atsc_chan); 469 return true; 470 } 471 else return false; 469 472 } 470 473 471 474 QString modulation; … … 794 797 TuneTo(inputTuneTo[currentcapchannel], 0); 795 798 796 799 if (setstarting && !inputChannel[currentcapchannel].isEmpty()) 797 SetChannelByString(inputChannel[currentcapchannel]); 800 if (!SetChannelByString(inputChannel[currentcapchannel])) 801 VERBOSE(VB_IMPORTANT,"Channel::SwitchToInput() FAILED"); 798 802 } 799 803 800 804 unsigned short *Channel::GetV4L1Field(int attrib, struct video_picture &vid_pic) … … 1099 1103 { 1100 1104 return ChangeColourAttribute(V4L2_CID_HUE, "hue", up); 1101 1105 } 1102