TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicplayedlistpopwidget.h
Go to the documentation of this file.
1 #ifndef MUSICPLAYEDLISTPOPWIDGET_H
2 #define MUSICPLAYEDLISTPOPWIDGET_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2024 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 <QLabel>
23 #include "musicsong.h"
24 #include "musictoolmenuwidget.h"
25 
26 class QScrollArea;
27 class MusicPlaylist;
29 
34 {
35  Q_OBJECT
37 public:
41  explicit MusicPlayedListTopContainerWidget(QWidget *parent = nullptr);
42 
43 private:
47  virtual void paintEvent(QPaintEvent *event) override final;
48 
49 };
50 
51 
56 {
57  Q_OBJECT
59 public:
63  explicit MusicPlayedListPopWidget(QWidget *parent = nullptr);
68 
72  static MusicPlayedListPopWidget *instance();
73 
77  void setPlaylist(MusicPlaylist *playlist);
78 
82  void clear();
86  void clearQueueState();
90  void updatePlayedList(const TTK::IndexPropertyList &indexs);
91 
95  void remove(int index);
99  void remove(int playlistRow, const QString &path);
103  void remove(int playlistRow, const MusicSong &song);
107  void remove(int playlistRow, const MusicSongList &songs);
108 
112  void append(const MusicSongList &songs);
116  void append(int playlistRow, const MusicSong &song);
120  void append(int playlistRow, const MusicSongList &songs);
121 
125  void insert(int playlistRow, const MusicSong &song);
129  void insert(int playlistRow, const MusicSongList &songs);
133  void insert(int playlistRow, int index, const MusicSong &song);
137  void insert(int playlistRow, int index, const MusicSongList &song);
138 
142  void selectCurrentIndex();
146  void selectCurrentIndex(int playlistRow, const MusicSong &song);
147 
148 public Q_SLOTS:
152  virtual void popupMenu() override final;
156  void removeItemAt(const TTKIntList &index);
160  void clearItems();
164  void itemDoubleClicked();
168  void itemDoubleClicked(int row, int column);
169 
170 private:
174  void initialize();
178  QWidget *createContainerWidget();
182  void setPlaylistSongs();
186  void setPlaylistCount(int count);
190  void clearPlaylist();
191 
192  QList<QLabel*> m_labels;
194  MusicSongList m_songList;
195  QScrollArea *m_scrollArea;
197 
199 };
200 
201 #endif // MUSICPLAYEDLISTPOPWIDGET_H
The class of the played list top container widget.
static MusicPlayedListPopWidget * m_instance
#define TTK_MODULE_EXPORT
The class of the tool menu base widget.
MusicSongsListPlayedTableWidget * m_tableWidget
QList< int > TTKIntList
Definition: ttkqtglobal.h:188
The class of the played list pop widget.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the songs played queue list table widget.
The class of the music song info.
Definition: musicsong.h:28
The class of the music play list.
Definition: musicplaylist.h:63