TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsongslistplaywidget.h
Go to the documentation of this file.
1 #ifndef MUSICSONGSLISTPLAYWIDGET_H
2 #define MUSICSONGSLISTPLAYWIDGET_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 <QPushButton>
24 #include "musicglobaldefine.h"
25 
26 class QMenu;
29 
34 {
35  Q_OBJECT
36 public:
40  explicit MusicSongsListPlayWidget(int index, QWidget *parent = nullptr);
45 
49  void updateDurationLabel(const QString &current, const QString &total);
53  void updateCurrentArtist();
54 
58  void initialize(const QString &name, const QString &path, QString &time);
62  void enableRenameMode();
63 
67  inline bool isRenameMode() noexcept { return m_renameEdit != nullptr; }
71  inline void setCurrentPlayIndex(int index) noexcept { m_currentPlayIndex = index; }
75  inline int currentPlayIndex() const noexcept { return m_currentPlayIndex; }
76 
77 Q_SIGNALS:
81  void renameFinished(const QString &text);
85  void enterChanged(int row, int column);
86 
87 public Q_SLOTS:
91  void deleteRenameItem();
95  void changItemName(const QString &name);
99  void currentLoveStateClicked();
103  void currentDownloadStateClicked();
104 
105 private:
109  virtual void enterEvent(QtEnterEvent *event) override final;
113  void createMoreMenu(QMenu *menu);
117  bool showArtistPicture(const QString &name) const;
118 
119  bool m_noCover;
121  QLabel *m_artistPictureLabel, *m_durationLabel;
123  QPushButton *m_loveButton, *m_deleteButton, *m_showMVButton;
124  QPushButton *m_downloadButton, *m_moreButton;
126 
127 };
128 
129 #endif // MUSICSONGSLISTPLAYWIDGET_H
#define QtEnterEvent
Event enter.
Definition: ttkqtcompat.h:178
The class of the song list play widget.
#define TTK_MODULE_EXPORT
void setCurrentPlayIndex(int index) noexcept
int currentPlayIndex() const noexcept
The class of the item rename edit.
const char * name
Definition: http_parser.c:458
MusicItemRenameEidt * m_renameEdit
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the split item clicked widget.
#define const
Definition: zconf.h:233
MusicSplitItemClickedLabel * m_songNameLabel