TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
qmmpsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2010-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 QMMPSETTINGS_H
22 #define QMMPSETTINGS_H
23 
24 #include <QUrl>
25 #include <QObject>
26 #include <QStringList>
27 #include "qmmp.h"
28 #include "eqsettings.h"
29 
30 class QTimer;
31 
35 class QMMP_EXPORT QmmpSettings : public QObject
36 {
37  Q_OBJECT
38 public:
43  {
44  REPLAYGAIN_TRACK = 0,
46  REPLAYGAIN_DISABLED
47  };
48 
52  enum ProxyType
53  {
54  HTTP_PROXY = 0,
55  SOCKS5_PROXY
56  };
57 
63  explicit QmmpSettings(QObject *parent = nullptr);
67  virtual ~QmmpSettings();
68 
72  QmmpSettings::ReplayGainMode replayGainMode() const;
76  double replayGainPreamp() const;
80  double replayGainDefaultGain() const;
84  bool replayGainPreventClipping() const;
92  void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip);
96  bool useSoftVolume() const;
100  Qmmp::AudioFormat outputFormat() const;
104  bool useDithering() const;
111  void setAudioSettings(bool soft_volume, Qmmp::AudioFormat format, bool use_dithering);
116  const QStringList &coverNameFilters(bool include = true) const;
120  int coverSearchDepth() const;
124  bool useCoverFiles() const;
134  void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files);
138  bool isProxyEnabled() const;
142  bool useProxyAuth() const;
146  const QUrl &proxy() const;
150  ProxyType proxyType() const;
158  void setNetworkSettings(bool use_proxy, bool auth, ProxyType type, const QUrl &proxy);
162  const EqSettings &eqSettings() const;
166  void setEqSettings(const EqSettings &settings);
171  void readEqSettings(EqSettings::Bands bands = EqSettings::EQ_BANDS_10);
175  int bufferSize() const;
180  void setBufferSize(int msec);
185  void setVolumeStep(int step);
189  int volumeStep() const;
196  void setAverageBitrate(bool enabled);
200  bool averageBitrate() const;
206  void setDetermineFileTypeByContent(bool enabled);
210  bool determineFileTypeByContent() const;
214  static QmmpSettings* instance();
215 
216 signals:
220  void replayGainSettingsChanged();
224  void audioSettingsChanged();
228  void coverSettingsChanged();
232  void networkSettingsChanged();
236  void eqSettingsChanged();
237 
238 private slots:
242  void sync();
243 
244 private:
245  void saveSettings();
246 
247  //replaygain settings
249  double m_rg_preamp;
252  //audio settings
258  //cover settings
259  QStringList m_cover_inc;
260  QStringList m_cover_exclude;
263  //network settings
268  //equalizer settings
270  //buffer size
272  //file type determination
274  //protect from multiple calls
275  bool m_saveSettings = false;
276 
278 
279 };
280 
281 #endif
bool m_aud_dithering
Definition: qmmpsettings.h:254
QStringList m_cover_inc
Definition: qmmpsettings.h:259
bool m_aud_software_volume
Definition: qmmpsettings.h:253
double m_rg_defaut_gain
Definition: qmmpsettings.h:250
QStringList m_cover_exclude
Definition: qmmpsettings.h:260
EqSettings m_eq_settings
Definition: qmmpsettings.h:269
bool m_average_bitrate
Definition: qmmpsettings.h:257
The QmmpSettings class provides access to global settings.
Definition: qmmpsettings.h:35
bool m_proxy_enabled
Definition: qmmpsettings.h:264
bool m_determine_by_content
Definition: qmmpsettings.h:273
double m_rg_preamp
Definition: qmmpsettings.h:249
The EqSettings class helps to work with equalizer settings.
Definition: eqsettings.h:29
#define QMMP_EXPORT
Definition: qmmp_export.h:29
bool m_cover_use_files
Definition: qmmpsettings.h:262
ProxyType m_proxy_type
Definition: qmmpsettings.h:267
bool m_rg_prevent_clipping
Definition: qmmpsettings.h:251
const char int mode
Definition: ioapi.h:135
Qmmp::AudioFormat m_aud_format
Definition: qmmpsettings.h:255
AudioFormat
Definition: qmmp.h:129
QmmpSettings::ReplayGainMode m_rg_mode
Definition: qmmpsettings.h:248
static QmmpSettings * m_instance
Definition: qmmpsettings.h:277