summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2001-09-16 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2001-09-16 18:00:00 +0200
commit156831036e9b0fcbfc719033cc89e08c1985cad6 (patch)
treedede3254f8982f36fe40a11f7ce333b13f2297d6 /menu.c
parentbb18b9e0b449afff418f010c1b2e255acd3fbad3 (diff)
downloadvdr-patch-lnbsharing-156831036e9b0fcbfc719033cc89e08c1985cad6.tar.gz
vdr-patch-lnbsharing-156831036e9b0fcbfc719033cc89e08c1985cad6.tar.bz2
Version 0.95vdr-0.95
- Fixed behaviour in case the shutdown didn't take place (there were many "next timer event at..." messages in that case). - Reduced the default value for MinEventTimeout to 30 minutes. - Fixed detecting manual start in shutdown feature. - An error message is now displayed in case the Transfer Mode can't be started because the necessary DVB card is currently recording (or there is no DVB card that can access this channel). - Fixed toggling channels with the '0' key in case the "Ok" button has been pressed to display the current/next information. - Pressing the "Power" key now always initiates the shutdown sequence (after user confirmation in case of a recording timer), event if there is currently a menu or a replay session active. Note the additional remarks in INSTALL regarding the values of the two parameters given to the shutdown program in case of a currently recording timer. - Switching through channel groups with the "Left" and "Right" keys now always starts at the group that contains the current channel. - Implemented "Multi Speed Mode" (thanks to Stefan Huelswitt). - Implemented backtracing to hit the right spot after fast forward/rewind (thanks to Stefan Huelswitt). - Implemented replay mode display (thanks to Stefan Huelswitt, with a few rewrites by kls). - Changed the size of all input buffers used to parse config files or receive SVDRP commands to the same value of 10KB. This allows long strings to be used in the 'summary' field of a timer, for instance. - The pipe to the Dolby Digital replay command (option '-a') now closes all unused file descriptors in the child process to avoid crashing when the OSD is used (thanks to Andreas Vitting). - Switched to the driver's new tuning API (VDR now requires a driver version dated 2001-09-14 or higher). - Changed obsolete macro VIDEO_WINDOW_CHROMAKEY to VID_TYPE_CHROMAKEY (thanks to Guido Fiala). - New version of the "Master-Timer" tool (thanks to Matthias Schniedermeyer). - Better error handling when writing configuration files. - Fixed putting the final editing mark into the edited version's marks file. - Fixed manipulating an editing mark at the very end of a recording. - Fixed starting a new replay immediately after stopping a previous one (had caused a mix between live video and replay). - Three new keys ("Volume+", Volume-" and "Mute") to control the DVB card's audio output volume. - New version of the 'epg2timers' tool (thanks to Carsten Koch).
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c112
1 files changed, 98 insertions, 14 deletions
diff --git a/menu.c b/menu.c
index 5ff54cb..98fd302 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.115 2001/09/02 15:27:54 kls Exp $
+ * $Id: menu.c 1.120 2001/09/15 10:36:31 kls Exp $
*/
#include "menu.h"
@@ -16,8 +16,9 @@
#include "eit.h"
#include "i18n.h"
-#define MENUTIMEOUT 120 // seconds
-#define MAXWAIT4EPGINFO 10 // seconds
+#define MENUTIMEOUT 120 // seconds
+#define MAXWAIT4EPGINFO 10 // seconds
+#define MODETIMEOUT 3 // seconds
const char *FileNameChars = " aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-.#~^";
@@ -1725,6 +1726,8 @@ void cMenuSetup::Set(void)
Add(new cMenuEditIntItem( tr("MaxVideoFileSize"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE));
Add(new cMenuEditIntItem( tr("MinEventTimeout"), &data.MinEventTimeout));
Add(new cMenuEditIntItem( tr("MinUserInactivity"), &data.MinUserInactivity));
+ Add(new cMenuEditBoolItem(tr("MultiSpeedMode"), &data.MultiSpeedMode));
+ Add(new cMenuEditBoolItem(tr("ShowReplayMode"), &data.ShowReplayMode));
}
eOSState cMenuSetup::ProcessKey(eKeys Key)
@@ -1920,14 +1923,14 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
#define DIRECTCHANNELTIMEOUT 1000 //ms
#define INFOTIMEOUT 5000 //ms
-cDisplayChannel::cDisplayChannel(int Number, bool Switched, bool Group)
+cDisplayChannel::cDisplayChannel(int Number, bool Switched)
:cOsdBase(true)
{
- group = Group;
- withInfo = !group && (!Switched || Setup.ShowInfoOnChSwitch);
+ group = -1;
+ withInfo = !Switched || Setup.ShowInfoOnChSwitch;
lines = 0;
oldNumber = number = 0;
- cChannel *channel = Group ? Channels.Get(Number) : Channels.GetByNumber(Number);
+ cChannel *channel = Channels.GetByNumber(Number);
Interface->Open(Setup.OSDwidth, Setup.ChannelInfoPos ? 5 : -5);
if (channel) {
DisplayChannel(channel);
@@ -1939,6 +1942,7 @@ cDisplayChannel::cDisplayChannel(int Number, bool Switched, bool Group)
cDisplayChannel::cDisplayChannel(eKeys FirstKey)
:cOsdBase(true)
{
+ group = -1;
oldNumber = cDvbApi::CurrentChannel();
number = 0;
lastTime = time_ms();
@@ -2049,6 +2053,32 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key)
}
}
break;
+ case kLeft:
+ case kRight:
+ withInfo = false;
+ if (group < 0) {
+ cChannel *channel = Channels.GetByNumber(cDvbApi::CurrentChannel());
+ if (channel)
+ group = channel->Index();
+ }
+ if (group >= 0) {
+ int SaveGroup = group;
+ if (Key == kRight)
+ group = Channels.GetNextGroup(group) ;
+ else
+ group = Channels.GetPrevGroup(group < 1 ? 1 : group);
+ if (group < 0)
+ group = SaveGroup;
+ cChannel *channel = Channels.Get(group);
+ if (channel) {
+ Interface->Clear();
+ DisplayChannel(channel);
+ if (!channel->groupSep)
+ group = -1;
+ }
+ }
+ lastTime = time_ms();
+ break;
case kNone:
if (number && time_ms() - lastTime > DIRECTCHANNELTIMEOUT) {
if (number > 0 && !Channels.SwitchTo(number))
@@ -2059,8 +2089,8 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key)
//TODO
//XXX case kGreen: return osEventNow;
//XXX case kYellow: return osEventNext;
- case kOk: if (group)
- Channels.SwitchTo(Channels.Get(Channels.GetNextNormal(CurrentGroup))->number);
+ case kOk: if (group >= 0)
+ Channels.SwitchTo(Channels.Get(Channels.GetNextNormal(group))->number);
return osEnd;
default: Interface->PutKey(Key);
return osEnd;
@@ -2304,7 +2334,7 @@ int cReplayControl::titleid = 0;//XXX
cReplayControl::cReplayControl(void)
{
dvbApi = cDvbApi::PrimaryDvbApi;
- visible = shown = displayFrames = false;
+ visible = modeOnly = shown = displayFrames = false;
lastCurrent = lastTotal = -1;
timeoutShow = 0;
timeSearchActive = false;
@@ -2367,7 +2397,51 @@ void cReplayControl::Hide(void)
{
if (visible) {
Interface->Close();
- needsFastResponse = visible = false;
+ needsFastResponse = visible = modeOnly = false;
+ }
+}
+
+void cReplayControl::DisplayAtBottom(const char *s)
+{
+ if (s) {
+ int w = dvbApi->WidthInCells(s);
+ int d = max(Width() - w, 0) / 2;
+ Interface->Write(d, -1, s);
+ Interface->Flush();
+ }
+ else
+ Interface->Fill(12, 2, Width() - 22, 1, clrBackground);
+}
+
+void cReplayControl::ShowMode(void)
+{
+ if (Setup.ShowReplayMode && !timeSearchActive) {
+ bool Play, Forward;
+ int Speed;
+ if (dvbApi->GetReplayMode(Play, Forward, Speed)) {
+
+ if (!visible) {
+ // open small display
+ Interface->Open(9, -1);
+ Interface->Clear();
+ visible = modeOnly = true;
+ }
+
+ timeoutShow = (modeOnly && !timeoutShow && Speed == -1 && Play) ? time(NULL) + MODETIMEOUT : 0;
+ const char *Mode;
+ if (Speed == -1) Mode = Play ? " > " : " || ";
+ else if (Play) Mode = Forward ? " X>> " : " <<X ";
+ else Mode = Forward ? " X|> " : " <|X ";
+ char buf[16];
+ strn0cpy(buf, Mode, sizeof(buf));
+ char *p = strchr(buf, 'X');
+ if (p)
+ *p = Speed > 0 ? '1' + Speed - 1 : ' ';
+
+ eDvbFont OldFont = Interface->SetFont(fontFix);
+ DisplayAtBottom(buf);
+ Interface->SetFont(OldFont);
+ }
}
}
@@ -2407,6 +2481,7 @@ bool cReplayControl::ShowProgress(bool Initial)
lastCurrent = Current;
}
lastTotal = Total;
+ ShowMode();
return true;
}
return false;
@@ -2428,7 +2503,7 @@ void cReplayControl::TimeSearchDisplay(void)
default: sprintf(buf + len, "--:--"); break;
}
- Interface->Write(12, 2, buf);
+ DisplayAtBottom(buf);
}
void cReplayControl::TimeSearchProcess(eKeys Key)
@@ -2485,7 +2560,8 @@ void cReplayControl::TimeSearchProcess(eKeys Key)
if (timeSearchHide)
Hide();
else
- Interface->Fill(12, 2, Width() - 22, 1, clrBackground);
+ DisplayAtBottom();
+ ShowMode();
}
}
@@ -2493,6 +2569,8 @@ void cReplayControl::TimeSearch(void)
{
timeSearchHH = timeSearchMM = timeSearchPos = 0;
timeSearchHide = false;
+ if (modeOnly)
+ Hide();
if (!visible) {
Show();
if (visible)
@@ -2596,7 +2674,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
Hide();
timeoutShow = 0;
}
- else
+ else if (!modeOnly)
shown = ShowProgress(!shown) || shown;
}
bool DisplayedFrames = displayFrames;
@@ -2605,13 +2683,16 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
TimeSearchProcess(Key);
return osContinue;
}
+ bool DoShowMode = true;
switch (Key) {
// Positioning:
case kUp: dvbApi->Play(); break;
case kDown: dvbApi->Pause(); break;
case kLeft|k_Release:
+ if (Setup.MultiSpeedMode) break;
case kLeft: dvbApi->Backward(); break;
case kRight|k_Release:
+ if (Setup.MultiSpeedMode) break;
case kRight: dvbApi->Forward(); break;
case kRed: TimeSearch(); break;
case kGreen|k_Repeat:
@@ -2622,6 +2703,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
dvbApi->StopReplay();
return osEnd;
default: {
+ DoShowMode = false;
switch (Key) {
// Editing:
//XXX should we do this only when the ProgressDisplay is on???
@@ -2647,6 +2729,8 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
}
}
}
+ if (DoShowMode)
+ ShowMode();
if (DisplayedFrames && !displayFrames)
Interface->Fill(0, 2, 11, 1, clrBackground);
return osContinue;