summaryrefslogtreecommitdiff
path: root/vdr.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 /vdr.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 'vdr.c')
-rw-r--r--vdr.c59
1 files changed, 36 insertions, 23 deletions
diff --git a/vdr.c b/vdr.c
index efb5e1c..b288108 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.68 2001/09/01 14:50:40 kls Exp $
+ * $Id: vdr.c 1.73 2001/09/16 14:54:45 kls Exp $
*/
#define _GNU_SOURCE
@@ -50,6 +50,9 @@
#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown
+#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start
+
+#define VOLUMEDELTA 5 // used to increase/decrease the volume
static int Interrupted = 0;
@@ -328,7 +331,8 @@ int main(int argc, char *argv[])
if (!EITScanner.Active() && cDvbApi::CurrentChannel() != LastChannel) {
if (!Menu)
Menu = new cDisplayChannel(cDvbApi::CurrentChannel(), LastChannel > 0);
- PreviousChannel = LastChannel;
+ if (LastChannel > 0)
+ PreviousChannel = LastChannel;
LastChannel = cDvbApi::CurrentChannel();
}
// Timers and Recordings:
@@ -348,7 +352,7 @@ int main(int argc, char *argv[])
EITScanner.Activity();
LastActivity = time(NULL);
}
- if (*Interact) {
+ if (*Interact && key != kPower) {
switch ((*Interact)->ProcessKey(key)) {
case osMenu: DELETENULL(Menu);
Menu = new cMenuMain(ReplayControl);
@@ -390,10 +394,12 @@ int main(int argc, char *argv[])
else {
switch (key) {
// Toggle channels:
- case k0:
- if (PreviousChannel != cDvbApi::CurrentChannel())
- Channels.SwitchTo(PreviousChannel);
+ case k0: {
+ int CurrentChannel = cDvbApi::CurrentChannel();
+ Channels.SwitchTo(PreviousChannel);
+ PreviousChannel = CurrentChannel;
break;
+ }
// Direct Channel Select:
case k1 ... k9:
Menu = new cDisplayChannel(key);
@@ -402,17 +408,9 @@ int main(int argc, char *argv[])
case kLeft|k_Repeat:
case kLeft:
case kRight|k_Repeat:
- case kRight: {
- int SaveGroup = CurrentGroup;
- if (NORMALKEY(key) == kRight)
- CurrentGroup = Channels.GetNextGroup(CurrentGroup) ;
- else
- CurrentGroup = Channels.GetPrevGroup(CurrentGroup < 1 ? 1 : CurrentGroup);
- if (CurrentGroup < 0)
- CurrentGroup = SaveGroup;
- Menu = new cDisplayChannel(CurrentGroup, false, true);
+ case kRight:
+ Menu = new cDisplayChannel(NORMALKEY(key));
break;
- }
// Up/Down Channel Select:
case kUp|k_Repeat:
case kUp:
@@ -428,8 +426,19 @@ int main(int argc, char *argv[])
case kMenu: Menu = new cMenuMain(ReplayControl); break;
// Viewing Control:
case kOk: LastChannel = -1; break; // forces channel display
+ // Volume Control:
+ case kVolUp|k_Repeat:
+ case kVolUp:
+ case kVolDn|k_Repeat:
+ case kVolDn:
+ cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
+ break;
+ case kMute:
+ cDvbApi::PrimaryDvbApi->ToggleMute();
+ break;
// Power off:
case kPower: isyslog(LOG_INFO, "Power button pressed");
+ DELETENULL(*Interact);
if (!Shutdown) {
Interface->Error(tr("Can't shutdown - option '-s' not given!"));
break;
@@ -451,20 +460,24 @@ int main(int argc, char *argv[])
time_t Now = time(NULL);
if (Now - LastActivity > ACTIVITYTIMEOUT) {
// Shutdown:
- if (Shutdown && (Setup.MinUserInactivity && Now - LastActivity > Setup.MinUserInactivity * 60 || ForceShutdown)) {
- ForceShutdown = false;
+ if (Shutdown && Setup.MinUserInactivity && Now - LastActivity > Setup.MinUserInactivity * 60) {
cTimer *timer = Timers.GetNextActiveTimer();
time_t Next = timer ? timer->StartTime() : 0;
time_t Delta = timer ? Next - Now : 0;
- if (timer)
- dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next));
- if (!Next || Delta > Setup.MinEventTimeout * 60) {
- if (!LastActivity) {
+ if (!LastActivity) {
+ if (!timer || Delta > MANUALSTART) {
// Apparently the user started VDR manually
dsyslog(LOG_INFO, "assuming manual start of VDR");
LastActivity = Now;
- continue; // skip the rest of the housekeeping for now
+ continue; // don't run into the actual shutdown procedure below
}
+ else
+ LastActivity = 1;
+ }
+ if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
+ ForceShutdown = false;
+ if (timer)
+ dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next));
if (WatchdogTimeout > 0)
signal(SIGALRM, SIG_IGN);
if (Interface->Confirm(tr("Press any key to cancel shutdown"), LastActivity == 1 ? 5 : SHUTDOWNWAIT, true)) {