Qmmp
/usr/src/RPM/BUILD/qmmp-0.8-svn/src/qmmp/qmmpsettings.h
00001 /***************************************************************************
00002  *   Copyright (C) 2010-2013 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 "eqsettings.h"
00028 
00029 class QTimer;
00030 
00034 class QmmpSettings : public QObject
00035 {
00036 Q_OBJECT
00037 public:
00043     QmmpSettings(QObject *parent = 0);
00047     virtual ~QmmpSettings();
00051     enum ReplayGainMode
00052     {
00053         REPLAYGAIN_TRACK = 0, 
00054         REPLAYGAIN_ALBUM,     
00055         REPLAYGAIN_DISABLED   
00056     };
00060     QmmpSettings::ReplayGainMode replayGainMode() const;
00064     double replayGainPreamp() const;
00068     double replayGainDefaultGain() const;
00072     bool replayGainPreventClipping() const;
00080     void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip);
00084     bool useSoftVolume() const;
00088     bool use16BitOutput() const;
00094     void setAudioSettings(bool soft_volume, bool use_16bit);
00099     QStringList coverNameFilters(bool include = true) const;
00103     int coverSearchDepth() const;
00107     bool useCoverFiles() const;
00117     void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files);
00121     bool isProxyEnabled() const;
00125     bool useProxyAuth() const;
00129     QUrl proxy() const;
00136     void setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy);
00140     EqSettings eqSettings() const;
00144     void setEqSettings(const EqSettings &settings);
00149     void readEqSettings(int bands = EqSettings::EQ_BANDS_10);
00153     int bufferSize() const;
00158     void setBufferSize(int msec);
00164     void setDetermineFileTypeByContent(bool enabled);
00168     bool determineFileTypeByContent() const;
00172     static QmmpSettings* instance();
00173 
00174 signals:
00178     void replayGainSettingsChanged();
00182     void audioSettingsChanged();
00186     void coverSettingsChanged();
00190     void networkSettingsChanged();
00194     void eqSettingsChanged();
00195 
00196 private slots:
00200     void sync();
00201 
00202 private:
00203     //replaygain settings
00204     QmmpSettings::ReplayGainMode m_rg_mode;
00205     double m_rg_preamp;
00206     double m_rg_defaut_gain;
00207     bool m_rg_prevent_clipping;
00208     //audio settings
00209     bool m_aud_software_volume;
00210     bool m_aud_16bit;
00211     //cover settings
00212     QStringList m_cover_inc;
00213     QStringList m_cover_exclude;
00214     int m_cover_depth;
00215     bool m_cover_use_files;
00216     //network settings
00217     bool m_proxy_enabled;
00218     bool m_proxy_auth;
00219     QUrl m_proxy_url;
00220     //equalizer settings
00221     EqSettings m_eq_settings;
00222     //buffer size
00223     int m_buffer_size;
00224     //file type determination
00225     bool m_determine_by_content;
00226     //timer
00227     QTimer *m_timer;
00228 
00229     static QmmpSettings* m_instance;
00230 
00231 };
00232 
00233 #endif // QMMPSETTINGS_H
 All Classes Functions Variables Enumerations Enumerator