Qmmp
Loading...
Searching...
No Matches
qmmpsettings.h
1/***************************************************************************
2 * Copyright (C) 2010-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
21#ifndef QMMPSETTINGS_H
22#define QMMPSETTINGS_H
23
24#include <QObject>
25#include <QUrl>
26#include <QStringList>
27#include "qmmp.h"
28#include "eqsettings.h"
29
30class QTimer;
31
35class QMMP_EXPORT QmmpSettings : public QObject
36{
37Q_OBJECT
38public:
43 {
44 REPLAYGAIN_TRACK = 0,
46 REPLAYGAIN_DISABLED
47 };
48
53 {
54 HTTP_PROXY = 0,
55 SOCKS5_PROXY
56 };
62 QmmpSettings(QObject *parent = nullptr);
66 virtual ~QmmpSettings();
74 double replayGainPreamp() const;
78 double replayGainDefaultGain() const;
90 void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip);
94 bool useSoftVolume() const;
102 bool useDithering() const;
109 void setAudioSettings(bool soft_volume, Qmmp::AudioFormat format, bool use_dithering);
114 const QStringList &coverNameFilters(bool include = true) const;
118 int coverSearchDepth() const;
122 bool useCoverFiles() const;
132 void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files);
136 bool isProxyEnabled() const;
140 bool useProxyAuth() const;
144 const QUrl &proxy() const;
156 void setNetworkSettings(bool use_proxy, bool auth, ProxyType type, const QUrl &proxy);
160 const EqSettings &eqSettings() const;
164 void setEqSettings(const EqSettings &settings);
173 int bufferSize() const;
178 void setBufferSize(int msec);
183 void setVolumeStep(int step);
187 int volumeStep() const;
194 void setAverageBitrate(bool enabled);
198 bool averageBitrate() const;
213
214signals:
235
236private slots:
240 void sync();
241
242private:
243 //replaygain settings
245 double m_rg_preamp;
246 double m_rg_defaut_gain;
247 bool m_rg_prevent_clipping;
248 //audio settings
249 bool m_aud_software_volume;
250 bool m_aud_dithering;
251 Qmmp::AudioFormat m_aud_format;
252 int m_volume_step;
253 bool m_average_bitrate;
254 //cover settings
255 QStringList m_cover_inc;
256 QStringList m_cover_exclude;
257 int m_cover_depth;
258 bool m_cover_use_files;
259 //network settings
260 bool m_proxy_enabled;
261 bool m_proxy_auth;
262 QUrl m_proxy_url;
263 ProxyType m_proxy_type;
264 //equalizer settings
265 EqSettings m_eq_settings;
266 //buffer size
267 int m_buffer_size;
268 //file type determination
269 bool m_determine_by_content;
270 //timer
271 QTimer *m_timer;
272
273 static QmmpSettings* m_instance;
274
275};
276
277#endif // QMMPSETTINGS_H
The EqSettings class helps to work with equalizer settings.
Definition eqsettings.h:30
Bands
Definition eqsettings.h:36
@ EQ_BANDS_10
Definition eqsettings.h:37
AudioFormat
Definition qmmp.h:115
The QmmpSettings class provides access to global settings.
Definition qmmpsettings.h:36
ReplayGainMode
Definition qmmpsettings.h:43
@ REPLAYGAIN_ALBUM
Definition qmmpsettings.h:45
void setAverageBitrate(bool enabled)
const QStringList & coverNameFilters(bool include=true) const
double replayGainDefaultGain() const
void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip)
QmmpSettings(QObject *parent=nullptr)
int bufferSize() const
bool useSoftVolume() const
int coverSearchDepth() const
void setNetworkSettings(bool use_proxy, bool auth, ProxyType type, const QUrl &proxy)
void setBufferSize(int msec)
void readEqSettings(EqSettings::Bands bands=EqSettings::EQ_BANDS_10)
QmmpSettings::ReplayGainMode replayGainMode() const
void setAudioSettings(bool soft_volume, Qmmp::AudioFormat format, bool use_dithering)
bool determineFileTypeByContent() const
ProxyType proxyType() const
bool replayGainPreventClipping() const
void setDetermineFileTypeByContent(bool enabled)
void setVolumeStep(int step)
double replayGainPreamp() const
void setEqSettings(const EqSettings &settings)
bool useDithering() const
const QUrl & proxy() const
void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files)
bool isProxyEnabled() const
bool useCoverFiles() const
void networkSettingsChanged()
Qmmp::AudioFormat outputFormat() const
bool averageBitrate() const
bool useProxyAuth() const
void replayGainSettingsChanged()
void eqSettingsChanged()
int volumeStep() const
void audioSettingsChanged()
virtual ~QmmpSettings()
const EqSettings & eqSettings() const
static QmmpSettings * instance()
void coverSettingsChanged()
ProxyType
Definition qmmpsettings.h:53