summaryrefslogtreecommitdiff
path: root/bdplayer.c
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2013-01-05 23:04:50 +0200
committerPetri Hintukainen <phintuka@users.sourceforge.net>2013-01-05 23:15:49 +0200
commit202a2beaac8949b1e192790242c9bc9c9b2230d0 (patch)
tree6e0c7bcca02029ec19b09347a02fdea857afdc39 /bdplayer.c
parentd209d84645f5ef3618024faefa0f57f1f92b272f (diff)
downloadvdr-plugin-bluray-202a2beaac8949b1e192790242c9bc9c9b2230d0.tar.gz
vdr-plugin-bluray-202a2beaac8949b1e192790242c9bc9c9b2230d0.tar.bz2
Added title selection menu (can be accessed with kBack)
Diffstat (limited to 'bdplayer.c')
-rw-r--r--bdplayer.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/bdplayer.c b/bdplayer.c
index e6048a5..d58bf45 100644
--- a/bdplayer.c
+++ b/bdplayer.c
@@ -60,6 +60,8 @@ public:
void SkipSeconds(int seconds);
void Play();
void Pause();
+ bool SelectPlaylist(int pl);
+ BLURAY *BDHandle() { return bd; }
cMarks *Marks() { return &marks; }
cString PosStr();
@@ -317,6 +319,19 @@ void cBDPlayer::Empty(void)
DeviceClear();
}
+bool cBDPlayer::SelectPlaylist(int pl)
+{
+ bool end_of_title;
+
+ LOCK_THREAD;
+
+ Empty();
+
+ end_of_title = !bd_select_playlist(bd, pl);
+ isyslog("bd_select_playlist -> %s", end_of_title ? "FAIL" : "OK");
+ return !end_of_title;
+}
+
void cBDPlayer::Pause(void)
{
// from vdr-1.7.34
@@ -373,6 +388,8 @@ bool cBDPlayer::GetReplayMode(bool &Play, bool &Forward, int &Speed)
// --- cBDControl -------------------------------------------------------
+#include "titlemenu.h"
+
#define MODETIMEOUT 3 // seconds
int cBDControl::active = 0;
@@ -393,6 +410,7 @@ cBDControl::cBDControl(cBDPlayer *Player)
chapterSeekTime = 0;
disc_name = tr("BluRay");
+ menu = NULL;
cStatus::MsgReplaying(this, "BluRay", NULL, true);
}
@@ -477,6 +495,20 @@ void cBDControl::Play(void)
player->Play();
}
+BLURAY *cBDControl::BDHandle()
+{
+ if (player)
+ return player->BDHandle();
+ return NULL;
+}
+
+bool cBDControl::SelectPlaylist(int pl)
+{
+ if (player)
+ return player->SelectPlaylist(pl);
+ return false;
+}
+
void cBDControl::SkipSeconds(int seconds)
{
if (player)
@@ -705,6 +737,23 @@ eOSState cBDControl::ProcessKey(eKeys Key)
// from vdr-1.7.34
if (!Active())
return osEnd;
+
+ // Handle menus
+ if (menu) {
+ eOSState state = menu->ProcessKey(Key);
+ if (state == osBack) {
+ delete menu;
+ menu = NULL;
+ return osEnd;
+ }
+ if (state == osEnd) {
+ Hide();
+ delete menu;
+ menu = NULL;
+ }
+ return osContinue;
+ }
+
if (visible) {
if (timeoutShow && time(NULL) > timeoutShow) {
Hide();
@@ -759,6 +808,9 @@ eOSState cBDControl::ProcessKey(eKeys Key)
else
Show();
break;
+ case kBack: Hide();
+ menu = new cTitleMenu(this);
+ break;
default: return osUnknown;
}
}