[mythtv-users] RE: Tuner card label - patch in progress but
assistance requested
Joel W. Goldwein, MD
jgoldwein at impac.com
Wed Nov 2 15:01:09 EST 2005
Well, here is the (crude) patch thus far, but it does not include the
addition of a "card_label" varchar(30) field in the capturecard table which
I manually created, and into which I entered for each card a label such as
"PVR-500-A", "PVR-500-B", "PVR-250".
We would need to do the following to polish this off:
1. Create an entry point in the MythTV-Setup program Capture Card
Creation/Edit Screen
2. Create a method to display the card label on the OSD screen which I
believe is in tv_play.cpp
3. Modify the cardinput table in dbcheck.cpp
4. Add support into mythweb backend status page
JG
---------------------
Index: statusbox.cpp
===================================================================
--- statusbox.cpp (revision 7675)
+++ statusbox.cpp (working copy)
@@ -708,7 +708,7 @@
doScroll = true;
MSqlQuery query(MSqlQuery::InitCon());
- query.prepare("SELECT cardid FROM capturecard;");
+ query.prepare("SELECT cardid, card_label FROM capturecard;");
query.exec();
contentLines.clear();
@@ -727,9 +727,11 @@
gContext->SendReceiveStringList(strlist);
int state = strlist[0].toInt();
-
- QString Status = QString(tr("Tuner %1 ")).arg(cardid);
- if (state==kState_Error)
+
+ QString Status = QString(tr(" Tuner %1 (")).arg(cardid);
+ QString CardLabel = QString(query.value(1).toString());
+ Status += CardLabel + ") ";
+ if (state==kState_Error)
Status += tr("is not available");
else if (state==kState_WatchingLiveTV)
Status += tr("is watching live TV");
@@ -921,6 +923,7 @@
}
else if (sizeKB>1024) // Megabytes
{
+
double sizeMB = sizeKB/1024.0;
return QString("%1 MB").arg(sizeMB, 0, 'f', (sizeMB>10)?0:prec);
}
More information about the mythtv-users
mailing list