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