MythTV  master
videolist.h
Go to the documentation of this file.
1 #ifndef VIDEOLIST_H_
2 #define VIDEOLIST_H_
3 
4 // Type of the item added to the tree
5 enum TreeNodeType : std::int8_t {
6  kSubFolder = -1,
7  kUpFolder = -2,
8  kRootNode = -3,
11 };
12 
13 // Tree node attribute index
14 enum TreeNodeAttributes : std::uint8_t {
16 };
17 
18 class MythGenericTree;
21 class ParentalLevel;
22 
23 class VideoList
24 {
25  public:
26  VideoList();
27  ~VideoList();
28 
29  // Deleted functions should be public.
30  VideoList(const VideoList &) = delete; // not copyable
31  VideoList &operator=(const VideoList &) = delete; // not copyable
32 
33  MythGenericTree *buildVideoList(bool filebrowser, bool flatlist,
34  int group_type,
35  const ParentalLevel &parental_level,
36  bool include_updirs);
37 
38  void refreshList(bool filebrowser, const ParentalLevel &parental_level,
39  bool flat_list, int group_type);
40  bool refreshNode(MythGenericTree *node);
41 
42  unsigned int count() const;
43 
45  void setCurrentVideoFilter(const VideoFilterSettings &filter);
46 
47  // returns the number of videos matched by this filter
48  int TryFilter(const VideoFilterSettings &filter) const;
49 
50  unsigned int getFilterChangedState();
51 
52  bool Delete(int video_id);
53 
55 
57 
58  void InvalidateCache();
59 
60  private:
62 };
63 
64 int AddFileNode(MythGenericTree *where_to_add, const QString& name,
65  VideoMetadata *metadata);
66 
67 class VideoMetadata;
69 {
70  public:
71  TreeNodeData() = default;;
72  explicit TreeNodeData(VideoMetadata *metadata);
73  TreeNodeData(QString path, QString host, QString prefix);
74 
75  TreeNodeData(const TreeNodeData &other);
76  TreeNodeData &operator=(const TreeNodeData &rhs);
77 
78  ~TreeNodeData();
79 
81  const VideoMetadata *GetMetadata() const;
82  QString GetPath() const;
83  QString GetHost() const;
84  QString GetPrefix() const;
85 
86  private:
87  class TreeNodeDataPrivate *m_d {nullptr};
88 };
89 
91 
92 #endif // VIDEOLIST_H
kSubFolder
@ kSubFolder
Definition: videolist.h:6
VideoMetadata
Definition: videometadata.h:24
VideoList::getFilterChangedState
unsigned int getFilterChangedState()
Definition: videolist.cpp:507
TreeNodeDataPrivate
Definition: videolist.cpp:36
kNodeSort
@ kNodeSort
Definition: videolist.h:15
kRootNode
@ kRootNode
Definition: videolist.h:8
TreeNodeData::TreeNodeData
TreeNodeData()=default
kNoFilesFound
@ kNoFilesFound
Definition: videolist.h:9
VideoMetadataListManager
Definition: videometadatalistmanager.h:10
VideoList::refreshList
void refreshList(bool filebrowser, const ParentalLevel &parental_level, bool flat_list, int group_type)
Definition: videolist.cpp:470
AddFileNode
int AddFileNode(MythGenericTree *where_to_add, const QString &name, VideoMetadata *metadata)
Definition: videolist.cpp:303
VideoList::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:497
kUpFolder
@ kUpFolder
Definition: videolist.h:7
kDynamicSubFolder
@ kDynamicSubFolder
Definition: videolist.h:10
TreeNodeAttributes
TreeNodeAttributes
Definition: videolist.h:14
TreeNodeData
Definition: videolist.h:68
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
VideoList::InvalidateCache
void InvalidateCache()
Definition: videolist.cpp:522
VideoList::buildVideoList
MythGenericTree * buildVideoList(bool filebrowser, bool flatlist, int group_type, const ParentalLevel &parental_level, bool include_updirs)
Definition: videolist.cpp:461
VideoList::VideoList
VideoList()
Definition: videolist.cpp:451
TreeNodeData::GetPath
QString GetPath() const
Definition: videolist.cpp:132
VideoList::Delete
bool Delete(int video_id)
Definition: videolist.cpp:512
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(std::chrono::seconds)
TreeNodeData::GetMetadata
VideoMetadata * GetMetadata()
Definition: videolist.cpp:116
VideoList::m_imp
class VideoListImp * m_imp
Definition: videolist.h:61
VideoList::operator=
VideoList & operator=(const VideoList &)=delete
VideoList::getCurrentVideoFilter
const VideoFilterSettings & getCurrentVideoFilter() const
Definition: videolist.cpp:487
VideoList::setCurrentVideoFilter
void setCurrentVideoFilter(const VideoFilterSettings &filter)
Definition: videolist.cpp:492
VideoList
Definition: videolist.h:23
TreeNodeData::operator=
TreeNodeData & operator=(const TreeNodeData &rhs)
Definition: videolist.cpp:100
VideoFilterSettings
Definition: videofilter.h:73
TreeNodeData::m_d
class TreeNodeDataPrivate * m_d
Definition: videolist.h:87
VideoListImp
Definition: videolist.cpp:325
ParentalLevel
Definition: parentalcontrols.h:9
VideoList::count
unsigned int count() const
Definition: videolist.cpp:482
MythGenericTree
Definition: mythgenerictree.h:27
VideoList::~VideoList
~VideoList()
Definition: videolist.cpp:456
TreeNodeType
TreeNodeType
Definition: videolist.h:5
VideoList::refreshNode
bool refreshNode(MythGenericTree *node)
Definition: videolist.cpp:477
VideoList::GetTreeRoot
MythGenericTree * GetTreeRoot()
Definition: videolist.cpp:517
TreeNodeData::GetHost
QString GetHost() const
Definition: videolist.cpp:139
TreeNodeData::~TreeNodeData
~TreeNodeData()
Definition: videolist.cpp:111
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:502
TreeNodeData::GetPrefix
QString GetPrefix() const
Definition: videolist.cpp:146