-
Notifications
You must be signed in to change notification settings - Fork 0
/
tpmainwindow.h
212 lines (136 loc) · 4.83 KB
/
tpmainwindow.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#ifndef TPMAINWINDOW_H
#define TPMAINWINDOW_H
#include <QMainWindow>
#include <QDesktopWidget>
#include "twitchapi.h"
#include "generichelper.h"
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonValue>
#include <QComboBox>
#include <QTreeWidgetItem>
#include "dialogoauthsetup.h"
#include "dialogpositioner.h"
#include "dialoglaunch.h"
#include "processlauncher.h"
#include "dialogoptions.h"
#include <QSystemTrayIcon>
#include <QInputDialog>
#include <QCloseEvent>
#include <QThread>
//#include <streamtablemodel.h>
#include <QStandardItemModel>
#include "advqsortfilterproxymodel.h"
#include "imageloader.h"
#include "updatecheck.h"
namespace Ui {
class tpMainWindow;
}
class tpMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit tpMainWindow(QWidget *parent = 0);
~tpMainWindow();
private slots:
void onChannelAccessTokenReady(const QJsonDocument &jsonResponseBuffer);
void startM3u8Player(QString m3u8playlist);
void updateFromJsonResponseFollows(const QJsonDocument &jsonResponseBuffer);
void updateFromJsonResponseBookmark(const QJsonDocument &jsonResponseBuffer);
void updateFromJsonResponseStream(const QJsonDocument &jsonResponseBuffer);
void updateFromJsonResponseChannel(const QJsonDocument &jsonResponseBuffer);
void updateFromJsonResponseHost(const QJsonDocument &jsonResponseBuffer);
void on_actionSetup_Twitch_Auth_triggered();
void on_updateNotify(const QString &latestVersion);
void on_actionPositioner_triggered();
void on_actionTwitch_Browser_triggered();
void on_actionHexChat_triggered();
void trayIconClicked(QSystemTrayIcon::ActivationReason);
void on_notifyByTray(QString title, QString message);
void on_actionAbout_triggered();
void on_actionAbout_Qt_triggered();
void on_actionReport_Bug_triggered();
void on_actionRefresh_triggered();
void myQuit();
void on_loadData();
void openStreamBrowser();
void openStreamBrowserBookmark();
void openChatHexChat();
void addBookmarkHosted();
void deleteBookmark();
void addBookmark();
void on_actionOptions_triggered();
void on_actionQuit_triggered();
void on_actionCredits_triggered();
void on_actionShow_Offline_Streamers_toggled(bool arg1);
void on_Ready();
void on_SwitchInputEnabled(bool enable);
void on_actionShow_Offline_Streamers_triggered();
void on_tableView_customContextMenuRequested(const QPoint &pos);
void on_tableView_doubleClicked(const QModelIndex &index);
void on_tableViewBookmarks_doubleClicked(const QModelIndex &index);
void on_tableViewBookmarks_customContextMenuRequested(const QPoint &pos);
void on_actionLogfile_triggered();
void on_tabWidget_currentChanged(int index);
private:
Ui::tpMainWindow *ui;
QString currentScreenResolution;
QString streamResolution;
QStringList viewerStreams;
QString version;
int streamWidth;
int streamHeight;
int xOffset;
int yOffset;
bool launchBookmarkEnabled;
QStandardItemModel *stmodel;
AdvQSortFilterProxyModel *stproxymodel;
QStandardItemModel *stmodelbookmarks;
AdvQSortFilterProxyModel *stproxymodelbookmarks;
QPixmap offline;
QPixmap online;
bool showOfflineStreamers;
QTimer *refreshTimer;
int updateInterval;
dialogOauthSetup *diaOauthSetup;
DialogPositioner *diaPositioner;
DialogLaunch *diaLaunch;
DialogOptions *diaOptions;
QDesktopWidget *desktop;
void updateCurrentScreenData();
void disableInput();
void enableInput();
void loadBookmarks();
void saveBookmarks();
void enableDelete();
void disableDelete();
void loadData();
QList<QThread*> playerThreads;
// tray icon
void closeEvent(QCloseEvent *); // Overriding the window's close event
QAction *open;
QAction *close;
void createActions();
void createTrayIcon();
void setIcon(QString iconname = "agtv_32");
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
bool localTitleEdit;
//tableview context meu
QAction *open_in_browser;
QAction *open_in_browser_bookmark;
QAction *open_in_hexchat;
QAction *delete_bookmark;
QAction *add_bookmark;
QAction *add_hosted_bookmark;
updateCheck *uc;
QString currArch;
TwitchApi *tw;
public slots:
void executePlayer(QString player, QString url, QString channel, int streamWidth, int streamHeight, int xOffset, int yOffset, bool mute=false, QString quality="best");
signals:
void setStreamTitle(QString, QString);
void setStreamUrl(QString);
};
#endif // TPMAINWINDOW_H