summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2006-08-19 14:22:14 +0000
committerphintuka <phintuka>2006-08-19 14:22:14 +0000
commitdeba22f72d3917bb8ffd65b6b4f0d58823019bd6 (patch)
tree2c7f345e17af134f7c69446e02d2f59789634787
parent461032a7b971bdff72c7edf40d4360158e4d1353 (diff)
downloadxineliboutput-deba22f72d3917bb8ffd65b6b4f0d58823019bd6.tar.gz
xineliboutput-deba22f72d3917bb8ffd65b6b4f0d58823019bd6.tar.bz2
Remember menu mode
-rw-r--r--media_player.c7
-rw-r--r--media_player.h9
-rw-r--r--menu.c20
3 files changed, 22 insertions, 14 deletions
diff --git a/media_player.c b/media_player.c
index c56c2655..379eb9a1 100644
--- a/media_player.c
+++ b/media_player.c
@@ -4,7 +4,7 @@
* See the main source file '.c' for copyright information and
* how to reach the author.
*
- * $Id: media_player.c,v 1.5 2006-08-18 04:31:24 phintuka Exp $
+ * $Id: media_player.c,v 1.6 2006-08-19 14:22:14 phintuka Exp $
*
*/
@@ -304,12 +304,13 @@ cXinelibPlayer *cXinelibPlayerControl::m_Player = NULL;
cMutex cXinelibPlayerControl::m_Lock;
int cXinelibPlayerControl::m_SubtitlePos = 0;
-cXinelibPlayerControl::cXinelibPlayerControl(const char *File) :
+cXinelibPlayerControl::cXinelibPlayerControl(eMainMenuMode Mode, const char *File) :
cControl(OpenPlayer(File))
{
m_DisplayReplay = NULL;
m_ShowModeOnly = true;
m_Speed = 1;
+ m_Mode = Mode;
#if VDRVERSNUM < 10338
cStatus::MsgReplaying(this, m_Player->File());
@@ -404,7 +405,7 @@ eOSState cXinelibPlayerControl::ProcessKey(eKeys Key)
int r;
char *tmp = NULL;
switch(Key) {
- case kBack: xc.main_menu_mode = ShowFiles;
+ case kBack: xc.main_menu_mode = m_Mode;
Hide();
Close();
BackToMenu();
diff --git a/media_player.h b/media_player.h
index 21fe49fc..c58fa223 100644
--- a/media_player.h
+++ b/media_player.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: media_player.h,v 1.3 2006-08-18 04:24:49 phintuka Exp $
+ * $Id: media_player.h,v 1.4 2006-08-19 14:22:14 phintuka Exp $
*
*/
@@ -13,6 +13,8 @@
#include <vdr/player.h>
+#include "config.h"
+
// --- Media player ---------------------------------------------------------
class cXinelibPlayer;
@@ -31,11 +33,12 @@ class cXinelibPlayerControl : public cControl
int m_Speed;
bool m_ShowModeOnly;
+ eMainMenuMode m_Mode;
static int m_SubtitlePos;
public:
- cXinelibPlayerControl(const char *file);
+ cXinelibPlayerControl(eMainMenuMode Mode, const char *file);
virtual ~cXinelibPlayerControl();
virtual void Show(void);
@@ -57,7 +60,7 @@ class cXinelibDvdPlayerControl : public cXinelibPlayerControl
public:
cXinelibDvdPlayerControl(const char *file) :
- cXinelibPlayerControl(file), Menu(NULL)
+ cXinelibPlayerControl(ShowFiles, file), Menu(NULL)
{}
virtual ~cXinelibDvdPlayerControl();
diff --git a/menu.c b/menu.c
index e4bc58a9..50df09d4 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c,v 1.9 2006-08-18 03:02:51 phintuka Exp $
+ * $Id: menu.c,v 1.10 2006-08-19 14:22:14 phintuka Exp $
*
*/
@@ -224,12 +224,16 @@ eOSState cMenuBrowseFiles::Open(bool ForceOpen, bool Parent)
return osEnd;
}
if(ForceOpen && GetCurrent()->IsDir()) {
- /* play all files */
- char *f = NULL;
- asprintf(&f, "%s/%s/", m_CurrentDir, GetCurrent()->Name());
- cControl::Launch(new cXinelibPlayerControl(f));
- free(f);
- return osEnd;
+ /* play all files */
+ if(m_Mode != ShowImages) {
+ char *f = NULL;
+ asprintf(&f, "%s/%s/", m_CurrentDir, GetCurrent()->Name());
+ cControl::Launch(new cXinelibPlayerControl(m_Mode, f));
+ free(f);
+ return osEnd;
+ } else {
+ // TODO: show all images
+ }
}
const char *d = GetCurrent()->Name();
char *buffer = NULL;
@@ -247,7 +251,7 @@ eOSState cMenuBrowseFiles::Open(bool ForceOpen, bool Parent)
StoreConfig();
if(m_Mode != ShowImages) {
/* video/audio */
- cControl::Launch(new cXinelibPlayerControl(f));
+ cControl::Launch(new cXinelibPlayerControl(m_Mode, f));
} else {
/* image */
char **files = new char*[Count()+1];