Sayonara Player
GUI_Playlist.h
1 /* GUI_Playlist.h */
2 
3 /* Copyright (C) 2011-2019 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: 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(Playlist_Window)
48 
49 
53 class GUI_Playlist :
54  public Gui::Widget
55 {
56  Q_OBJECT
57  UI_CLASS(Playlist_Window)
58  PIMPL(GUI_Playlist)
59 
60 public:
61  explicit GUI_Playlist(QWidget *parent=nullptr);
62  ~GUI_Playlist() override;
63 
64 private:
65  Playlist::View* view_by_index(int idx);
66  Playlist::View* current_view();
67 
68  void set_total_time_label();
69 
71  void language_changed() override;
72  void skin_changed() override;
73 
74  void dragEnterEvent(QDragEnterEvent* event) override;
75  void dragLeaveEvent(QDragLeaveEvent* event) override;
76  void dropEvent(QDropEvent* event) override;
77  void dragMoveEvent(QDragMoveEvent* event) override;
78 
79  Message::Answer show_save_message_box(Util::SaveAsAnswer answer);
80 
81 
82 private slots:
83 
84  // triggered from playlist
85  void playlist_created(PlaylistPtr pl);
86  void playlist_added(PlaylistPtr pl);
87  void playlist_name_changed(int pl_idx);
88  void playlist_changed(int pl_idx);
89  void playlist_idx_changed(int pld_idx);
90 
91  // triggered by GUI
92  void tab_close_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
93  void tab_save_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
94  void tab_save_playlist_as_clicked(int pl_idx, const QString& str); // GUI_PlaylistTabs.cpp
95  void tab_save_playlist_to_file_clicked(int pl_idx, const QString& filename); // GUI_PlaylistTabs.cpp
96  void tab_rename_clicked(int pl_idx, const QString& str);
97  void tab_delete_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
98  void tab_metadata_dropped(int pl_idx, const MetaDataList& v_md);
99  void tab_files_dropped(int pl_idx, const QStringList& paths);
100  void open_file_clicked(int pl_idx);
101  void open_dir_clicked(int pl_idx);
102  void delete_tracks_clicked(const IndexSet& rows);
103 
104  void check_tab_icon();
105  void check_playlist_menu(PlaylistConstPtr pl);
106  void check_playlist_name(PlaylistConstPtr pl);
107 
108  void double_clicked(int row);
109 
110  void add_playlist_button_pressed();
111 
112  void clear_button_pressed(int pl_idx);
113  void bookmark_selected(int idx, Seconds timestamp);
114 
115  // called by playmanager
116  void playstate_changed(PlayState state);
117  void playlist_finished();
118 
119  void sl_show_clear_button_changed();
120 };
121 
122 #endif /* GUI_PLAYLIST_H_ */
PlayState
The PlayState enum.
Definition: PlayState.h:28
The MetaDataList class.
Definition: MetaDataList.h:37
The GUI_Playlist class.
Definition: GUI_Playlist.h:53
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: Set.h:35
Answer
The GlobalMessage class.
Definition: Message.h:34
The PlaylistView class.
Definition: PlaylistView.h:50