/
videolist.h
92 lines (68 loc) · 2.25 KB
/
videolist.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
#ifndef VIDEOLIST_H_
#define VIDEOLIST_H_
// Type of the item added to the tree
enum TreeNodeType {
kSubFolder = -1,
kUpFolder = -2,
kRootNode = -3,
kNoFilesFound = -4,
kDynamicSubFolder = -5,
};
// Tree node attribute index
enum TreeNodeAttributes {
kNodeSort
};
class MythGenericTree;
class VideoFilterSettings;
class VideoMetadataListManager;
class ParentalLevel;
class VideoList
{
public:
VideoList();
~VideoList();
// Deleted functions should be public.
VideoList(const VideoList &) = delete; // not copyable
VideoList &operator=(const VideoList &) = delete; // not copyable
MythGenericTree *buildVideoList(bool filebrowser, bool flatlist,
int group_type,
const ParentalLevel &parental_level,
bool include_updirs);
void refreshList(bool filebrowser, const ParentalLevel &parental_level,
bool flat_list, int group_type);
bool refreshNode(MythGenericTree *node);
unsigned int count() const;
const VideoFilterSettings &getCurrentVideoFilter() const;
void setCurrentVideoFilter(const VideoFilterSettings &filter);
// returns the number of videos matched by this filter
int TryFilter(const VideoFilterSettings &filter) const;
unsigned int getFilterChangedState();
bool Delete(int video_id);
const VideoMetadataListManager &getListCache() const;
MythGenericTree *GetTreeRoot();
void InvalidateCache();
private:
class VideoListImp *m_imp;
};
int AddFileNode(MythGenericTree *where_to_add, const QString& name,
VideoMetadata *metadata);
class VideoMetadata;
class TreeNodeData
{
public:
TreeNodeData() = default;;
explicit TreeNodeData(VideoMetadata *metadata);
TreeNodeData(QString path, QString host, QString prefix);
TreeNodeData(const TreeNodeData &other);
TreeNodeData &operator=(const TreeNodeData &rhs);
~TreeNodeData();
VideoMetadata *GetMetadata();
const VideoMetadata *GetMetadata() const;
QString GetPath() const;
QString GetHost() const;
QString GetPrefix() const;
private:
class TreeNodeDataPrivate *m_d {nullptr};
};
Q_DECLARE_METATYPE(TreeNodeData)
#endif // VIDEOLIST_H