Permalink
Browse files

Add rsOtherTuning and rsOtherRecording recording statuses.

rsOtherShowing is a display only recording status used by mythfrontend
to indicate a program will record or is recording on another related
channel.  There are two long-standing problems with it.  One, it
doesn't distinguish between will record and is recording.  Two, it is
treated as a non-recording type.  Both problems force the user to find
the "other" channel in the EPG or elsewhere in order to see the
complete status and/or maniuplate the recording.  This change
addresses both problems.

Add new rsOtherTuning and rsOtherRecording recording statuses.  These
statuses are analogous to the existing rsTuning and rsRecording
statuses and indicates that a recording is active.  rsOtherShowing is
now analogous to rsWillRecord and indicates future activity.

Treat all of the rsOther* status like their analogs.  This makes it
possible for actions like stoping an active recording or adding an
override without having to navigate to the other channel.

This change also removes oneChanid parameter from the ProgramInfo
constructor and from LoadFromProgram since it is no longer needed.
  • Loading branch information...
1 parent 45f24b0 commit 090f847f1549e28cd92d6273f0b492293a9e421c @gigem gigem committed Apr 17, 2012
@@ -518,7 +518,7 @@ ProgramInfo::ProgramInfo(
uint _audioproperties,
uint _subtitleType,
- const ProgramList &schedList, bool oneChanid) :
+ const ProgramList &schedList) :
title(_title),
subtitle(_subtitle),
description(_description),
@@ -618,21 +618,25 @@ ProgramInfo::ProgramInfo(
dupmethod = s.dupmethod;
findid = s.findid;
- if (s.recstatus == rsWillRecord ||
- s.recstatus == rsRecording ||
- s.recstatus == rsTuning)
+ if (chanstr != s.chanstr)
{
- if (oneChanid)
- {
- chanid = s.chanid;
- chanstr = s.chanstr;
- chansign = s.chansign;
- channame = s.channame;
- }
- else if ((chanid != s.chanid) && (chanstr != s.chanstr))
- {
+ if (s.recstatus == rsWillRecord)
recstatus = rsOtherShowing;
- }
+ else if (s.recstatus == rsRecording)
+ recstatus = rsOtherRecording;
+ else if (s.recstatus == rsTuning)
+ recstatus = rsOtherTuning;
+ }
+
+ // Stop recording keys on chanid (and recstarts). If the
+ // recording is running, override the chanid, so we can stop
+ // it from any matching program. Remove this hack when we
+ // replace chanid/recstartts as the primary key for the
+ // recorded and related tables with something better.
+ if (s.recstatus == rsRecording ||
+ s.recstatus == rsTuning)
+ {
+ chanid = s.chanid;
}
}
}
@@ -4576,7 +4580,7 @@ static bool FromProgramQuery(
bool LoadFromProgram(
ProgramList &destination,
const QString &sql, const MSqlBindings &bindings,
- const ProgramList &schedList, bool oneChanid)
+ const ProgramList &schedList)
{
destination.clear();
@@ -4622,7 +4626,7 @@ bool LoadFromProgram(
query.value(24).toInt(), // audioprop
query.value(25).toInt(), // subtitletypes
- schedList, oneChanid));
+ schedList));
}
return true;
@@ -198,8 +198,7 @@ class MPUBLIC ProgramInfo
uint audioprops,
uint subtitletype,
- const ProgramList &schedList,
- bool oneChanid);
+ const ProgramList &schedList);
/// Constructs a basic ProgramInfo (used by RecordingInfo)
ProgramInfo(const QString &title,
const QString &subtitle,
@@ -727,8 +726,7 @@ MPUBLIC bool LoadFromProgram(
ProgramList &destination,
const QString &sql,
const MSqlBindings &bindings,
- const ProgramList &schedList,
- bool oneChanid);
+ const ProgramList &schedList);
MPUBLIC bool LoadFromOldRecorded(
ProgramList &destination,
@@ -44,10 +44,12 @@ QString toString(MarkTypes type)
QString toUIState(RecStatusType recstatus)
{
- if (recstatus == rsRecorded || recstatus == rsWillRecord)
+ if (recstatus == rsRecorded || recstatus == rsWillRecord ||
+ recstatus == rsOtherShowing)
return "normal";
- if (recstatus == rsRecording || recstatus == rsTuning)
+ if (recstatus == rsRecording || recstatus == rsTuning ||
+ recstatus == rsOtherRecording || recstatus == rsOtherTuning)
return "running";
if (recstatus == rsConflict || recstatus == rsOffLine ||
@@ -57,7 +59,7 @@ QString toUIState(RecStatusType recstatus)
return "error";
}
- if (recstatus == rsRepeat || recstatus == rsOtherShowing ||
+ if (recstatus == rsRepeat ||
recstatus == rsNeverRecord || recstatus == rsDontRecord ||
(recstatus != rsDontRecord && recstatus <= rsEarlierShowing))
{
@@ -83,7 +85,7 @@ QString toString(RecStatusType recstatus, uint id)
ret = QString::number(id);
break;
case rsTuning:
- ret = QObject::tr("t", "RecStatusChar rsTuning");
+ ret = QString::number(id);
break;
case rsWillRecord:
ret = QString::number(id);
@@ -143,7 +145,13 @@ QString toString(RecStatusType recstatus, uint id)
ret = QObject::tr("F", "RecStatusChar rsOffLine");
break;
case rsOtherShowing:
- ret = QObject::tr("O", "RecStatusChar rsOtherShowing");
+ ret = QString::number(id);
+ break;
+ case rsOtherRecording:
+ ret = QString::number(id);
+ break;
+ case rsOtherTuning:
+ ret = QString::number(id);
break;
}
@@ -206,6 +214,10 @@ QString toString(RecStatusType recstatus, RecordingType rectype)
return QObject::tr("Recorder Off-Line");
case rsOtherShowing:
return QObject::tr("Other Showing");
+ case rsOtherRecording:
+ return QObject::tr("Other Recording");
+ case rsOtherTuning:
+ return QObject::tr("Other Tuning");
}
return QObject::tr("Unknown");
@@ -232,7 +244,15 @@ QString toDescription(RecStatusType recstatus, RecordingType rectype,
message = QObject::tr("This showing is being recorded.");
break;
case rsTuning:
- message = QObject::tr("The channel is being tuned.");
+ message = QObject::tr("The showing is being tuned.");
+ break;
+ case rsOtherRecording:
+ message = QObject::tr("This showing is being recorded on "
+ "a different channel.");
+ break;
+ case rsOtherTuning:
+ message = QObject::tr("The showing is being tuned on a "
+ "different channel.");
break;
case rsRecorded:
message = QObject::tr("This showing was recorded.");
@@ -198,6 +198,8 @@ typedef enum SubtitleTypes {
#define kSubtitlePropertyMask (0x0f<<kSubtitlePropertyOffset)
typedef enum RecStatusTypes {
+ rsOtherRecording = -13,
+ rsOtherTuning = -12,
rsMissedFuture = -11,
rsTuning = -10,
rsFailed = -9,
@@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
-#define MYTH_BINARY_VERSION "0.26.20120414-1"
+#define MYTH_BINARY_VERSION "0.26.20120417-1"
/** \brief Increment this whenever the MythTV network protocol changes.
*
@@ -248,7 +248,7 @@ RecordingInfo::RecordingInfo(
bindings[":STARTTS2"] = query_startts;
::LoadFromScheduler(schedList);
- LoadFromProgram(progList, querystr, bindings, schedList, false);
+ LoadFromProgram(progList, querystr, bindings, schedList);
if (!progList.empty())
{
@@ -341,7 +341,7 @@ RecordingInfo::RecordingInfo(
bindings[":CHANID"] = QString::number(_chanid);
bindings[":STARTTS"] = desiredts.addSecs(50 - desiredts.time().second());
- LoadFromProgram(progList, querystr, bindings, schedList, false);
+ LoadFromProgram(progList, querystr, bindings, schedList);
if (!progList.empty())
nextstart = (*progList.begin())->GetScheduledStartTime();
@@ -393,7 +393,7 @@ void TVBrowseHelper::GetNextProgramDB(
ProgramList progList;
ProgramList dummySched;
- LoadFromProgram(progList, querystr, bindings, dummySched, false);
+ LoadFromProgram(progList, querystr, bindings, dummySched);
if (progList.empty())
{
@@ -106,7 +106,7 @@ DTC::ProgramGuide *Guide::GetProgramGuide( const QDateTime &dtStartTime ,
// ----------------------------------------------------------------------
- LoadFromProgram( progList, sSQL, bindings, schedList, false );
+ LoadFromProgram( progList, sSQL, bindings, schedList );
// ----------------------------------------------------------------------
// Build Response
@@ -191,7 +191,7 @@ DTC::Program* Guide::GetProgramDetails( int nChanId,
ProgramList progList;
- LoadFromProgram( progList, sSQL, bindings, schedList, false );
+ LoadFromProgram( progList, sSQL, bindings, schedList );
if ( progList.size() == 0)
throw( "Error Reading Program Info" );
@@ -706,7 +706,7 @@ ProgramList GuideGrid::GetProgramList(uint chanid) const
bindings[":CHANID"] = chanid;
ProgramList dummy;
- LoadFromProgram(proglist, querystr, bindings, dummy, false);
+ LoadFromProgram(proglist, querystr, bindings, dummy);
return proglist;
}
@@ -1082,7 +1082,7 @@ ProgramList *GuideGrid::getProgramListFromProgram(int chanNum)
bindings[":ENDTS"] =
m_currentEndTime.addSecs(0 - m_currentEndTime.time().second());
- LoadFromProgram(*proglist, querystr, bindings, m_recList, false);
+ LoadFromProgram(*proglist, querystr, bindings, m_recList);
}
return proglist;
@@ -577,7 +577,7 @@ void ProgFinder::selectShowData(QString progTitle, int newCurShow)
bindings[":ENDTIME"] = progStart.addSecs(50 - progStart.time().second());
LoadFromScheduler(m_schedList);
- LoadFromProgram(m_showData, querystr, bindings, m_schedList, false);
+ LoadFromProgram(m_showData, querystr, bindings, m_schedList);
updateTimesList();
@@ -1111,7 +1111,6 @@ void ProgLister::FillItemList(bool restorePosition, bool updateDisp)
if (m_curView < 0)
return;
- bool oneChanid = false;
QString where;
QString qphrase = m_viewList[m_curView];
@@ -1228,7 +1227,6 @@ void ProgLister::FillItemList(bool restorePosition, bool updateDisp)
}
else if (m_type == plChannel) // list by channel
{
- oneChanid = true;
where = "WHERE channel.visible = 1 "
" AND program.endtime > :PGILSTART "
" AND channel.chanid = :PGILPHRASE2 ";
@@ -1355,7 +1353,7 @@ void ProgLister::FillItemList(bool restorePosition, bool updateDisp)
else
{
LoadFromScheduler(m_schedList);
- LoadFromProgram(m_itemList, where, bindings, m_schedList, oneChanid);
+ LoadFromProgram(m_itemList, where, bindings, m_schedList);
}
const QRegExp prefixes(
@@ -111,7 +111,8 @@ void ScheduleCommon::EditRecording(ProgramInfo *pginfo)
if (!ri.GetRecordingRuleID())
EditScheduled(&ri);
- else if (ri.GetRecordingStatus() <= rsWillRecord)
+ else if (ri.GetRecordingStatus() <= rsWillRecord ||
+ ri.GetRecordingStatus() == rsOtherShowing)
ShowRecordingDialog(ri);
else
ShowNotRecordingDialog(ri);
@@ -215,7 +216,9 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
recinfo.GetRecordingEndTime() > now)
{
if (recinfo.GetRecordingStatus() != rsRecording &&
- recinfo.GetRecordingStatus() != rsTuning)
+ recinfo.GetRecordingStatus() != rsTuning &&
+ recinfo.GetRecordingStatus() != rsOtherRecording &&
+ recinfo.GetRecordingStatus() != rsOtherTuning)
menuPopup->AddButton(tr("Reactivate"),
qVariantFromValue(recinfo));
else
@@ -239,6 +242,8 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
if (recinfo.GetRecordingStatus() != rsRecording &&
recinfo.GetRecordingStatus() != rsTuning &&
+ recinfo.GetRecordingStatus() != rsOtherRecording &&
+ recinfo.GetRecordingStatus() != rsOtherTuning &&
recinfo.GetRecordingRuleType() != kFindOneRecord &&
!((recinfo.GetFindID() == 0 ||
!IsFindApplicable(recinfo)) &&
@@ -265,7 +270,9 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
recinfo.GetRecordingRuleType() != kDontRecord)
{
if (recinfo.GetRecordingStatus() == rsRecording ||
- recinfo.GetRecordingStatus() == rsTuning)
+ recinfo.GetRecordingStatus() == rsTuning ||
+ recinfo.GetRecordingStatus() == rsOtherRecording ||
+ recinfo.GetRecordingStatus() == rsOtherTuning)
{
menuPopup->AddButton(tr("Modify Recording Options"),
qVariantFromValue(recinfo));
@@ -288,7 +295,9 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
recinfo.GetRecordingRuleType() == kDontRecord)
{
if (recinfo.GetRecordingStatus() == rsRecording ||
- recinfo.GetRecordingStatus() == rsTuning)
+ recinfo.GetRecordingStatus() == rsTuning ||
+ recinfo.GetRecordingStatus() == rsOtherRecording ||
+ recinfo.GetRecordingStatus() == rsOtherTuning)
{
menuPopup->AddButton(tr("Modify Recording Options"),
qVariantFromValue(recinfo));
@@ -383,7 +392,6 @@ void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
recinfo.GetRecordingStatus() == rsPreviousRecording ||
recinfo.GetRecordingStatus() == rsCurrentRecording ||
recinfo.GetRecordingStatus() == rsEarlierShowing ||
- recinfo.GetRecordingStatus() == rsOtherShowing ||
recinfo.GetRecordingStatus() == rsNeverRecord ||
recinfo.GetRecordingStatus() == rsRepeat ||
recinfo.GetRecordingStatus() == rsInactive ||
@@ -405,7 +405,10 @@ void ViewScheduled::FillList()
QString state;
const RecStatusType recstatus = pginfo->GetRecordingStatus();
- if (recstatus == rsRecording)
+ if (recstatus == rsRecording ||
+ recstatus == rsTuning ||
+ recstatus == rsOtherRecording ||
+ recstatus == rsOtherTuning)
state = "running";
else if (recstatus == rsConflict ||
recstatus == rsOffLine ||
@@ -414,7 +417,8 @@ void ViewScheduled::FillList()
recstatus == rsAborted ||
recstatus == rsMissed)
state = "error";
- else if (recstatus == rsWillRecord)
+ else if (recstatus == rsWillRecord ||
+ recstatus == rsOtherShowing)
{
if ((m_curcard == 0 && m_curinput == 0) ||
pginfo->GetCardID() == m_curcard ||
@@ -427,7 +431,6 @@ void ViewScheduled::FillList()
}
}
else if (recstatus == rsRepeat ||
- recstatus == rsOtherShowing ||
recstatus == rsNeverRecord ||
recstatus == rsDontRecord ||
(recstatus != rsDontRecord &&

0 comments on commit 090f847

Please sign in to comment.