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 
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 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::description
const char * description
Definition: archiveutil.h:30
getFileDetails
bool getFileDetails(ArchiveItem *a)
Definition: archiveutil.cpp:221
ArchiveDestination
Definition: archiveutil.h:27
ArchiveItem::useCutlist
bool useCutlist
Definition: archiveutil.h:70
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:37
EncoderProfile::description
QString description
Definition: archiveutil.h:39
extractDetailsFromFilename
bool extractDetailsFromFilename(const QString &inFile, QString &chanID, QString &startTime)
Definition: archiveutil.cpp:155
AD_DVD_SL
@ AD_DVD_SL
Definition: archiveutil.h:18
ArchiveItem::newsize
int64_t newsize
Definition: archiveutil.h:61
ArchiveDestination::freeSpace
int64_t freeSpace
Definition: archiveutil.h:31
getProgramInfoForFile
ProgramInfo * getProgramInfoForFile(const QString &inFile)
Definition: archiveutil.cpp:185
ArchiveItem::videoWidth
int videoWidth
Definition: archiveutil.h:67
ArchiveDestinations
std::vector< ArchiveDestination > ArchiveDestinations
Definition: archiveutil.cpp:28
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:145
ARCHIVEDESTINATION
ARCHIVEDESTINATION
Definition: archiveutil.h:17
ArchiveItem::type
QString type
Definition: archiveutil.h:53
recalcItemSize
void recalcItemSize(ArchiveItem *item)
Definition: archiveutil.cpp:303
ArchiveItem::size
int64_t size
Definition: archiveutil.h:60
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:47
ArchiveItem::startDate
QString startDate
Definition: archiveutil.h:57
ThumbImage
Definition: archiveutil.h:44
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
ArchiveItem::encoderProfile
EncoderProfile * encoderProfile
Definition: archiveutil.h:64
ArchiveItem::thumbList
QList< ThumbImage * > thumbList
Definition: archiveutil.h:72
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
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:294
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:69
ArchiveItem::subtitle
QString subtitle
Definition: archiveutil.h:55
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(ARCHIVEDESTINATION)
formatSize
QString formatSize(int64_t sizeKB, int prec=2)
Definition: archiveutil.cpp:47
ArchiveItem
Definition: archiveutil.h:51
checkTempDirectory
void checkTempDirectory()
Definition: archiveutil.cpp:92
getTempDirectory
QString getTempDirectory(bool showError=false)
Definition: archiveutil.cpp:68
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