summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert McNamara <rmcnamara@mythtv.org>2011-06-19 18:53:27 (GMT)
committer Robert McNamara <rmcnamara@mythtv.org>2011-06-19 18:53:27 (GMT)
commit3ffe4d24801d2af7f0eaeb16fee2e4c134d1f1b4 (patch)
treed937e2bdbf3a5b9e4a80ff6fc2dff94ba54f2eee
parent1ae98c82c1a5f9a3da822ba3e510590ed852e828 (diff)
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.
-rw-r--r--mythtv/libs/libmythtv/cardutil.cpp10
-rw-r--r--mythtv/libs/libmythtv/videosource.cpp17
-rw-r--r--mythtv/libs/libmythtv/videosource.h2
3 files changed, 12 insertions, 17 deletions
diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp
index cc820b1..44e550d 100644
--- a/mythtv/libs/libmythtv/cardutil.cpp
+++ b/mythtv/libs/libmythtv/cardutil.cpp
@@ -301,7 +301,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");
@@ -317,9 +317,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
diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp
index 796a6af..0a357b0 100644
--- a/mythtv/libs/libmythtv/videosource.cpp
+++ b/mythtv/libs/libmythtv/videosource.cpp
@@ -1337,8 +1337,6 @@ HDHomeRunTunerIndex::HDHomeRunTunerIndex()
{
setLabel(QObject::tr("Tuner"));
setEnabled(false);
- addSelection("0");
- addSelection("1");
connect(this, SIGNAL(valueChanged( const QString&)),
this, SLOT( UpdateDevices(const QString&)));
_oldValue = "";
@@ -1346,7 +1344,7 @@ HDHomeRunTunerIndex::HDHomeRunTunerIndex()
void HDHomeRunTunerIndex::setEnabled(bool e)
{
- TransComboBoxSetting::setEnabled(e);
+ TransLineEditSetting::setEnabled(e);
if (e) {
if (!_oldValue.isEmpty())
setValue(_oldValue);
@@ -1838,8 +1836,9 @@ 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;
@@ -1847,13 +1846,7 @@ void HDHomeRunConfigurationGroup::FillDeviceList(void)
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;
diff --git a/mythtv/libs/libmythtv/videosource.h b/mythtv/libs/libmythtv/videosource.h
index a152128..bdd2657 100644
--- a/mythtv/libs/libmythtv/videosource.h
+++ b/mythtv/libs/libmythtv/videosource.h
@@ -857,7 +857,7 @@ class HDHomeRunIP : public TransLineEditSetting
QString _oldValue;
};
-class HDHomeRunTunerIndex : public TransComboBoxSetting
+class HDHomeRunTunerIndex : public TransLineEditSetting
{
Q_OBJECT