-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathglobalobjects.h
More file actions
81 lines (68 loc) · 1.84 KB
/
globalobjects.h
File metadata and controls
81 lines (68 loc) · 1.84 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef GLOBALOBJECTS_H
#define GLOBALOBJECTS_H
#include <QString>
#include <QVector>
#include <QIcon>
class MPVPlayer;
class DanmuPool;
class DanmuRender;
class PlayList;
class Blocker;
class QFont;
class QThread;
class QObject;
class QSettings;
class DanmuProvider;
class AnimeProvider;
class LabelModel;
class DownloadModel;
class DanmuManager;
class LANServer;
class ScriptManager;
class AppManager;
class AutoDownloadManager;
class QMainWindow;
class QElapsedTimer;
struct GlobalContext
{
void init();
QString lang{"en-US"};
QString dataPath;
QString tmpPath;
float devicePixelRatioF{1.0f};
int curMainPage{0};
qint64 startupTime;
QVector<QPair<QString, qint64>> stepTime;
qint64 tick(QElapsedTimer *timer, const QString &step);
QIcon getFontIcon(QChar iconChar, QColor fontColor);
};
class GlobalObjects
{
public:
static void init(QElapsedTimer *elapsedTimer = nullptr);
static void clear();
static MPVPlayer *mpvplayer;
static DanmuPool *danmuPool;
static DanmuRender *danmuRender;
static PlayList *playlist;
static Blocker *blocker;
static QFont* iconfont;
static QThread *workThread;
static QSettings *appSetting;
static DanmuProvider *danmuProvider;
static AnimeProvider *animeProvider;
static DownloadModel *downloadModel;
static DanmuManager *danmuManager;
static LANServer *lanServer;
static ScriptManager *scriptManager;
static AppManager *appManager;
static AutoDownloadManager *autoDownloadManager;
static QMainWindow *mainWindow;
static GlobalContext *context();
static QString normalFont;
static void setFont(const QString &font);
static constexpr const char *kikoVersion = "2.1.0";
static constexpr const int kikoVersionNum = 200100;
static void registerCustomSettingType();
};
#endif // GLOBALOBJECTS_H