Sayonara Player
Loading...
Searching...
No Matches
PlaylistView.h
1/* PlaylistView.h */
2
3/* Copyright (C) 2011-2024 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 SAYONARA_PLAYER_PLAYLIST_VIEW_H
30#define SAYONARA_PLAYER_PLAYLIST_VIEW_H
31
32#include "Gui/InfoDialog/InfoDialogContainer.h"
33#include "Gui/Utils/SearchableWidget/SearchableView.h"
34#include "Gui/Utils/Widgets/Dragable.h"
35#include "Gui/Utils/Widgets/WidgetTemplate.h"
36#include "Utils/Library/Sortorder.h"
37#include "Utils/MetaData/MetaDataFwd.h"
38#include "Utils/Pimpl.h"
39#include "Utils/Playlist/PlaylistFwd.h"
40#include "Utils/typedefs.h"
41
42class QPoint;
44
45namespace Library
46{
47 class InfoAccessor;
48}
49
50namespace Playlist
51{
52 class ContextMenu;
53 class View :
56 private Gui::Dragable
57 {
58 Q_OBJECT
59 PIMPL(View)
60
61 public:
62 View(const PlaylistPtr& playlist, DynamicPlaybackChecker* dynamicPlaybackChecker,
63 Library::InfoAccessor* libraryAccessor, QWidget* parent);
64 ~View() override;
65
66 void dropEventFromOutside(QDropEvent* event);
67 void removeSelectedRows();
68
69 [[nodiscard]] bool isLocked() const;
70 void setLocked(bool b);
71
72 protected:
73 [[nodiscard]] MD::Interpretation metadataInterpretation() const override;
74 [[nodiscard]] MetaDataList infoDialogData() const override;
75 [[nodiscard]] QWidget* getParentWidget() override;
76
77 [[nodiscard]] int mapModelIndexToIndex(const QModelIndex& idx) const override;
78 [[nodiscard]] ModelIndexRange mapIndexToModelIndexes(int index) const override;
79
80 void skinChanged() override;
81
82 void dragLeaveEvent(QDragLeaveEvent* event) override;
83 void dragEnterEvent(QDragEnterEvent* event) override;
84 void dragMoveEvent(QDragMoveEvent* event) override;
85 void dropEvent(QDropEvent* event) override;
86 void mouseDoubleClickEvent(QMouseEvent* event) override;
87 void keyPressEvent(QKeyEvent* event) override;
88 bool viewportEvent(QEvent* event) override;
89 void contextMenuEvent(QContextMenuEvent* e) override;
90
91 void searchDone() override;
92
93 private slots:
94 void clear();
95 void refresh();
96 void asyncDropFinished();
97 void ratingChanged(Rating rating);
98 void columnsChanged();
99 void showRatingChanged();
100 void bookmarkTriggered(Seconds timestamp);
101 void sortingTriggered(Library::SortOrder sortOrder);
102 void moveSelectedRowsUp();
103 void moveSelectedRowsDown();
104 void playSelectedTrack();
105 void jumpToCurrentTrack();
106 void playlistBusyChanged(bool isBusy);
107 void currentScannedFileChanged(const QString& currentFile);
108 void currentTrackChanged(int index);
109 void deleteSelectedTracks();
110
111 private:
112 void gotoRow(int row);
113 void initContextMenu();
114 void handleDrop(QDropEvent* event);
115 };
116}
117
118#endif /* SAYONARA_PLAYER_PLAYLIST_VIEW_H */
Definition DynamicPlaybackChecker.h:29
The Dragable class.
Definition Dragable.h:62
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition WidgetTemplate.h:86
Definition InfoDialogContainer.h:61
Definition LibraryManager.h:36
Definition MetaDataList.h:34
Definition PlaylistView.h:57
Definition typedefs.h:33