diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2005-08-28 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2005-08-28 18:00:00 +0200 |
commit | ad40eaa28e6e9f0fa594937453b5ae53b88dce75 (patch) | |
tree | 6bd222711a6a20d4977d572dcab2bb526c27d743 /menu.c | |
parent | dab203efe9e24f1dade33ee1da6a39b26f8501f0 (diff) | |
download | vdr-patch-lnbsharing-ad40eaa28e6e9f0fa594937453b5ae53b88dce75.tar.gz vdr-patch-lnbsharing-ad40eaa28e6e9f0fa594937453b5ae53b88dce75.tar.bz2 |
Version 1.3.31vdr-1.3.31
- Added missing German OSD texts for 'Audio language'.
- The Setup/CICAM menu now only contains the devices that actually have a CI and
dynamically detects the number of slots a CI provides.
- Implemented cAudioRepacker for better handling of audio PES packets (thanks to
Reinhard Nissl).
- Modified handling of audio packets for radio channels in remux.c (thanks to
Reinhard Nissl).
- Updated the Danish OSD texts (thanks to Mogens Elneff).
- Fixed the EPG scan, so that it doesn't use the primary device if that is
currently in Transfer-Mode from itself (thanks to Marcus Hilbrich for a bug
report that lead to this).
- Removed the TUNER_LOCK_TIMEOUT in cDevice::AttachReceiver() since it caused more
trouble than it fixed.
- Fixed detecting short channel names for "Kabel Deutschland", who uses a comma
as delimiter (thanks to Marco Schlüßler).
- Moved cMenuEditTimer and cMenuEvent to menu.h so that plugins can use it (suggested
by Thomas Günther).
- The new static function cString::sprintf() can be used to easily create a formatted
string.
- Plugins can now implement their own SVDRP commands (based on a patch from Hardy
Flor). See PLUGINS.html, section "SVDRP commands" for details. The SVDRP commands
of a plugin are accessed through the new SVDRP command PLUG.
See PLUGINS/src/svdrpdemo for an example of how to use this feature.
- The new SVDRP command PLAY can be used to start replaying a recording (thanks to
Hardy Flor).
- The new SVDRP command EDIT can be used to start the editing process of a recording
(based on the CUTR patch by Harald Milz).
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 128 |
1 files changed, 46 insertions, 82 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.355 2005/08/14 15:14:29 kls Exp $ + * $Id: menu.c 1.357 2005/08/27 09:37:23 kls Exp $ */ #include "menu.h" @@ -19,7 +19,6 @@ #include "eitscan.h" #include "i18n.h" #include "interface.h" -#include "menuitems.h" #include "plugin.h" #include "recording.h" #include "remote.h" @@ -605,20 +604,6 @@ eOSState cMenuText::ProcessKey(eKeys Key) // --- cMenuEditTimer -------------------------------------------------------- -class cMenuEditTimer : public cOsdMenu { -private: - cTimer *timer; - cTimer data; - int channel; - bool addIfConfirmed; - cMenuEditDateItem *firstday; - void SetFirstDayItem(void); -public: - cMenuEditTimer(cTimer *Timer, bool New = false); - virtual ~cMenuEditTimer(); - virtual eOSState ProcessKey(eKeys Key); - }; - cMenuEditTimer::cMenuEditTimer(cTimer *Timer, bool New) :cOsdMenu(tr("Edit timer"), 12) { @@ -904,15 +889,6 @@ eOSState cMenuTimers::ProcessKey(eKeys Key) // --- cMenuEvent ------------------------------------------------------------ -class cMenuEvent : public cOsdMenu { -private: - const cEvent *event; -public: - cMenuEvent(const cEvent *Event, bool CanSwitch = false); - virtual void Display(void); - virtual eOSState ProcessKey(eKeys Key); -}; - cMenuEvent::cMenuEvent(const cEvent *Event, bool CanSwitch) :cOsdMenu(tr("Event")) { @@ -2122,11 +2098,28 @@ eOSState cMenuSetupLNB::ProcessKey(eKeys Key) // --- cMenuSetupCICAM ------------------------------------------------------- +class cMenuSetupCICAMItem : public cOsdItem { +private: + cCiHandler *ciHandler; + int slot; +public: + cMenuSetupCICAMItem(int Device, cCiHandler *CiHandler, int Slot); + cCiHandler *CiHandler(void) { return ciHandler; } + int Slot(void) { return slot; } + }; + +cMenuSetupCICAMItem::cMenuSetupCICAMItem(int Device, cCiHandler *CiHandler, int Slot) +{ + ciHandler = CiHandler; + slot = Slot; + char buffer[32]; + const char *CamName = CiHandler->GetCamName(slot); + snprintf(buffer, sizeof(buffer), "%s%d %d\t%s", tr("Setup.CICAM$CICAM DVB"), Device + 1, slot + 1, CamName ? CamName : "-"); + SetText(buffer); +} + class cMenuSetupCICAM : public cMenuSetupBase { private: - int helpKeys; - void SetHelpKeys(void); - cCiHandler *GetCurrentCiHandler(int *Slot = NULL); eOSState Menu(void); eOSState Reset(void); public: @@ -2136,66 +2129,43 @@ public: cMenuSetupCICAM::cMenuSetupCICAM(void) { - helpKeys = -1; SetSection(tr("CICAM")); for (int d = 0; d < cDevice::NumDevices(); d++) { cDevice *Device = cDevice::GetDevice(d); - cCiHandler *CiHandler = Device->CiHandler(); - for (int Slot = 0; Slot < 2; Slot++) { - char buffer[32]; - int CardIndex = Device->CardIndex(); - const char *CamName = CiHandler ? CiHandler->GetCamName(Slot) : NULL; - if (!CamName) - CamName = "-"; - snprintf(buffer, sizeof(buffer), "%s%d %d\t%s", tr("Setup.CICAM$CICAM DVB"), CardIndex + 1, Slot + 1, CamName); - Add(new cOsdItem(buffer)); - } + if (Device) { + cCiHandler *CiHandler = Device->CiHandler(); + if (CiHandler) { + for (int Slot = 0; Slot < CiHandler->NumSlots(); Slot++) + Add(new cMenuSetupCICAMItem(Device->CardIndex(), CiHandler, Slot)); + } + } } - SetHelpKeys(); -} - -cCiHandler *cMenuSetupCICAM::GetCurrentCiHandler(int *Slot) -{ - cDevice *Device = cDevice::GetDevice(Current() / 2); - if (Slot) - *Slot = Current() % 2; - return Device ? Device->CiHandler() : NULL; -} - -void cMenuSetupCICAM::SetHelpKeys(void) -{ - int NewHelpKeys = helpKeys; - NewHelpKeys = GetCurrentCiHandler() ? 1 : 0; - if (NewHelpKeys != helpKeys) { - switch (NewHelpKeys) { - case 0: SetHelp(NULL); break; - case 1: SetHelp(tr("Menu"), tr("Reset")); - } - helpKeys = NewHelpKeys; - } + SetHelp(tr("Menu"), tr("Reset")); } eOSState cMenuSetupCICAM::Menu(void) { - int Slot = 0; - cCiHandler *CiHandler = GetCurrentCiHandler(&Slot); - if (CiHandler && CiHandler->EnterMenu(Slot)) - return osEnd; // the CAM menu will be executed explicitly from the main loop - else - Skins.Message(mtError, tr("Can't open CAM menu!")); + cMenuSetupCICAMItem *item = (cMenuSetupCICAMItem *)Get(Current()); + if (item) { + if (item->CiHandler()->EnterMenu(item->Slot())) + return osEnd; // the CAM menu will be executed explicitly from the main loop + else + Skins.Message(mtError, tr("Can't open CAM menu!")); + } return osContinue; } eOSState cMenuSetupCICAM::Reset(void) { - int Slot = 0; - cCiHandler *CiHandler = GetCurrentCiHandler(&Slot); - if (CiHandler && CiHandler->Reset(Slot)) { - Skins.Message(mtInfo, tr("CAM has been reset")); - return osEnd; + cMenuSetupCICAMItem *item = (cMenuSetupCICAMItem *)Get(Current()); + if (item) { + if (item->CiHandler()->Reset(item->Slot())) { + Skins.Message(mtInfo, tr("CAM has been reset")); + return osEnd; + } + else + Skins.Message(mtError, tr("Can't reset CAM!")); } - else - Skins.Message(mtError, tr("Can't reset CAM!")); return osContinue; } @@ -2205,17 +2175,11 @@ eOSState cMenuSetupCICAM::ProcessKey(eKeys Key) if (state == osUnknown) { switch (Key) { - case kRed: if (helpKeys == 1) - return Menu(); - break; - case kGreen: if (helpKeys == 1) - return Reset(); - break; + case kRed: return Menu(); + case kGreen: return Reset(); default: break; } } - if (Key != kNone) - SetHelpKeys(); return state; } |