TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
tagmodel.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 TAGMODEL_H
22 #define TAGMODEL_H
23 
24 #include <QList>
25 #include "qmmp.h"
26 
31 {
32 public:
36  enum ModelCap
37  {
38  CreateRemove = 0x1,
39  Save = 0x2,
40  DefaultCaps = CreateRemove | Save,
41  };
42  Q_DECLARE_FLAGS(ModelCaps, ModelCap)
43 
44 
48  explicit TagModel(ModelCaps f = DefaultCaps);
52  virtual ~TagModel() = default;
53 
58  virtual QString name() const = 0;
62  virtual QList<Qmmp::MetaData> keys() const;
67  virtual QString value(Qmmp::MetaData key) const = 0;
72  virtual void setValue(Qmmp::MetaData key, const QString &value) = 0;
77  virtual void setValue(Qmmp::MetaData key, int value);
81  virtual bool exists() const;
85  virtual void create();
89  virtual void remove();
93  virtual void save();
97  ModelCaps caps() const;
98 
99 private:
100  ModelCaps m_f = DefaultCaps;
101 
102 };
103 
104 Q_DECLARE_OPERATORS_FOR_FLAGS(TagModel::ModelCaps)
105 
106 #endif
static constexpr wchar_t key[]
The StateHandler class provides is the base interface class of tag editor.
Definition: tagmodel.h:30
const char * name
Definition: http_parser.c:458
#define QMMP_EXPORT
Definition: qmmp_export.h:29
#define const
Definition: zconf.h:233
The Qmmp class stores global settings and enums.
Definition: qmmp.h:70