Qmmp
qmmp.h
1 /***************************************************************************
2  * Copyright (C) 2008-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 QMMP_H
21 #define QMMP_H
22 
23 #include <QString>
24 #include "qmmp_export.h"
25 
26 #define QMMP_VERSION_MAJOR 2
27 #define QMMP_VERSION_MINOR 1
28 #define QMMP_VERSION_PATCH 5
29 #define QMMP_VERSION_STABLE 1
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 
46 class QMMP_EXPORT Qmmp
47 {
48 public:
52  enum State
53  {
54  Playing = 0,
59  FatalError
60  };
64  enum MetaData
65  {
66  UNKNOWN = -1,
67  TITLE = 0,
74  YEAR,
76  DISCNUMBER
77  };
82  {
83  UNKNOWN_PROPERTY = -1,
84  BITRATE = 0,
85  SAMPLERATE,
86  CHANNELS,
87  BITS_PER_SAMPLE,
88  FORMAT_NAME,
89  DECODER,
90  FILE_SIZE
91  };
96  {
97  REPLAYGAIN_TRACK_GAIN = 0,
100  REPLAYGAIN_ALBUM_PEAK
101  };
106  {
107  PCM_UNKNOWN = -1,
108  PCM_S8 = 0,
122  PCM_FLOAT
123  };
124 
129  {
130  CHAN_NULL = 0x00,
131  CHAN_FRONT_LEFT = 0x01,
132  CHAN_FRONT_RIGHT = 0x02,
133  CHAN_REAR_LEFT = 0x04,
134  CHAN_REAR_RIGHT = 0x08,
135  CHAN_FRONT_CENTER = 0x10,
136  CHAN_REAR_CENTER = 0x20,
137  CHAN_SIDE_LEFT = 0x40,
138  CHAN_SIDE_RIGHT = 0x80,
139  CHAN_LFE = 0x100,
140  };
144  static QString configDir();
148  static void setConfigDir(const QString &path);
152  static QString cacheDir();
156  static QString strVersion();
160  static QString pluginPath();
165  static QStringList findPlugins(const QString &prefix);
169  static QString systemLanguageID();
173  static QString uiLanguageID();
178  static void setUiLanguageID(const QString &code);
182  static QString dataPath();
187  static QString userDataPath();
188 #ifdef Q_OS_WIN
192  static bool isPortable();
193 #endif
194 
195 private:
196  static QString m_configDir;
197  static QString m_langID;
198 #ifdef Q_OS_WIN
199  static QString m_appDir;
200 #endif
201 
202 };
203 
204 #endif
The Qmmp class stores global settings and enums.
Definition: qmmp.h:47
static void setConfigDir(const QString &path)
static void setUiLanguageID(const QString &code)
TrackProperty
Definition: qmmp.h:82
static QString strVersion()
ChannelPosition
Definition: qmmp.h:129
static QString dataPath()
State
Definition: qmmp.h:53
@ Stopped
Definition: qmmp.h:56
@ Paused
Definition: qmmp.h:55
@ NormalError
Definition: qmmp.h:58
@ Buffering
Definition: qmmp.h:57
static QString userDataPath()
MetaData
Definition: qmmp.h:65
@ ALBUMARTIST
Definition: qmmp.h:69
@ TRACK
Definition: qmmp.h:75
@ COMPOSER
Definition: qmmp.h:73
@ GENRE
Definition: qmmp.h:72
@ COMMENT
Definition: qmmp.h:71
@ ARTIST
Definition: qmmp.h:68
@ ALBUM
Definition: qmmp.h:70
@ YEAR
Definition: qmmp.h:74
AudioFormat
Definition: qmmp.h:106
@ PCM_S32BE
Definition: qmmp.h:119
@ PCM_U8
Definition: qmmp.h:109
@ PCM_S24BE
Definition: qmmp.h:115
@ PCM_S16BE
Definition: qmmp.h:111
@ PCM_S32LE
Definition: qmmp.h:118
@ PCM_U24BE
Definition: qmmp.h:117
@ PCM_U32BE
Definition: qmmp.h:121
@ PCM_S16LE
Definition: qmmp.h:110
@ PCM_S24LE
Definition: qmmp.h:114
@ PCM_U24LE
Definition: qmmp.h:116
@ PCM_U16BE
Definition: qmmp.h:113
@ PCM_U32LE
Definition: qmmp.h:120
@ PCM_U16LE
Definition: qmmp.h:112
ReplayGainKey
Definition: qmmp.h:96
@ REPLAYGAIN_ALBUM_GAIN
Definition: qmmp.h:99
@ REPLAYGAIN_TRACK_PEAK
Definition: qmmp.h:98
static QString systemLanguageID()
static QString cacheDir()
static QString uiLanguageID()
static QString configDir()
static QStringList findPlugins(const QString &prefix)
static QString pluginPath()