Skip to content

Commit 2cb7fc6

Browse files
committed
Expose the media type as a statetype to the OSD, states are recording, video, dvd, bluraydisc, httpstream and rtspstream
1 parent c60f331 commit 2cb7fc6

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

mythtv/libs/libmyth/programinfo.cpp

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,41 @@ void ProgramInfo::ToMap(InfoMap &progMap,
15781578
progMap["originalairdate"] = MythDateToString(originalAirDate, kDateFull);
15791579
progMap["shortoriginalairdate"] = MythDateToString(originalAirDate, kDateShort);
15801580
}
1581+
1582+
// 'mediatype' for a statetype, so untranslated
1583+
// 'mediatypestring' for textarea, so translated
1584+
// TODO Move to a dedicated ToState() method?
1585+
QString mediaType;
1586+
QString mediaTypeString;
1587+
switch (GetProgramInfoType())
1588+
{
1589+
case kProgramInfoTypeVideoFile :
1590+
mediaType = "video";
1591+
mediaTypeString = QObject::tr("Video");
1592+
break;
1593+
case kProgramInfoTypeVideoDVD :
1594+
mediaType = "dvd";
1595+
mediaTypeString = QObject::tr("DVD");
1596+
break;
1597+
case kProgramInfoTypeVideoStreamingHTML :
1598+
mediaType = "httpstream";
1599+
mediaTypeString = QObject::tr("HTTP Streaming");
1600+
break;
1601+
case kProgramInfoTypeVideoStreamingRTSP :
1602+
mediaType = "rtspstream";
1603+
mediaTypeString = QObject::tr("RTSP Streaming");
1604+
break;
1605+
case kProgramInfoTypeVideoBD :
1606+
mediaType = "bluraydisc";
1607+
mediaTypeString = QObject::tr("Blu-Ray Disc");
1608+
break;
1609+
case kProgramInfoTypeRecording : // Fall through
1610+
default :
1611+
mediaType = "recording";
1612+
mediaTypeString = tr("Recording", "Recorded file, object not action");
1613+
}
1614+
progMap["mediatype"] = mediaType;
1615+
progMap["mediatypestring"] = mediaTypeString;
15811616
}
15821617

15831618
/// \brief Returns length of program/recording in seconds.
@@ -1951,7 +1986,7 @@ bool ProgramInfo::IsSameTimeslot(const ProgramInfo& other) const
19511986
return false;
19521987
if (startts == other.startts &&
19531988
(chanid == other.chanid ||
1954-
(!chansign.isEmpty() &&
1989+
(!chansign.isEmpty() &&
19551990
chansign.compare(other.chansign, Qt::CaseInsensitive) == 0)))
19561991
return true;
19571992

@@ -1969,7 +2004,7 @@ bool ProgramInfo::IsSameProgramTimeslot(const ProgramInfo &other) const
19692004
if (title.compare(other.title, Qt::CaseInsensitive) != 0)
19702005
return false;
19712006
if ((chanid == other.chanid ||
1972-
(!chansign.isEmpty() &&
2007+
(!chansign.isEmpty() &&
19732008
chansign.compare(other.chansign, Qt::CaseInsensitive) == 0)) &&
19742009
startts < other.endts &&
19752010
endts > other.startts)
@@ -2003,7 +2038,7 @@ void ProgramInfo::CheckProgramIDAuthorities(void)
20032038
}
20042039

20052040
int numAuths = authMap.count();
2006-
LOG(VB_GENERAL, LOG_INFO,
2041+
LOG(VB_GENERAL, LOG_INFO,
20072042
QString("Found %1 distinct programid authorities").arg(numAuths));
20082043

20092044
usingProgIDAuth = (numAuths > 1);

mythtv/libs/libmythtv/osd.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ void OSD::SetText(const QString &window, QHash<QString,QString> &map,
463463
if (state)
464464
state->DisplayState(map["nightmode"]);
465465
}
466+
if (map.contains("mediatype"))
467+
{
468+
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("mediatype"));
469+
if (state)
470+
state->DisplayState(map["mediatype"]);
471+
}
466472

467473
MythUIProgressBar *bar =
468474
dynamic_cast<MythUIProgressBar *>(win->GetChild("elapsedpercent"));

0 commit comments

Comments
 (0)