Sayonara Player
GUI_Playlist.h
1 /* GUI_Playlist.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 /*
23  * GUI_Playlist.h
24  *
25  * Created on: Apr 6, 2011
26  * Author: Michael Lugmair (Lucio Carreras)
27  */
28 
29 #ifndef GUI_PLAYLIST_H_
30 #define GUI_PLAYLIST_H_
31 
32 #include "Utils/Message/Message.h"
33 #include "Utils/Library/LibraryNamespaces.h"
34 #include "Utils/Playlist/PlaylistFwd.h"
35 #include "Utils/Pimpl.h"
36 
37 #include "Gui/Utils/Widgets/Widget.h"
38 
39 #include "Components/PlayManager/PlayState.h"
40 #include "Components/Playlist/PlaylistDBInterface.h"
41 
42 namespace Playlist
43 {
44  class View;
45 }
46 
47 UI_FWD(PlaylistWindow)
48 
49 
53 class GUI_Playlist :
54  public Gui::Widget
55 {
56  Q_OBJECT
57  UI_CLASS(PlaylistWindow)
58  PIMPL(GUI_Playlist)
59 
60 public:
61  explicit GUI_Playlist(QWidget* parent=nullptr);
62  ~GUI_Playlist() override;
63 
64 private:
65  void initToolButton();
66 
67  Playlist::View* viewByIndex(int idx);
68  Playlist::View* currentView();
69 
70  void setTotalTimeLabel();
71 
72 private slots:
73 
74  // triggered from playlist
75  void playlistCreated(PlaylistPtr pl);
76  void playlistAdded(PlaylistPtr pl);
77  void playlistNameChanged(int playlistIndex);
78  void playlistChanged(int playlistIndex);
79  void playlistIdxChanged(int pld_idx);
80 
81  // triggered by GUI
82  void tabClosePlaylistClicked(int playlistIndex); // GUI_PlaylistTabs.cpp
83  void tabSavePlaylistClicked(int playlistIndex); // GUI_PlaylistTabs.cpp
84  void tabSavePlaylistAsClicked(int playlistIndex, const QString& str); // GUI_PlaylistTabs.cpp
85  void tabSavePlaylistToFileClicked(int playlistIndex, const QString& filename); // GUI_PlaylistTabs.cpp
86  void tabRenameClicked(int playlistIndex, const QString& str);
87  void tabDeletePlaylistClicked(int playlistIndex); // GUI_PlaylistTabs.cpp
88  void tabMetadataDropped(int playlistIndex, const MetaDataList& tracks);
89  void tabFilesDropped(int playlistIndex, const QStringList& paths);
90  void openFileClicked(int playlistIndex);
91  void openDirClicked(int playlistIndex);
92  void deleteTracksClicked(const IndexSet& rows);
93 
94  void checkTabIcon();
95  void checkPlaylistMenu(PlaylistConstPtr pl);
96  void checkPlaylistName(PlaylistConstPtr pl);
97 
98  void doubleClicked(int row);
99 
100  void addPlaylistButtonPressed();
101 
102  void clearButtonPressed(int playlistIndex);
103  void bookmarkSelected(int idx, Seconds timestamp);
104 
105  // called by playmanager
106  void playstateChanged(PlayState state);
107  void playlistFinished();
108 
109  void showClearButtonChanged();
110  void showBottomBarChanged();
111 
112 protected:
113  void languageChanged() override;
114  void skinChanged() override;
115 
116  void dragEnterEvent(QDragEnterEvent* event) override;
117  void dragLeaveEvent(QDragLeaveEvent* event) override;
118  void dropEvent(QDropEvent* event) override;
119  void dragMoveEvent(QDragMoveEvent* event) override;
120 };
121 
122 #endif /* GUI_PLAYLIST_H_ */
PlayState
PlayState
The PlayState enum.
Definition: PlayState.h:29
MetaDataList
The MetaDataList class.
Definition: MetaDataList.h:37
Util::Set
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: Set.h:37
Playlist::View
The PlaylistView class.
Definition: PlaylistView.h:54
GUI_Playlist
The GUI_Playlist class.
Definition: GUI_Playlist.h:55