vdr  1.7.31
Static Public Member Functions | Static Private Attributes | List of all members
cVideoDiskUsage Class Reference

#include <videodir.h>

Static Public Member Functions

static bool HasChanged (int &State)
static void ForceCheck (void)
static cString String (void)
static int UsedPercent (void)
static int FreeMB (void)
static int FreeMinutes (void)
static bool HasChanged (int &State)
static void ForceCheck (void)
static cString String (void)
static int UsedPercent (void)
static int FreeMB (void)
static int FreeMinutes (void)

Static Private Attributes

static int state = 0
static time_t lastChecked = 0
static int usedPercent = 0
static int freeMB = 0
static int freeMinutes = 0

Detailed Description

Definition at line 31 of file include/vdr/videodir.h.

Member Function Documentation

static void cVideoDiskUsage::ForceCheck ( void  )
inlinestatic

To avoid unnecessary load, the video disk usage is only actually checked every DISKSPACECHEK seconds.

Calling ForceCheck() makes sure that the next call to HasChanged() will check the disk usage immediately. This is useful in case some files have been deleted and the result shall be displayed instantly.

Definition at line 45 of file include/vdr/videodir.h.

References lastChecked.

Referenced by cMenuRecordings::Delete().

static void cVideoDiskUsage::ForceCheck ( void  )
inlinestatic

To avoid unnecessary load, the video disk usage is only actually checked every DISKSPACECHEK seconds.

Calling ForceCheck() makes sure that the next call to HasChanged() will check the disk usage immediately. This is useful in case some files have been deleted and the result shall be displayed instantly.

Definition at line 45 of file videodir.h.

References lastChecked.

static int cVideoDiskUsage::FreeMB ( void  )
inlinestatic

Returns the amount of free space on the video disk in MB.

The caller should call HasChanged() first, to make sure the value is up to date.

Definition at line 59 of file include/vdr/videodir.h.

References freeMB.

Referenced by HasChanged().

static int cVideoDiskUsage::FreeMB ( void  )
inlinestatic

Returns the amount of free space on the video disk in MB.

The caller should call HasChanged() first, to make sure the value is up to date.

Definition at line 59 of file videodir.h.

References freeMB.

static int cVideoDiskUsage::FreeMinutes ( void  )
inlinestatic

Returns the number of minutes that can still be recorded on the video disk.

This is an estimate and depends on the data rate of the existing recordings. There is no guarantee that this value will actually be met. The caller should call HasChanged() first, to make sure the value is up to date.

Definition at line 62 of file include/vdr/videodir.h.

References freeMinutes.

Referenced by cSkinLCARSDisplayMenu::DrawDisk().

static int cVideoDiskUsage::FreeMinutes ( void  )
inlinestatic

Returns the number of minutes that can still be recorded on the video disk.

This is an estimate and depends on the data rate of the existing recordings. There is no guarantee that this value will actually be met. The caller should call HasChanged() first, to make sure the value is up to date.

Definition at line 62 of file videodir.h.

References freeMinutes.

bool cVideoDiskUsage::HasChanged ( int &  State)
static

Returns true if the usage of the video disk space has changed since the last call to this function with the given State variable.

The caller should initialize State to -1, and it will be set to the current internal state value of the video disk usage checker upon return. Future calls with the same State variable can then quickly check for changes.

Definition at line 394 of file videodir.c.

References DISKSPACECHEK, freeMB, FreeMB(), freeMinutes, lastChecked, MB_PER_MINUTE, cRecordings::MBperMinute(), Recordings, state, usedPercent, UsedPercent(), and VideoDiskSpace().

Referenced by cSkinLCARSDisplayMenu::DrawDisk(), cSkinClassicDisplayMenu::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinSTTNGDisplayMenu::Flush(), and String().

static bool cVideoDiskUsage::HasChanged ( int &  State)
static

Returns true if the usage of the video disk space has changed since the last call to this function with the given State variable.

The caller should initialize State to -1, and it will be set to the current internal state value of the video disk usage checker upon return. Future calls with the same State variable can then quickly check for changes.

cString cVideoDiskUsage::String ( void  )
static

Returns a localized string of the form "Disk nn% - hh:mm free".

This function is mainly for use in skins that want to retain the display of the free disk space in the menu title, as was the case until VDR version 1.7.27. An implicit call to HasChanged() is done in this function, to make sure the returned value is up to date.

Definition at line 417 of file videodir.c.

References freeMinutes, HasChanged(), cString::sprintf(), state, tr, and usedPercent.

Referenced by cSkinClassicDisplayMenu::DrawTitle(), cSkinCursesDisplayMenu::DrawTitle(), and cSkinSTTNGDisplayMenu::DrawTitle().

static cString cVideoDiskUsage::String ( void  )
static

Returns a localized string of the form "Disk nn% - hh:mm free".

This function is mainly for use in skins that want to retain the display of the free disk space in the menu title, as was the case until VDR version 1.7.27. An implicit call to HasChanged() is done in this function, to make sure the returned value is up to date.

static int cVideoDiskUsage::UsedPercent ( void  )
inlinestatic

Returns the used space of the video disk in percent.

The caller should call HasChanged() first, to make sure the value is up to date.

Definition at line 56 of file include/vdr/videodir.h.

References usedPercent.

Referenced by cSkinLCARSDisplayMenu::DrawDisk(), and HasChanged().

static int cVideoDiskUsage::UsedPercent ( void  )
inlinestatic

Returns the used space of the video disk in percent.

The caller should call HasChanged() first, to make sure the value is up to date.

Definition at line 56 of file videodir.h.

References usedPercent.

Member Data Documentation

static int cVideoDiskUsage::freeMB = 0
staticprivate

Definition at line 36 of file include/vdr/videodir.h.

Referenced by FreeMB(), and HasChanged().

static int cVideoDiskUsage::freeMinutes = 0
staticprivate

Definition at line 37 of file include/vdr/videodir.h.

Referenced by FreeMinutes(), HasChanged(), and String().

static time_t cVideoDiskUsage::lastChecked = 0
staticprivate

Definition at line 34 of file include/vdr/videodir.h.

Referenced by ForceCheck(), and HasChanged().

static int cVideoDiskUsage::state = 0
staticprivate

Definition at line 33 of file include/vdr/videodir.h.

Referenced by HasChanged(), and String().

static int cVideoDiskUsage::usedPercent = 0
staticprivate

Definition at line 35 of file include/vdr/videodir.h.

Referenced by HasChanged(), String(), and UsedPercent().


The documentation for this class was generated from the following files: