TTKMusicPlayer  4.3.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 - 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 <QLabel>
23 #include "musicsong.h"
24 #include "musictoolmenuwidget.h"
25 
26 class QScrollArea;
27 class MusicPlaylist;
29 
34 {
35  Q_OBJECT
36 public:
40  explicit MusicPlayedListTopContainerWidget(QWidget *parent = nullptr);
41 
42 private:
46  virtual void paintEvent(QPaintEvent *event) override final;
47 
48 };
49 
50 
55 {
56  Q_OBJECT
57 public:
61  explicit MusicPlayedListPopWidget(QWidget *parent = nullptr);
66 
70  static MusicPlayedListPopWidget *instance();
71 
75  void setPlaylist(MusicPlaylist *playlist);
76 
80  void clear();
84  void clearQueueState();
88  void updatePlayedRows(const TTK::IndexPropertyList &rows);
89 
93  void remove(int index);
97  void remove(int playlistRow, const QString &path);
101  void remove(int playlistRow, const MusicSong &song);
105  void remove(int playlistRow, const MusicSongList &songs);
106 
110  void append(const MusicSongList &songs);
114  void append(int playlistRow, const MusicSong &song);
118  void append(int playlistRow, const MusicSongList &songs);
119 
123  void insert(int playlistRow, const MusicSong &song);
127  void insert(int playlistRow, const MusicSongList &songs);
131  void insert(int playlistRow, int index, const MusicSong &song);
135  void insert(int playlistRow, int index, const MusicSongList &song);
136 
140  QString currentMediaPath(int index) const;
144  void selectCurrentMedia();
148  void selectCurrentMedia(int playlistRow, const MusicSong &song);
149 
150 public Q_SLOTS:
154  virtual void popupMenu() override final;
158  void removeItemAt(const TTKIntList &rows);
162  void clearItems();
166  void itemDoubleClicked();
170  void itemDoubleClicked(int row, int column);
171 
172 private:
176  void initialize();
180  QWidget *createContainerWidget();
184  void setPlaylistSongs();
188  void setPlaylistCount(int count);
192  void clearPlaylist();
193 
194  QList<QLabel*> m_labels;
196  MusicSongList m_songList;
197  QScrollArea *m_scrollArea;
199 
201 };
202 
203 #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:200
The class of the played list pop widget.
The class of the songs played queue list table widget.
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the music song info.
Definition: musicsong.h:28
The class of the music play list.
Definition: musicplaylist.h:63