Sayonara Player
GUI_Playlist.h
1 /* GUI_Playlist.h */
2 
3 /* Copyright (C) 2011-2017 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/GlobalMessage.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 #include <QTextEdit>
43 
44 class PlaylistView;
45 
46 UI_FWD(Playlist_Window)
47 
48 class GUI_Playlist :
49  public Gui::Widget
50 {
51  Q_OBJECT
52  UI_CLASS(Playlist_Window)
53  PIMPL(GUI_Playlist)
54 
55 public:
56  explicit GUI_Playlist(QWidget *parent=nullptr);
57  ~GUI_Playlist();
58 
59 private:
60  PlaylistView* view_by_index(int idx);
61  PlaylistView* current_view();
62 
63  void set_total_time_label();
64 
66  void language_changed() override;
67  void skin_changed() override;
68 
69  void dragEnterEvent(QDragEnterEvent* event) override;
70  void dragLeaveEvent(QDragLeaveEvent* event) override;
71  void dropEvent(QDropEvent* event) override;
72  void dragMoveEvent(QDragMoveEvent* event) override;
73 
74  GlobalMessage::Answer show_save_message_box(Playlist::DBInterface::SaveAsAnswer answer);
75 
76 private slots:
77 
78  // triggered from playlist
79  void playlist_track_changed(int row, int pl_idx);
80  void playlist_created(PlaylistPtr pl);
81  void playlist_added(PlaylistPtr pl);
82  void playlist_name_changed(int pl_idx);
83  void playlist_changed(int pl_idx);
84  void playlist_idx_changed(int pld_idx);
85 
86  // triggered by GUI
87  void tab_close_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
88  void tab_save_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
89  void tab_save_playlist_as_clicked(int pl_idx, const QString& str); // GUI_PlaylistTabs.cpp
90  void tab_save_playlist_to_file_clicked(int pl_idx, const QString& filename); // GUI_PlaylistTabs.cpp
91  void tab_rename_clicked(int pl_idx, const QString& str);
92  void tab_delete_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
93  void tab_metadata_dropped(int pl_idx, const MetaDataList& v_md);
94  void open_file_clicked(int pl_idx);
95  void open_dir_clicked(int pl_idx);
96  void delete_tracks_clicked(const IndexSet& rows);
97 
98  void check_tab_icon();
99  void check_playlist_menu(PlaylistConstPtr pl);
100  void check_playlist_name(PlaylistConstPtr pl);
101 
102  void double_clicked(int row);
103 
104  void add_playlist_button_pressed();
105 
106  void clear_button_pressed(int pl_idx);
107 
108  // called by playmanager
109  void playstate_changed(PlayState state);
110  void playlist_finished();
111 
112  void _sl_look_changed();
113  void _sl_show_clear_button_changed();
114 };
115 
116 #endif /* GUI_PLAYLIST_H_ */
Definition: ComboBoxDelegate.h:26
PlayState
The PlayState enum.
Definition: PlayState.h:28
The MetaDataList class.
Definition: MetaDataList.h:38
Definition: ListView.h:45
Definition: GUI_Playlist.h:48
std::shared_ptr< const Playlist::Base > PlaylistConstPtr
PlaylistConstPtr read only Playlist Pointer.
Definition: PlaylistFwd.h:45
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: AbstractPlaylist.h:36
std::shared_ptr< Playlist::Base > PlaylistPtr
PlaylistPtr Playlist Pointer (only used internally)
Definition: PlaylistFwd.h:38