Sayonara Player
GUI_Playlist.h
1 /* GUI_Playlist.h */
2 
3 /* Copyright (C) 2011-2016 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 "GUI/Playlist/ui_GUI_Playlist.h"
33 #include "Components/Playlist/PlaylistHandler.h"
34 #include "GUI/Helper/Message/GlobalMessage.h"
35 
36 #include <QTextEdit>
37 #include <QFocusEvent>
38 #include <QKeyEvent>
39 
40 
41 class PlaylistView;
43 {
44  Q_OBJECT
45 
46 public:
47  GUI_Playlist(QWidget *parent=nullptr);
48  ~GUI_Playlist();
49 
50 private:
51  PlayManager* _play_manager=nullptr;
52  PlaylistHandler* _playlist=nullptr;
53  Playlist::Type _playlist_type;
54 
55 private:
56  PlaylistView* get_view_by_idx(int idx);
57  PlaylistView* get_current_view();
58 
59  void init_shortcuts();
60  void set_total_time_label();
61 
63  void resizeEvent(QResizeEvent *e) override;
64  void language_changed() override;
65  void skin_changed() override;
66 
67  void dragEnterEvent(QDragEnterEvent* event) override;
68  void dragLeaveEvent(QDragLeaveEvent* event) override;
69  void dropEvent(QDropEvent* event) override;
70  void dragMoveEvent(QDragMoveEvent* event) override;
71  void changeEvent(QEvent* e) override;
72 
73  GlobalMessage::Answer show_save_message_box(PlaylistDBInterface::SaveAsAnswer answer);
74 
75 private slots:
76 
77  void load_old_playlists();
78 
79  // triggered from playlist
80  void playlist_track_changed(int row, int pl_idx); // GUI_Playlist.cpp
81  void playlist_fill(PlaylistPtr pl); // GUI_Playlist.cpp
82  void playlist_added(PlaylistPtr pl); // GUI_PlaylistTabs.cpp
83  void playlist_name_changed(int pl_idx);// GUI_PlaylistTabs.cpp
84  void playlist_changed(int pl_idx);
85  void playlist_idx_changed(int pld_idx);
86 
87  // triggered by GUI
88  void tab_close_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
89  void tab_save_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
90  void tab_save_playlist_as_clicked(int pl_idx, const QString& str); // 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 
97  void check_tab_icon();
98  void check_playlist_menu(PlaylistConstPtr pl);
99  void check_playlist_name(PlaylistConstPtr pl);
100 
101  void double_clicked(int row);
102 
103  void add_playlist_button_pressed();
104 
105  void clear_button_pressed(int pl_idx);
106 
107  void select_tab_left();
108  void select_tab_right();
109 
110 
111  // called by playmanager
112  void playstate_changed(PlayManager::PlayState state);
113  void playlist_finished();
114  void playlist_time_changed();
115 
116 
117  void _sl_show_numbers_changed();
118  void _sl_library_path_changed();
119 };
120 
121 
122 
123 
124 
125 #endif /* GUI_PLAYLIST_H_ */
Definition: ui_GUI_Playlist.h:115
PlayState
Current Playing state.
Definition: PlayManager.h:91
Definition: MetaDataList.h:44
Definition: PlaylistView.h:55
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: SayonaraWidget.h:41
Definition: GUI_Playlist.h:42
Global handler for current playback state (Singleton)
Definition: PlayManager.h:79
Global handler for playlists.
Definition: PlaylistHandler.h:47