TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
qmmp.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2008-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 QMMP_H
22 #define QMMP_H
23 
24 #include <QString>
25 #include "qmmp_export.h"
26 
27 #define QMMP_VERSION_MAJOR 1
28 #define QMMP_VERSION_MINOR 6
29 #define QMMP_VERSION_PATCH 7
30 
31 #define QMMP_VERSION_INT (QMMP_VERSION_MAJOR<<16 | QMMP_VERSION_MINOR<<8 | QMMP_VERSION_PATCH)
32 
36 #ifdef Q_OS_WIN
37 # define QStringToFileName(s) TagLib::FileName(reinterpret_cast<const wchar_t *>(s.utf16()))
38 #else
39 # define QStringToFileName(s) s.toLocal8Bit().constData()
40 #endif
41 
42 #ifndef qPrintable
43 # define qPrintable(s) QString(s).toLocal8Bit().constData()
44 #endif
45 
46 #ifndef qUtf8Printable
47 # define qUtf8Printable(s) QString(s).toUtf8().constData()
48 #endif
49 
50 #ifndef QmmpPrintable
51 # define QmmpPrintable(s) Qmmp::generatePrintable(s).constData()
52 #endif
53 
54 #define CSTR_TO_QSTR(codec, str, utf) codec->toUnicode(str.toCString(utf)).trimmed()
55 
56 #ifndef TTK_AS_CONST
57 # if QT_VERSION < QT_VERSION_CHECK(5,7,0)
58 // this adds const to non-const objects (like std::as_const)
59 template <typename T>
60 Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
61 // prevent rvalue arguments:
62 template <typename T>
63 void qAsConst(const T &&) = delete;
64 # endif
65 #endif
66 
71 {
72 public:
76  enum State
77  {
78  Playing = 0,
83  FatalError
84  };
88  enum MetaData
89  {
90  UNKNOWN = -1,
91  TITLE = 0,
98  YEAR,
100  DISCNUMBER
101  };
106  {
107  UNKNOWN_PROPERTY = -1,
108  BITRATE = 0,
114  FILE_SIZE
115  };
120  {
121  REPLAYGAIN_TRACK_GAIN = 0,
124  REPLAYGAIN_ALBUM_PEAK
125  };
130  {
131  PCM_UNKNOWN = -1,
132  PCM_S8 = 0,
146  PCM_FLOAT
147  };
148 
153  {
154  CHAN_NULL = 0x00,
155  CHAN_FRONT_LEFT = 0x01,
156  CHAN_FRONT_RIGHT = 0x02,
157  CHAN_REAR_LEFT = 0x04,
158  CHAN_REAR_RIGHT = 0x08,
159  CHAN_FRONT_CENTER = 0x10,
160  CHAN_REAR_CENTER = 0x20,
161  CHAN_SIDE_LEFT = 0x40,
162  CHAN_SIDE_RIGHT = 0x80,
163  CHAN_LFE = 0x100,
164  };
165 
169  static QString configFile();
173  static QString configDir();
177  static QString cacheDir();
181  static QString strVersion();
185  static QString pluginPath();
190  static QStringList findPlugins(const QString &prefix);
194  static QString ttkPluginPath();
199  static QByteArray generatePrintable(const QString &text);
200 };
201 
202 #endif
#define T(v)
Definition: http_parser.c:237
TrackProperty
Definition: qmmp.h:105
ReplayGainKey
Definition: qmmp.h:119
#define qAsConst
Definition: ttkqtglobal.h:53
ChannelPosition
Definition: qmmp.h:152
MetaData
Definition: qmmp.h:88
State
Definition: qmmp.h:76
#define QMMP_EXPORT
Definition: qmmp_export.h:29
TTK_MODULE_EXPORT QString pluginPath(const QString &module, const QString &format)
AudioFormat
Definition: qmmp.h:129
The Qmmp class stores global settings and enums.
Definition: qmmp.h:70