vdr  1.7.31
videodir.h
Go to the documentation of this file.
1 /*
2  * videodir.h: Functions to maintain a distributed video directory
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: videodir.h 2.3 2012/09/30 11:01:15 kls Exp $
8  */
9 
10 #ifndef __VIDEODIR_H
11 #define __VIDEODIR_H
12 
13 #include <stdlib.h>
14 #include "tools.h"
15 
16 extern const char *VideoDirectory;
17 
18 void SetVideoDirectory(const char *Directory);
19 cUnbufferedFile *OpenVideoFile(const char *FileName, int Flags);
21 bool RenameVideoFile(const char *OldName, const char *NewName);
22 bool RemoveVideoFile(const char *FileName);
23 bool HardLinkVideoFile(const char *OldName, const char *NewName);
24 bool VideoFileSpaceAvailable(int SizeMB);
25 int VideoDiskSpace(int *FreeMB = NULL, int *UsedMB = NULL); // returns the used disk space in percent
26 cString PrefixVideoFileName(const char *FileName, char Prefix);
27 cString NewVideoFileName(const char *FileName, const char *NewDirName);
28 void RemoveEmptyVideoDirectories(const char *IgnoreFiles[] = NULL);
29 bool IsOnVideoDirectoryFileSystem(const char *FileName);
30 
31 class cVideoDiskUsage {
32 private:
33  static int state;
34  static time_t lastChecked;
35  static int usedPercent;
36  static int freeMB;
37  static int freeMinutes;
38 public:
39  static bool HasChanged(int &State);
45  static void ForceCheck(void) { lastChecked = 0; }
50  static cString String(void);
56  static int UsedPercent(void) { return usedPercent; }
59  static int FreeMB(void) { return freeMB; }
62  static int FreeMinutes(void) { return freeMinutes; }
67  };
68 
69 #endif //__VIDEODIR_H