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 "Gui/Utils/Widgets/Widget.h"
33
34#include "Components/Playlist/PlaylistDBInterface.h"
35
36#include "Utils/Message/Message.h"
37#include "Utils/Library/LibraryNamespaces.h"
38#include "Utils/Playlist/PlaylistFwd.h"
39#include "Utils/Pimpl.h"
40
41namespace Playlist
42{
43 class Handler;
44 class View;
45}
46
47class PlayManager;
49
50UI_FWD(PlaylistWindow)
51
52
57 public Gui::Widget
58{
59 Q_OBJECT
60 PIMPL(GUI_Playlist)
61
62 public:
63 explicit GUI_Playlist(QWidget* parent = nullptr);
64 ~GUI_Playlist() override;
65
66 void init(Playlist::Handler* playlistHandler, PlayManager* playManager,
67 DynamicPlaybackChecker* dynamicPlaybackChecker);
68
69 private:
70 void initToolButton();
71
72 private slots:
73 // triggered from playlist
74 void playlistAdded(int playlistIndex);
75 void playlistNameChanged(int playlistIndex);
76 void playlistChanged(int playlistIndex);
77 void playlistIdxChanged(int playlistIndex);
78 void playlistClosed(int playlistIndex);
79
80 // triggered by GUI
81 void tabSavePlaylistClicked(int playlistIndex); // GUI_PlaylistTabs.cpp
82 void tabSavePlaylistAsClicked(int playlistIndex, const QString& newName); // GUI_PlaylistTabs.cpp
83 void tabSavePlaylistToFileClicked(int playlistIndex, const QString& filename, bool relativePaths);
84 void tabRenameClicked(int playlistIndex, const QString& newName);
85 void tabResetClicked(int playlistIndex);
86 void tabDeletePlaylistClicked(int playlistIndex); // GUI_PlaylistTabs.cpp
87 void tabMetadataDropped(int playlistIndex, const MetaDataList& tracks);
88 void tabFilesDropped(int playlistIndex, const QStringList& paths);
89 void openFileClicked(int playlistIndex, const QStringList& files);
90 void openDirClicked(int playlistIndex, const QString& dir);
91 void contextMenuRequested(int playlistIndex, const QPoint& position);
92
93 void checkTabIcon();
94
95 void clearButtonPressed(int playlistIndex);
96
97 void showClearButtonChanged();
98 void showBottomBarChanged();
99
100 protected:
101 void languageChanged() override;
102 void skinChanged() override;
103
104 void dragEnterEvent(QDragEnterEvent* event) override;
105 void dragLeaveEvent(QDragLeaveEvent* event) override;
106 void dropEvent(QDropEvent* event) override;
107 void dragMoveEvent(QDragMoveEvent* event) override;
108
109 private:
110 std::shared_ptr<Ui::PlaylistWindow> ui;
111};
112
113#endif /* GUI_PLAYLIST_H_ */
Definition: DynamicPlayback.h:24
The GUI_Playlist class.
Definition: GUI_Playlist.h:58
The MetaDataList class.
Definition: MetaDataList.h:39
Global handler for current playback state (Singleton)
Definition: PlayManager.h:36
Global handler for playlists.
Definition: PlaylistHandler.h:56