|
Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2010-2016 by Ilya Kotov * 00003 * forkotov02@hotmail.ru * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef QMMPSETTINGS_H 00022 #define QMMPSETTINGS_H 00023 00024 #include <QObject> 00025 #include <QUrl> 00026 #include <QStringList> 00027 #include "qmmp.h" 00028 #include "eqsettings.h" 00029 00030 class QTimer; 00031 00035 class QmmpSettings : public QObject 00036 { 00037 Q_OBJECT 00038 public: 00044 QmmpSettings(QObject *parent = 0); 00048 virtual ~QmmpSettings(); 00052 enum ReplayGainMode 00053 { 00054 REPLAYGAIN_TRACK = 0, 00055 REPLAYGAIN_ALBUM, 00056 REPLAYGAIN_DISABLED 00057 }; 00061 QmmpSettings::ReplayGainMode replayGainMode() const; 00065 double replayGainPreamp() const; 00069 double replayGainDefaultGain() const; 00073 bool replayGainPreventClipping() const; 00081 void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip); 00085 bool useSoftVolume() const; 00089 Qmmp::AudioFormat outputFormat() const; 00093 bool useDithering() const; 00100 void setAudioSettings(bool soft_volume, Qmmp::AudioFormat format, bool use_dithering); 00105 QStringList coverNameFilters(bool include = true) const; 00109 int coverSearchDepth() const; 00113 bool useCoverFiles() const; 00123 void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files); 00127 bool isProxyEnabled() const; 00131 bool useProxyAuth() const; 00135 QUrl proxy() const; 00142 void setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy); 00146 EqSettings eqSettings() const; 00150 void setEqSettings(const EqSettings &settings); 00155 void readEqSettings(int bands = EqSettings::EQ_BANDS_10); 00159 int bufferSize() const; 00164 void setBufferSize(int msec); 00165 00166 void setVolumeStep(int step); 00167 int volumeStep() const; 00173 void setDetermineFileTypeByContent(bool enabled); 00177 bool determineFileTypeByContent() const; 00181 static QmmpSettings* instance(); 00182 00183 signals: 00187 void replayGainSettingsChanged(); 00191 void audioSettingsChanged(); 00195 void coverSettingsChanged(); 00199 void networkSettingsChanged(); 00203 void eqSettingsChanged(); 00204 00205 private slots: 00209 void sync(); 00210 00211 private: 00212 //replaygain settings 00213 QmmpSettings::ReplayGainMode m_rg_mode; 00214 double m_rg_preamp; 00215 double m_rg_defaut_gain; 00216 bool m_rg_prevent_clipping; 00217 //audio settings 00218 bool m_aud_software_volume; 00219 bool m_aud_dithering; 00220 Qmmp::AudioFormat m_aud_format; 00221 int m_volume_step; 00222 //cover settings 00223 QStringList m_cover_inc; 00224 QStringList m_cover_exclude; 00225 int m_cover_depth; 00226 bool m_cover_use_files; 00227 //network settings 00228 bool m_proxy_enabled; 00229 bool m_proxy_auth; 00230 QUrl m_proxy_url; 00231 //equalizer settings 00232 EqSettings m_eq_settings; 00233 //buffer size 00234 int m_buffer_size; 00235 //file type determination 00236 bool m_determine_by_content; 00237 //timer 00238 QTimer *m_timer; 00239 00240 static QmmpSettings* m_instance; 00241 00242 }; 00243 00244 #endif // QMMPSETTINGS_H
1.7.4