TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
metadatamodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2009-2024 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 METADATAMODEL_H
22 #define METADATAMODEL_H
23 
24 #include <QCoreApplication>
25 #include <QPixmap>
26 #include <QVariant>
27 #include <QFlags>
28 #include "tagmodel.h"
29 #include "regularexpression.h"
30 
35 {
36 public:
43  MetaDataItem(const QString &name, const QVariant &value, const QString &suffix = QString());
47  const QString &name() const;
51  void setName(const QString &name);
55  const QVariant &value() const;
59  void setValue(const QString &value);
63  const QString &suffix() const;
67  void setSuffix(const QString &suffix);
68 
69 private:
70  QString m_name, m_suffix;
71  QVariant m_value;
72 
73 };
74 
79 {
80 public:
85  {
86  IsCoverEditable = 0x1,
87  CompletePropertyList = 0x2,
88  IsCueEditable = 0x4
89  };
90  Q_DECLARE_FLAGS(DialogHints, DialogHint)
91 
92 
97  explicit MetaDataModel(bool readOnly, DialogHints hints = DialogHints());
101  virtual ~MetaDataModel() = default;
102 
107  virtual QList<MetaDataItem> extraProperties() const;
112  virtual QList<MetaDataItem> descriptions() const;
117  virtual QList<TagModel*> tags() const;
122  virtual QPixmap cover() const;
128  virtual void setCover(const QPixmap &pix);
133  virtual void removeCover();
137  virtual QString coverPath() const;
141  virtual QString cue() const;
145  virtual void setCue(const QString &content);
149  virtual void removeCue();
153  virtual QString lyrics() const;
157  bool isReadOnly() const;
161  const DialogHints &dialogHints() const;
162 
163 protected:
167  void setDialogHints(const DialogHints &hints);
172  void setReadOnly(bool readOnly);
173 
174 private:
175  bool m_readOnly;
176  DialogHints m_dialogHints;
177 
178 };
179 
180 Q_DECLARE_OPERATORS_FOR_FLAGS(MetaDataModel::DialogHints)
181 
182 #endif
Container of extra file/track property.
Definition: metadatamodel.h:34
QString m_suffix
Definition: metadatamodel.h:70
The StateHandler class provides is the base interface class of tag editor.
Definition: tagmodel.h:30
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:78
const char * name
Definition: http_parser.c:458
TTK_MODULE_EXPORT QString suffix(const QString &name)
#define QMMP_EXPORT
Definition: qmmp_export.h:29
#define const
Definition: zconf.h:233
QVariant m_value
Definition: metadatamodel.h:71