Qmmp
detailsdialog.h
1 /***************************************************************************
2  * Copyright (C) 2009-2022 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 #ifndef DETAILSDIALOG_H
21 #define DETAILSDIALOG_H
22 
23 #include <QDialog>
24 #include <QList>
25 #include <QSet>
26 #include <qmmp/qmmp.h>
27 #include <qmmp/trackinfo.h>
28 #include "qmmpui_export.h"
29 
30 class QTextCodec;
31 class QAbstractButton;
32 class PlayListTrack;
33 class MetaDataModel;
34 class MetaDataItem;
35 
36 namespace Ui {
37  class DetailsDialog;
38 }
39 
43 class QMMPUI_EXPORT DetailsDialog : public QDialog
44 {
45  Q_OBJECT
46 public:
52  explicit DetailsDialog(const QList<PlayListTrack *> &tracks, QWidget *parent = nullptr);
58  explicit DetailsDialog(PlayListTrack *track, QWidget *parent = nullptr);
66  QStringList modifiedPaths() const;
67 
68 signals:
73  void metaDataChanged(const QStringList &paths);
74 
75 private slots:
76  void on_buttonBox_clicked(QAbstractButton *button);
77  void on_tabWidget_currentChanged(int index);
78  void on_directoryButton_clicked();
79  void on_prevButton_clicked();
80  void on_nextButton_clicked();
81 
82 private:
83  Ui::DetailsDialog *m_ui;
84  void closeEvent(QCloseEvent *) override;
85  void updatePage();
86  void printInfo();
87  QString formatRow(const QString &key, const QString &value) const;
88  QString formatRow(const MetaDataItem &item) const;
89  MetaDataModel *m_metaDataModel = nullptr;
90  QList<PlayListTrack *> m_tracks;
91  TrackInfo m_info;
92  int m_page = 0;
93  QSet<QString> m_modifiedPaths;
94 };
95 
96 #endif
The DetailsDialog class provides dialog to show/edit metadata.
Definition: detailsdialog.h:44
QStringList modifiedPaths() const
DetailsDialog(const QList< PlayListTrack * > &tracks, QWidget *parent=nullptr)
void metaDataChanged(const QStringList &paths)
DetailsDialog(PlayListTrack *track, QWidget *parent=nullptr)
Container of extra file/track property.
Definition: metadatamodel.h:38
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:81
The PlayListTrack class provides a track for use with the PlayListModel class.
Definition: playlisttrack.h:37
The TrackInfo class stores metadata and other information about track.
Definition: trackinfo.h:32