MythTV master
playlisteditorview.h
Go to the documentation of this file.
1#ifndef PLAYLISTEDITORVIEW_H_
2#define PLAYLISTEDITORVIEW_H_
3
4// c++
5#include <utility>
6
7// qt
8#include <QEvent>
9#include <QVector>
10
11// MythTV
16
17// mythmusic
18#include "musiccommon.h"
19
21class MythUIText;
22class MythMenu;
23
24// This is just so we can use the guarded pointers provided by QPointer in the MusicGenericTree
26{
27 public:
28 MusicButtonItem(MythUIButtonList *lbtype, const QString& text,
29 const QString& image = "", bool checkable = false,
30 CheckState state = CantCheck, bool showArrow = false,
31 int listPosition = -1):
32 MythUIButtonListItem(lbtype, text, image, checkable, state, showArrow, listPosition) {}
33
34 MusicButtonItem(MythUIButtonList *lbtype, const QString& text, QVariant data, int listPosition = -1) :
35 MythUIButtonListItem(lbtype, text, std::move(data), listPosition) {}
36};
37
39{
40 public:
41 MusicGenericTree(MusicGenericTree *parent, const QString &name,
42 const QString &action = "",
44 bool showArrow = true);
45 ~MusicGenericTree() override = default;
46
47 QString getAction(void) const { return m_action; }
48
49 MythUIButtonListItem::CheckState getCheck(void) const { return m_check; }
50 void setCheck(MythUIButtonListItem::CheckState state);
51
52 void setDrawArrow(bool flag);
53
54 MythUIButtonListItem *CreateListButton(MythUIButtonList *list) override; // MythGenericTree
55
56 protected:
57 QString m_action;
58 QPointer<MusicButtonItem> m_buttonItem {nullptr};
60 bool m_showArrow {true};
61};
62
64
66{
67 Q_OBJECT
68 public:
70 const QString &layout, bool restorePosition = false);
71 ~PlaylistEditorView(void) override;
72
73 bool Create(void) override; // MythScreenType
74 bool keyPressEvent(QKeyEvent *event) override; // MusicCommon
75
76 void saveTreePosition(void);
77
78 void ShowMenu(void) override; // MusicCommon
79
80 protected:
81 void customEvent(QEvent *event) override; // MusicCommon
82
83 private slots:
85 static void treeItemVisible(MythUIButtonListItem *item);
87 void smartPLChanged(const QString &category, const QString &name);
88 void deleteSmartPlaylist(bool ok);
89 void deletePlaylist(bool ok);
90
91 private:
93
94 static void getPlaylists(MusicGenericTree *node);
95 static void getPlaylistTracks(MusicGenericTree *node, int playlistID);
96
98 static void getSmartPlaylists(MusicGenericTree *node);
99 static void getSmartPlaylistTracks(MusicGenericTree *node, int playlistID);
100
101 static void getCDTracks(MusicGenericTree *node);
102
103 void updateSelectedTracks(void);
106
107 void createRootNode(void);
108 void reloadTree(void);
109 void restoreTreePosition(const QStringList &route);
110
113
114 private:
115 QString m_layout;
116 bool m_restorePosition {false};
118 QList<MetadataPtrList*> m_deleteList;
119
123};
124
125#endif
MusicButtonItem(MythUIButtonList *lbtype, const QString &text, const QString &image="", bool checkable=false, CheckState state=CantCheck, bool showArrow=false, int listPosition=-1)
MusicButtonItem(MythUIButtonList *lbtype, const QString &text, QVariant data, int listPosition=-1)
bool restorePosition(int trackID)
MythUIButtonListItem::CheckState getCheck(void) const
QString getAction(void) const
~MusicGenericTree() override=default
Screen in which all other widgets are contained and rendered.
void setDrawArrow(bool flag)
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A tree widget for displaying and navigating a MythGenericTree()
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
static void getCDTracks(MusicGenericTree *node)
MythUIText * m_positionText
MythUIText * m_breadcrumbsText
void ShowMenu(void) override
void filterTracks(MusicGenericTree *node)
static void getSmartPlaylistTracks(MusicGenericTree *node, int playlistID)
bool Create(void) override
MusicGenericTree * m_rootNode
static void getSmartPlaylistCategories(MusicGenericTree *node)
void treeItemClicked(MythUIButtonListItem *item)
static void getSmartPlaylists(MusicGenericTree *node)
static void treeItemVisible(MythUIButtonListItem *item)
static void getPlaylists(MusicGenericTree *node)
~PlaylistEditorView(void) override
QList< MetadataPtrList * > m_deleteList
void treeNodeChanged(MythGenericTree *node)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void smartPLChanged(const QString &category, const QString &name)
static void getPlaylistTracks(MusicGenericTree *node, int playlistID)
MythUIButtonTree * m_playlistTree
void restoreTreePosition(const QStringList &route)
MythMenu * createPlaylistMenu(void)
MythMenu * createSmartPlaylistMenu(void)
void deleteSmartPlaylist(bool ok)
void customEvent(QEvent *event) override
void updateSonglist(MusicGenericTree *node)
PlaylistEditorView(MythScreenStack *parent, MythScreenType *parentScreen, const QString &layout, bool restorePosition=false)
#define MPLUGIN_PUBLIC
STL namespace.
Q_DECLARE_METATYPE(MusicGenericTree *)