Qmmp
qmmp.h
1 /***************************************************************************
2  * Copyright (C) 2008-2018 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 0
27 #define QMMP_VERSION_MINOR 12
28 #define QMMP_VERSION_PATCH 0
29 #define QMMP_VERSION_STABLE 0
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_UNKNOWM = -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  };
141 
145  static QString configFile();
149  static QString configDir();
153  static void setConfigDir(const QString &path);
157  static QString strVersion();
161  static QString pluginPath();
162  static QStringList findPlugins(const QString &prefix);
163 
167  static QString systemLanguageID();
171  static QString uiLanguageID();
176  static void setUiLanguageID(const QString &code);
177 #ifdef Q_OS_WIN
178 
181  static bool isPortable();
182 #endif
183 
184 private:
185  static QString m_configDir;
186  static QString m_langID;
187 #ifdef Q_OS_WIN
188  static QString m_appDir;
189 #endif
190 
191 };
192 
193 #endif
Definition: qmmp.h:68
Definition: qmmp.h:71
Definition: qmmp.h:118
Definition: qmmp.h:58
Definition: qmmp.h:73
Definition: qmmp.h:110
Definition: qmmp.h:113
Definition: qmmp.h:121
State
Definition: qmmp.h:52
ChannelPosition
Definition: qmmp.h:128
Definition: qmmp.h:109
Definition: qmmp.h:69
Definition: qmmp.h:57
Definition: qmmp.h:72
Definition: qmmp.h:56
Definition: qmmp.h:55
Definition: qmmp.h:115
Definition: qmmp.h:120
Definition: qmmp.h:119
Definition: qmmp.h:75
MetaData
Definition: qmmp.h:64
Definition: qmmp.h:117
Definition: qmmp.h:98
Definition: qmmp.h:74
Definition: qmmp.h:114
ReplayGainKey
Definition: qmmp.h:95
Definition: qmmp.h:111
Definition: qmmp.h:112
AudioFormat
Definition: qmmp.h:105
TrackProperty
Definition: qmmp.h:81
Definition: qmmp.h:116
Definition: qmmp.h:70
The Qmmp class stores global settings and enums.
Definition: qmmp.h:46
Definition: qmmp.h:99