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