/
videodlg.h
231 lines (178 loc) · 6.2 KB
/
videodlg.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#ifndef VIDEODLG_H_
#define VIDEODLG_H_
#include <QPointer>
#include <QStringList>
#include <mythscreentype.h>
#include <metadata/metadatadownload.h>
#include <metadata/metadataimagedownload.h>
#include <metadata/metadatacommon.h>
#include <metadata/parentalcontrols.h>
#include <metadata/quicksp.h>
class MythUIText;
class MythUIButtonList;
class MythUIButtonTree;
class MythUIButtonListItem;
class MythUIBusyDialog;
class MythUIImage;
class MythUIStateType;
class MythDialogBox;
class MythGenericTree;
class VideoMetadata;
class VideoScanner;
class QUrl;
enum ImageDownloadErrorState { esOK, esError, esTimeout };
class VideoDialog : public MythScreenType
{
Q_OBJECT
public:
enum DialogType { DLG_DEFAULT = 0, DLG_BROWSER = 0x1, DLG_GALLERY = 0x2,
DLG_TREE = 0x4, DLG_MANAGER = 0x8, dtLast };
enum BrowseType { BRS_FOLDER = 0, BRS_GENRE = 0x1, BRS_CATEGORY = 0x2,
BRS_YEAR = 0x4, BRS_DIRECTOR = 0x8, BRS_CAST = 0x10,
BRS_USERRATING = 0x20, BRS_INSERTDATE = 0x40,
BRS_TVMOVIE = 0x80, BRS_STUDIO = 0x100, btLast };
typedef simple_ref_ptr<class VideoList> VideoListPtr;
typedef QPointer<class VideoListDeathDelay> VideoListDeathDelayPtr;
static VideoListDeathDelayPtr &GetSavedVideoList();
public:
VideoDialog(MythScreenStack *lparent, QString lname,
VideoListPtr video_list, DialogType type,
BrowseType browse);
~VideoDialog();
bool Create();
bool keyPressEvent(QKeyEvent *levent);
private:
void searchStart();
public slots:
void searchComplete(QString string);
protected slots:
void Init(); /// Called after the screen is created by MythScreenStack
private slots:
void UpdatePosition();
void UpdateText(MythUIButtonListItem *);
void handleSelect(MythUIButtonListItem *);
void SetCurrentNode(MythGenericTree *);
void playVideo();
void playVideoAlt();
void playFolder();
void playVideoWithTrailers();
void playTrailer();
void SwitchTree();
void SwitchGallery();
void SwitchBrowse();
void SwitchManager();
void SwitchVideoFolderGroup();
void SwitchVideoGenreGroup();
void SwitchVideoCategoryGroup();
void SwitchVideoYearGroup();
void SwitchVideoDirectorGroup();
void SwitchVideoStudioGroup();
void SwitchVideoCastGroup();
void SwitchVideoUserRatingGroup();
void SwitchVideoInsertDateGroup();
void SwitchVideoTVMovieGroup();
void EditMetadata();
void VideoSearch(MythGenericTree *node = NULL,
bool automode = false);
void VideoAutoSearch(MythGenericTree *node = NULL);
void ResetMetadata();
void ToggleBrowseable();
void ToggleWatched();
void ToggleProcess();
void RemoveVideo();
void OnRemoveVideo(bool);
void VideoMenu();
void InfoMenu();
void ManageMenu();
void PlayMenu();
void DisplayMenu();
void ViewMenu();
void SettingsMenu();
void MetadataBrowseMenu();
void ChangeFilter();
void ToggleBrowseMode();
void ToggleFlatView();
void ViewPlot();
void ShowCastDialog();
void ShowHomepage();
bool DoItemDetailShow();
void ShowPlayerSettings();
void ShowExtensionSettings();
void ShowMetadataSettings();
void OnParentalChange(int amount);
// Called when the underlying data for an item changes
void OnVideoSearchListSelection(MetadataLookup *lookup);
void doVideoScan();
protected slots:
void reloadAllData(bool);
void reloadData();
void refreshData();
void UpdateItem(MythUIButtonListItem *item);
protected:
void customEvent(QEvent *levent);
virtual MythUIButtonListItem *GetItemCurrent();
virtual MythUIButtonListItem *GetItemByMetadata(VideoMetadata *metadata);
virtual void loadData();
void fetchVideos();
QString RemoteImageCheck(QString host, QString filename);
QString GetCoverImage(MythGenericTree *node);
QString GetFirstImage(MythGenericTree *node, QString type,
QString gpnode = QString(), int levels = 0);
QString GetImageFromFolder(VideoMetadata *metadata);
QString GetScreenshot(MythGenericTree *node);
QString GetBanner(MythGenericTree *node);
QString GetFanart(MythGenericTree *node);
void handleDownloadedImages(MetadataLookup *lookup);
VideoMetadata *GetMetadata(MythUIButtonListItem *item);
void handleDirSelect(MythGenericTree *node);
bool goBack();
void setParentalLevel(const ParentalLevel::Level &level);
void shiftParental(int amount);
bool createPopup();
void createBusyDialog(QString title);
void createOkDialog(QString title);
void SwitchLayout(DialogType type, BrowseType browse);
void StartVideoImageSet(MythGenericTree *node, QStringList coverart = QStringList(),
QStringList fanart = QStringList(), QStringList banner = QStringList(),
QStringList screenshot = QStringList());
private slots:
void OnVideoImageSetDone(VideoMetadata *metadata);
void OnVideoSearchDone(MetadataLookup *lookup);
private:
MythDialogBox *m_menuPopup;
MythUIBusyDialog *m_busyPopup;
MythScreenStack *m_popupStack;
MythScreenStack *m_mainStack;
MythUIButtonList *m_videoButtonList;
MythUIButtonTree *m_videoButtonTree;
MythUIText *m_titleText;
MythUIText *m_novideoText;
MythUIText *m_positionText;
MythUIText *m_crumbText;
MythUIImage *m_coverImage;
MythUIImage *m_screenshot;
MythUIImage *m_banner;
MythUIImage *m_fanart;
MythUIStateType *m_trailerState;
MythUIStateType *m_parentalLevelState;
MythUIStateType *m_videoLevelState;
MythUIStateType *m_userRatingState;
MythUIStateType *m_watchedState;
MythUIStateType *m_studioState;
MetadataDownload *m_query;
MetadataImageDownload *m_imageDownload;
class VideoDialogPrivate *m_d;
};
class VideoListDeathDelay : public QObject
{
Q_OBJECT
public:
VideoListDeathDelay(VideoDialog::VideoListPtr toSave);
~VideoListDeathDelay();
VideoDialog::VideoListPtr GetSaved();
private slots:
void OnTimeUp();
private:
class VideoListDeathDelayPrivate *m_d;
};
#endif