MythTV  master
archiveutil.h
Go to the documentation of this file.
1 /*
2  archiveutil.h
3 
4  some shared functions and types
5 */
6 
7 #ifndef ARCHIVEUTIL_H_
8 #define ARCHIVEUTIL_H_
9 
10 #include <cstdint>
11 #include <QString>
12 #include <QMetaType>
13 
14 class ProgramInfo;
15 
16 typedef enum
17 {
18  AD_DVD_SL = 0,
19  AD_DVD_DL = 1,
20  AD_DVD_RW = 2,
21  AD_FILE = 3
23 
25 
26 typedef struct ArchiveDestination
27 {
29  const char *name;
30  const char *description;
31  int64_t freeSpace;
33 
35 extern int ArchiveDestinationsCount;
36 
37 typedef struct
38 {
39  QString name;
40  QString description;
41  float bitrate;
43 
44 typedef struct ThumbImage
45 {
46  QString caption;
47  QString filename;
48  qint64 frame;
49 } ThumbImage;
50 
51 typedef struct
52 {
53  int id;
54  QString type;
55  QString title;
56  QString subtitle;
57  QString description;
58  QString startDate;
59  QString startTime;
60  QString filename;
61  int64_t size;
62  int64_t newsize;
63  int duration;
66  QString fileCodec;
67  QString videoCodec;
68  int videoWidth, videoHeight;
69  bool hasCutlist;
70  bool useCutlist;
72  QList<ThumbImage*> thumbList;
73 } ArchiveItem;
74 
75 QString formatSize(int64_t sizeKB, int prec = 2);
76 QString getTempDirectory(bool showError = false);
77 void checkTempDirectory();
78 bool extractDetailsFromFilename(const QString &inFile,
79  QString &chanID, QString &startTime);
80 ProgramInfo *getProgramInfoForFile(const QString &inFile);
82 void recalcItemSize(ArchiveItem *item);
83 QString getBaseName(const QString &filename);
84 void showWarningDialog(const QString &msg);
85 
88 
89 #endif
ARCHIVEDESTINATION
Definition: archiveutil.h:16
QString filename
Definition: archiveutil.h:47
QString caption
Definition: archiveutil.h:46
bool hasCutlist
Definition: archiveutil.h:69
const char * description
Definition: archiveutil.h:30
bool useCutlist
Definition: archiveutil.h:70
struct ThumbImage ThumbImage
bool getFileDetails(ArchiveItem *a)
int videoWidth
Definition: archiveutil.h:68
qint64 frame
Definition: archiveutil.h:48
int64_t newsize
Definition: archiveutil.h:62
ARCHIVEDESTINATION type
Definition: archiveutil.h:28
QString startTime
Definition: archiveutil.h:59
void recalcItemSize(ArchiveItem *item)
QString filename
Definition: archiveutil.h:60
Holds information on recordings and videos.
Definition: programinfo.h:66
ProgramInfo * getProgramInfoForFile(const QString &inFile)
QString formatSize(int64_t sizeKB, int prec=2)
Definition: archiveutil.cpp:50
int ArchiveDestinationsCount
Definition: archiveutil.cpp:48
QString fileCodec
Definition: archiveutil.h:66
struct ArchiveDestination ArchiveDestinations[]
Definition: archiveutil.cpp:28
bool extractDetailsFromFilename(const QString &inFile, QString &chanID, QString &startTime)
bool editedDetails
Definition: archiveutil.h:71
QString description
Definition: archiveutil.h:40
int cutDuration
Definition: archiveutil.h:64
QString getBaseName(const QString &filename)
struct ArchiveDestination _ArchiveDestination
const char * name
Definition: archiveutil.h:29
void checkTempDirectory()
Definition: archiveutil.cpp:93
QString type
Definition: archiveutil.h:54
QString subtitle
Definition: archiveutil.h:56
QString videoCodec
Definition: archiveutil.h:67
QString getTempDirectory(bool showError=false)
Definition: archiveutil.cpp:71
QString startDate
Definition: archiveutil.h:58
QString title
Definition: archiveutil.h:55
EncoderProfile * encoderProfile
Definition: archiveutil.h:65
Q_DECLARE_METATYPE(ARCHIVEDESTINATION)
QString description
Definition: archiveutil.h:57
int64_t size
Definition: archiveutil.h:61
QString name
Definition: archiveutil.h:39
QList< ThumbImage * > thumbList
Definition: archiveutil.h:72
void showWarningDialog(const QString &msg)