Permalink
Browse files

HDHomeRun: Create the right number of tuners for the found device.

Patch by Nick Kelsey from SiliconDust.  Since some HDHRs are now single or triple tuners, the assumption that there are two tuners is false.  Create a device for each tuner which is actually available on the queried unit.
  • Loading branch information...
1 parent 422a88f commit 6fca6fa5258df2452c84f13e2bc58871dd4d99ed Robert McNamara committed Jun 19, 2011
Showing with 12 additions and 17 deletions.
  1. +6 −4 mythtv/libs/libmythtv/cardutil.cpp
  2. +5 −12 mythtv/libs/libmythtv/videosource.cpp
  3. +1 −1 mythtv/libs/libmythtv/videosource.h
@@ -234,7 +234,7 @@ QStringList CardUtil::ProbeVideoDevices(const QString &rawtype)
return devs;
}
- if (result == 50)
+ if (result >= max_count)
{
VERBOSE(VB_IMPORTANT, "CardUtil::ProbeVideoDevices: "
"Warning: may be > 50 HDHomerun devices");
@@ -250,9 +250,11 @@ QStringList CardUtil::ProbeVideoDevices(const QString &rawtype)
.arg((result_list[i].ip_addr>> 8) & 0xFF)
.arg((result_list[i].ip_addr>> 0) & 0xFF);
- QString hdhrdev = id.toUpper() + " " + ip;
-
- devs.push_back(hdhrdev);
+ for (int tuner = 0; tuner < result_list[i].tuner_count; tuner++)
+ {
+ QString hdhrdev = id.toUpper() + " " + ip + " " + QString("%1").arg(tuner);
+ devs.push_back(hdhrdev);
+ }
}
}
#endif // USING_HDHOMERUN
@@ -1337,16 +1337,14 @@ HDHomeRunTunerIndex::HDHomeRunTunerIndex()
{
setLabel(QObject::tr("Tuner"));
setEnabled(false);
- addSelection("0");
- addSelection("1");
connect(this, SIGNAL(valueChanged( const QString&)),
this, SLOT( UpdateDevices(const QString&)));
_oldValue = "";
};
void HDHomeRunTunerIndex::setEnabled(bool e)
{
- TransComboBoxSetting::setEnabled(e);
+ TransLineEditSetting::setEnabled(e);
if (e) {
if (!_oldValue.isEmpty())
setValue(_oldValue);
@@ -1696,22 +1694,17 @@ void HDHomeRunConfigurationGroup::FillDeviceList(void)
{
QString dev = *it;
QStringList devinfo = dev.split(" ");
- QString devid = devinfo.first();
- QString devip = devinfo.last();
+ QString devid = devinfo.at(0);
+ QString devip = devinfo.at(1);
+ QString devtuner = devinfo.at(2);
HDHomeRunDevice tmpdevice;
tmpdevice.deviceid = devid;
tmpdevice.desc = CardUtil::GetHDHRdesc(devid);
tmpdevice.cardip = devip;
tmpdevice.inuse = false;
tmpdevice.discovered = true;
-
- tmpdevice.cardtuner = "0";
- tmpdevice.mythdeviceid =
- tmpdevice.deviceid + "-" + tmpdevice.cardtuner;
- devicelist[tmpdevice.mythdeviceid] = tmpdevice;
-
- tmpdevice.cardtuner = "1";
+ tmpdevice.cardtuner = devtuner;
tmpdevice.mythdeviceid =
tmpdevice.deviceid + "-" + tmpdevice.cardtuner;
devicelist[tmpdevice.mythdeviceid] = tmpdevice;
@@ -823,7 +823,7 @@ class HDHomeRunIP : public TransLineEditSetting
QString _oldValue;
};
-class HDHomeRunTunerIndex : public TransComboBoxSetting
+class HDHomeRunTunerIndex : public TransLineEditSetting
{
Q_OBJECT

0 comments on commit 6fca6fa

Please sign in to comment.