File indexing completed on 2024-05-05 04:48:31

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Artur Szymiec <artur.szymiec@gmail.com>                           *
0003  * Copyright (c) 2011 Kevin Funk <krf@electrostorm.net>                                 *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #ifndef EQUALIZERPRESETS_H
0019 #define EQUALIZERPRESETS_H
0020 
0021 #include <QList>
0022 #include <QStringList>
0023 
0024 /** Functions that handles equalizer presets.
0025     There are two lists of presets. The globals are pre-defined and cannot
0026     be changed.
0027     The user presets can be created and deleted.
0028 */
0029 namespace EqualizerPresets
0030 {
0031     QStringList eqGlobalTranslatedList();
0032     QStringList eqGlobalList();
0033 
0034     /** Will return a list of all non default preset names */
0035     QStringList eqUserList();
0036 
0037     /** Will return a "user" preset if present. Else a "global". */
0038     QList<int> eqCfgGetPresetVal( const QString &presetName );
0039 
0040     /** Returns true if the preset was deleted.
0041         @param presetName The untranslated preset name.
0042     */
0043     bool eqCfgDeletePreset( const QString &presetName );
0044 
0045     /** Returns true if the preset was restored (meaning that there was
0046         a user preset and a global one and we just deleted the user preset)
0047         @param presetName The untranslated preset name.
0048     */
0049     bool eqCfgRestorePreset( const QString &presetName );
0050 
0051     /** Returns true if it is possible to restore the preset
0052         Meaning that there is a user and a default preset with the given name.
0053     */
0054     bool eqCfgCanRestorePreset( const QString &presetName );
0055 
0056     /** Sets the preset (create a user preset).
0057         @param presetName The untranslated preset name.
0058         @param presetValues The preset values.
0059     */
0060     void eqCfgSetPresetVal( const QString &presetName, const QList<int> &presetValues );
0061 
0062     /**
0063      * Will return a list of all default preset names untranslated.
0064      */
0065     QStringList eqDefaultPresetsList();
0066 
0067     /**
0068      * Will return a list of all default preset names translated.
0069      */
0070     QStringList eqDefaultTranslatedPresetsList();
0071 };
0072 
0073 #endif // EQUALIZERPRESETS_H