/usr/include/qmmp/qmmpsettings.h is in libqmmp-dev 0.7.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | /***************************************************************************
* Copyright (C) 2010 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef QMMPSETTINGS_H
#define QMMPSETTINGS_H
#include <QObject>
#include <QUrl>
#include <QStringList>
#include "eqsettings.h"
/*! @brief The QmmpSettings class provides access to global settings.
* @author Ilya Kotov <forkotov02@hotmail.ru>
*/
class QmmpSettings : public QObject
{
Q_OBJECT
public:
/*!
* Constructor.
* @param parent Parent object.
* This functions is for internal usage only, use QmmpSettings::instance() instead.
*/
QmmpSettings(QObject *parent = 0);
/*!
* Destructor.
*/
virtual ~QmmpSettings();
/*!
* This enum describes possible replaygain modes.
*/
enum ReplayGainMode
{
REPLAYGAIN_TRACK = 0, /*!< Use track gain/peak */
REPLAYGAIN_ALBUM, /*!< Use album gain/peak */
REPLAYGAIN_DISABLED /*!< Disable ReplayGain */
};
/*!
* Returns current ReplayGain mode.
*/
QmmpSettings::ReplayGainMode replayGainMode() const;
/*!
* Returns preamp in dB.
*/
double replayGainPreamp() const;
/*!
* Returns default gain in dB.
*/
double replayGainDefaultGain() const;
/*!
* Returns \b true if clipping prevention is enabled; otherwise returns \b false.
*/
bool replayGainPreventClipping() const;
/*!
* Sets ReplayGains settings.
* @param mode ReplayGain mode.
* @param preamp Preamp in dB.
* @param default_gain Default gain in dB.
* @param clip Clipping prevention state.
*/
void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip);
/*!
* Returns \b true if software volume is enabled; otherwise returns \b false.
*/
bool useSoftVolume() const;
/*!
* Returns \b true if 16-bit converter is enabled; otherwise returns \b false.
*/
bool use16BitOutput() const;
/*!
* Sets audio settings.
* @param soft_volume State of software volume.
* @param use_16bit State of the 16-bit audio converter.
*/
void setAudioSettings(bool soft_volume, bool use_16bit);
/*!
* If \b include is \b true, this function returns include cover file name filters,
* otherwise returns exclude filters.
*/
QStringList coverNameFilters(bool include = true) const;
/*!
* Returns a depth of recursive cover file search.
*/
int coverSearchDepth() const;
/*!
* Returns \b true if cover file search is enabled; otherwise returns \b false.
*/
bool useCoverFiles() const;
/*!
* Sets cover search options.
* @param inc Include cover name filters
* @param exc Exclude cover name filters
* @param depth Depth of recursive cover file search.
* Recursive cover file search can be disabled by setting \b depth to \b 0.
* @param use_files Use or not use files with covers.
* This parameter doesn't take effect in embedded covers.
*/
void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files);
/*!
* Returns \b true if global proxy is enabled, otherwise returns \b false
*/
bool isProxyEnabled() const;
/*!
* Returns \b true if global proxy authentication is enabled, otherwise returns \b false
*/
bool useProxyAuth() const;
/*!
* Returns global proxy url.
*/
QUrl proxy() const;
/*!
* Sets network settings.
* @param use_proxy Enables or disables global proxy.
* @param auth Enables or disables proxy authentication.
* @param proxy Proxy url.
*/
void setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy);
/*!
* Returns equalizer settings.
*/
EqSettings eqSettings() const;
/*!
* Changes equalizer settings to \b settings
*/
void setEqSettings(const EqSettings &settings);
/*!
* Reads equalizer settings. Call this function before equalizer usage.
* @param bands Number of bands.
*/
void readEqSettings(int bands = EqSettings::EQ_BANDS_10);
/*!
* Returns buffer size in milliseconds
*/
int bufferSize() const;
/*!
* Sets buffer size
* @param msec Buffer size in milliseconds
*/
void setBufferSize(int msec);
/*!
* Enables/Desables file type determination by content
* @param enabled State of the content based type determination
* (\b true - enabled, \b false - disabled)
*/
void setDetermineFileTypeByContent(bool enabled);
/*!
* Return \b true if content based file type determination is enabled. Otherwise returns \b false.
*/
bool determineFileTypeByContent() const;
/*!
* Returns a pointer to the QmmpSettings instance.
*/
static QmmpSettings* instance();
signals:
/*!
* Emitted when ReplayGain settings are changed.
*/
void replayGainSettingsChanged();
/*!
* Emitted when audio settings are changed.
*/
void audioSettingsChanged();
/*!
* Emitted when cover settings are changed.
*/
void coverSettingsChanged();
/*!
* Emitted when network settings are changed.
*/
void networkSettingsChanged();
/*!
* Emitted when equalizer settings are changed.
*/
void eqSettingsChanged();
public slots:
/*!
* Writes all unsaved settings to configuration file
*/
void sync();
private:
//replaygain settings
QmmpSettings::ReplayGainMode m_rg_mode;
double m_rg_preamp;
double m_rg_defaut_gain;
bool m_rg_prevent_clipping;
//audio settings
bool m_aud_software_volume;
bool m_aud_16bit;
//cover settings
QStringList m_cover_inc;
QStringList m_cover_exclude;
int m_cover_depth;
bool m_cover_use_files;
//network settings
bool m_proxy_enabled;
bool m_proxy_auth;
QUrl m_proxy_url;
//equalizer settings
EqSettings m_eq_settings;
//buffer size
int m_buffer_size;
//file type determination
bool m_determine_by_content;
static QmmpSettings* m_instance;
};
#endif // QMMPSETTINGS_H
|