00001 /* 00002 archiveutil.h 00003 00004 some shared functions and types 00005 */ 00006 00007 #ifndef ARCHIVEUTIL_H_ 00008 #define ARCHIVEUTIL_H_ 00009 00010 #include <qstring.h> 00011 00012 class ProgramInfo; 00013 00014 typedef enum 00015 { 00016 AD_DVD_SL = 0, 00017 AD_DVD_DL = 1, 00018 AD_DVD_RW = 2, 00019 AD_FILE = 3 00020 } ARCHIVEDESTINATION; 00021 00022 typedef struct ArchiveDestination 00023 { 00024 ARCHIVEDESTINATION type; 00025 QString name; 00026 QString description; 00027 long long freeSpace; 00028 }_ArchiveDestination; 00029 00030 extern struct ArchiveDestination ArchiveDestinations[]; 00031 extern int ArchiveDestinationsCount; 00032 00033 typedef struct 00034 { 00035 QString name; 00036 QString description; 00037 float bitrate; 00038 } EncoderProfile; 00039 00040 typedef struct ThumbImage 00041 { 00042 QString caption; 00043 QString filename; 00044 int64_t frame; 00045 } ThumbImage; 00046 00047 typedef struct 00048 { 00049 int id; 00050 QString type; 00051 QString title; 00052 QString subtitle; 00053 QString description; 00054 QString startDate; 00055 QString startTime; 00056 QString filename; 00057 long long size; 00058 long long newsize; 00059 int duration; 00060 int cutDuration; 00061 EncoderProfile *encoderProfile; 00062 QString fileCodec; 00063 QString videoCodec; 00064 int videoWidth, videoHeight; 00065 bool hasCutlist; 00066 bool useCutlist; 00067 bool editedDetails; 00068 QPtrList<ThumbImage> thumbList; 00069 } ArchiveItem; 00070 00071 QString formatSize(long long sizeKB, int prec = 2); 00072 QString getTempDirectory(bool showError = false); 00073 void checkTempDirectory(); 00074 bool extractDetailsFromFilename(const QString &inFile, 00075 QString &chanID, QString &startTime); 00076 ProgramInfo *getProgramInfoForFile(const QString &inFile); 00077 bool getFileDetails(ArchiveItem *a); 00078 QString getBaseName(const QString &filename); 00079 void showWarningDialog(const QString msg); 00080 00081 #endif
1.5.5