TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclocalmanagerwidget.h
Go to the documentation of this file.
1 #ifndef MUSICLOCALMANAGERWIDGET_H
2 #define MUSICLOCALMANAGERWIDGET_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2026 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include "musicsearchinterface.h"
24 
29 {
30  QString m_title;
31  QString m_artist;
32  QString m_album;
33  QString m_year;
34  QString m_genre;
35  QString m_track;
36  QString m_path;
37 };
39 
40 using MusicSongStatisticItem = QMap<QString, int>;
41 
46 {
47  Q_OBJECT
48 public:
52  explicit MusicLocalManagerStatisticTableWidget(QWidget *parent = nullptr);
57 
61  void addCellItem(const MusicSongStatisticItem &song);
65  void resizeGeometry() const;
66 
67 };
68 
69 
74 {
75  Q_OBJECT
76 public:
80  explicit MusicLocalManagerSongsTableWidget(QWidget *parent = nullptr);
85 
89  void addCellItems(const MusicSongInfoItemList &songs);
93  void resizeGeometry() const;
94 
95 public Q_SLOTS:
99  virtual void removeItems() override final;
103  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
104 
105 };
106 
107 class QLabel;
108 class TTKTabButton;
109 class MusicItemQueryEdit;
111 
115 class TTK_MODULE_EXPORT MusicLocalManagerWidget : public QWidget, public TTKAbstractResizeInterface, private MusicItemSearchInterface<MusicSongInfoItemList>
116 {
117  Q_OBJECT
118 public:
122  explicit MusicLocalManagerWidget(QWidget *parent = nullptr);
127 
131  virtual void resizeGeometry() override final;
132 
133 private Q_SLOTS:
137  void typeIndexChanged(int index);
141  void refreshItems();
145  void updateMediaLibraryPath();
149  void searchResultChanged(int row, int column);
153  void itemDoubleClicked(int row, int column);
154 
155 private:
159  virtual void resizeEvent(QResizeEvent *event) override final;
163  void updateStatisticWidget(int index, const MusicSongInfoItemList &items);
164 
165  QLabel *m_sizeLabel;
171 
172 };
173 
174 #endif // MUSICLOCALMANAGERWIDGET_H
MusicLocalManagerSongsTableWidget * m_songTableWidget
#define TTK_MODULE_EXPORT
The class of the local manager songs table widget.
MusicGifLabelValueWidget * m_loadingLabel
The class of the item search interface.
The class of the table widget base.
TTK_DECLARE_LIST(MusicSongInfoItem)
The class of the local song item information.
MusicLocalManagerStatisticTableWidget * m_statisticTableWidget
QMap< QString, int > MusicSongStatisticItem
MusicItemQueryEdit * m_searchEdit
The class of the local manager statistic table widget.
The class of the widget resize interface.
The class of the local manager widget.
The class of the tab button module.
Definition: ttktabbutton.h:29
The class of the query line edit widget.
virtual void resizeGeometry()=0
The class of the songs list abstract table widget.
The class of the float gif label value widget.