36 #define MAXWAIT4EPGINFO 3
38 #define NEWTIMERLIMIT 120
43 #define MAXRECORDCONTROLS (MAXDEVICES * MAXRECEIVERS)
44 #define MAXINSTANTRECTIME (24 * 60 - 1)
45 #define MAXWAITFORCAMMENU 10
46 #define CAMMENURETRYTIMEOUT 3
47 #define CAMRESPONSETIMEOUT 5
48 #define PROGRESSTIMEOUT 100
49 #define MINFREEDISK 300
50 #define NODISKSPACEDELTA 300
51 #define MAXCHNAMWIDTH 16
53 #define CHNUMWIDTH (numdigits(cChannels::MaxNumber()) + 1)
54 #define CHNAMWIDTH (min(MAXCHNAMWIDTH, cChannels::MaxShortChannelNameLength() + 1))
60 virtual void Set(
void);
103 virtual void Set(
void);
248 bool Modified =
false;
299 virtual void Set(
void);
351 #define CHANNELNUMBERTIMEOUT 1000
358 void Set(
bool Force =
false);
367 virtual void Move(
int From,
int To);
396 for (
const cChannel *Channel = Channels->First(); Channel; Channel = Channels->
Next(Channel)) {
400 if (Channel == CurrentChannel)
410 SetHelp(
tr(
"Button$Edit"),
tr(
"Button$New"),
tr(
"Button$Delete"),
tr(
"Button$Mark"));
445 if (!ci->Channel()->GroupSep() && ci->Channel()->Number() ==
number) {
498 bool Deleted =
false;
501 int DeletedChannel = Channel->
Number();
503 if (Timers->UsesChannel(Channel)) {
509 if (CurrentChannel && Channel == CurrentChannel) {
513 CurrentChannel = Channels->
Get(n);
514 CurrentChannelNr = 0;
516 Channels->
Del(Channel);
519 isyslog(
"channel %d deleted", DeletedChannel);
521 if (CurrentChannel && CurrentChannel->
Number() != CurrentChannelNr) {
537 cChannel *CurrentChannel = Channels->GetByNumber(CurrentChannelNr);
540 if (FromChannel && ToChannel) {
541 int FromNumber = FromChannel->
Number();
542 int ToNumber = ToChannel->
Number();
543 if (Channels->MoveNeedsDecrement(FromChannel, ToChannel)) {
544 ToChannel = Channels->
Prev(ToChannel);
547 Channels->Move(FromChannel, ToChannel);
551 isyslog(
"channel %d moved to %d", FromNumber, ToNumber);
552 if (CurrentChannel && CurrentChannel->
Number() != CurrentChannelNr) {
554 Channels->SwitchTo(CurrentChannel->
Number());
572 if (
cChannel *Channel = MenuEditChannel->Channel()) {
599 if (!ci->Channel()->GroupSep() && ci->Channel()->Number() == CurrentChannelNr) {
632 text = Text ? strdup(Text) : NULL;
677 virtual void Set(
void);
712 :
cOsdMenu(Folder ?
tr(
"Edit folder") :
tr(
"New folder"), 12)
741 if (strcmp(Folder->Text(),
name) == 0) {
746 char *p = strpbrk(
name,
"\\{}#~");
821 #define FOLDERDELIMCHARSUBST 0x01
829 for (Folder =
List->First(); Folder; Folder =
List->Next(Folder)) {
830 if (strcmp(Path, Folder->
Text()) == 0)
842 for (
const cRecording *Recording = Recordings->
First(); Recording; Recording = Recordings->
Next(Recording)) {
843 cString Folder = Recording->Folder();
845 if (Dirs.
Find(Folder) < 0)
846 Dirs.
Append(strdup(Folder));
849 for (
int i = 0; i < Dirs.
Size(); i++) {
850 if (
char *s = Dirs[i])
862 RecordingsStateKey.
Remove();
875 Add(FolderItem, CurrentFolder ? strcmp(Folder->Text(), CurrentFolder) == 0 :
false);
887 if (strncmp(Folder->Folder()->Text(), Path, p - Path) == 0) {
951 Set(mef->GetFolder());
1069 cString Folder = mf->GetFolder();
1078 memmove(
data.
file, p, strlen(p) + 1);
1133 Timers->Del(
timer,
false);
1182 virtual void Set(
void);
1210 localtime_r(&Day, &tm_r);
1212 strftime(buffer,
sizeof(buffer),
"%Y%m%d", &tm_r);
1224 *name && **name ?
" " :
"",
1279 for (
const cTimer *Timer = Timers->First(); Timer; Timer = Timers->
Next(Timer)) {
1282 if (CurrentTimer && Timer->
Id() == CurrentTimer->
Id() && (!Timer->Remote() && !CurrentTimer->
Remote() || Timer->Remote() && CurrentTimer->
Remote() && strcmp(Timer->Remote(), CurrentTimer->
Remote()) == 0))
1301 int NewHelpKeys = 0;
1340 StateKey.
Remove(Timer != NULL);
1367 bool TimerRecording = Timer->
Recording();
1400 if (Timer && Timer->
Event())
1426 Add(CurrentItem,
true);
1450 SetHelp(TimerMatch ==
tmFull ?
tr(
"Button$Timer") :
tr(
"Button$Record"), NULL, NULL, CanSwitch ?
tr(
"Button$Switch") : NULL);
1551 char v =
event->Vps() && (
event->Vps() -
event->StartTime()) ?
'V' :
' ';
1552 char r =
event->SeenWithin(30) &&
event->IsRunning() ?
'*' :
' ';
1554 cString eds =
event->GetDateString();
1556 buffer =
cString::sprintf(
"%d\t%.*s\t%.*s\t%s\t%c%c%c\t%s",
channel->
Number(),
Utf8SymChars(csn, 999), csn,
Utf8SymChars(eds, 6), *eds, *
event->
GetTimeString(), t, v, r,
event->
Title());
1605 for (
const cChannel *Channel = Channels->
First(); Channel; Channel = Channels->
Next(Channel)) {
1606 if (!Channel->GroupSep()) {
1608 if (
const cEvent *Event = Now ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent())
1620 bool result =
false;
1635 int NewHelpKeys = 0;
1638 NewHelpKeys |= 0x02;
1640 NewHelpKeys |= 0x01;
1642 NewHelpKeys |= 0x04;
1644 NewHelpKeys |= 0x08;
1647 NewHelpKeys |= 0x10;
1653 const char *Red[] = { NULL,
tr(
"Button$Record"),
tr(
"Button$Timer") };
1654 SetHelp(Red[NewHelpKeys & 0x03],
now ?
tr(
"Button$Next") :
tr(
"Button$Now"),
tr(
"Button$Schedule"),
canSwitch ?
tr(
"Button$Switch") : NULL);
1689 Timers->SetExplicitModify();
1690 if (item->timerMatch ==
tmFull) {
1691 if (
cTimer *Timer = Timers->GetMatch(item->event))
1697 if (
cTimer *t = Timers->GetTimer(Timer)) {
1705 Timers->SetModified();
1710 else if (Timer->
Remote())
1775 if (HadSubMenu &&
Update()) {
1825 Set(Timers, Channels, NULL,
true);
1841 const cEvent *Event = NULL;
1844 Event = CurrentItem->
event;
1850 bool Refresh =
false;
1876 const cEvent *PresentEvent = Event ? Event : Schedule->GetPresentEvent();
1878 for (
const cEvent *ev = Schedule->Events()->First(); ev; ev = Schedule->Events()->
Next(ev)) {
1879 if (ev->EndTime() >
now || ev == PresentEvent)
1897 for (
const cEvent *ev = Schedule->Events()->First(); ev; ev = Schedule->Events()->
Next(ev)) {
1898 if ((ev->EndTime() >
now || ev == Event) && !strcmp(ev->Title(), Event->
Title()))
1915 for (
const cChannel *ch = Channels->First(); ch; ch = Channels->
Next(ch)) {
1918 for (
const cEvent *ev = Schedule->Events()->First(); ev; ev = Schedule->Events()->
Next(ev)) {
1919 if ((ev->EndTime() >
now || ev == Event) && !strcmp(ev->Title(), Event->
Title()))
1935 for (
const cChannel *ch = Channels->First(); ch; ch = Channels->
Next(ch)) {
1938 for (
const cEvent *ev = Schedule->Events()->First(); ev; ev = Schedule->Events()->
Next(ev)) {
1939 if (ev->EndTime() >
now || ev == Event)
1949 bool result =
false;
1964 int NewHelpKeys = 0;
1967 NewHelpKeys |= 0x02;
1969 NewHelpKeys |= 0x01;
1973 NewHelpKeys |= 0x10;
1979 const char *Red[] = { NULL,
tr(
"Button$Record"),
tr(
"Button$Timer") };
1980 SetHelp(Red[NewHelpKeys & 0x03],
tr(
"Button$Now"),
tr(
"Button$Next"),
canSwitch ?
tr(
"Button$Switch") : NULL);
1990 Set(Timers, Channels, NULL,
true);
2000 Timers->SetExplicitModify();
2001 if (item->timerMatch ==
tmFull) {
2002 if (
cTimer *Timer = Timers->GetMatch(item->event))
2008 if (
cTimer *t = Timers->GetTimer(Timer)) {
2016 Timers->SetModified();
2021 else if (Timer->
Remote())
2040 if (Channel = Channels->GetByChannelID(item->
event->
ChannelID(),
true)) {
2041 if (!Channels->SwitchTo(Channel->
Number()))
2056 Set(Timers, Channels);
2074 ChannelNr = Channel->Number();
2099 Set(Timers, Channels, Channel,
true);
2118 if (
const cChannel *Channel = Channels->GetByChannelID(ei->ChannelID(),
true)) {
2120 Set(Timers, Channels, Channel,
true);
2123 else if (HadSubMenu &&
Update()) {
2144 const char *s = Command->Text();
2145 if (Command->SubItems())
2159 const char *p = strchr(s,
':');
2166 if (l > 1 && t[l - 1] ==
'?') {
2194 const char *cmd = *cmdbuf ? *cmdbuf : *
command;
2195 dsyslog(
"executing command '%s'", cmd);
2197 if (p.
Open(cmd,
"r")) {
2200 while ((c = fgetc(p)) != EOF) {
2202 if (
char *NewBuffer = (
char *)realloc(
result, l + 21))
2205 esyslog(
"ERROR: out of memory");
2216 esyslog(
"ERROR: can't open pipe for command '%s'", cmd);
2357 const char *p = strchr(s,
'\n');
2358 int l = p ? p - s : strlen(s);
2361 item->
SetText(strndup(s, l),
false);
2406 else if (state ==
osBack) {
2433 if (CamSlot->HasUserIO())
2446 #define osUserRecRenamed osUser1
2447 #define osUserRecMoved osUser2
2448 #define osUserRecRemoved osUser3
2449 #define osUserRecEmpty osUser4
2524 if (strcmp(NewPath,
path)) {
2525 int NumRecordings = 0;
2528 NumRecordings = Recordings->GetNumRecordingsInPath(
path);
2535 Recordings->SetExplicitModify();
2536 Error = !Recordings->MoveRecordings(
path, NewPath);
2538 Recordings->SetModified();
2562 else if (Key ==
kOk)
2644 Add(
new cOsdItem(
tr(
"This recording is currently in use - no changes are possible!"),
osUnknown,
false));
2726 if (access(*FileName, F_OK) != 0 ||
Interface->
Confirm(
tr(
"Edited version already exists - overwrite?"))) {
2731 Recordings->AddByName(FileName);
2775 if (
const cRecording *Recording = Control->GetRecording()) {
2777 Control->ClearEditingMarks();
2798 bool Modified =
false;
2801 StateKey.
Remove(Modified);
2814 if (strcmp(NewName, Recording->
Name())) {
2816 StateKey.
Remove(Modified);
2824 if (strcmp(Recording->
Folder(), OldFolder))
2827 StateKey.
Remove(Modified);
2830 StateKey.
Remove(Modified);
2882 SetHelp(
tr(
"Button$Play"),
tr(
"Button$Rewind"), NULL,
tr(
"Button$Edit"));
2981 if (*
Text() ==
'\t')
3015 :
cOsdMenu(Base ? Base :
tr(
"Recordings"), 9, 6, 6)
3018 base = Base ? strdup(Base) : NULL;
3039 if (!ri->IsDirectory())
3048 int NewHelpKeys = 0;
3056 switch (NewHelpKeys) {
3058 case 1:
SetHelp(
tr(
"Button$Open"), NULL, NULL,
tr(
"Button$Edit"));
break;
3071 const char *CurrentRecording = NULL;
3073 CurrentRecording = ri->Recording()->FileName();
3074 if (!CurrentRecording)
3082 for (
const cRecording *Recording = Recordings->
First(); Recording; Recording = Recordings->
Next(Recording)) {
3089 if (p->Name() && strcmp(p->Name(), Item->
Name()) == 0) {
3095 if (*Item->
Text() && !LastDir) {
3103 if (LastItem || LastDir) {
3105 if (strcmp(
path, Recording->Folder()) == 0)
3106 CurrentItem = LastDir ? LastDir : LastItem;
3108 else if (CurrentRecording && strcmp(CurrentRecording, Recording->FileName()) == 0)
3109 CurrentItem = LastDir ? LastDir : LastItem;
3150 const char *t = ri->
Name();
3196 if (
cTimer *Timer = rc->Timer()) {
3199 if (Timer->IsSingleEvent()) {
3201 isyslog(
"deleted timer %s", *Timer->ToDescr());
3213 char *RemoteBuf = NULL;
3215 if (2 == sscanf(TimerId,
"%d@%m[^ \n]", &Id, &RemoteBuf)) {
3220 if (
cTimer *Timer = Timers->GetById(Id, Remote)) {
3221 cTimer OldTimer = *Timer;
3224 if (Timer->IsSingleEvent()) {
3255 FileName = Recording->FileName();
3268 if (!Recording || Recording->
Delete()) {
3294 if (ri->IsDirectory())
3372 ri->SetRecording(riSub->Recording());
3400 virtual void Store(
void);
3435 virtual void Set(
void);
3526 bool ModifiedAppearance =
false;
3535 ModifiedAppearance =
true;
3544 ModifiedAppearance =
true;
3546 ModifiedAppearance =
true;
3551 ModifiedAppearance =
true;
3553 ModifiedAppearance =
true;
3555 ModifiedAppearance =
true;
3558 Recordings->ClearSortNames();
3566 if (ModifiedAppearance)
3660 for (k = 0; k < oldnumLanguages; k++) {
3664 if (k >= oldnumLanguages) {
3721 SetHelp(NULL,
tr(
"Button$Audio"),
tr(
"Button$Subtitles"), NULL);
3757 int oldVideoDisplayFormat =
::Setup.VideoDisplayFormat;
3758 bool oldVideoFormat =
::Setup.VideoFormat;
3760 bool oldStandardCompliance =
::Setup.StandardCompliance;
3761 bool oldDisplaySubtitles =
::Setup.DisplaySubtitles;
3783 for (k = 0; k < oldnumAudioLanguages; k++) {
3787 if (k >= oldnumAudioLanguages) {
3801 for (k = 0; k < oldnumSubtitleLanguages; k++) {
3805 if (k >= oldnumSubtitleLanguages) {
3820 if (::
Setup.VideoDisplayFormat != oldVideoDisplayFormat)
3822 if (::
Setup.VideoFormat != oldVideoFormat)
3824 if (::
Setup.DisplaySubtitles != oldDisplaySubtitles)
3826 if (::
Setup.StandardCompliance != oldStandardCompliance) {
3828 Channels->SetExplicitModify();
3829 Channels->ReNumber();
3869 int NumSatDevices = 0;
3874 if (NumSatDevices > 1) {
3899 bool DeviceBondingsChanged =
false;
3909 else if (DeviceBondingsChanged)
3935 const char *Activating =
"";
3939 case msReset: CamName =
tr(
"CAM reset");
break;
3940 case msPresent: CamName =
tr(
"CAM present");
break;
3941 case msReady: CamName =
tr(
"CAM ready");
break;
3942 default: CamName =
"-";
break;
3947 Activating =
tr(
" (activating)");
3953 if (DeviceNumbers.
Size() > 0) {
3956 for (
int i = 0; i < DeviceNumbers.
Size(); i++)
3957 AssignedDevice =
cString::sprintf(
"%s %d", *AssignedDevice, DeviceNumbers[i]);
3961 if (strcmp(buffer,
Text()) != 0) {
3990 if (CamSlot->IsMasterSlot())
4001 const char *NewActivationHelp =
"";
4005 NewActivationHelp =
tr(
"Button$Cancel activation");
4007 NewActivationHelp =
tr(
"Button$Activate");
4021 time_t t0 = time(NULL);
4055 if (Device->ProvidesChannel(Channel)) {
4057 if (CamSlot->
Assign(Device,
true)) {
4060 if (CamSlot->
Assign(Device)) {
4061 if (Device->SwitchChannel(Channel,
true)) {
4162 virtual void Store(
void);
4192 Recordings->ResetResume();
4257 bool ModifiedSVDRPSettings =
false;
4263 if (ModifiedSVDRPSettings) {
4267 Timers->SetExplicitModify();
4268 if (Timers->StoreRemoteTimers(NULL, NULL))
4269 Timers->SetModified();
4305 for (
int i = 0; ; i++) {
4347 virtual void Set(
void);
4365 snprintf(buffer,
sizeof(buffer),
"%s - VDR %s",
tr(
"Setup"),
VDRVERSION);
4435 #define STOP_RECORDING trNOOP(" Stop recording ")
4500 for (
int i = 0; ; i++) {
4524 bool result =
false;
4526 bool NewReplaying =
false;
4531 if (Force || NewReplaying !=
replaying) {
4566 const char *s = NULL;
4646 default:
switch (Key) {
4648 case kRed:
if (!HadSubMenu)
4651 case kGreen:
if (!HadSubMenu) {
4656 case kYellow:
if (!HadSubMenu)
4659 case kBlue:
if (!HadSubMenu)
4691 if (
const cChannel *Channel = Channels->GetByNumber(LiveChannel)) {
4693 if (
const cSchedule *Schedule = Schedules->GetSchedule(Channel)) {
4694 const cEvent *Present = Schedule->GetPresentEvent();
4703 Components = Recording->Info()->Components();
4708 int indexSubtitle = 0;
4712 case 2:
if (p->
type == 0x05)
4745 channel = Channels->GetByNumber(Number);
4798 const cEvent *Present = Schedule->GetPresentEvent();
4799 const cEvent *Following = Schedule->GetFollowingEvent();
4825 Channel = Direction > 0 ? Channels->
Next(Channel) : Channels->
Prev(Channel);
4827 Channel = Direction > 0 ? Channels->First() : Channels->Last();
4866 while (ch && (ch = Channels->
Next(ch)) != NULL) {
4868 if (n <= ch->Number() && ch->
Number() < n + m) {
4900 group = Channel->Index();
4903 int SaveGroup =
group;
4965 channel = Channels->Get(Channels->GetNextNormal(
group));
5003 Channels->SwitchTo(NewChannel->
Number());
5008 bool PositionerMoving = Positioner && Positioner->
IsMoving();
5010 if (!PositionerMoving) {
5027 #define VOLUMETIMEOUT 1000
5028 #define MUTETIMEOUT 5000
5094 #define TRACKTIMEOUT 5000
5109 if (TrackId && TrackId->
id) {
5112 if (i == CurrentAudioTrack)
5161 int oldTrack =
track;
5178 static int ac[] = { 1, 0, 2 };
5205 if (
track != oldTrack) {
5230 if (TrackId && TrackId->
id) {
5233 if (i == CurrentSubtitleTrack)
5279 int oldTrack =
track;
5306 if (
track != oldTrack) {
5340 ChannelsStateKey.
Remove();
5365 SchedulesStateKey.
Remove();
5377 if (!
Timer && !LastReplayed)
5379 SchedulesStateKey.
Remove();
5394 SchedulesStateKey.
Remove();
5403 #define INSTANT_REC_EPG_LOOKAHEAD 300
5412 if (
const cSchedule *Schedule = Schedules->GetSchedule(Channel)) {
5413 event = Schedule->GetEventAround(Time);
5416 dsyslog(
"got EPG info after %d seconds", seconds);
5422 dsyslog(
"waiting for EPG info...");
5425 dsyslog(
"no EPG info available");
5437 if (ExecuteUserCommand)
5459 static time_t LastNoDiskSpaceMessage = 0;
5468 isyslog(
"not enough disk space to start recording%s%s", Timer ?
" timer " :
"", Timer ? *Timer->
ToDescr() :
"");
5470 LastNoDiskSpaceMessage = time(NULL);
5474 LastNoDiskSpaceMessage = 0;
5484 dsyslog(
"switching device %d to channel %d %s (%s)", device->
DeviceNumber() + 1, Channel->Number(), *Channel->GetChannelID().ToString(), Channel->Name());
5492 if (!Timer || Timer->
Matches()) {
5501 else if (!Timer || !Timer->
Pending()) {
5502 isyslog(
"no free DVB device to record channel %d (%s)!", ch, Channel->Name());
5507 esyslog(
"ERROR: channel %d not defined!", ch);
5516 return Start(Timers, NULL, Pause);
5526 if (
id && strcmp(
id, InstantId) == 0) {
5573 if (LastInstantId && LastInstantId ==
RecordControls[i]->InstantId())
5574 LastInstantId = NULL;
5602 bool Result =
false;
5621 isyslog(
"stopping recording due to modification of channel %d (%s)", Channel->
Number(), Channel->
Name());
5650 int NewState =
state;
5651 bool Result = State != NewState;
5739 Timers->SetExplicitModify();
5744 Timers->SetModified();
5752 Recordings->SetExplicitModify();
5754 if (Recording->Delete()) {
5757 Recordings->SetModified();
5797 if (!Recordings->GetByName(
fileName))
5850 bool NormalPlay = (
Play && Speed == -1);
5893 Index = Current - Index;
5913 strcpy(buf,
tr(
"Jump: "));
5914 int len = strlen(buf);
5923 sprintf(buf + len,
"%c%c:%c%c", ch10, ch1, cm10, cm1);
5929 #define STAY_SECONDS_OFF_END 10
6002 if (
GetIndex(Current, Total,
true)) {
6013 Goto(Current,
true);
6034 Goto(m->Position());
6038 Goto(m->Position(),
true);
6082 else if (!MarkRequired)
6173 bool DoShowMode =
true;
cString ChannelString(const cChannel *Channel, int Number)
#define LOCK_CHANNELS_READ
#define LOCK_CHANNELS_WRITE
void Initialize(int *InitialValue, double FramesPerSecond)
bool Devices(cVector< int > &DeviceNumbers)
Adds the numbers of any devices that currently use this CAM to the given DeviceNumbers.
int Priority(void)
Returns the priority of the device this slot is currently assigned to, or IDLEPRIORITY if it is not a...
virtual const char * GetCamName(void)
Returns the name of the CAM in this slot, or NULL if there is no ready CAM in this slot.
virtual bool EnterMenu(void)
Requests the CAM in this slot to start its menu.
virtual cCiEnquiry * GetEnquiry(void)
Gets a pending enquiry, or NULL if there is no enquiry.
virtual eModuleStatus ModuleStatus(void)
Returns the status of the CAM in this slot.
virtual bool HasUserIO(void)
Returns true if there is a pending user interaction, which shall be retrieved via GetMenu() or GetEnq...
virtual bool Assign(cDevice *Device, bool Query=false)
Assigns this CAM slot to the given Device, if this is possible.
virtual cCiMenu * GetMenu(void)
Gets a pending menu, or NULL if there is no menu.
virtual bool Reset(void)
Resets the CAM in this slot.
virtual void StartActivation(void)
Puts the CAM in this slot into a mode where an inserted smart card can be activated.
virtual bool IsActivating(void)
Returns true if this CAM slot is currently activating a smart card.
virtual bool HasMMI(void)
Returns 'true' if the CAM in this slot has an active MMI.
virtual bool CanActivate(void)
Returns true if there is a CAM in this slot that can be put into activation mode.
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.
cCamSlot * MtdSpawn(void)
If this CAM slot can do MTD ("Multi Transponder Decryption"), a call to this function returns a cMtdC...
cCamSlot * MasterSlot(void)
Returns this CAM slot's master slot, or a pointer to itself if it is a master slot.
int SlotNumber(void)
Returns the number of this CAM slot within the whole system.
virtual void CancelActivation(void)
Cancels a previously started activation (if any).
const int * Caids(void) const
const int * Dpids(void) const
static cString ToText(const cChannel *Channel)
const char * Name(void) const
bool GroupSep(void) const
const char * ShortName(bool OrName=false) const
const int * Apids(void) const
const char * Provider(void) const
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
bool HasUniqueChannelID(const cChannel *NewChannel, const cChannel *OldChannel=NULL) const
static int MaxNumber(void)
int GetPrevNormal(int Idx) const
Get previous normal channel (not group)
static const cChannels * GetChannelsRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for read access.
void ReNumber(void)
Recalculate 'number' based on channel type.
const cChannel * GetByNumber(int Number, int SkipGap=0) const
void SetModifiedByUser(void)
const cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false) const
bool SwitchTo(int Number) const
void Del(cChannel *Channel)
Delete the given Channel from the list.
int GetNextNormal(int Idx) const
Get next normal channel (not group)
void Reply(const char *s)
tComponent * Component(int Index) const
int NumComponents(void) const
static void SleepMs(int TimeoutMs)
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the...
double FramesPerSecond(void) const
static void Shutdown(void)
static cControl * Control(bool Hidden=false)
Old version of this function, for backwards compatibility with plugins.
static void Launch(cControl *Control)
static cString EditedFileName(const char *FileName)
Returns the full path name of the edited version of the recording with the given FileName.
void SetKeepTracks(bool KeepTracks)
Controls whether the current audio and subtitle track settings shall be kept as they currently are,...
bool SetCurrentSubtitleTrack(eTrackType Type, bool Manual=false)
Sets the current subtitle track to the given Type.
virtual const cPositioner * Positioner(void) const
Returns a pointer to the positioner (if any) this device has used to move the satellite dish to the r...
virtual bool ProvidesSource(int Source) const
Returns true if this device can provide the given source.
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise.
eTrackType GetCurrentSubtitleTrack(void) const
static cDevice * GetDevice(int Index)
Gets the device with the given Index.
eTrackType GetCurrentAudioTrack(void) const
bool SwitchChannel(const cChannel *Channel, bool LiveView)
Switches the device to the given Channel, initiating transfer mode if necessary.
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
bool AttachReceiver(cReceiver *Receiver)
Attaches the given receiver to this device.
static int CurrentChannel(void)
Returns the number of the current channel on the primary device.
static void SetCurrentChannel(const cChannel *Channel)
void StopReplay(void)
Stops the current replay session (if any).
int GetAudioChannel(void)
Gets the current audio channel, which is stereo (0), mono left (1) or mono right (2).
void EnsureAudioTrack(bool Force=false)
Makes sure an audio track is selected that is actually available.
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
void SetAudioChannel(int AudioChannel)
Sets the audio channel to stereo (0), mono left (1) or mono right (2).
static int NumDevices(void)
Returns the total number of devices.
virtual void SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
Sets the video display format to the given one (only useful if this device has an MPEG decoder).
virtual void SetVideoFormat(bool VideoFormat16_9)
Sets the output video format to either 16:9 or 4:3 (only useful if this device has an MPEG decoder).
void ClrAvailableTracks(bool DescriptionsOnly=false, bool IdsOnly=false)
Clears the list of currently available tracks.
void EnsureSubtitleTrack(void)
Makes sure one of the preferred language subtitle tracks is selected.
static int CurrentVolume(void)
static cDevice * PrimaryDevice(void)
Returns the primary device.
bool SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language=NULL, const char *Description=NULL)
Sets the track of the given Type and Index to the given values.
bool SetCurrentAudioTrack(eTrackType Type)
Sets the current audio track to the given Type.
const cEvent * lastPresent
void DisplayChannel(void)
virtual ~cDisplayChannel()
const cEvent * lastFollowing
cSkinDisplayChannel * displayChannel
const cPositioner * positioner
static cDisplayChannel * currentDisplayChannel
virtual eOSState ProcessKey(eKeys Key)
cDisplayChannel(int Number, bool Switched)
const cChannel * NextAvailableChannel(const cChannel *Channel, int Direction)
cSkinDisplayTracks * displayTracks
cDisplaySubtitleTracks(void)
static void Process(eKeys Key)
char * descriptions[ttMaxTrackTypes+1]
eTrackType types[ttMaxTrackTypes]
static cDisplaySubtitleTracks * currentDisplayTracks
virtual ~cDisplaySubtitleTracks()
static cDisplaySubtitleTracks * Create(void)
eOSState ProcessKey(eKeys Key)
char * descriptions[ttMaxTrackTypes+1]
static cDisplayTracks * Create(void)
virtual ~cDisplayTracks()
eOSState ProcessKey(eKeys Key)
static cDisplayTracks * currentDisplayTracks
cSkinDisplayTracks * displayTracks
static void Process(eKeys Key)
eTrackType types[ttMaxTrackTypes]
static cDisplayVolume * Create(void)
cSkinDisplayVolume * displayVolume
virtual ~cDisplayVolume()
eOSState ProcessKey(eKeys Key)
static void Process(eKeys Key)
static cDisplayVolume * currentDisplayVolume
static bool BondDevices(const char *Bondings)
Bonds the devices as defined in the given Bondings string.
void SetMarks(const cMarks *Marks)
bool GetIndex(int &Current, int &Total, bool SnapToIFrame=false)
void SkipSeconds(int Seconds)
bool GetReplayMode(bool &Play, bool &Forward, int &Speed)
int SkipFrames(int Frames)
void Goto(int Index, bool Still=false)
bool GetFrameNumber(int &Current, int &Total)
static void SetupChanged(void)
time_t StartTime(void) const
tChannelID ChannelID(void) const
cString GetTimeString(void) const
const cComponents * Components(void) const
const char * Title(void) const
const char * ShortText(void) const
const char * Description(void) const
static bool GetAvailableFontNames(cStringList *FontNames, bool Monospaced=false)
Queries the font configuration for a list of available font names, which is returned in FontNames.
bool Confirm(const char *s, int Seconds=10, bool WaitForTimeout=false)
bool Contains(const cListObject *Object) const
If a pointer to an object contained in this list has been obtained while holding a lock,...
void Del(cListObject *Object, bool DeleteObject=true)
virtual void Move(int From, int To)
void SetExplicitModify(void)
If you have obtained a write lock on this list, and you don't want it to be automatically marked as m...
void SetModified(void)
Unconditionally marks this list as modified.
void SetSyncStateKey(cStateKey &StateKey)
When making changes to this list (while holding a write lock) that shall not affect some other code t...
bool Lock(cStateKey &StateKey, bool Write=false, int TimeoutMs=0) const
Tries to get a lock on this list and returns true if successful.
void Add(cListObject *Object, cListObject *After=NULL)
cListObject * Prev(void) const
cListObject * Next(void) const
const T * Next(const T *Object) const
< Returns the element immediately before Object in this list, or NULL if Object is the first element ...
const T * Last(void) const
Returns the last element in this list, or NULL if the list is empty.
const T * First(void) const
Returns the first element in this list, or NULL if the list is empty.
const cOsdItem * Get(int Index) const
Returns the list element at the given Index, or NULL if no such element exists.
const T * Prev(const T *Object) const
void SetPosition(int Position)
int GetNumSequences(void) const
Returns the actual number of sequences to be cut from the recording.
void Add(int Position)
If this cMarks object is used by multiple threads, the caller must Lock() it before calling Add() and...
const cMark * GetNext(int Position) const
bool Load(const char *RecordingFileName, double FramesPerSecond=DEFAULTFRAMESPERSECOND, bool IsPesRecording=false)
const cMark * Get(int Position) const
static bool DeleteMarksFile(const cRecording *Recording)
const cMark * GetPrev(int Position) const
cList< cNestedItem > * commands
cMenuCommands(const char *Title, cList< cNestedItem > *Commands, const char *Parameters=NULL)
virtual eOSState ProcessKey(eKeys Key)
bool Parse(const char *s)
cOsdItem * cancelEditingItem
cOsdItem * stopRecordingItem
cOsdItem * stopReplayItem
bool Update(bool Force=false)
virtual eOSState ProcessKey(eKeys Key)
cMenuMain(eOSState State=osUnknown, bool OpenSubMenus=false)
static cOsdObject * pluginOsdObject
static cOsdObject * PluginOsdObject(void)
void SetText(const char *Text)
cList< cNestedItem > * SubItems(void)
void SetSubItems(bool On)
const char * Text(void) const
void SetSelectable(bool Selectable)
virtual eOSState ProcessKey(eKeys Key)
bool Selectable(void) const
void SetText(const char *Text, bool Copy=true)
const char * Text(void) const
void SetNeedsFastResponse(bool NeedsFastResponse)
static bool OsdSizeChanged(int &State)
Checks if the OSD size has changed and a currently displayed OSD needs to be redrawn.
static void UpdateOsdSize(bool Force=false)
Inquires the actual size of the video display and adjusts the OSD and font sizes accordingly.
static int IsOpen(void)
Returns true if there is currently a level 0 OSD open.
bool Open(const char *Command, const char *Mode)
static bool HasPlugins(void)
static cPlugin * CallFirstService(const char *Id, void *Data=NULL)
static cPlugin * GetPlugin(int Index)
virtual cMenuSetupPage * SetupMenu(void)
virtual const char * Description(void)=0
virtual const char * MainMenuEntry(void)
virtual const char * Version(void)=0
virtual cOsdObject * MainMenuAction(void)
A steerable satellite dish generally points to the south on the northern hemisphere,...
virtual bool IsMoving(void) const
Returns true if the dish is currently moving as a result of a call to GotoPosition() or GotoAngle().
bool IsAttached(void)
Returns true if this receiver is (still) attached to a device.
virtual ~cRecordControl()
void Stop(bool ExecuteUserCommand=true)
const char * InstantId(void)
cRecordControl(cDevice *Device, cTimers *Timers, cTimer *Timer=NULL, bool Pause=false)
static bool StateChanged(int &State)
static const char * GetInstantId(const char *LastInstantId)
static void ChannelDataModified(const cChannel *Channel)
static bool Process(cTimers *Timers, time_t t)
static bool PauseLiveVideo(void)
static void Shutdown(void)
static bool Start(cTimers *Timers, cTimer *Timer, bool Pause=false)
static cRecordControl * RecordControls[]
static void Stop(const char *InstantId)
static cRecordControl * GetRecordControl(const char *FileName)
static void ChangeState(void)
virtual bool Filter(const cRecording *Recording) const =0
Returns true if the given Recording shall be displayed in the Recordings menu.
const char * Description(void) const
static void InvokeCommand(const char *State, const char *RecordingFileName, const char *SourceFileName=NULL)
bool ChangePriorityLifetime(int NewPriority, int NewLifetime)
Changes the priority and lifetime of this recording to the given values.
bool HasMarks(void) const
Returns true if this recording has any editing marks.
bool WriteInfo(const char *OtherFileName=NULL)
Writes in info file of this recording.
int IsInUse(void) const
Checks whether this recording is currently in use and therefore shall not be tampered with.
bool ChangeName(const char *NewName)
Changes the name of this recording to the given value.
bool Delete(void)
Changes the file name so that it will no longer be visible in the "Recordings" menu Returns false in ...
const char * Name(void) const
Returns the full name of the recording (without the video directory).
cString Folder(void) const
Returns the name of the folder this recording is stored in (without the video directory).
const char * FileName(void) const
Returns the full path name to the recording directory, including the video directory and the actual '...
cString BaseName(void) const
Returns the base name of this recording (without the video directory and folder).
cRecordingInfo * Info(void) const
const char * Title(char Delimiter=' ', bool NewIndicator=false, int Level=-1) const
double FramesPerSecond(void) const
bool IsPesRecording(void) const
void DelAll(void)
Deletes/terminates all operations.
bool Add(int Usage, const char *FileNameSrc, const char *FileNameDst=NULL)
Adds the given FileNameSrc to the recordings handler for (later) processing.
int GetUsage(const char *FileName)
Returns the usage type for the given FileName.
void Del(const char *FileName)
Deletes the given FileName from the list of operations.
static const cRecordings * GetRecordingsRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of recordings for read access.
static void TouchUpdate(void)
Touches the '.update' file in the video directory, so that other instances of VDR that access the sam...
static cRecordings * GetRecordingsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of recordings for write access.
void DelByName(const char *FileName)
const cRecording * GetByName(const char *FileName) const
bool Put(uint64_t Code, bool Repeat=false, bool Release=false)
static void TriggerLastActivity(void)
Simulates user activity, for instance to keep the current menu open even if no remote control key has...
static void SetRecording(const char *FileName)
static const char * LastReplayed(void)
void TimeSearchDisplay(void)
static void ClearLastReplayed(const char *FileName)
void MarkMove(int Frames, bool MarkRequired)
static cReplayControl * currentReplayControl
virtual eOSState ProcessKey(eKeys Key)
void TimeSearchProcess(eKeys Key)
void MarkJump(bool Forward)
cSkinDisplayReplay * displayReplay
void ShowTimed(int Seconds=0)
virtual const cRecording * GetRecording(void)
Returns the cRecording that is currently being replayed, or NULL if this player is not playing a cRec...
virtual void ClearEditingMarks(void)
Clears any editing marks this player might be showing.
bool ShowProgress(bool Initial)
cAdaptiveSkipper adaptiveSkipper
virtual cOsdObject * GetInfo(void)
Returns an OSD object that displays information about the currently played programme.
virtual ~cReplayControl()
static const char * NowReplaying(void)
cReplayControl(bool PauseLive=false)
bool FromString(const char *s)
const cSchedule * GetSchedule(tChannelID ChannelID) const
static const cSchedules * GetSchedulesRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of schedules for read access.
static void ResetVersions(void)
int SubtitleFgTransparency
char SVDRPDefaultHost[HOST_NAME_MAX]
char OSDTheme[MaxThemeName]
int SubtitleLanguages[I18N_MAX_LANGUAGES+1]
int EPGLanguages[I18N_MAX_LANGUAGES+1]
char OSDSkin[MaxSkinName]
int AlwaysSortFoldersFirst
char OSDLanguage[I18N_MAX_LOCALE_LEN]
int ShowChannelNamesWithSource
int SubtitleBgTransparency
int AdaptiveSkipAlternate
int AudioLanguages[I18N_MAX_LANGUAGES+1]
char NameInstantRecord[NAME_MAX+1]
char FontOsd[MAXFONTNAME]
char FontSml[MAXFONTNAME]
char FontFix[MAXFONTNAME]
char SVDRPHostName[HOST_NAME_MAX]
void RequestEmergencyExit(void)
Requests an emergency exit of the VDR main loop.
bool ConfirmRestart(bool Ask)
Check for background activity that blocks restart.
void Exit(int ExitCode)
Set VDR exit code and initiate end of VDR main loop.
virtual void SetEvents(const cEvent *Present, const cEvent *Following)=0
Sets the Present and Following EPG events.
virtual void SetPositioner(const cPositioner *Positioner)
Sets the Positioner used to move the satellite dish.
virtual void SetChannel(const cChannel *Channel, int Number)=0
Sets the current channel to Channel.
virtual void SetJump(const char *Jump)=0
Sets the prompt that allows the user to enter a jump point.
virtual void SetMarks(const cMarks *Marks)
Sets the editing marks to Marks, which shall be used to display the progress bar through a cProgressB...
virtual void SetRecording(const cRecording *Recording)
Sets the recording that is currently being played.
virtual void SetCurrent(const char *Current)=0
Sets the current position within the recording, as a user readable string if the form "h:mm:ss....
virtual void SetProgress(int Current, int Total)=0
This function will be called whenever the position in or the total length of the recording has change...
virtual void SetMode(bool Play, bool Forward, int Speed)=0
Sets the current replay mode, which can be used to display some indicator, showing the user whether w...
virtual void SetTotal(const char *Total)=0
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
virtual void SetAudioChannel(int AudioChannel)=0
Sets the audio channel indicator.
virtual void SetTrack(int Index, const char *const *Tracks)=0
< This class implements the track display.
virtual void SetVolume(int Current, int Total, bool Mute)=0
< This class implements the volume/mute display.
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual cSkinDisplayVolume * DisplayVolume(void)=0
Creates and returns a new object for displaying the current volume.
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)=0
Creates and returns a new object for displaying replay progress.
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)=0
Creates and returns a new object for displaying the current channel.
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)=0
Creates and returns a new object for displaying the available tracks.
bool SetCurrent(const char *Name=NULL)
Sets the current skin to the one indicated by name.
eKeys Message(eMessageType Type, const char *s, int Seconds=0)
Displays the given message, either through a currently visible display object that is capable of doin...
cSkin * Current(void)
Returns a pointer to the current skin.
int QueueMessage(eMessageType Type, const char *s, int Seconds=0, int Timeout=0)
Like Message(), but this function may be called from a background thread.
virtual void SetData(cChannel *Channel)=0
Sets all source specific parameters to those of the given Channel.
virtual void GetData(cChannel *Channel)=0
Copies all source specific parameters to the given Channel.
virtual cOsdItem * GetOsdItem(void)=0
Returns all the OSD items necessary for editing the source specific parameters of the channel that wa...
cSourceParam * Get(char Source)
static cString ToString(int Code)
const char * Description(void) const
void Remove(bool IncState=true)
Removes this key from the lock it was previously used with.
void Reset(void)
Resets the state of this key, so that the next call to a lock's Lock() function with this key will re...
static void MsgMarksModified(const cMarks *Marks)
static void MsgOsdChannel(const char *Text)
static void MsgSetAudioChannel(int AudioChannel)
static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle)
static void MsgReplaying(const cControl *Control, const char *Name, const char *FileName, bool On)
static void MsgRecording(const cDevice *Device, const char *Name, const char *FileName, bool On)
static void MsgOsdClear(void)
static void MsgSetAudioTrack(int Index, const char *const *Tracks)
static void MsgOsdTextItem(const char *Text, bool Scroll=false)
static void MsgSetSubtitleTrack(int Index, const char *const *Tracks)
void Sort(bool IgnoreCase=false)
int Find(const char *s) const
cString & CompactChars(char c)
Compact any sequence of characters 'c' to a single character, and strip all of them from the beginnin...
static cString sprintf(const char *fmt,...) __attribute__((format(printf
const char * Description(void)
Returns a user visible, single line description of this theme.
bool Load(const char *FileName, bool OnlyDescriptions=false)
Loads the theme data from the given file.
const char *const * Descriptions(void)
const char * Name(int Index)
const char * FileName(int Index)
int GetThemeIndex(const char *Description)
bool Load(const char *SkinName)
bool Active(void)
Checks whether the thread is still alive.
uint64_t Elapsed(void) const
void Set(int Ms=0)
Sets the timer.
bool TimedOut(void) const
cString PrintFirstDay(void) const
time_t day
midnight of the day this timer shall hit, or of the first day it shall hit in case of a repeating tim...
int weekdays
bitmask, lowest bits: SSFTWTM (the 'M' is the LSB)
bool IsSingleEvent(void) const
void SetPending(bool Pending)
const char * Remote(void) const
time_t StopTime(void) const
time_t FirstDay(void) const
bool Recording(void) const
virtual int Compare(const cListObject &ListObject) const
Must return 0 if this object is equal to ListObject, a positive value if it is "greater",...
void SetFlags(uint Flags)
void SetDeferred(int Seconds)
static cString PrintDay(time_t Day, int WeekDays, bool SingleByteChars)
void SetRemote(const char *Remote)
const char * File(void) const
time_t StartTime(void) const
cString ToDescr(void) const
bool SetEventFromSchedule(const cSchedules *Schedules)
void SetRecording(bool Recording)
const cEvent * Event(void) const
static int GetMDay(time_t t)
bool HasFlags(uint Flags) const
bool Matches(time_t t=0, bool Directly=false, int Margin=0) const
cString ToText(bool UseChannelID=false) const
const cChannel * Channel(void) const
void Add(cTimer *Timer, cTimer *After=NULL)
static cTimers * GetTimersWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of timers for write access.
void Del(cTimer *Timer, bool DeleteObject=true)
static const cTimers * GetTimersRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of timers for read access.
const cTimer * GetMatch(time_t t) const
void Sort(__compar_fn_t Compare)
virtual void Insert(T Data, int Before=0)
virtual void Append(T Data)
static const char * Name(void)
static int VideoDiskSpace(int *FreeMB=NULL, int *UsedMB=NULL)
static void ForceCheck(void)
To avoid unnecessary load, the video disk usage is only actually checked every DISKSPACECHEK seconds.
cNestedItemList RecordingCommands
#define TIMERMACRO_EPISODE
#define IS_AUDIO_TRACK(t)
#define IS_DOLBY_TRACK(t)
#define LOCK_SCHEDULES_READ
#define MAXEPGBUGFIXLEVEL
const char * DefaultFontOsd
const char * DefaultFontSml
const char * DefaultFontFix
const cStringList * I18nLanguages(void)
Returns the list of available languages.
int I18nNumLanguagesWithLocale(void)
Returns the number of entries in the list returned by I18nLanguages() that actually have a locale.
int I18nCurrentLanguage(void)
Returns the index of the current language.
const char * I18nLocale(int Language)
Returns the locale code of the given Language (which is an index as returned by I18nCurrentLanguage()...
void I18nSetLocale(const char *Locale)
Sets the current locale to Locale.
void I18nSetLanguage(int Language)
Sets the current language index to Language.
cString GetRecordingTimerId(const char *Directory)
cString IndexToHMSF(int Index, bool WithFrame, double FramesPerSecond)
char * ExchangeChars(char *s, bool ToFileSystem)
void AssertFreeDiskSpace(int Priority, bool Force)
The special Priority value -1 means that we shall get rid of any deleted recordings faster than norma...
void GetRecordingsSortMode(const char *Directory)
int SecondsToFrames(int Seconds, double FramesPerSecond)
eRecordingsSortMode RecordingsSortMode
void IncRecordingsSortMode(const char *Directory)
cRecordingsHandler RecordingsHandler
void SetRecordingTimerId(const char *Directory, const char *TimerId)
#define RUC_BEFORERECORDING
#define RUC_AFTERRECORDING
#define LOCK_RECORDINGS_READ
#define MAXVIDEOFILESIZETS
#define LOCK_RECORDINGS_WRITE
cShutdownHandler ShutdownHandler
static const cCursesFont Font
cSourceParams SourceParams
char language[MAXLANGCODE2]
char language[MAXLANGCODE2]
void StopSVDRPHandler(void)
bool GetSVDRPServerNames(cStringList *ServerNames)
Gets a list of all available VDRs this VDR is connected to via SVDRP, and stores it in the given Serv...
bool ExecSVDRPCommand(const char *ServerName, const char *Command, cStringList *Response)
Sends the given SVDRP Command string to the remote VDR identified by ServerName and collects all of t...
void StartSVDRPHandler(void)
int SVDRPCode(const char *s)
Returns the value of the three digit reply code of the given SVDRP response string.
cStateKey StateKeySVDRPRemoteTimersPoll
Controls whether a change to the local list of timers needs to result in sending a POLL to the remote...
bool HandleRemoteTimerModifications(cTimer *NewTimer, cTimer *OldTimer, cString *Msg)
Performs any operations necessary to synchronize changes to a timer between peer VDR machines.
#define LOCK_TIMERS_WRITE