Qmmp
qmmpsettings.h
1 /***************************************************************************
2  * Copyright (C) 2010-2019 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 
30 class QTimer;
31 
35 class QMMP_EXPORT QmmpSettings : public QObject
36 {
37 Q_OBJECT
38 public:
44  QmmpSettings(QObject *parent = 0);
48  virtual ~QmmpSettings();
53  {
54  REPLAYGAIN_TRACK = 0,
56  REPLAYGAIN_DISABLED
57  };
61  QmmpSettings::ReplayGainMode replayGainMode() const;
65  double replayGainPreamp() const;
69  double replayGainDefaultGain() const;
73  bool replayGainPreventClipping() const;
81  void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip);
85  bool useSoftVolume() const;
89  Qmmp::AudioFormat outputFormat() const;
93  bool useDithering() const;
100  void setAudioSettings(bool soft_volume, Qmmp::AudioFormat format, bool use_dithering);
105  QStringList coverNameFilters(bool include = true) const;
109  int coverSearchDepth() const;
113  bool useCoverFiles() const;
123  void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files);
127  bool isProxyEnabled() const;
131  bool useProxyAuth() const;
135  QUrl proxy() const;
142  void setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy);
146  EqSettings eqSettings() const;
150  void setEqSettings(const EqSettings &settings);
155  void readEqSettings(int bands = EqSettings::EQ_BANDS_10);
159  int bufferSize() const;
164  void setBufferSize(int msec);
169  void setVolumeStep(int step);
173  int volumeStep() const;
179  void setDetermineFileTypeByContent(bool enabled);
183  bool determineFileTypeByContent() const;
187  static QmmpSettings* instance();
188 
189 signals:
193  void replayGainSettingsChanged();
197  void audioSettingsChanged();
201  void coverSettingsChanged();
205  void networkSettingsChanged();
209  void eqSettingsChanged();
210 
211 private slots:
215  void sync();
216 
217 private:
218  //replaygain settings
220  double m_rg_preamp;
221  double m_rg_defaut_gain;
222  bool m_rg_prevent_clipping;
223  //audio settings
224  bool m_aud_software_volume;
225  bool m_aud_dithering;
226  Qmmp::AudioFormat m_aud_format;
227  int m_volume_step;
228  //cover settings
229  QStringList m_cover_inc;
230  QStringList m_cover_exclude;
231  int m_cover_depth;
232  bool m_cover_use_files;
233  //network settings
234  bool m_proxy_enabled;
235  bool m_proxy_auth;
236  QUrl m_proxy_url;
237  //equalizer settings
238  EqSettings m_eq_settings;
239  //buffer size
240  int m_buffer_size;
241  //file type determination
242  bool m_determine_by_content;
243  //timer
244  QTimer *m_timer;
245 
246  static QmmpSettings* m_instance;
247 
248 };
249 
250 #endif // QMMPSETTINGS_H
Definition: eqsettings.h:88
ReplayGainMode
Definition: qmmpsettings.h:52
The QmmpSettings class provides access to global settings.
Definition: qmmpsettings.h:35
Definition: qmmpsettings.h:55
The EqSettings class helps to work with equalizer settings.
Definition: eqsettings.h:29
AudioFormat
Definition: qmmp.h:105