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 enum ARCHIVEDESTINATION : std::uint8_t
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 
34 extern std::vector<ArchiveDestination> ArchiveDestinations;
35 
37 {
38  QString name;
39  QString description;
40  float bitrate { 0.0F };
41 };
42 
43 struct ThumbImage
44 {
45  QString caption;
46  QString filename;
47  qint64 frame { 0 };
48 };
49 
51 {
52  int id { 0 };
53  QString type;
54  QString title;
55  QString subtitle;
56  QString description;
57  QString startDate;
58  QString startTime;
59  QString filename;
60  int64_t size { 0 };
61  int64_t newsize { 0 };
62  int duration { 0 };
63  int cutDuration { 0 };
65  QString fileCodec;
66  QString videoCodec;
67  int videoWidth { 0 };
68  int videoHeight { 0 };
69  bool hasCutlist { false };
70  bool useCutlist { false };
71  bool editedDetails { false };
72  QList<ThumbImage*> thumbList;
73 };
74 
75 QString getTempDirectory(bool showError = false);
76 void checkTempDirectory();
77 bool extractDetailsFromFilename(const QString &inFile,
78  QString &chanID, QString &startTime);
79 ProgramInfo *getProgramInfoForFile(const QString &inFile);
81 void recalcItemSize(ArchiveItem *item);
82 QString getBaseName(const QString &filename);
83 void showWarningDialog(const QString &msg);
84 
87 
88 #endif
ArchiveDestination::description
const char * description
Definition: archiveutil.h:30
getFileDetails
bool getFileDetails(ArchiveItem *a)
Definition: archiveutil.cpp:201
ArchiveDestination
Definition: archiveutil.h:26
ArchiveItem::useCutlist
bool useCutlist
Definition: archiveutil.h:70
AD_FILE
@ AD_FILE
Definition: archiveutil.h:21
ThumbImage::caption
QString caption
Definition: archiveutil.h:45
EncoderProfile::bitrate
float bitrate
Definition: archiveutil.h:40
ThumbImage::filename
QString filename
Definition: archiveutil.h:46
EncoderProfile
Definition: archiveutil.h:36
EncoderProfile::description
QString description
Definition: archiveutil.h:39
extractDetailsFromFilename
bool extractDetailsFromFilename(const QString &inFile, QString &chanID, QString &startTime)
Definition: archiveutil.cpp:133
ArchiveItem::newsize
int64_t newsize
Definition: archiveutil.h:61
ArchiveDestination::freeSpace
int64_t freeSpace
Definition: archiveutil.h:31
AD_DVD_RW
@ AD_DVD_RW
Definition: archiveutil.h:20
getProgramInfoForFile
ProgramInfo * getProgramInfoForFile(const QString &inFile)
Definition: archiveutil.cpp:163
ArchiveItem::videoWidth
int videoWidth
Definition: archiveutil.h:67
ArchiveDestinations
std::vector< ArchiveDestination > ArchiveDestinations
Definition: archiveutil.cpp:27
ArchiveItem::startTime
QString startTime
Definition: archiveutil.h:58
ArchiveItem::duration
int duration
Definition: archiveutil.h:62
ArchiveItem::title
QString title
Definition: archiveutil.h:54
ArchiveItem::cutDuration
int cutDuration
Definition: archiveutil.h:63
getBaseName
QString getBaseName(const QString &filename)
Definition: archiveutil.cpp:123
ArchiveItem::type
QString type
Definition: archiveutil.h:53
ARCHIVEDESTINATION
ARCHIVEDESTINATION
Definition: archiveutil.h:16
recalcItemSize
void recalcItemSize(ArchiveItem *item)
Definition: archiveutil.cpp:283
ArchiveItem::size
int64_t size
Definition: archiveutil.h:60
ArchiveDestination::type
ARCHIVEDESTINATION type
Definition: archiveutil.h:28
ThumbImage::frame
qint64 frame
Definition: archiveutil.h:47
ArchiveItem::startDate
QString startDate
Definition: archiveutil.h:57
ThumbImage
Definition: archiveutil.h:43
ArchiveItem::encoderProfile
EncoderProfile * encoderProfile
Definition: archiveutil.h:64
AD_DVD_SL
@ AD_DVD_SL
Definition: archiveutil.h:18
AD_DVD_DL
@ AD_DVD_DL
Definition: archiveutil.h:19
ArchiveItem::thumbList
QList< ThumbImage * > thumbList
Definition: archiveutil.h:72
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
ArchiveItem::videoHeight
int videoHeight
Definition: archiveutil.h:68
ArchiveItem::fileCodec
QString fileCodec
Definition: archiveutil.h:65
ArchiveItem::description
QString description
Definition: archiveutil.h:56
showWarningDialog
void showWarningDialog(const QString &msg)
Definition: archiveutil.cpp:274
ArchiveItem::hasCutlist
bool hasCutlist
Definition: archiveutil.h:69
ArchiveItem::subtitle
QString subtitle
Definition: archiveutil.h:55
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(ARCHIVEDESTINATION)
ArchiveItem
Definition: archiveutil.h:50
checkTempDirectory
void checkTempDirectory()
Definition: archiveutil.cpp:70
getTempDirectory
QString getTempDirectory(bool showError=false)
Definition: archiveutil.cpp:46
build_compdb.filename
filename
Definition: build_compdb.py:21
ArchiveItem::filename
QString filename
Definition: archiveutil.h:59
EncoderProfile::name
QString name
Definition: archiveutil.h:38
ArchiveItem::videoCodec
QString videoCodec
Definition: archiveutil.h:66
ArchiveDestination::name
const char * name
Definition: archiveutil.h:29
ArchiveItem::editedDetails
bool editedDetails
Definition: archiveutil.h:71