diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-03 14:10:01 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-03 14:10:01 +0200 |
commit | 9e864aba12553c2bd5a157cf94b7fee49c6d88ce (patch) | |
tree | ca3624203b3294ab34d248f201eb8b35e8895de8 | |
parent | 06117cbaab3e8bf347fa59fe194210cf627e553a (diff) | |
download | vdr-9e864aba12553c2bd5a157cf94b7fee49c6d88ce.tar.gz vdr-9e864aba12553c2bd5a157cf94b7fee49c6d88ce.tar.bz2 |
Implemented the SVDRP command MOVC
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | svdrp.c | 49 |
3 files changed, 48 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4d7b64c0..c5c7fe72 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -830,6 +830,7 @@ Andreas Brachold <vdr04@deltab.de> umask settings for reporting that there are empty info.vdr files created if there is no EPG info available + for implementing the SVDRP command MOVC Manuel Hartl <icecep@gmx.net> for suggesting to extend the logging info when starting/stopping timers @@ -3789,3 +3789,4 @@ Video Disk Recorder Revision History creates a VDR that always behaves as if it were called with '--vfat'. - Replaced the ':' delimiter between hour and minute in recording file names with a '.' under Linux, too. Existing recordings with ':' as delimiter will still work. +- Implemented the SVDRP command MOVC (thanks to Andreas Brachold). @@ -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.79 2005/09/03 12:46:57 kls Exp $ + * $Id: svdrp.c 1.80 2005/09/03 14:09:02 kls Exp $ */ #include "svdrp.h" @@ -1039,8 +1039,51 @@ void cSVDRP::CmdMODT(const char *Option) void cSVDRP::CmdMOVC(const char *Option) { - //TODO combine this with menu action (timers must be updated) - Reply(502, "MOVC not yet implemented"); + if (*Option) { + if (!Channels.BeingEdited() && !Timers.BeingEdited()) { + char *tail; + int From = strtol(Option, &tail, 10); + if (tail && tail != Option) { + tail = skipspace(tail); + if (tail && tail != Option) { + int To = strtol(tail, NULL, 10); + int CurrentChannelNr = cDevice::CurrentChannel(); + cChannel *CurrentChannel = Channels.GetByNumber(CurrentChannelNr); + cChannel *FromChannel = Channels.GetByNumber(From); + if (FromChannel) { + cChannel *ToChannel = Channels.GetByNumber(To); + if (ToChannel) { + int FromNumber = FromChannel->Number(); + int ToNumber = ToChannel->Number(); + if (FromNumber != ToNumber) { + Channels.Move(FromChannel, ToChannel); + Channels.ReNumber(); + Channels.SetModified(true); + if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr) + Channels.SwitchTo(CurrentChannel->Number()); + isyslog("channel %d moved to %d", FromNumber, ToNumber); + Reply(250,"Channel \"%d\" moved to \"%d\"", From, To); + } + else + Reply(501, "Can't move channel to same postion"); + } + else + Reply(501, "Channel \"%d\" not defined", To); + } + else + Reply(501, "Channel \"%d\" not defined", From); + } + else + Reply(501, "Error in channel number"); + } + else + Reply(501, "Error in channel number"); + } + else + Reply(550, "Channels or timers are being edited - try again later"); + } + else + Reply(501, "Missing channel number"); } void cSVDRP::CmdMOVT(const char *Option) |