diff options
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | svdrp.c | 94 | ||||
-rw-r--r-- | svdrp.h | 4 |
3 files changed, 51 insertions, 50 deletions
@@ -8010,9 +8010,10 @@ Video Disk Recorder Revision History the last replayed recording (if any) by pressing Ok repeatedly in the Recordings menu. -2013-10-20: Version 2.1.3 +2013-10-21: Version 2.1.3 - Changed the return value of cPositioner::HorizonLongitude() to 0 in case the latitude of the antenna location is beyond +/-81 degrees. - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Fixed some compiler warnings with gcc-4.6.3 (thanks to Rolf Ahrenberg). +- Changed the name of the SVDRP command RENR to MOVR (suggested by Rolf Ahrenberg). @@ -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 3.4 2013/10/20 09:53:13 kls Exp $ + * $Id: svdrp.c 3.5 2013/10/21 07:46:04 kls Exp $ */ #include "svdrp.h" @@ -257,6 +257,11 @@ const char *HelpPages[] = { " used to easily activate or deactivate a timer.", "MOVC <number> <to>\n" " Move a channel to a new position.", + "MOVR <number> <new name>\n" + " Move the recording with the given number. Before a recording can be\n" + " moved, an LSTR command must have been executed in order to retrieve\n" + " the recording numbers. The numbers don't change during subsequent MOVR\n" + " commands.n", "NEWC <settings>\n" " Create a new channel. Settings must be in the same format as returned\n" " by the LSTC command.", @@ -304,11 +309,6 @@ const char *HelpPages[] = { "REMO [ on | off ]\n" " Turns the remote control on or off. Without a parameter, the current\n" " status of the remote control is reported.", - "RENR <number> <new name>\n" - " Rename the recording with the given number. Before a recording can be\n" - " renamed, an LSTR command must have been executed in order to retrieve\n" - " the recording numbers. The numbers don't change during subsequent RENR\n" - " commands.n", "SCAN\n" " Forces an EPG scan. If this is a single DVB device system, the scan\n" " will be done on the primary device unless it is currently recording.", @@ -1331,6 +1331,46 @@ void cSVDRP::CmdMOVC(const char *Option) Reply(501, "Missing channel number"); } +void cSVDRP::CmdMOVR(const char *Option) +{ + if (*Option) { + char *opt = strdup(Option); + char *num = skipspace(opt); + char *option = num; + while (*option && !isspace(*option)) + option++; + char c = *option; + *option = 0; + if (isnumber(num)) { + cRecording *recording = recordings.Get(strtol(num, NULL, 10) - 1); + if (recording) { + if (int RecordingInUse = recording->IsInUse()) + Reply(550, "%s", *RecordingInUseMessage(RecordingInUse, Option, recording)); + else { + if (c) + option = skipspace(++option); + if (*option) { + cString oldName = recording->Name(); + if ((recording = Recordings.GetByName(recording->FileName())) != NULL && recording->ChangeName(option)) + Reply(250, "Recording \"%s\" moved to \"%s\"", *oldName, recording->Name()); + else + Reply(554, "Error while moving recording \"%s\" to \"%s\"!", *oldName, option); + } + else + Reply(501, "Missing new recording name"); + } + } + else + Reply(550, "Recording \"%s\" not found%s", num, recordings.Count() ? "" : " (use LSTR before moving)"); + } + else + Reply(501, "Error in recording number \"%s\"", num); + free(opt); + } + else + Reply(501, "Missing recording number"); +} + void cSVDRP::CmdNEWC(const char *Option) { if (*Option) { @@ -1550,46 +1590,6 @@ void cSVDRP::CmdREMO(const char *Option) Reply(250, "Remote control is %s", cRemote::Enabled() ? "enabled" : "disabled"); } -void cSVDRP::CmdRENR(const char *Option) -{ - if (*Option) { - char *opt = strdup(Option); - char *num = skipspace(opt); - char *option = num; - while (*option && !isspace(*option)) - option++; - char c = *option; - *option = 0; - if (isnumber(num)) { - cRecording *recording = recordings.Get(strtol(num, NULL, 10) - 1); - if (recording) { - if (int RecordingInUse = recording->IsInUse()) - Reply(550, "%s", *RecordingInUseMessage(RecordingInUse, Option, recording)); - else { - if (c) - option = skipspace(++option); - if (*option) { - cString oldName = recording->Name(); - if ((recording = Recordings.GetByName(recording->FileName())) != NULL && recording->ChangeName(option)) - Reply(250, "Recording \"%s\" renamed to \"%s\"", *oldName, recording->Name()); - else - Reply(554, "Error while renaming recording \"%s\" to \"%s\"!", *oldName, option); - } - else - Reply(501, "Missing new recording name"); - } - } - else - Reply(550, "Recording \"%s\" not found%s", num, recordings.Count() ? "" : " (use LSTR before renaming)"); - } - else - Reply(501, "Error in recording number \"%s\"", num); - free(opt); - } - else - Reply(501, "Missing recording number"); -} - void cSVDRP::CmdSCAN(const char *Option) { EITScanner.ForceScan(); @@ -1710,6 +1710,7 @@ void cSVDRP::Execute(char *Cmd) else if (CMD("MODC")) CmdMODC(s); else if (CMD("MODT")) CmdMODT(s); else if (CMD("MOVC")) CmdMOVC(s); + else if (CMD("MOVR")) CmdMOVR(s); else if (CMD("NEWC")) CmdNEWC(s); else if (CMD("NEWT")) CmdNEWT(s); else if (CMD("NEXT")) CmdNEXT(s); @@ -1717,7 +1718,6 @@ void cSVDRP::Execute(char *Cmd) else if (CMD("PLUG")) CmdPLUG(s); else if (CMD("PUTE")) CmdPUTE(s); else if (CMD("REMO")) CmdREMO(s); - else if (CMD("RENR")) CmdRENR(s); else if (CMD("SCAN")) CmdSCAN(s); else if (CMD("STAT")) CmdSTAT(s); else if (CMD("UPDR")) CmdUPDR(s); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: svdrp.h 3.1 2013/09/14 13:24:50 kls Exp $ + * $Id: svdrp.h 3.2 2013/10/21 07:42:03 kls Exp $ */ #ifndef __SVDRP_H @@ -71,6 +71,7 @@ private: void CmdMODC(const char *Option); void CmdMODT(const char *Option); void CmdMOVC(const char *Option); + void CmdMOVR(const char *Option); void CmdNEWC(const char *Option); void CmdNEWT(const char *Option); void CmdNEXT(const char *Option); @@ -78,7 +79,6 @@ private: void CmdPLUG(const char *Option); void CmdPUTE(const char *Option); void CmdREMO(const char *Option); - void CmdRENR(const char *Option); void CmdSCAN(const char *Option); void CmdSTAT(const char *Option); void CmdUPDT(const char *Option); |