TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsongscontainerwidget.h
Go to the documentation of this file.
1 #ifndef MUSICSONGSCONTAINERWIDGET_H
2 #define MUSICSONGSCONTAINERWIDGET_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 "musicsearchinterface.h"
25 
27 class MusicSongsListWidget;
29 
34 {
35  Q_OBJECT
37 public:
41  explicit MusicSongsContainerWidget(QWidget *parent = nullptr);
46 
50  bool addMusicItemList(const MusicSongItemList &items);
54  void appendMusicItemList(const MusicSongItemList &items);
58  inline const MusicSongItemList& items() const { return m_containerItems; }
59 
63  void importMusicSongsByUrl(const QString &path, int playlistRow);
67  void importMusicSongsByPath(const QStringList &files, int playlistRow);
68 
72  QStringList musicSongsFileName(int index) const;
76  QStringList musicSongsFilePath(int index) const;
80  int mapSongIndexByFilePath(int playlistRow, const QString &path) const;
84  QString mapFilePathBySongIndex(int playlistRow, int index) const;
85 
89  void removeSearchResult(int &row);
90 
94  inline int playRowIndex() const { return m_playRowIndex; }
98  void setCurrentSongTreeIndex(int index);
99 
103  void playLocation(int index);
107  void selectRow(int index);
111  void updateDurationLabel(const QString &current, const QString &total) const;
112 
113 public Q_SLOTS:
117  void addNewRowItem();
121  void deleteRowItem(int index);
125  void deleteRowItems();
129  void deleteRowItemAll(int index);
133  void changRowItemName(int index, const QString &name);
137  void swapDragItemIndex(int start, int end);
141  void addToPlayLater(int index);
145  void addToPlayedList(int index);
149  void importSongsByFiles(int index = TTK_LOW_LEVEL);
153  void importSongsByDir(int index = TTK_LOW_LEVEL);
157  void showSongCheckToolsWidget();
161  void showLrcDownloadBatchWidget();
165  void searchResultChanged(int row, int column);
166 
170  void updateCurrentIndex();
174  void songToLovestListAt(bool state, int row);
178  void addSongToLovestList(bool state, int row);
182  void addSongBufferToPlaylist(const MusicResultDataItem &item);
186  void addSongToPlaylist(const QStringList &items);
190  void removeItemAt(const TTKIntList &del, bool fileRemove);
194  void itemIndexSwaped(int start, int end, int play, MusicSongList &songs);
198  void isCurrentPlaylistRow(bool &state);
202  void isSearchedResultEmpty(bool &empty);
206  void setMusicPlayCount(int index);
210  void setRecentMusicSongs(int index);
214  void queryMusicItemList(MusicSongItemList &songs);
218  void updateCurrentArtist();
222  void showFloatWidget();
226  void songListSortBy(int index);
227 
228 private Q_SLOTS:
232  void showSearchWidget();
236  void sliderValueChanaged(int value);
240  void deleteFloatWidget();
241 
242 private:
246  virtual void resizeEvent(QResizeEvent *event) override final;
247  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
248  virtual void dragEnterEvent(QDragEnterEvent *event) override final;
249  virtual void dragMoveEvent(QDragMoveEvent *event) override final;
250  virtual void dropEvent(QDropEvent *event) override final;
254  inline bool isSearchPlayIndex() const { return m_lastSearchIndex == m_currentIndex; }
258  void closeSearchWidget();
262  void closeSearchWidgetInNeed();
266  void checkCurrentNameExist(QString &name);
270  void addNewRowItem(const QString &name);
274  void createWidgetItem(MusicSongItem *item);
278  void setItemTitle(MusicSongItem *item);
282  void setInputModule(QObject *object) const;
286  void resizeWindow();
290  void updatePlayedList(int start, int end);
291 
295 
299 
300 };
301 
302 #endif // MUSICSONGSCONTAINERWIDGET_H
const MusicSongItemList & items() const
#define TTK_MODULE_EXPORT
The class of the songs container widget.
The class of the search result data item.
The class of the item search interface.
#define TTK_LOW_LEVEL
Definition: ttkglobal.h:253
MusicSongSearchDialog * m_songSearchWidget
The class of the tool box mask widget.
The class of the songs list function widget.
QList< int > TTKIntList
Definition: ttkqtglobal.h:188
const char * name
Definition: http_parser.c:458
MusicSongsToolBoxMaskWidget * m_listMaskWidget
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the tool box widget.
The class of the music song item.
Definition: musicsong.h:161
MusicSongsListFunctionWidget * m_listFunctionWidget
The class of the song search widget.
state
Definition: http_parser.c:279