Ticket #802: dvbchannel.alt.8.patch
File dvbchannel.alt.8.patch, 5.3 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/dvbchannel.h
92 92 bool GetTransportOptions(int mplexid); 93 93 bool GetChannelOptions(const QString &channum); 94 94 95 void InitializeInputs(void); 96 95 97 void CheckOptions(); 96 98 bool CheckModulation(fe_modulation_t modulation) const; 97 99 bool CheckCodeRate(fe_code_rate_t rate) const; -
libs/libmythtv/dvbtypes.h
423 423 QString lnb_lof_hi, QString lnb_lof_lo, QString _sistandard, 424 424 QString hp_code_rate, QString lp_code_rate, QString constellation, 425 425 QString transmission_mode, QString guard_interval, QString hierarchy, 426 QString modulation, QString bandwidth );426 QString modulation, QString bandwidth, QString _input_id); 427 427 428 428 DVBTuning tuning; 429 429 … … 436 436 uint16_t transportID; 437 437 438 438 QString sistandard; 439 int input_id; 439 440 uint8_t version; 440 441 private: 441 442 mutable QMutex lock; -
libs/libmythtv/dvbchannel.cpp
125 125 } 126 126 } 127 127 128 /** \fn DVBChannel::InitializeInputs(void) 129 * This enumerates the inputs, from a DiSEqC switch if available 130 */ 131 void DVBChannel::InitializeInputs(void) 132 { 133 134 channelnames.clear(); 135 inputChannel.clear(); 136 137 MSqlQuery query(MSqlQuery::InitCon()); 138 query.prepare( 139 "SELECT cardinputid, inputname, " 140 " if (startchan, startchan, '') " 141 "FROM cardinput " 142 "WHERE cardid = :CARDID"); 143 query.bindValue(":CARDID", GetCardID()); 144 145 if (!query.exec() || !query.isActive()) 146 { 147 MythContext::DBError("InitializeInputs", query); 148 return; 149 } 150 else if (!query.size()) 151 { 152 VERBOSE(VB_IMPORTANT, "dvbchannel.cpp::InitializeInputs" 153 "\n\t\t\tCould not get inputs for the capturecard." 154 "\n\t\t\tPerhaps you have forgotten to bind video" 155 "\n\t\t\tsources to your card's inputs?"); 156 return; 157 } 158 159 while (query.next()) 160 { 161 int inputNum = query.value(0).toInt(); 162 channelnames[inputNum] = query.value(1).toString(); 163 inputChannel[inputNum] = query.value(2).toString(); 164 } 165 166 // print em 167 InputNames::const_iterator it; 168 for (it = channelnames.begin(); it != channelnames.end(); ++it) 169 { 170 VERBOSE(VB_CHANNEL, QString("Input #%1: '%2' schan(%3)") 171 .arg(it.key()).arg(*it) 172 .arg(inputChannel[it.key()])); 173 } 174 } 175 128 176 bool DVBChannel::Open() 129 177 { 130 178 CHANNEL("Opening DVB channel"); … … 171 219 172 220 first_tune = true; 173 221 222 InitializeInputs(); 223 174 224 return (fd_frontend >= 0 ); 175 225 } 176 226 … … 234 284 235 285 CHANNEL(QString("Tuned to frequency for channel %1.").arg(chan)); 236 286 287 currentcapchannel = chan_opts.input_id; 237 288 inputChannel[currentcapchannel] = curchannelname; 238 289 239 290 return true; 240 291 } 241 292 … … 250 301 251 302 bool DVBChannel::SwitchToInput(const QString &input, const QString &chan) 252 303 { 253 currentcapchannel = 0; 254 if (channelnames.empty()) 255 channelnames[currentcapchannel] = input; 256 304 (void)input; 257 305 return SetChannelByString(chan); 258 306 } 259 307 … … 338 386 " lnb_lof_hi, lnb_lof_lo, sistandard, " 339 387 " hp_code_rate, lp_code_rate, constellation, " 340 388 " transmission_mode, guard_interval, hierarchy, " 341 " modulation, bandwidth "389 " modulation, bandwidth, cardinputid " 342 390 "FROM dtv_multiplex, cardinput, capturecard " 343 391 "WHERE dtv_multiplex.sourceid = cardinput.sourceid AND "); 344 392 … … 370 418 query.value(12).toString(), query.value(13).toString(), 371 419 query.value(14).toString(), query.value(15).toString(), 372 420 query.value(16).toString(), query.value(17).toString(), 373 query.value(18).toString(), query.value(19).toString()); 421 query.value(18).toString(), query.value(19).toString(), 422 query.value(20).toString()); 374 423 } 375 424 376 425 /** \fn DVBChannel::CheckOptions() -
libs/libmythtv/dvbtypes.cpp
906 906 QString lnb_lof_hi, QString lnb_lof_lo, QString _sistandard, 907 907 QString hp_code_rate, QString lp_code_rate, QString constellation, 908 908 QString trans_mode, QString guard_interval, QString hierarchy, 909 QString modulation, QString bandwidth )909 QString modulation, QString bandwidth, QString _input_id) 910 910 { 911 911 lock.lock(); 912 912 … … 928 928 ok = tuning.parseATSC(frequency, modulation); 929 929 930 930 sistandard = _sistandard; 931 931 input_id = _input_id.toInt(); 932 932 933 lock.unlock(); 933 934 return ok; 934 935 }