summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Prochnow <nordlicht@martins-kabuff.de>2006-03-16 20:17:58 +0100
committerAndreas Mair <andreas@vdr-developer.org>2006-03-16 20:17:58 +0100
commita245047c8c60d3acc0af75f5ffc7479cfeacd34d (patch)
tree1623a6f2239d242eb40eaaaa86a2be7a1e72443a
parentdda6babd28ffef10bed47f53f2b4a9168fa90a67 (diff)
downloadvdr-plugin-extrecmenu-a245047c8c60d3acc0af75f5ffc7479cfeacd34d.tar.gz
vdr-plugin-extrecmenu-a245047c8c60d3acc0af75f5ffc7479cfeacd34d.tar.bz2
Version 0.6v0.6
- after the replay of a recording ended, the menu jumps now to the last replayed recording - recording commands like in VDR's recordings menu now work - start to write some documentation in README
-rw-r--r--HISTORY6
-rw-r--r--Makefile3
-rw-r--r--README16
-rw-r--r--extrecmenu.c5
-rw-r--r--extrecmenu.h2
-rw-r--r--i18n.c5
-rw-r--r--mydvbplayer.c6
-rw-r--r--mymenucommands.c71
-rw-r--r--mymenucommands.h11
-rw-r--r--mymenumoverecording.c5
-rw-r--r--mymenurecordinginfo.c6
-rw-r--r--mymenurecordings.c64
-rw-r--r--mymenurecordings.h3
-rw-r--r--mymenurenamerecording.c5
-rw-r--r--myreplaycontrol.c6
15 files changed, 204 insertions, 10 deletions
diff --git a/HISTORY b/HISTORY
index 7b68d46..8862d7c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,12 @@
VDR Plugin 'extrecmenu' Revision History
----------------------------------------
+2006-03-16: Version 0.6
+- after the replay of a recording ended, the menu jumps now to the last
+ replayed recording
+- recording commands like in VDR's recordings menu now work
+- start to write some documentation in README
+
2006-03-13: Version 0.5
- improved updating of moved or renamed recordings - updating should be faster
now
diff --git a/Makefile b/Makefile
index 1a52cef..0533057 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,8 @@ DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
OBJS = $(PLUGIN).o mymenurecordings.o myreplaycontrol.o mymenurenamerecording.o \
- mymenumoverecording.o i18n.o mydvbplayer.o mymenurecordinginfo.o mymenusetup.o
+ mymenumoverecording.o i18n.o mydvbplayer.o mymenurecordinginfo.o mymenusetup.o \
+ mymenucommands.o
### Implicit rules:
diff --git a/README b/README
index 7f83822..de3c566 100644
--- a/README
+++ b/README
@@ -4,8 +4,22 @@ Written by: Martin Prochnow (nordlicht@martins-kabuff.de)
Project's homepage: http://martins-kabuff.de/extrecmenu.html
-See the file COPYING for license information.
+See the file COPYING for license information. See top of *.c for copyright
+information
Description:
This plugin provides a recordings menu enhanced with the possibility to
rename or move recordings.
+
+Renaming:
+Select a recording, press 'Yellow', then 'Red'. Type in/edit the name. By
+pressing 'Ok', the recording will be renamed with this name.
+
+Moving:
+Select a recording, press 'Yellow', then 'Green'. Now you are in the base video
+directory. You can browse the directories, the path to the selected directory
+is shown at the title bar. By pressing 'Blue' you select this path for moving.
+
+There is a patch for VDR in /patches for replacing VDR's recordings menu with
+this plugin. You have to set the corresponding option at the setup menu of the
+plugin!
diff --git a/extrecmenu.c b/extrecmenu.c
index aeb58c3..918cb99 100644
--- a/extrecmenu.c
+++ b/extrecmenu.c
@@ -1,3 +1,8 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
#include "mymenusetup.h"
#include "mymenurecordings.h"
#include "extrecmenu.h"
diff --git a/extrecmenu.h b/extrecmenu.h
index a828f17..eb0a438 100644
--- a/extrecmenu.h
+++ b/extrecmenu.h
@@ -1,6 +1,6 @@
#include <vdr/plugin.h>
-static const char *VERSION = "0.5";
+static const char *VERSION = "0.6";
static const char *DESCRIPTION = "Extended recordings menu";
static const char *MAINMENUENTRY = "ExtRecMenu";
diff --git a/i18n.c b/i18n.c
index b6e89ac..010eb8a 100644
--- a/i18n.c
+++ b/i18n.c
@@ -1,7 +1,9 @@
/*
* See the README file for copyright information and how to reach the author.
+ *
*/
+
#include "i18n.h"
const tI18nPhrase Phrases[] = {
@@ -17,6 +19,9 @@ const tI18nPhrase Phrases[] = {
{ "Button$Play",
"Wiedergabe",
},
+ { "Button$Commands",
+ "Befehle",
+ },
{ "Button$Rewind",
"Anfang",
},
diff --git a/mydvbplayer.c b/mydvbplayer.c
index 4578ff4..2ef2b28 100644
--- a/mydvbplayer.c
+++ b/mydvbplayer.c
@@ -1,3 +1,9 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ * This code is directly taken from VDR with some changes by me to work with this plugin
+ */
+
#include "mydvbplayer.h"
#include <stdlib.h>
#include <vdr/recording.h>
diff --git a/mymenucommands.c b/mymenucommands.c
new file mode 100644
index 0000000..399df6e
--- /dev/null
+++ b/mymenucommands.c
@@ -0,0 +1,71 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ * This code is directly taken from VDR with some changes by me to work with this plugin
+ */
+
+#include <vdr/menu.h>
+#include <vdr/config.h>
+#include <vdr/interface.h>
+#include "mymenucommands.h"
+
+myMenuCommands::myMenuCommands(const char *Title,cCommands *Commands,const char *Parameters):cOsdMenu(Title)
+{
+ SetHasHotkeys();
+ commands=Commands;
+ parameters=Parameters?strdup(Parameters):NULL;
+ for(cCommand *command=commands->First();command;command=commands->Next(command))
+ Add(new cOsdItem(hk(command->Title())));
+}
+
+myMenuCommands::~myMenuCommands()
+{
+ free(parameters);
+}
+
+eOSState myMenuCommands::Execute()
+{
+ cCommand *command=commands->Get(Current());
+ if(command)
+ {
+ char *buffer=NULL;
+ bool confirmed=true;
+ if(command->Confirm())
+ {
+ asprintf(&buffer,"%s?",command->Title());
+ confirmed=Interface->Confirm(buffer);
+ free(buffer);
+ }
+ if(confirmed)
+ {
+ asprintf(&buffer, "%s...",command->Title());
+ Skins.Message(mtStatus,buffer);
+ free(buffer);
+ const char *Result=command->Execute(parameters);
+ Skins.Message(mtStatus, NULL);
+ if(Result)
+ return AddSubMenu(new cMenuText(command->Title(),Result,fontFix));
+ return osEnd;
+ }
+ }
+ return osContinue;
+}
+
+eOSState myMenuCommands::ProcessKey(eKeys Key)
+{
+ eOSState state=cOsdMenu::ProcessKey(Key);
+
+ if(state==osUnknown)
+ {
+ switch(Key)
+ {
+ case kRed:
+ case kGreen:
+ case kYellow:
+ case kBlue: return osContinue;
+ case kOk: return Execute();
+ default: break;
+ }
+ }
+ return state;
+}
diff --git a/mymenucommands.h b/mymenucommands.h
new file mode 100644
index 0000000..3834c85
--- /dev/null
+++ b/mymenucommands.h
@@ -0,0 +1,11 @@
+class myMenuCommands:public cOsdMenu
+{
+ private:
+ cCommands *commands;
+ char *parameters;
+ eOSState Execute(void);
+ public:
+ myMenuCommands(const char *Title, cCommands *Commands, const char *Parameters = NULL);
+ virtual ~myMenuCommands();
+ virtual eOSState ProcessKey(eKeys Key);
+};
diff --git a/mymenumoverecording.c b/mymenumoverecording.c
index 6435c51..317c3f2 100644
--- a/mymenumoverecording.c
+++ b/mymenumoverecording.c
@@ -1,3 +1,8 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
#include <vdr/videodir.h>
#include <vdr/menu.h>
#include "mymenurecordings.h"
diff --git a/mymenurecordinginfo.c b/mymenurecordinginfo.c
index 6610227..70384b3 100644
--- a/mymenurecordinginfo.c
+++ b/mymenurecordinginfo.c
@@ -1,3 +1,9 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ * This code is directly taken from VDR with some changes by me to work with this plugin
+ */
+
#include <vdr/status.h>
#include "myreplaycontrol.h"
diff --git a/mymenurecordings.c b/mymenurecordings.c
index 3fa1b2c..fcc74dc 100644
--- a/mymenurecordings.c
+++ b/mymenurecordings.c
@@ -1,6 +1,14 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
#include <vdr/interface.h>
+#include <vdr/videodir.h>
+#include "myreplaycontrol.h"
#include "mymenurecordings.h"
#include "mymenusetup.h"
+#include "mymenucommands.h"
// --- myMenuRecordingsItem ---------------------------------------------------
myMenuRecordingsItem::myMenuRecordingsItem(cRecording *Recording,int Level)
@@ -132,6 +140,12 @@ myMenuRecordings::myMenuRecordings(const char *Base,int Level):cOsdMenu(Base?Bas
Display();
Set();
+ if(Current()<0)
+ SetCurrent(First());
+ else
+ if(myReplayControl::LastReplayed())
+ Open();
+
Display();
SetHelpKeys();
}
@@ -154,6 +168,9 @@ void myMenuRecordings::SetHelpKeys()
else
{
newhelpkeys=2;
+ cRecording *recording=GetRecording(item);
+ if(recording&&recording->Info()->Title())
+ newhelpkeys=3;
}
if(newhelpkeys!=helpkeys)
{
@@ -161,8 +178,8 @@ void myMenuRecordings::SetHelpKeys()
{
case 0: SetHelp(NULL);break;
case 1: SetHelp(tr("Button$Open"));break;
- case 2:
- case 3: SetHelp(tr("Button$Play"),tr("Button$Rewind"),tr("Button$Edit"),tr("Button$Info"));break;
+ case 2: SetHelp(RecordingCommands.Count()?tr("Button$Commands"):tr("Button$Play"),tr("Button$Rewind"),tr("Button$Edit"),NULL);break;
+ case 3: SetHelp(RecordingCommands.Count()?tr("Button$Commands"):tr("Button$Play"),tr("Button$Rewind"),tr("Button$Edit"),tr("Button$Info"));break;
}
}
helpkeys=newhelpkeys;
@@ -170,8 +187,11 @@ void myMenuRecordings::SetHelpKeys()
}
}
+// create the menu list
void myMenuRecordings::Set(bool Refresh)
{
+ const char *lastreplayed=myReplayControl::LastReplayed();
+
cThreadLock RecordingsLock(&Recordings);
Clear();
Recordings.Sort();
@@ -192,7 +212,6 @@ void myMenuRecordings::Set(bool Refresh)
Add(item);
inlist=true;
}
-
lastitem=item;
free(lastitemtext);
lastitemtext=strdup(lastitem->Text());
@@ -203,7 +222,11 @@ void myMenuRecordings::Set(bool Refresh)
if(lastitem)
{
if(lastitem->IsDirectory())
+ {
lastitem->IncrementCounter(recording->IsNew()); // counts the number of entries in a directory
+ if(lastreplayed&&!strcmp(lastreplayed,recording->FileName()))
+ SetCurrent(lastitem);
+ }
// delete items that are not in the list
if(!inlist)
{
@@ -238,6 +261,12 @@ void myMenuRecordings::Set(bool Refresh)
if(lastitem)
{
+ if(!item->IsDirectory()&&lastreplayed&&!strcmp(lastreplayed,recording->FileName()))
+ {
+ SetCurrent(lastitem);
+ if(!cControl::Control())
+ myReplayControl::ClearLastReplayed(recording->FileName());
+ }
// delete items that are not in the list
if(!inlist)
{
@@ -426,6 +455,30 @@ eOSState myMenuRecordings::Info(void)
return osContinue;
}
+// execute a command for a recording
+eOSState myMenuRecordings::Commands(eKeys Key)
+{
+ if(HasSubMenu()||Count()==0)
+ return osContinue;
+ myMenuRecordingsItem *item=(myMenuRecordingsItem*)Get(Current());
+ if(item&&!item->IsDirectory())
+ {
+ cRecording *recording=GetRecording(item);
+ if(recording)
+ {
+ char *parameter=NULL;
+ asprintf(&parameter,"'%s'",recording->FileName());
+ myMenuCommands *menu;
+ eOSState state=AddSubMenu(menu=new myMenuCommands(tr("Recording commands"),&RecordingCommands,parameter));
+ free(parameter);
+ if(Key!=kNone)
+ state=menu->ProcessKey(Key);
+ return state;
+ }
+ }
+ return osContinue;
+}
+
eOSState myMenuRecordings::ProcessKey(eKeys Key)
{
eOSState state;
@@ -457,8 +510,8 @@ eOSState myMenuRecordings::ProcessKey(eKeys Key)
{
switch(Key)
{
- case kOk:
- case kRed: return Play();
+ case kOk: return Play();
+ case kRed: return (helpkeys>1&&RecordingCommands.Count())?Commands():Play();
case kGreen: return Rewind();
case kYellow: {
myMenuRecordingsItem *item=(myMenuRecordingsItem*)Get(Current());
@@ -470,6 +523,7 @@ eOSState myMenuRecordings::ProcessKey(eKeys Key)
break;
}
case kBlue: return Info();
+ case k1...k9: return Commands(Key);
default: break;
}
}
diff --git a/mymenurecordings.h b/mymenurecordings.h
index a5789ad..bc7b389 100644
--- a/mymenurecordings.h
+++ b/mymenurecordings.h
@@ -1,5 +1,3 @@
-#include "myreplaycontrol.h"
-
extern bool clearall; // needed for myMenuMoveRecording
// --- myMenuRecordingsItem ---------------------------------------------------
@@ -37,6 +35,7 @@ class myMenuRecordings:public cOsdMenu
eOSState Rename();
eOSState MoveRec();
eOSState Info();
+ eOSState Commands(eKeys Key=kNone);
public:
myMenuRecordings(const char *Base=NULL,int Level=0);
~myMenuRecordings();
diff --git a/mymenurenamerecording.c b/mymenurenamerecording.c
index 1c93e73..0c36a01 100644
--- a/mymenurenamerecording.c
+++ b/mymenurenamerecording.c
@@ -1,3 +1,8 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
#include <vdr/videodir.h>
#include <vdr/menu.h>
#include "mymenurecordings.h"
diff --git a/myreplaycontrol.c b/myreplaycontrol.c
index a9a60a4..fe5f2b6 100644
--- a/myreplaycontrol.c
+++ b/myreplaycontrol.c
@@ -1,3 +1,9 @@
+/*
+ * See the README file for copyright information and how to reach the author.
+ *
+ * This code is directly taken from VDR with some changes by me to work with this plugin
+ */
+
#include <vdr/interface.h>
#include <vdr/status.h>
#include <vdr/cutter.h>