mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
VDR developer version 2.1.1 is now available at ftp://ftp.tvdr.de/vdr/Developer/vdr-2.1.1.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-2.0.0-2.1.1.diff MD5 checksums: b17f9838bb8ddee9620f838fea7a171d vdr-2.1.1.tar.bz2 8b8ca593885c380cd370e6d19a5b16a1 vdr-2.0.0-2.1.1.diff WARNING: ======== This is a *developer* version. Even though *I* use it in my productive environment, I strongly recommend that you only use it under controlled conditions and for testing and debugging. The main focus of this version is on adding basic support for positioners to control steerable satellite dishes. Manually controlling the dish position and storing individual positions will follow later. The fixes contained in this version will be released in a stable version 2.0.3 later, if there are no problems. From the HISTORY file: - Fixed initializing cDevice::keepTracks. - Fixed an endless loop in cTextWrapper::Set() in case the given Width is smaller than one character (reported by Stefan Braun). - Removed all "modified since version 1.6" markers from PLUGINS.html. - Added definitions for older DVB API versions, back until 5.0 (based on a patch from Udo Richter). - Changed cThread::SetIOPriority() from "best effort class" to "idle class" in order to improve overall performance when an editing process is running (thanks to Jochen Dolze). - Fixed handling '/' and '~' in recording file names in case DirectoryEncoding is used (thanks to Lars Hanisch). - Changed the sign of the satellite position value in cSource to reflect the standard of western values being negative. The new member function cSource::Position() can be used to retrieve the orbital position of a satellite. - Fixed multiple occurrences of the same directory in the recordings list in case there are directories that only differ in non-alphanumeric characters (was broken by "Fixed selecting the last replayed recording in the Recordings menu in case there are folders and plain recordings with names that differ only in non-alphanumeric characters" in version 1.7.36). - Fixed displaying the frame number when setting an editing mark (thanks to Thomas Günther). - Fixed no longer generating any editing marks if the edited recording results in just one single sequence (reported by Halim Sahin). - Fixed an error message when parsing SCR values in diseqc.conf. - Fixed an unexpected RCS version tag in the newplugin script. - Fixed an endless loop in the DrawEllipse() functions for very small ellipses (reported by Stefan Braun). - Fixed a crash in the LCARS skin's main menu in case there is no current channel (reported by Dominique Dumont). - Added basic support for positioners to control steerable satellite dishes (based on a patch from Seppo Ingalsuo and Ales Jurik). + Supports GotoN (aka "DiSEqC 1.2") and GotoX (aka "USALS"). + The new DiSEqC command code 'P' can be used to instruct a positioner to move the dish to the required satellite position. When a 'P' code is processed, further execution of the remaining DiSEqC sequence (if any) is postponed until the positioner has reached the new satellite position. + The new special source value of "S360E" can be used in diseqc.conf to indicate that an entry using a positioner can move the dish to any requested position within its range. Think of it as "full circle". + The devices a particular cDiseqc or cScr applies to are now stored directly in each cDiseqc or cScr, respectively. + A plugin can implement a custom positioner control (see PLUGINS.html, section "Positioners"). + The new function cSkinDisplayChannel::SetPositioner() can be implemented by skins to show the user a progress display when the dish is being moved. The default implementation calls SetMessage() with a string indicating the new position the dish is being moved to. The LCARS skin shows a progress bar indicating the movement of the dish. + The new parameters "Site latitude", "Site longitude", "Positioner speed", and "Positioner swing" in the "Setup/LNB" menu can be used to configure the necessary values for a steerable dish. + The cDvbTuner now has a new status tsPositioning, in which it waits until a steerable dish has reached its target position. Parsing SI data is paused until the target position has been reached. - The LCARS skin now shows the source value of the current channel in its channel display. - Fixed asserting free disk space in the cutter. - No longer trying to delete old recordings in AssertFreeDiskSpace() if the given Priority is less than 1. - Fixed handling LIRC events in case repeated events are lost. - Fixed a possible crash when shutting down VDR while subtitles are being displayed (reported by Ville Skyttä). - cDevice::IsPrimaryDevice() now also checks whether the primary device actually has a decoder and returns false otherwise. This should improve device allocation on systems that are only used as a receiver and don't actually display anything. - Increased the value of MAXRETRIES to 20 to reduce the probability of disturbances in transfer mode. - All bonded devices (except for the master) now turn off their LNB power completely to avoid problems when receiving vertically polarized transponders (suggested by Manfred Völkel and Oliver Endriss). - Reverted the change from version 1.5.7 that made all logging go to LOG_ERR (thanks to Christopher Reimer). - Added Begin/EndSegmentTransfer() to the EPG handler interface (thanks to Jörg Wendel). - The code for distributing recordings over several video directories is now deprecated and disabled by default. You can re-enable this feature by removing the comment sign ('//') from the beginning of the line //#define DEPRECATED_DISTRIBUTED_VIDEODIR // Code enclosed with this macro is ... in the file videodir.c. Note, though, that this can only be a temporary workaround. This feature will be completely removed in one of the next developer versions. Distributing the video directory over several disks was a useful feature in times when disks were still relatively small, but it also caused serious problems in case one of the disks failed. Nowadays hard disks come in sizes measured in terabytes, and tools like "mhddfs" can be used to combine several disks to form one large volume. A recommended method for a relatively safe disk setup in a VDR system is to use two 1TB (or larger) disks and use them as a RAID-1 (mirrored). That way, if one disk fails, you can replace it without data loss.
116 lines
5.2 KiB
C++
116 lines
5.2 KiB
C++
/*
|
|
* shutdown.h: Handling of shutdown and inactivity
|
|
*
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
* how to reach the author.
|
|
*
|
|
* Original version written by Udo Richter <udo_richter@gmx.de>.
|
|
*
|
|
* $Id: shutdown.h 3.0 2013/02/18 10:35:27 kls Exp $
|
|
*/
|
|
|
|
#ifndef __SHUTDOWN_H
|
|
#define __SHUTDOWN_H
|
|
|
|
#include <time.h>
|
|
|
|
class cCountdown {
|
|
private:
|
|
time_t timeout; ///< 5-minute countdown timer
|
|
int counter; ///< last shown time in 10s units
|
|
bool timedOut; ///< countdown did run down to 0 and was not canceled
|
|
const char *message; ///< message to display, %s is placeholder for time
|
|
public:
|
|
cCountdown(void);
|
|
void Start(const char *Message, int Seconds);
|
|
///< Start the 5 minute shutdown warning countdown.
|
|
void Cancel(void);
|
|
///< Cancel the 5 minute shutdown warning countdown.
|
|
bool Done(void);
|
|
///< Check if countdown timer has run out without canceling.
|
|
operator bool(void) const { return timeout != 0; }
|
|
///< Check if countdown is running.
|
|
bool Update(void);
|
|
///< Update status display of the countdown.
|
|
///< Returns true on actual update.
|
|
};
|
|
|
|
class cShutdownHandler {
|
|
private:
|
|
time_t activeTimeout;
|
|
///< Time when VDR will become non-interactive. 0 means never, 1 means unknown time ago.
|
|
time_t retry;
|
|
///< Time for retrying the shutdown.
|
|
char *shutdownCommand;
|
|
///< Command for shutting down VDR.
|
|
int exitCode;
|
|
///< Exit code, if VDR exit was requested, or -1 if not requested.
|
|
bool emergencyExitRequested;
|
|
///< The requested exit is an emergency exit.
|
|
public:
|
|
cCountdown countdown;
|
|
cShutdownHandler(void);
|
|
~cShutdownHandler();
|
|
void Exit(int ExitCode) { exitCode = ExitCode; }
|
|
///< Set VDR exit code and initiate end of VDR main loop.
|
|
///< This will exit VDR without any confirmation.
|
|
bool DoExit(void) { return exitCode >= 0; }
|
|
///< Check if an exit code was set, and VDR should exit.
|
|
int GetExitCode(void) { return exitCode >= 0 ? exitCode : 0; }
|
|
///< Get the currently set exit code of VDR.
|
|
bool EmergencyExitRequested(void) { return emergencyExitRequested; }
|
|
///< Returns true if an emergency exit was requested.
|
|
void RequestEmergencyExit(void);
|
|
///< Requests an emergency exit of the VDR main loop.
|
|
void CheckManualStart(int ManualStart);
|
|
///< Check whether the next timer is in ManualStart time window.
|
|
///< If yes, assume non-interactive use.
|
|
void SetShutdownCommand(const char *ShutdownCommand);
|
|
///< Set the command string for shutdown command.
|
|
void CallShutdownCommand(time_t WakeupTime, int Channel, const char *File, bool UserShutdown);
|
|
///< Call the shutdown command with the given parameters.
|
|
bool IsUserInactive(time_t AtTime = 0) { return activeTimeout && activeTimeout <= (AtTime ? AtTime : time(NULL)); }
|
|
///< Check whether VDR is in interactive mode or non-interactive mode (waiting for shutdown).
|
|
///< AtTime checks whether VDR will probably be inactive at that time.
|
|
time_t GetUserInactiveTime(void) { return activeTimeout; }
|
|
///< Time when user will become non-inactive, or 0 if never, 1 if a long time ago
|
|
void SetUserInactiveTimeout(int Seconds = -1, bool Force = false);
|
|
///< Set the time in the future when VDR will switch into non-interactive mode or power down.
|
|
///< Seconds >= 0 means that many seconds in the future.
|
|
///< Seconds = -1 means Setup.MinUserInactivity in the future.
|
|
///< Seconds = -2 means never.
|
|
///< Seconds = -3 means a long, unknown time ago.
|
|
///< Setup.MinUserInactivity = 0 will overrule this, unless Force = true is given.
|
|
///< If Setup.MinUserInactivity = 0 and Force = false, Seconds is ignored and VDR will
|
|
///< stay interactive forever (like Seconds = -2).
|
|
void SetUserInactive(void) { SetUserInactiveTimeout(0, true); }
|
|
///< Set VDR manually into non-interactive mode from now on.
|
|
bool Retry(time_t AtTime = 0) { return retry <= (AtTime ? AtTime : time(NULL)); }
|
|
///< Check whether its time to re-try the shutdown.
|
|
///< AtTime checks whether VDR will probably be inactive at that time.
|
|
time_t GetRetry(void) { return retry; }
|
|
///< Time when shutdown retry block ends.
|
|
void SetRetry(int Seconds) { retry = time(NULL) + Seconds; }
|
|
///< Set shutdown retry so that VDR will not try to automatically shut down
|
|
///< within Seconds.
|
|
bool ConfirmShutdown(bool Ask);
|
|
///< Check for background activity that blocks shutdown.
|
|
///< Returns immediately and without user interaction if Ask = false.
|
|
///< Asks for confirmation if Ask = true.
|
|
///< Returns true if ready for shutdown.
|
|
bool ConfirmRestart(bool Ask);
|
|
///< Check for background activity that blocks restart.
|
|
///< Returns immediately and without user interaction if Ask = false.
|
|
///< Asks for confirmation if Ask = true.
|
|
///< Returns true if ready for restart.
|
|
bool DoShutdown(bool Force);
|
|
///< Call the shutdown script with data of the next pending timer.
|
|
///< Fails if Force = false and a timer is running or within MinEventTimeout.
|
|
///< Always calls shutdown on Force = true.
|
|
///< Returns true on success.
|
|
};
|
|
|
|
extern cShutdownHandler ShutdownHandler;
|
|
|
|
#endif
|