mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The "flags" of a timer are now handled as an unsigned integer value
This commit is contained in:
parent
16f037e3c2
commit
72e93b614b
2
HISTORY
2
HISTORY
@ -4116,3 +4116,5 @@ Video Disk Recorder Revision History
|
|||||||
- Any cReceivers still attached to a cDevice when that device switches to a
|
- Any cReceivers still attached to a cDevice when that device switches to a
|
||||||
different transponder are now automatically detached (suggested by Patrick
|
different transponder are now automatically detached (suggested by Patrick
|
||||||
Fischer).
|
Fischer).
|
||||||
|
- The "flags" of a timer are now handled as an unsigned integer value. In order
|
||||||
|
to do this, the interface of cMenuEditBitItem also had to be changed.
|
||||||
|
@ -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: menuitems.c 1.25 2006/01/03 12:47:39 kls Exp $
|
* $Id: menuitems.c 1.26 2006/01/06 14:19:06 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menuitems.h"
|
#include "menuitems.h"
|
||||||
@ -116,7 +116,7 @@ void cMenuEditBoolItem::Set(void)
|
|||||||
|
|
||||||
// --- cMenuEditBitItem ------------------------------------------------------
|
// --- cMenuEditBitItem ------------------------------------------------------
|
||||||
|
|
||||||
cMenuEditBitItem::cMenuEditBitItem(const char *Name, int *Value, int Mask, const char *FalseString, const char *TrueString)
|
cMenuEditBitItem::cMenuEditBitItem(const char *Name, uint *Value, uint Mask, const char *FalseString, const char *TrueString)
|
||||||
:cMenuEditBoolItem(Name, &bit, FalseString, TrueString)
|
:cMenuEditBoolItem(Name, &bit, FalseString, TrueString)
|
||||||
{
|
{
|
||||||
value = Value;
|
value = Value;
|
||||||
|
@ -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: menuitems.h 1.13 2006/01/03 12:45:38 kls Exp $
|
* $Id: menuitems.h 1.14 2006/01/06 14:19:12 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __MENUITEMS_H
|
#ifndef __MENUITEMS_H
|
||||||
@ -44,12 +44,12 @@ public:
|
|||||||
|
|
||||||
class cMenuEditBitItem : public cMenuEditBoolItem {
|
class cMenuEditBitItem : public cMenuEditBoolItem {
|
||||||
protected:
|
protected:
|
||||||
int *value;
|
uint *value;
|
||||||
|
uint mask;
|
||||||
int bit;
|
int bit;
|
||||||
int mask;
|
|
||||||
virtual void Set(void);
|
virtual void Set(void);
|
||||||
public:
|
public:
|
||||||
cMenuEditBitItem(const char *Name, int *Value, int Mask, const char *FalseString = NULL, const char *TrueString = NULL);
|
cMenuEditBitItem(const char *Name, uint *Value, uint Mask, const char *FalseString = NULL, const char *TrueString = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
class cMenuEditNumItem : public cMenuEditItem {
|
class cMenuEditNumItem : public cMenuEditItem {
|
||||||
|
14
timers.c
14
timers.c
@ -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.c 1.39 2006/01/03 11:45:19 kls Exp $
|
* $Id: timers.c 1.40 2006/01/06 14:14:59 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
@ -110,7 +110,7 @@ cString cTimer::ToText(bool UseChannelID)
|
|||||||
char *buffer;
|
char *buffer;
|
||||||
strreplace(file, ':', '|');
|
strreplace(file, ':', '|');
|
||||||
strreplace(summary, '\n', '|');
|
strreplace(summary, '\n', '|');
|
||||||
asprintf(&buffer, "%d:%s:%s:%04d:%04d:%d:%d:%s:%s\n", flags, UseChannelID ? *Channel()->GetChannelID().ToString() : *itoa(Channel()->Number()), *PrintDay(day, weekdays), start, stop, priority, lifetime, file, summary ? summary : "");
|
asprintf(&buffer, "%u:%s:%s:%04d:%04d:%d:%d:%s:%s\n", flags, UseChannelID ? *Channel()->GetChannelID().ToString() : *itoa(Channel()->Number()), *PrintDay(day, weekdays), start, stop, priority, lifetime, file, summary ? summary : "");
|
||||||
strreplace(summary, '|', '\n');
|
strreplace(summary, '|', '\n');
|
||||||
strreplace(file, '|', ':');
|
strreplace(file, '|', ':');
|
||||||
return cString(buffer, true);
|
return cString(buffer, true);
|
||||||
@ -244,7 +244,7 @@ bool cTimer::Parse(const char *s)
|
|||||||
s = s2;
|
s = s2;
|
||||||
}
|
}
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (8 <= sscanf(s, "%d :%a[^:]:%a[^:]:%d :%d :%d :%d :%a[^:\n]:%a[^\n]", &flags, &channelbuffer, &daybuffer, &start, &stop, &priority, &lifetime, &filebuffer, &summary)) {
|
if (8 <= sscanf(s, "%u :%a[^:]:%a[^:]:%d :%d :%d :%d :%a[^:\n]:%a[^\n]", &flags, &channelbuffer, &daybuffer, &start, &stop, &priority, &lifetime, &filebuffer, &summary)) {
|
||||||
if (summary && !*skipspace(summary)) {
|
if (summary && !*skipspace(summary)) {
|
||||||
free(summary);
|
free(summary);
|
||||||
summary = NULL;
|
summary = NULL;
|
||||||
@ -467,22 +467,22 @@ void cTimer::SetPriority(int Priority)
|
|||||||
priority = Priority;
|
priority = Priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTimer::SetFlags(int Flags)
|
void cTimer::SetFlags(uint Flags)
|
||||||
{
|
{
|
||||||
flags |= Flags;
|
flags |= Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTimer::ClrFlags(int Flags)
|
void cTimer::ClrFlags(uint Flags)
|
||||||
{
|
{
|
||||||
flags &= ~Flags;
|
flags &= ~Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTimer::InvFlags(int Flags)
|
void cTimer::InvFlags(uint Flags)
|
||||||
{
|
{
|
||||||
flags ^= Flags;
|
flags ^= Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cTimer::HasFlags(int Flags) const
|
bool cTimer::HasFlags(uint Flags) const
|
||||||
{
|
{
|
||||||
return (flags & Flags) == Flags;
|
return (flags & Flags) == Flags;
|
||||||
}
|
}
|
||||||
|
14
timers.h
14
timers.h
@ -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.22 2006/01/03 11:45:26 kls Exp $
|
* $Id: timers.h 1.23 2006/01/06 14:13:17 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __TIMERS_H
|
#ifndef __TIMERS_H
|
||||||
@ -29,7 +29,7 @@ class cTimer : public cListObject {
|
|||||||
private:
|
private:
|
||||||
mutable time_t startTime, stopTime;
|
mutable time_t startTime, stopTime;
|
||||||
bool recording, pending, inVpsMargin;
|
bool recording, pending, inVpsMargin;
|
||||||
int flags;
|
uint flags;
|
||||||
cChannel *channel;
|
cChannel *channel;
|
||||||
mutable time_t day; ///< midnight of the day this timer shall hit, or of the first day it shall hit in case of a repeating timer
|
mutable time_t day; ///< midnight of the day this timer shall hit, or of the first day it shall hit in case of a repeating timer
|
||||||
int weekdays; ///< bitmask, lowest bits: SSFTWTM (the 'M' is the LSB)
|
int weekdays; ///< bitmask, lowest bits: SSFTWTM (the 'M' is the LSB)
|
||||||
@ -49,7 +49,7 @@ public:
|
|||||||
bool Recording(void) const { return recording; }
|
bool Recording(void) const { return recording; }
|
||||||
bool Pending(void) const { return pending; }
|
bool Pending(void) const { return pending; }
|
||||||
bool InVpsMargin(void) const { return inVpsMargin; }
|
bool InVpsMargin(void) const { return inVpsMargin; }
|
||||||
int Flags(void) const { return flags; }
|
uint Flags(void) const { return flags; }
|
||||||
const cChannel *Channel(void) const { return channel; }
|
const cChannel *Channel(void) const { return channel; }
|
||||||
time_t Day(void) const { return day; }
|
time_t Day(void) const { return day; }
|
||||||
int WeekDays(void) const { return weekdays; }
|
int WeekDays(void) const { return weekdays; }
|
||||||
@ -82,10 +82,10 @@ public:
|
|||||||
void SetPending(bool Pending);
|
void SetPending(bool Pending);
|
||||||
void SetInVpsMargin(bool InVpsMargin);
|
void SetInVpsMargin(bool InVpsMargin);
|
||||||
void SetPriority(int Priority);
|
void SetPriority(int Priority);
|
||||||
void SetFlags(int Flags);
|
void SetFlags(uint Flags);
|
||||||
void ClrFlags(int Flags);
|
void ClrFlags(uint Flags);
|
||||||
void InvFlags(int Flags);
|
void InvFlags(uint Flags);
|
||||||
bool HasFlags(int Flags) const;
|
bool HasFlags(uint Flags) const;
|
||||||
void Skip(void);
|
void Skip(void);
|
||||||
void OnOff(void);
|
void OnOff(void);
|
||||||
cString PrintFirstDay(void) const;
|
cString PrintFirstDay(void) const;
|
||||||
|
6
vdr.5
6
vdr.5
@ -8,7 +8,7 @@
|
|||||||
.\" License as specified in the file COPYING that comes with the
|
.\" License as specified in the file COPYING that comes with the
|
||||||
.\" vdr distribution.
|
.\" vdr distribution.
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: vdr.5 1.40 2005/12/25 11:08:40 kls Exp $
|
.\" $Id: vdr.5 1.41 2006/01/06 14:21:49 kls Exp $
|
||||||
.\"
|
.\"
|
||||||
.TH vdr 5 "19 Mar 2005" "1.3.38" "Video Disk Recorder Files"
|
.TH vdr 5 "19 Mar 2005" "1.3.38" "Video Disk Recorder Files"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
@ -207,7 +207,7 @@ separated by ':' characters. Example:
|
|||||||
The fields in a timer definition have the following meaning (from left
|
The fields in a timer definition have the following meaning (from left
|
||||||
to right):
|
to right):
|
||||||
.TP
|
.TP
|
||||||
.B Status
|
.B Flags
|
||||||
The individual bits in this field have the following meaning:
|
The individual bits in this field have the following meaning:
|
||||||
.TS
|
.TS
|
||||||
tab (@);
|
tab (@);
|
||||||
@ -219,7 +219,7 @@ l l.
|
|||||||
.TE
|
.TE
|
||||||
Bits other than these can be used by external programs to mark active timers
|
Bits other than these can be used by external programs to mark active timers
|
||||||
and recognize if the user has modified them. When a user modifies an active
|
and recognize if the user has modified them. When a user modifies an active
|
||||||
timer, the upper 16 bits of this 32 bit parameter will be explicitly set to 0.
|
timer, the upper 16 bits of this unsigned 32 bit parameter will be explicitly set to 0.
|
||||||
|
|
||||||
Note: in order to allow future extensibility, external programs using the
|
Note: in order to allow future extensibility, external programs using the
|
||||||
\fBstatus\fR parameter should only use the upper 16 bit of this 32 bit parameter
|
\fBstatus\fR parameter should only use the upper 16 bit of this 32 bit parameter
|
||||||
|
Loading…
Reference in New Issue
Block a user