diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-03-10 12:45:58 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-03-10 12:45:58 +0100 |
commit | f9a3885ef2d21cef30180f2a90a0a305981a27c6 (patch) | |
tree | 068fc60123196fdb2ac15c4304b7520bae96e18f /menu.c | |
parent | 550c79e411a3e9237cb357bb4dab45cc3b7d5d0f (diff) | |
download | vdr-f9a3885ef2d21cef30180f2a90a0a305981a27c6.tar.gz vdr-f9a3885ef2d21cef30180f2a90a0a305981a27c6.tar.bz2 |
New Setup parameter TrustedTransponder
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 45 |
1 files changed, 43 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.163 2002/03/09 16:57:34 kls Exp $ + * $Id: menu.c 1.164 2002/03/10 12:45:58 kls Exp $ */ #include "menu.h" @@ -168,6 +168,47 @@ void cMenuEditChanItem::Set(void) SetValue(buf); } +// --- cMenuEditTranItem ----------------------------------------------------- + +class cMenuEditTranItem : public cMenuEditChanItem { +private: + int number; + int transponder; +public: + cMenuEditTranItem(const char *Name, int *Value); + virtual eOSState ProcessKey(eKeys Key); + }; + +cMenuEditTranItem::cMenuEditTranItem(const char *Name, int *Value) +:cMenuEditChanItem(Name, Value) +{ + number = 0; + transponder = *Value; + cChannel *channel = Channels.First(); + while (channel) { + if (!channel->groupSep && ISTRANSPONDER(channel->frequency, *Value)) { + number = channel->number; + break; + } + channel = (cChannel *)channel->Next(); + } + *Value = number; + Set(); + *Value = transponder; +} + +eOSState cMenuEditTranItem::ProcessKey(eKeys Key) +{ + *value = number; + eOSState state = cMenuEditChanItem::ProcessKey(Key); + number = *value; + cChannel *channel = Channels.GetByNumber(*value); + if (channel) + transponder = channel->frequency; + *value = transponder; + return state; +} + // --- cMenuEditDayItem ------------------------------------------------------ class cMenuEditDayItem : public cMenuEditIntItem { @@ -1911,6 +1952,7 @@ void cMenuSetup::Set(void) Add(new cMenuEditIntItem( tr("LnbFrequHi"), &data.LnbFrequHi)); Add(new cMenuEditBoolItem(tr("Setup$DiSEqC"), &data.DiSEqC)); Add(new cMenuEditBoolItem(tr("SetSystemTime"), &data.SetSystemTime)); + Add(new cMenuEditTranItem(tr("TrustedTransponder"), &data.TrustedTransponder)); Add(new cMenuEditIntItem( tr("MarginStart"), &data.MarginStart)); Add(new cMenuEditIntItem( tr("MarginStop"), &data.MarginStop)); Add(new cMenuEditIntItem( tr("EPGScanTimeout"), &data.EPGScanTimeout)); @@ -1950,7 +1992,6 @@ eOSState cMenuSetup::ProcessKey(eKeys Key) if (state == osUnknown) { switch (Key) { case kOk: state = (Setup.PrimaryDVB != data.PrimaryDVB) ? osSwitchDvb : osEnd; - cDvbApi::PrimaryDvbApi->SetUseTSTime(data.SetSystemTime); cDvbApi::PrimaryDvbApi->SetVideoFormat(data.VideoFormat ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3); Setup = data; Setup.Save(); |