Timers now internally have a pointer to their channel

This commit is contained in:
Klaus Schmidinger
2002-10-20 12:28:55 +02:00
parent ab4ceb29a0
commit ac9622bb8a
13 changed files with 596 additions and 573 deletions

11
svdrp.c
View File

@@ -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.46 2002/10/19 11:48:02 kls Exp $
* $Id: svdrp.c 1.47 2002/10/20 10:24:20 kls Exp $
*/
#include "svdrp.h"
@@ -31,6 +31,7 @@
#include "device.h"
#include "keys.h"
#include "remote.h"
#include "timers.h"
#include "tools.h"
// --- cSocket ---------------------------------------------------------------
@@ -487,7 +488,7 @@ void cSVDRP::CmdDELT(const char *Option)
if (isnumber(Option)) {
cTimer *timer = Timers.Get(strtol(Option, NULL, 10) - 1);
if (timer) {
if (!timer->recording) {
if (!timer->Recording()) {
Timers.Del(timer);
Timers.Save();
isyslog("timer %s deleted", Option);
@@ -806,16 +807,16 @@ void cSVDRP::CmdMODT(const char *Option)
if (timer) {
cTimer t = *timer;
if (strcasecmp(tail, "ON") == 0)
t.active = 1;
t.SetActive(taActive);
else if (strcasecmp(tail, "OFF") == 0)
t.active = 0;
t.SetActive(taInactive);
else if (!t.Parse(tail)) {
Reply(501, "Error in timer settings");
return;
}
*timer = t;
Timers.Save();
isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
isyslog("timer %d modified (%s)", timer->Index() + 1, timer->Active() ? "active" : "inactive");
Reply(250, "%d %s", timer->Index() + 1, timer->ToText());
}
else