Qmmp
Loading...
Searching...
No Matches
jumptotrackdialog_p.h
1/***************************************************************************
2 * Copyright (C) 2007-2025 by Ilya Kotov *
3 * forkotov02@ya.ru *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20
21#ifndef JUMPTOTRACKDIALOG_P_H
22#define JUMPTOTRACKDIALOG_P_H
23
24#include <QDialog>
25#include <QList>
26#include <QSet>
27#include <QAbstractListModel>
28#include "metadataformatter.h"
29
30class TrackListModel;
31class QSortFilterProxyModel;
32class QEvent;
33class PlayListManager;
34class PlayListModel;
35
36namespace Ui {
37class JumpToTrackDialog;
38}
39
44class JumpToTrackDialog : public QDialog
45{
46 Q_OBJECT
47
48public:
49 enum { QueueRole = Qt::UserRole + 1 };
50
51 explicit JumpToTrackDialog(PlayListModel *model, QWidget* parent = nullptr);
52 ~JumpToTrackDialog();
53
54private slots:
55 void on_queuePushButton_clicked();
56 void on_jumpToPushButton_clicked();
57 void jumpTo(const QModelIndex&);
58 void queueUnqueue(const QModelIndex&,const QModelIndex&);
59
60private:
61 bool eventFilter(QObject *o, QEvent *e) override;
62
63 Ui::JumpToTrackDialog *m_ui;
64 TrackListModel *m_listModel;
65 QSortFilterProxyModel* m_proxyModel;
66 PlayListManager *m_pl_manager;
67 PlayListModel *m_model;
68 QList<int> m_indexes;
69 QHash<int, QString> m_queueText;
70};
71
76class TrackListModel : public QAbstractListModel
77{
78 Q_OBJECT
79public:
80 explicit TrackListModel(PlayListModel *model, QObject *parent);
81
82 QVariant data(const QModelIndex &index, int role) const override;
83 int rowCount(const QModelIndex &parent) const override;
84
85private slots:
86 void onListChanged(int flags);
87
88private:
89 PlayListModel *m_model;
90 QSet<PlayListTrack *> m_queue;
91
92};
93
94
95#endif //JUMPTOTRACKDIALOG_P_H
The PlayListManager class is used to handle multiple playlists.
Definition playlistmanager.h:37
The PlayListModel class provides a data model for the playlist.
Definition playlistmodel.h:88