summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-02-09 16:32:03 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-02-09 16:32:03 (GMT)
commit54fcb928d38bf7a4d992b4c5d81cdfd84c864229 (patch)
treeeb1092fe26401d00157d0744d94eefe98f7364fc
parent54a300f80fe1c56ec31e5680fb82f8568c886d12 (diff)
Improved handling of 'Show the Program Guide when Start Live TV'.
There is no longer a need to hit the database for the appropriate action and add a simulated keypress to the list of queued keypresses (and hope the player is up and running before the keypress is processed). Instead just start the guide when the player is ready. Cherry plucked from 341efdf947f4c19558d1
-rw-r--r--mythtv/libs/libmythtv/tv_play.cpp33
-rw-r--r--mythtv/libs/libmythtv/tv_play.h3
2 files changed, 7 insertions, 29 deletions
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index 7aa11a0..723814e 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/mythtv/libs/libmythtv/tv_play.cpp
@@ -268,7 +268,7 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags)
else if (RemoteGetFreeRecorderCount())
{
VERBOSE(VB_PLAYBACK, LOC + "tv->LiveTV() -- begin");
- if (!tv->LiveTV(showDialogs, startInGuide))
+ if (!tv->LiveTV(showDialogs))
{
tv->SetExitPlayer(true, true);
quitAll = true;
@@ -279,6 +279,9 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags)
SendMythSystemEvent("LIVETV_STARTED");
}
+ if (!quitAll && (startInGuide || tv->StartLiveTVInGuide()))
+ tv->DoEditSchedule();
+
VERBOSE(VB_PLAYBACK, LOC + "tv->LiveTV() -- end");
}
else if (!ConfiguredTunerCards())
@@ -1333,9 +1336,8 @@ TVState TV::GetState(const PlayerContext *actx) const
/** \fn TV::LiveTV(bool,bool)
* \brief Starts LiveTV
* \param showDialogs if true error dialogs are shown, if false they are not
- * \param startInGuide if true the EPG will be shown upon entering LiveTV
*/
-bool TV::LiveTV(bool showDialogs, bool startInGuide)
+bool TV::LiveTV(bool showDialogs)
{
requestDelete = false;
allowRerecord = false;
@@ -1357,31 +1359,6 @@ bool TV::LiveTV(bool showDialogs, bool startInGuide)
.arg(db_idle_timeout*(1.0f/60000.0f)));
}
- if (startInGuide || db_start_in_guide)
- {
- MSqlQuery query(MSqlQuery::InitCon());
- query.prepare("SELECT keylist FROM keybindings WHERE "
- "context = 'TV Playback' AND action = 'GUIDE' AND "
- "hostname = :HOSTNAME ;");
- query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
-
- if (query.exec() && query.isActive() && query.size() > 0)
- {
- query.next();
-
- QKeySequence keyseq(query.value(0).toString());
-
- int keynum = keyseq[0];
- keynum &= ~Qt::UNICODE_ACCEL;
-
- QMutexLocker locker(&timerIdLock);
- keyList.push_front(
- new QKeyEvent(QEvent::KeyPress, keynum, 0, 0));
- if (!keyListTimerId)
- keyListTimerId = StartTimer(1, __LINE__);
- }
- }
-
ReturnPlayerLock(actx);
return true;
}
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
index 1a370b8..4744e16 100644
--- a/mythtv/libs/libmythtv/tv_play.h
+++ b/mythtv/libs/libmythtv/tv_play.h
@@ -196,7 +196,8 @@ class MPUBLIC TV : public QObject
bool HandleTrackAction(PlayerContext*, const QString &action);
// LiveTV commands
- bool LiveTV(bool showDialogs = true, bool startInGuide = false);
+ bool LiveTV(bool showDialogs = true);
+ bool StartLiveTVInGuide(void) { return db_start_in_guide; }
// Embedding commands for the guidegrid to use in LiveTV
bool StartEmbedding(PlayerContext*, WId wid, const QRect&);