summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-08-06 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-08-06 18:00:00 +0200
commit9b405778674d5325b225b32ab694d9216b099527 (patch)
treedbce3ee646e63439d0690ffbcdf6cf93d7314d25 /svdrp.c
parent1d22145c423f2524c7766b4ae30ee2c26174113d (diff)
downloadvdr-patch-lnbsharing-9b405778674d5325b225b32ab694d9216b099527.tar.gz
vdr-patch-lnbsharing-9b405778674d5325b225b32ab694d9216b099527.tar.bz2
Version 0.61vdr-0.61
- When scrolling through a list it now moves a full page up or down when the cursor reaches the top or bottom of the menu (thanks to Heino Goldenstein!). - Added missing '#include <sys/stat.h>' to recording.c. - The video directory can now be defined with the command line option -v. - There can now be more than one video directory (in case you have several disks). - Fixed learning key codes for PC keyboard. - New command line option '-l' to set the log level. - Times in timers.conf are now always printed with 4 digits (leading '0'). - Slow forward/back mode (thanks to Guido Fiala!). - The "Up" key in replay mode no longer restarts replay at the very beginning, but rather resumes normal replay mode after a "pause", "forward" or "backward" operation. Use the "Skip -60s" function repeatedly to go back to the beginning of the recording. - Improved reaction on user input in fast/slow forward/back modes. - No more upper limit for the value of 'Pnr'. - Checking if the video card is really a DVB card. - New SVDRP command UPDT to update an existing timer (or add a new one if it doesn't yet exist). - New version of the 'epg2timers' tool (with a modified channel list). - Bugfix in closing window in DEBUG_OSD mode.
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c53
1 files changed, 47 insertions, 6 deletions
diff --git a/svdrp.c b/svdrp.c
index 6873d16..9fef184 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 1.2 2000/07/24 16:43:51 kls Exp $
+ * $Id: svdrp.c 1.4 2000/08/06 12:52:04 kls Exp $
*/
#define _GNU_SOURCE
@@ -145,7 +145,12 @@ const char *HelpPages[] = {
" by the LSTC command.",
"NEWT <settings>\n"
" Create a new timer. Settings must be in the same format as returned\n"
- " by the LSTT command.",
+ " by the LSTT command. It is an error if a timer with the same channel,\n"
+ " day, start and stop time already exists.",
+ "UPDT <settings>\n"
+ " Updates a timer. Settings must be in the same format as returned\n"
+ " by the LSTT command. If a timer with the same channel, day, start\n"
+ " and stop time does not yet exists, it will be created.",
"QUIT\n"
" Exit vdr (SVDRP).\n"
" You can also hit Ctrl-D to exit.",
@@ -369,7 +374,7 @@ void cSVDRP::CmdHelp(const char *Option)
}
}
else {
- Reply(-214, "This is VDR version 0.6"); //XXX dynamically insert version number
+ Reply(-214, "This is VDR version %s", VDRVERSION);
Reply(-214, "Topics:");
const char **hp = HelpPages;
while (*hp) {
@@ -548,13 +553,48 @@ void cSVDRP::CmdNewt(const char *Option)
if (*Option) {
cTimer *timer = new cTimer;
if (timer->Parse(Option)) {
- Timers.Add(timer);
+ cTimer *t = Timers.GetTimer(timer);
+ if (!t) {
+ Timers.Add(timer);
+ Timers.Save();
+ isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
+ Reply(250, "%d %s", timer->Index() + 1, timer->ToText());
+ return;
+ }
+ else
+ Reply(550, "Timer already defined: %d %s", t->Index() + 1, t->ToText());
+ }
+ else
+ Reply(501, "Error in timer settings");
+ delete timer;
+ }
+ else
+ Reply(501, "Missing timer settings");
+}
+
+void cSVDRP::CmdUpdt(const char *Option)
+{
+ if (*Option) {
+ cTimer *timer = new cTimer;
+ if (timer->Parse(Option)) {
+ cTimer *t = Timers.GetTimer(timer);
+ if (t) {
+ t->Parse(Option);
+ delete timer;
+ timer = t;
+ isyslog(LOG_INFO, "timer %d updated", timer->Index() + 1);
+ }
+ else {
+ Timers.Add(timer);
+ isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
+ }
Timers.Save();
- isyslog(LOG_INFO, "timer %d added", timer->Index() + 1);
Reply(250, "%d %s", timer->Index() + 1, timer->ToText());
+ return;
}
else
Reply(501, "Error in timer settings");
+ delete timer;
}
else
Reply(501, "Missing timer settings");
@@ -583,6 +623,7 @@ void cSVDRP::Execute(char *Cmd)
else if (CMD("MOVT")) CmdMovt(s);
else if (CMD("NEWC")) CmdNewc(s);
else if (CMD("NEWT")) CmdNewt(s);
+ else if (CMD("UPDT")) CmdUpdt(s);
else if (CMD("QUIT")
|| CMD("\x04")) Close();
else Reply(500, "Command unrecognized: \"%s\"", Cmd);
@@ -598,7 +639,7 @@ void cSVDRP::Process(void)
//TODO how can we get the *full* hostname?
gethostname(buffer, sizeof(buffer));
time_t now = time(NULL);
- Reply(220, "%s SVDRP VideoDiskRecorder 0.6; %s", buffer, ctime(&now));//XXX dynamically insert version number
+ Reply(220, "%s SVDRP VideoDiskRecorder %s; %s", VDRVERSION, buffer, ctime(&now));
}
int rbytes = readstring(filedes, buffer, sizeof(buffer) - 1);
if (rbytes > 0) {