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::description
const char * description
Definition: archiveutil.h:30
getFileDetails
bool getFileDetails(ArchiveItem *a)
Definition: archiveutil.cpp:224
ArchiveDestination
Definition: archiveutil.h:26
ArchiveItem::useCutlist
bool useCutlist
Definition: archiveutil.h:71
ThumbImage::caption
QString caption
Definition: archiveutil.h:46
EncoderProfile::bitrate
float bitrate
Definition: archiveutil.h:41
ThumbImage::filename
QString filename
Definition: archiveutil.h:47
EncoderProfile
Definition: archiveutil.h:37
EncoderProfile::description
QString description
Definition: archiveutil.h:40
extractDetailsFromFilename
bool extractDetailsFromFilename(const QString &inFile, QString &chanID, QString &startTime)
Definition: archiveutil.cpp:158
AD_DVD_SL
@ AD_DVD_SL
Definition: archiveutil.h:18
ArchiveItem::newsize
int64_t newsize
Definition: archiveutil.h:62
ArchiveDestination::freeSpace
int64_t freeSpace
Definition: archiveutil.h:31
getProgramInfoForFile
ProgramInfo * getProgramInfoForFile(const QString &inFile)
Definition: archiveutil.cpp:188
ArchiveItem::videoWidth
int videoWidth
Definition: archiveutil.h:68
ArchiveItem::startTime
QString startTime
Definition: archiveutil.h:59
ArchiveItem::duration
int duration
Definition: archiveutil.h:63
ArchiveDestinationsCount
int ArchiveDestinationsCount
Definition: archiveutil.cpp:48
ArchiveItem::title
QString title
Definition: archiveutil.h:55
ArchiveItem::cutDuration
int cutDuration
Definition: archiveutil.h:64
getBaseName
QString getBaseName(const QString &filename)
Definition: archiveutil.cpp:148
ARCHIVEDESTINATION
ARCHIVEDESTINATION
Definition: archiveutil.h:16
ArchiveItem::type
QString type
Definition: archiveutil.h:54
recalcItemSize
void recalcItemSize(ArchiveItem *item)
Definition: archiveutil.cpp:306
ArchiveItem::size
int64_t size
Definition: archiveutil.h:61
AD_DVD_RW
@ AD_DVD_RW
Definition: archiveutil.h:20
ArchiveDestination::type
ARCHIVEDESTINATION type
Definition: archiveutil.h:28
ThumbImage::frame
qint64 frame
Definition: archiveutil.h:48
ArchiveItem::startDate
QString startDate
Definition: archiveutil.h:58
ThumbImage
Definition: archiveutil.h:44
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
ArchiveItem::encoderProfile
EncoderProfile * encoderProfile
Definition: archiveutil.h:65
ArchiveItem::thumbList
QList< ThumbImage * > thumbList
Definition: archiveutil.h:73
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
ArchiveItem::videoHeight
int videoHeight
Definition: archiveutil.h:69
ArchiveItem::fileCodec
QString fileCodec
Definition: archiveutil.h:66
ArchiveItem::description
QString description
Definition: archiveutil.h:57
showWarningDialog
void showWarningDialog(const QString &msg)
Definition: archiveutil.cpp:297
ArchiveDestinations
struct ArchiveDestination ArchiveDestinations[]
Definition: archiveutil.cpp:28
AD_DVD_DL
@ AD_DVD_DL
Definition: archiveutil.h:19
AD_FILE
@ AD_FILE
Definition: archiveutil.h:21
ArchiveItem::hasCutlist
bool hasCutlist
Definition: archiveutil.h:70
ArchiveItem::subtitle
QString subtitle
Definition: archiveutil.h:56
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(ARCHIVEDESTINATION)
formatSize
QString formatSize(int64_t sizeKB, int prec=2)
Definition: archiveutil.cpp:50
ArchiveItem
Definition: archiveutil.h:51
checkTempDirectory
void checkTempDirectory()
Definition: archiveutil.cpp:95
getTempDirectory
QString getTempDirectory(bool showError=false)
Definition: archiveutil.cpp:71
ArchiveItem::filename
QString filename
Definition: archiveutil.h:60
EncoderProfile::name
QString name
Definition: archiveutil.h:39
ArchiveItem::videoCodec
QString videoCodec
Definition: archiveutil.h:67
ArchiveDestination::name
const char * name
Definition: archiveutil.h:29
ArchiveItem::editedDetails
bool editedDetails
Definition: archiveutil.h:72