Permalink
Browse files

Add bluray menu options to the OSD menu.

Adds entries for the top and popup menu, renames the player GoToDVDMenu
to GoToMenu to make it more generic and fixes bringing up the popup menu
when not in a menu already (when using the "MENUTEXT" action). The
latter can probably be removed as I have added a JUMPTOPOPUPMENU action
without a default keybinding.

I will probably also rename the JUMPTODVDROOTMENU and associated actions
but was unsure at this stage of possible complications.
  • Loading branch information...
1 parent 5479b3a commit 5707d26ebffde3d4507503d98c1e85c71107b874 Mark Kendall committed Jan 15, 2011
View
10 mythtv/libs/libmythtv/bdringbuffer.cpp
@@ -613,11 +613,11 @@ bool BDRingBuffer::GoToMenu(const QString str, int64_t pts)
VERBOSE(VB_PLAYBACK, QString("BDRingBuf: Invoked Menu Successfully"));
return true;
}
- else
- {
- m_inMenu = false;
- return false;
- }
+ }
+ else if (str.compare("popup") == 0)
+ {
+ PressButton(BD_VK_POPUP, pts);
+ return true;
}
else
return false;
View
13 mythtv/libs/libmythtv/mythbdplayer.cpp
@@ -13,6 +13,19 @@ void MythBDPlayer::PreProcessNormalFrame(void)
DisplayMenu();
}
+bool MythBDPlayer::GoToMenu(QString str)
+{
+ if (player_ctx->buffer->BD() && videoOutput)
+ {
+ int64_t pts = 0;
+ VideoFrame *frame = videoOutput->GetLastShownFrame();
+ if (frame)
+ pts = (int64_t)(frame->timecode * 90);
+ return player_ctx->buffer->BD()->GoToMenu(str, pts);
+ }
+ return false;
+}
+
void MythBDPlayer::DisplayMenu(void)
{
if (!player_ctx->buffer->IsBD())
View
1 mythtv/libs/libmythtv/mythbdplayer.h
@@ -7,6 +7,7 @@ class MythBDPlayer : public MythPlayer
{
public:
MythBDPlayer(bool muted = false);
+ virtual bool GoToMenu(QString str);
virtual int GetNumChapters(void);
virtual int GetCurrentChapter(void);
virtual void GetChapterTimes(QList<long long> &times);
View
4 mythtv/libs/libmythtv/mythdvdplayer.cpp
@@ -432,7 +432,7 @@ void MythDVDPlayer::SeekForScreenGrab(uint64_t &number, uint64_t frameNum,
{
if (!player_ctx->buffer->IsDVD())
return;
- if (GoToDVDMenu("menu"))
+ if (GoToMenu("menu"))
{
if (player_ctx->buffer->DVD()->IsInMenu() &&
!player_ctx->buffer->DVD()->IsInStillFrame())
@@ -502,7 +502,7 @@ void MythDVDPlayer::DisplayDVDButton(void)
player_ctx->buffer->DVD()->ReleaseMenuButton();
}
-bool MythDVDPlayer::GoToDVDMenu(QString str)
+bool MythDVDPlayer::GoToMenu(QString str)
{
if (!player_ctx->buffer->IsDVD())
return false;
View
2 mythtv/libs/libmythtv/mythdvdplayer.h
@@ -22,7 +22,7 @@ class MythDVDPlayer : public MythPlayer
// DVD public stuff
virtual void ChangeDVDTrack(bool ffw);
- virtual bool GoToDVDMenu(QString str);
+ virtual bool GoToMenu(QString str);
virtual void GoToDVDProgram(bool direction);
// DVD ringbuffer methods
View
2 mythtv/libs/libmythtv/mythplayer.h
@@ -277,7 +277,7 @@ class MPUBLIC MythPlayer
// DVD public stuff
virtual void ChangeDVDTrack(bool ffw) { (void) ffw; }
- virtual bool GoToDVDMenu(QString str) { return false; }
+ virtual bool GoToMenu(QString str) { return false; }
virtual void GoToDVDProgram(bool direction) { (void) direction; }
// Position Map Stuff
View
59 mythtv/libs/libmythtv/tv_play.cpp
@@ -677,6 +677,8 @@ void TV::InitKeys(void)
"Monitor Signal Quality"), "Alt+F7");
REG_KEY("TV Playback", "JUMPTODVDROOTMENU",
QT_TRANSLATE_NOOP("MythControls", "Jump to the DVD Root Menu"), "");
+ REG_KEY("TV Playback", "JUMPTOPOPUPMENU",
+ QT_TRANSLATE_NOOP("MythControls", "Jump to the Popup Menu"), "");
REG_KEY("TV Playback", "EXITSHOWNOPROMPTS",
QT_TRANSLATE_NOOP("MythControls", "Exit Show without any prompts"),
"");
@@ -3616,7 +3618,7 @@ void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
handled = handled || ToggleHandleAction(actx, actions, isDVD);
handled = handled || PxPHandleAction(actx, actions);
handled = handled || FFRewHandleAction(actx, actions);
- handled = handled || ActivePostQHandleAction(actx, actions, isDVD);
+ handled = handled || ActivePostQHandleAction(actx, actions);
#if DEBUG_ACTIONS
for (uint i = 0; i < actions.size(); ++i)
@@ -3882,9 +3884,6 @@ bool TV::DiscMenuHandleAction(PlayerContext *ctx, const QStringList &actions)
}
else if (bdrb)
{
- if (!bdrb->IsInDiscMenuOrStillFrame())
- return false;
-
int64_t pts = 0;
VideoOutput *output = ctx->player->getVideoOutput();
if (output)
@@ -3897,6 +3896,15 @@ bool TV::DiscMenuHandleAction(PlayerContext *ctx, const QStringList &actions)
}
}
+ if (has_action("MENUTEXT", actions))
+ {
+ bdrb->PressButton(BD_VK_POPUP, pts);
+ return true;
+ }
+
+ if (!bdrb->IsInDiscMenuOrStillFrame())
+ return false;
+
handled = true;
if (has_action("UP", actions) ||
has_action("CHANNELUP", actions))
@@ -3918,10 +3926,6 @@ bool TV::DiscMenuHandleAction(PlayerContext *ctx, const QStringList &actions)
{
bdrb->PressButton(BD_VK_RIGHT, pts);
}
- else if (has_action("MENUTEXT", actions))
- {
- bdrb->PressButton(BD_VK_POPUP, pts);
- }
else if (has_action("0", actions))
{
bdrb->PressButton(BD_VK_0, pts);
@@ -4217,8 +4221,8 @@ bool TV::ActiveHandleAction(PlayerContext *ctx,
!GetMythMainWindow()->IsExitingToMain() &&
has_action("BACK", actions) &&
!ctx->buffer->DVD()->IsInMenu() &&
- (ctx->player->GoToDVDMenu("title") ||
- ctx->player->GoToDVDMenu("root"))
+ (ctx->player->GoToMenu("title") ||
+ ctx->player->GoToMenu("root"))
)
{
return handled;
@@ -4397,11 +4401,13 @@ bool TV::PxPHandleAction(PlayerContext *ctx, const QStringList &actions)
return handled;
}
-bool TV::ActivePostQHandleAction(PlayerContext *ctx,
- const QStringList &actions, bool isDVD)
+bool TV::ActivePostQHandleAction(PlayerContext *ctx, const QStringList &actions)
{
bool handled = true;
- bool islivetv = StateIsLiveTV(GetState(ctx));
+ TVState state = GetState(ctx);
+ bool islivetv = StateIsLiveTV(state);
+ bool isdvd = state == kState_WatchingDVD;
+ bool isdisc = isdvd || state == kState_WatchingBD;
if (has_action("SELECT", actions))
{
@@ -4441,7 +4447,7 @@ bool TV::ActivePostQHandleAction(PlayerContext *ctx,
else
ChangeChannel(ctx, CHANNEL_DIRECTION_UP);
}
- else if (isDVD)
+ else if (isdvd)
DVDJumpBack(ctx);
else if (GetNumChapters(ctx) > 0)
DoJumpChapter(ctx, -1);
@@ -4457,7 +4463,7 @@ bool TV::ActivePostQHandleAction(PlayerContext *ctx,
else
ChangeChannel(ctx, CHANNEL_DIRECTION_DOWN);
}
- else if (isDVD)
+ else if (isdvd)
DVDJumpForward(ctx);
else if (GetNumChapters(ctx) > 0)
DoJumpChapter(ctx, 9999);
@@ -4474,11 +4480,18 @@ bool TV::ActivePostQHandleAction(PlayerContext *ctx,
ctx->UnlockDeletePlayer(__FILE__, __LINE__);
ShowOSDPromptDeleteRecording(ctx, tr("Delete this recording?"));
}
- else if (has_action("JUMPTODVDROOTMENU", actions) && isDVD)
+ else if (has_action("JUMPTODVDROOTMENU", actions) && isdisc)
{
ctx->LockDeletePlayer(__FILE__, __LINE__);
if (ctx->player)
- ctx->player->GoToDVDMenu("root");
+ ctx->player->GoToMenu("root");
+ ctx->UnlockDeletePlayer(__FILE__, __LINE__);
+ }
+ else if (has_action("JUMPTOPOPUPMENU", actions) && isdisc)
+ {
+ ctx->LockDeletePlayer(__FILE__, __LINE__);
+ if (ctx->player)
+ ctx->player->GoToMenu("popup");
ctx->UnlockDeletePlayer(__FILE__, __LINE__);
}
else if (has_action("FINDER", actions))
@@ -9802,16 +9815,19 @@ void TV::OSDDialogEvent(int result, QString text, QString action)
{
if (action == "JUMPTODVDROOTMENU" ||
action == "JUMPTODVDCHAPTERMENU" ||
+ action == "JUMPTOPOPUPMENU" ||
action == "JUMPTODVDTITLEMENU")
{
QString menu = "root";
if (action == "JUMPTODVDCHAPTERMENU")
menu = "chapter";
else if (action == "JUMPTODVDTITLEMENU")
menu = "title";
+ else if (action == "JUMPTOPOPUPMENU")
+ menu = "popup";
actx->LockDeletePlayer(__FILE__, __LINE__);
if (actx->player)
- actx->player->GoToDVDMenu(menu);
+ actx->player->GoToMenu(menu);
actx->UnlockDeletePlayer(__FILE__, __LINE__);
}
else if (action.left(13) == "JUMPTOCHAPTER")
@@ -10286,6 +10302,7 @@ void TV::FillOSDMenuNavigate(const PlayerContext *ctx, OSD *osd,
int num_angles = GetNumAngles(ctx);
TVState state = ctx->GetState();
bool isdvd = state == kState_WatchingDVD;
+ bool isbd = state == kState_WatchingBD;
bool islivetv = StateIsLiveTV(state);
bool isrecording = state == kState_WatchingPreRecorded;
bool previouschan = false;
@@ -10319,6 +10336,12 @@ void TV::FillOSDMenuNavigate(const PlayerContext *ctx, OSD *osd,
"DIALOG_MENU_COMMSKIP_0",
true, selected == "COMMSKIP");
}
+ // FIXME need to check whether we are in HDMV navigation mode
+ if (isbd)
+ {
+ osd->DialogAddButton(tr("Top menu"), "JUMPTODVDROOTMENU");
+ osd->DialogAddButton(tr("Popup menu"), "JUMPTOPOPUPMENU");
+ }
if (isdvd)
{
osd->DialogAddButton(tr("DVD Root Menu"), "JUMPTODVDROOTMENU");
View
3 mythtv/libs/libmythtv/tv_play.h
@@ -331,8 +331,7 @@ class MPUBLIC TV : public QObject
bool ToggleHandleAction(PlayerContext*,
const QStringList &actions, bool isDVD);
bool FFRewHandleAction(PlayerContext*, const QStringList &actions);
- bool ActivePostQHandleAction(PlayerContext*,
- const QStringList &actions, bool isDVD);
+ bool ActivePostQHandleAction(PlayerContext*, const QStringList &actions);
bool HandleJumpToProgramAction(PlayerContext *ctx,
const QStringList &actions);

0 comments on commit 5707d26

Please sign in to comment.