1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Timers are now processed even if a menu is open

This commit is contained in:
Klaus Schmidinger 2003-02-09 13:14:44 +01:00
parent 7db4f96252
commit 8ddaaf9849
4 changed files with 25 additions and 4 deletions

View File

@ -1954,3 +1954,5 @@ Video Disk Recorder Revision History
in debugging this). It is now possible to insert the CAM in any of the two slots, in debugging this). It is now possible to insert the CAM in any of the two slots,
to insert and remove it while VDR is running and even to have two CAMs inserted. to insert and remove it while VDR is running and even to have two CAMs inserted.
- Turning SI filtering off and on when switching channels. - Turning SI filtering off and on when switching channels.
- Timers are now processed even if an OSD menu is open (except for menus that
explicitly handle timers).

16
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.233 2003/02/09 10:46:25 kls Exp $ * $Id: menu.c 1.234 2003/02/09 12:55:38 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -837,6 +837,7 @@ private:
void SetFirstDayItem(void); void SetFirstDayItem(void);
public: public:
cMenuEditTimer(int Index, bool New = false); cMenuEditTimer(int Index, bool New = false);
virtual ~cMenuEditTimer();
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
}; };
@ -860,6 +861,12 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file), tr(FileNameChars))); Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file), tr(FileNameChars)));
SetFirstDayItem(); SetFirstDayItem();
} }
Timers.IncBeingEdited();
}
cMenuEditTimer::~cMenuEditTimer()
{
Timers.DecBeingEdited();
} }
void cMenuEditTimer::SetFirstDayItem(void) void cMenuEditTimer::SetFirstDayItem(void)
@ -964,6 +971,7 @@ private:
cTimer *CurrentTimer(void); cTimer *CurrentTimer(void);
public: public:
cMenuTimers(void); cMenuTimers(void);
virtual ~cMenuTimers();
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
}; };
@ -980,6 +988,12 @@ cMenuTimers::cMenuTimers(void)
if (Setup.SortTimers) if (Setup.SortTimers)
Sort(); Sort();
SetHelp(tr("Edit"), tr("New"), tr("Delete"), Setup.SortTimers ? tr("On/Off") : tr("Mark")); SetHelp(tr("Edit"), tr("New"), tr("Delete"), Setup.SortTimers ? tr("On/Off") : tr("Mark"));
Timers.IncBeingEdited();
}
cMenuTimers::~cMenuTimers()
{
Timers.DecBeingEdited();
} }
cTimer *cMenuTimers::CurrentTimer(void) cTimer *cMenuTimers::CurrentTimer(void)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: timers.h 1.3 2002/11/24 11:50:56 kls Exp $ * $Id: timers.h 1.4 2003/02/09 12:49:45 kls Exp $
*/ */
#ifndef __TIMERS_H #ifndef __TIMERS_H
@ -80,10 +80,15 @@ public:
}; };
class cTimers : public cConfig<cTimer> { class cTimers : public cConfig<cTimer> {
private:
int beingEdited;
public: public:
cTimer *GetTimer(cTimer *Timer); cTimer *GetTimer(cTimer *Timer);
cTimer *GetMatch(time_t t); cTimer *GetMatch(time_t t);
cTimer *GetNextActiveTimer(void); cTimer *GetNextActiveTimer(void);
int BeingEdited(void) { return beingEdited; }
void IncBeingEdited(void) { beingEdited++; }
void DecBeingEdited(void) { beingEdited--; }
}; };
extern cTimers Timers; extern cTimers Timers;

4
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.142 2003/02/09 11:25:38 kls Exp $ * $Id: vdr.c 1.143 2003/02/09 13:13:42 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -459,7 +459,7 @@ int main(int argc, char *argv[])
LastChannel = cDevice::CurrentChannel(); LastChannel = cDevice::CurrentChannel();
} }
// Timers and Recordings: // Timers and Recordings:
if (!Menu) { if (!Timers.BeingEdited()) {
time_t Now = time(NULL); // must do both following calls with the exact same time! time_t Now = time(NULL); // must do both following calls with the exact same time!
cRecordControls::Process(Now); cRecordControls::Process(Now);
cTimer *Timer = Timers.GetMatch(Now); cTimer *Timer = Timers.GetMatch(Now);