TTKMusicPlayer  4.2.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsongslistplaytablewidget.h
Go to the documentation of this file.
1 #ifndef MUSICSONGSLISTPLAYTABLEWIDGET_H
2 #define MUSICSONGSLISTPLAYTABLEWIDGET_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 <QTimer>
24 
25 class QPropertyAnimation;
30 
35 {
36  Q_OBJECT
38 public:
42  explicit MusicSongsListPlayTableWidget(QWidget *parent = nullptr);
47 
51  virtual void updateSongsList(const MusicSongList &songs) override final;
55  virtual void selectRow(int index) override final;
56 
60  void updateSearchFileName(MusicSongList *songs, const TTKIntList &result);
61 
65  inline void setSongSort(MusicSongSort *sort) noexcept { m_songSort = sort; }
66 
70  void updateDurationLabel(const QString &current, const QString &total) const;
74  void updateCurrentArtist();
78  void adjustPlayWidgetRow();
82  bool createUploadFileModule();
83 
84 Q_SIGNALS:
88  void isSearchedResultEmpty(bool &empty);
92  void deleteItemAt(const TTKIntList &index, bool fileRemove);
96  void itemIndexSwaped(int start, int end, int play, MusicSongList &songs);
100  void addSongToLovestList(bool state, int row);
104  void showFloatWidget();
108  void songListSortBy(int index);
109 
110 public Q_SLOTS:
114  virtual void itemCellEntered(int row, int column) override final;
118  virtual void itemCellClicked(int row, int column) override final;
122  virtual void removeItems() override final;
126  virtual void removeItemAt() override final;
130  void removeItemWithFile();
134  void setChangSongName();
138  void showMakeRingWidget();
142  void showTransformWidget();
146  void searchQueryByName(QAction *action);
150  void addToPlayLater();
154  void addToPlayedList();
158  void itemRenameFinished(const QString &name);
162  void songListSortBy(QAction *action);
163 
164 private Q_SLOTS:
168  void showTimeOut();
172  void stayTimeOut();
173 
174 private:
178  virtual void mousePressEvent(QMouseEvent *event) override final;
179  virtual void mouseMoveEvent(QMouseEvent *event) override final;
180  virtual void mouseReleaseEvent(QMouseEvent *event) override final;
181  virtual void leaveEvent(QEvent *event) override final;
182  virtual void wheelEvent(QWheelEvent *event) override final;
183  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
187  void closeRenameItem();
191  void startToDrag();
192 
193  QWidget *m_parent;
194  int m_dragStartIndex;
195  QPoint m_dragStartPoint;
196  bool m_mouseMoved;
197 
198  QTimer m_timerShow, m_timerStay;
199  MusicOpenFileWidget *m_openFileWidget;
200  MusicSongsListItemInfoWidget *m_songsInfoWidget;
201  MusicSongsListPlayWidget *m_songsPlayWidget;
202 
203  bool m_mouseLeftPressed;
204  bool m_renameActived, m_deleteItemWithFile;
205  MusicSongList m_searchedSongs;
206  QTableWidgetItem *m_renameItem;
207  MusicLineEditItemDelegate *m_renameEditDelegate;
208  MusicSongSort *m_songSort;
209 
210 };
211 
212 #endif // MUSICSONGSLISTPLAYTABLEWIDGET_H
The class of the song list play widget.
#define TTK_MODULE_EXPORT
void setSongSort(MusicSongSort *sort) noexcept
QList< int > TTKIntList
Definition: ttkqtglobal.h:200
const char * name
Definition: http_parser.c:458
The class of the song list item info widget.
virtual void itemCellClicked(int row, int column)
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:164
virtual void updateSongsList(const MusicSongList &songs)
The class of the music song sort tag.
Definition: musicsong.h:142
virtual void itemCellEntered(int row, int column)
The class of the lineedit item delegate.
#define const
Definition: zconf.h:233
The class of the open file widget.
The class of the songs list abstract table widget.
state
Definition: http_parser.c:279
The class of the songs list play table widget.