Qmmp
/usr/src/RPM/BUILD/qmmp-0.7-svn/src/qmmp/qmmpsettings.h
00001 /***************************************************************************
00002  *   Copyright (C) 2010 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 
00032 class QmmpSettings : public QObject
00033 {
00034 Q_OBJECT
00035 public:
00041     QmmpSettings(QObject *parent = 0);
00045     virtual ~QmmpSettings();
00049     enum ReplayGainMode
00050     {
00051         REPLAYGAIN_TRACK = 0, 
00052         REPLAYGAIN_ALBUM,     
00053         REPLAYGAIN_DISABLED   
00054     };
00058     QmmpSettings::ReplayGainMode replayGainMode() const;
00062     double replayGainPreamp() const;
00066     double replayGainDefaultGain() const;
00070     bool replayGainPreventClipping() const;
00078     void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip);
00082     bool useSoftVolume() const;
00086     bool use16BitOutput() const;
00092     void setAudioSettings(bool soft_volume, bool use_16bit);
00097     QStringList coverNameFilters(bool include = true) const;
00101     int coverSearchDepth() const;
00105     bool useCoverFiles() const;
00115     void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files);
00119     bool isProxyEnabled() const;
00123     bool useProxyAuth() const;
00127     QUrl proxy() const;
00134     void setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy);
00138     EqSettings eqSettings() const;
00142     void setEqSettings(const EqSettings &settings);
00147     void readEqSettings(int bands = EqSettings::EQ_BANDS_10);
00151     int bufferSize() const;
00156     void setBufferSize(int msec);
00162     void setDetermineFileTypeByContent(bool enabled);
00166     bool determineFileTypeByContent() const;
00170     static QmmpSettings* instance();
00171 
00172 signals:
00176     void replayGainSettingsChanged();
00180     void audioSettingsChanged();
00184     void coverSettingsChanged();
00188     void networkSettingsChanged();
00192     void eqSettingsChanged();
00193 
00194 public slots:
00198     void sync();
00199 
00200 private:
00201     //replaygain settings
00202     QmmpSettings::ReplayGainMode m_rg_mode;
00203     double m_rg_preamp;
00204     double m_rg_defaut_gain;
00205     bool m_rg_prevent_clipping;
00206     //audio settings
00207     bool m_aud_software_volume;
00208     bool m_aud_16bit;
00209     //cover settings
00210     QStringList m_cover_inc;
00211     QStringList m_cover_exclude;
00212     int m_cover_depth;
00213     bool m_cover_use_files;
00214     //network settings
00215     bool m_proxy_enabled;
00216     bool m_proxy_auth;
00217     QUrl m_proxy_url;
00218     //equalizer settings
00219     EqSettings m_eq_settings;
00220     //buffer size
00221     int m_buffer_size;
00222     //file type determination
00223     bool m_determine_by_content;
00224 
00225     static QmmpSettings* m_instance;
00226 
00227 };
00228 
00229 #endif // QMMPSETTINGS_H
 All Classes Functions Variables Enumerations Enumerator