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 class GUI_InfoDialog;
41 class PlaylistView;
43 {
44  Q_OBJECT
45 
46 public:
47  GUI_Playlist(QWidget *parent=nullptr);
48  ~GUI_Playlist();
49 
50 
51 private:
52 
53  PlayManager* _play_manager=nullptr;
54  PlaylistHandler* _playlist=nullptr;
55  GUI_InfoDialog* _info_dialog=nullptr;
56  Playlist::Type _playlist_type;
57 
58  QVector<qint64> _total_time;
59 
60 
61 private:
62  PlaylistView* get_view_by_idx(int idx);
63  PlaylistView* get_current_view();
64 
65  void set_total_time_label();
66  void fill_info_dialog();
67  void init_shortcuts();
68 
69 
71  void resizeEvent(QResizeEvent *e) override;
72  void language_changed() override;
73  void skin_changed() override;
74 
75  void dragEnterEvent(QDragEnterEvent* event) override;
76  void dragLeaveEvent(QDragLeaveEvent* event) override;
77  void dropEvent(QDropEvent* event) override;
78  void dragMoveEvent(QDragMoveEvent* event) override;
79  void changeEvent(QEvent* e) override;
80 
81 
82  GlobalMessage::Answer show_save_message_box(PlaylistDBInterface::SaveAsAnswer answer);
83 
84 
85 private slots:
86 
87  void load_old_playlists();
88 
89  // triggered from playlist
90  void playlist_track_changed(int row, int pl_idx); // GUI_Playlist.cpp
91  void playlist_fill(PlaylistPtr pl); // GUI_Playlist.cpp
92  void playlist_added(PlaylistPtr pl); // GUI_PlaylistTabs.cpp
93  void playlist_name_changed(int pl_idx);// GUI_PlaylistTabs.cpp
94  void playlist_changed(int pl_idx);
95  void playlist_idx_changed(int pld_idx);
96 
97  // triggered by GUI
98  void tab_close_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
99  void tab_save_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
100  void tab_save_playlist_as_clicked(int pl_idx, const QString& str); // GUI_PlaylistTabs.cpp
101  void tab_rename_clicked(int pl_idx, const QString& str);
102  void tab_delete_playlist_clicked(int pl_idx); // GUI_PlaylistTabs.cpp
103  void tab_metadata_dropped(int pl_idx, const MetaDataList& v_md);
104 
105  void check_tab_icon();
106  void check_playlist_menu(PlaylistConstPtr pl);
107  void check_playlist_name(PlaylistConstPtr pl);
108 
109  void double_clicked(int row);
110 
111  void add_playlist_button_pressed();
112 
113  void clear_button_pressed(int pl_idx);
114 
115  void select_tab_left();
116  void select_tab_right();
117 
118 
119  // triggered from ContextMenu
120 
121  void menu_info_clicked();
122  void menu_edit_clicked();
123  void menu_lyrics_clicked();
124 
125  // called by playmanager
126  void playstate_changed(PlayManager::PlayState state);
127  void playlist_finished();
128 
129 
130  void _sl_show_numbers_changed();
131  void _sl_library_path_changed();
132 };
133 
134 
135 
136 
137 
138 #endif /* GUI_PLAYLIST_H_ */
Definition: GUI_InfoDialog.h:41
Definition: ui_GUI_Playlist.h:115
PlayState
Current Playing state.
Definition: PlayManager.h:79
Definition: MetaDataList.h:46
Definition: PlaylistView.h:48
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:67
Global handler for playlists.
Definition: PlaylistHandler.h:48