-
Notifications
You must be signed in to change notification settings - Fork 0
/
mediaobject.h
executable file
·60 lines (50 loc) · 1.41 KB
/
mediaobject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef LINK_H
#define LINK_H
#include <QString>
#include <QVariant>
#include "settings.h"
#include "treenode.h"
class MediaObject
{
public:
static const int DISPLAY_MAX_PROPERTIES = 2;
enum Data {
DATA_INVALID,
DATA_LINK,
DATA_TITLE,
DATA_PROGRESS,
DATA_IS_STARTED,
DATA_IS_FINISHED,
DATA_IS_CONTAINER,
DATA_IS_FAILED,
DATA_IS_SKIPPED,
DATA_DOWNLOADED_SIZE, // Indiciates the already downloaded amount
DATA_SPEED, // Indicates the current speed
DATA_MAX_SIZE, // Indicates the size of the download
DATA_TIME // Indicates the estimate time until the download finishes or the time needed when the download has finished
};
MediaObject(QString title, QString link, QString progress);
MediaObject(const MediaObject &other) = default;
QVariant getData(MediaObject::Data data);
void setData(MediaObject::Data data, QVariant value);
Settings *getSettings();
QVariant getSettingsValue(QString key);
void setTreeNode(TreeNode *treeNode);
TreeNode *getTreeNode();
private:
QString mTitle;
QString mLink;
QString mProgress;
bool mIsStarted;
bool mIsFinished;
bool mIsFailed;
bool mIsSkipped;
bool mIsContainer;
QString mMaxSize;
QString mSpeed;
QString mTime;
QString mDownloadedSize;
Settings settings;
TreeNode *treeNode;
};
#endif // LINK_H