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 
17 {
18  AD_DVD_SL = 0,
19  AD_DVD_DL = 1,
20  AD_DVD_RW = 2,
21  AD_FILE = 3
22 };
23 
25 
27 {
29  const char *name;
30  const char *description;
31  int64_t freeSpace;
32 };
33 
35 extern int ArchiveDestinationsCount;
36 
38 {
39  QString name;
40  QString description;
41  float bitrate { 0.0F };
42 };
43 
44 struct ThumbImage
45 {
46  QString caption;
47  QString filename;
48  qint64 frame { 0 };
49 };
50 
52 {
53  int id { 0 };
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 { 0 };
62  int64_t newsize { 0 };
63  int duration { 0 };
64  int cutDuration { 0 };
66  QString fileCodec;
67  QString videoCodec;
68  int videoWidth { 0 };
69  int videoHeight { 0 };
70  bool hasCutlist { false };
71  bool useCutlist { false };
72  bool editedDetails { false };
73  QList<ThumbImage*> thumbList;
74 };
75 
76 QString formatSize(int64_t sizeKB, int prec = 2);
77 QString getTempDirectory(bool showError = false);
78 void checkTempDirectory();
79 bool extractDetailsFromFilename(const QString &inFile,
80  QString &chanID, QString &startTime);
81 ProgramInfo *getProgramInfoForFile(const QString &inFile);
83 void recalcItemSize(ArchiveItem *item);
84 QString getBaseName(const QString &filename);
85 void showWarningDialog(const QString &msg);
86 
89 
90 #endif
ARCHIVEDESTINATION
Definition: archiveutil.h:16
QString filename
Definition: archiveutil.h:47
QString caption
Definition: archiveutil.h:46
bool hasCutlist
Definition: archiveutil.h:70
const char * description
Definition: archiveutil.h:30
bool useCutlist
Definition: archiveutil.h:71
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:67
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:72
QString description
Definition: archiveutil.h:40
int cutDuration
Definition: archiveutil.h:64
QString getBaseName(const QString &filename)
const char * name
Definition: archiveutil.h:29
void checkTempDirectory()
Definition: archiveutil.cpp:95
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)
int videoHeight
Definition: archiveutil.h:69
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:73
void showWarningDialog(const QString &msg)