TTKMusicPlayer  4.1.3.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 - 2025 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
49 public:
53  explicit MusicLocalManagerStatisticTableWidget(QWidget *parent = nullptr);
58 
62  void addCellItem(const MusicSongStatisticItem &song);
66  void resizeSection() const;
67 
68 };
69 
70 
75 {
76  Q_OBJECT
78 public:
82  explicit MusicLocalManagerSongsTableWidget(QWidget *parent = nullptr);
87 
91  void addCellItems(const MusicSongInfoItemList &songs);
95  void resizeSection() const;
96 
97 public Q_SLOTS:
101  virtual void removeItems() override final;
105  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
106 
107 };
108 
109 class QLabel;
110 class TTKTabButton;
111 class MusicItemQueryEdit;
113 
117 class TTK_MODULE_EXPORT MusicLocalManagerWidget : public QWidget, public TTKAbstractResizeInterface, private MusicItemSearchInterface<MusicSongInfoItemList>
118 {
119  Q_OBJECT
121 public:
125  explicit MusicLocalManagerWidget(QWidget *parent = nullptr);
130 
134  virtual void resizeWidget() override final;
135 
136 private Q_SLOTS:
140  void typeIndexChanged(int index);
144  void refreshItems();
148  void updateMediaLibraryPath();
152  void searchResultChanged(int row, int column);
156  void itemDoubleClicked(int row, int column);
157 
158 private:
162  virtual void resizeEvent(QResizeEvent *event) override final;
166  void updateStatisticWidget(int index, const MusicSongInfoItemList &items);
167 
168  QLabel *m_sizeLabel;
174 
175 };
176 
177 #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
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:168
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 resizeWidget()=0
The class of the songs list abstract table widget.
The class of the float gif label value widget.