Sayonara Player
PlaylistView.h
1/* PlaylistView.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 * PlaylistView.h
24 *
25 * Created on: Jun 27, 2011
26 * Author: Michael Lugmair (Lucio Carreras)
27 */
28
29#ifndef PLAYLISTVIEW_H_
30#define PLAYLISTVIEW_H_
31
32#include "Gui/Utils/SearchableWidget/SearchableView.h"
33#include "Gui/Utils/Widgets/Dragable.h"
34#include "Gui/Utils/Widgets/WidgetTemplate.h"
35
36#include "Gui/InfoDialog/InfoDialogContainer.h"
37
38#include "Utils/Playlist/PlaylistFwd.h"
39#include "Utils/MetaData/MetaDataFwd.h"
40#include "Utils/Pimpl.h"
41
42class QPoint;
44class PlaylistCreator;
45
46namespace Playlist
47{
48 class ContextMenu;
49 class View :
52 private Gui::Dragable
53 {
54 Q_OBJECT
55 PIMPL(View)
56
57 public:
58 View(PlaylistCreator* playlistCreator, const PlaylistPtr& playlist,
59 DynamicPlaybackChecker* dynamicPlaybackChecker, QWidget* parent = nullptr);
60 ~View() override;
61
62 void dropEventFromOutside(QDropEvent* event);
63 void removeSelectedRows();
64
65 protected:
66 MD::Interpretation metadataInterpretation() const override;
67 MetaDataList infoDialogData() const override;
68 QWidget* getParentWidget() override;
69
70 int mapModelIndexToIndex(const QModelIndex& idx) const override;
71 ModelIndexRange mapIndexToModelIndexes(int index) const override;
72
73 void skinChanged() override;
74
75 void dragLeaveEvent(QDragLeaveEvent* event) override;
76 void dragEnterEvent(QDragEnterEvent* event) override;
77 void dragMoveEvent(QDragMoveEvent* event) override;
78 void dropEvent(QDropEvent* event) override;
79 void mouseDoubleClickEvent(QMouseEvent* event) override;
80 void keyPressEvent(QKeyEvent* event) override;
81 bool viewportEvent(QEvent* event) override;
82 void contextMenuEvent(QContextMenuEvent* e) override;
83
84 void searchDone() override;
85
86 private slots:
87 void clear();
88 void refresh();
89 void asyncDropFinished();
90 void ratingChanged();
91 void columnsChanged();
92 void showRatingChanged();
93 void bookmarkTriggered(Seconds timestamp);
94 void moveSelectedRowsUp();
95 void moveSelectedRowsDown();
96 void playSelectedTrack();
97 void jumpToCurrentTrack();
98 void playlistBusyChanged(bool isBusy);
99 void currentScannedFileChanged(const QString& currentFile);
100 void currentTrackChanged(int index);
101 void deleteSelectedTracks();
102
103 private:
104 void gotoRow(int row);
105 void initContextMenu();
106 void handleDrop(QDropEvent* event);
107 };
108}
109
110#endif /* PlaylistView_H_ */
Definition: DynamicPlayback.h:24
The Dragable class.
Definition: Dragable.h:61
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition: WidgetTemplate.h:87
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:64
The MetaDataList class.
Definition: MetaDataList.h:39
Definition: PlaylistInterface.h:56
Definition: PlaylistView.h:53
MetaDataList infoDialogData() const override
get the metadata that should be used for the info dialog So for lists, the selected tracks are used h...
MD::Interpretation metadataInterpretation() const override
get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums whil...
Definition: typedefs.h:33