OSDN Git Service

Happy new year!
[lamexp/LameXP.git] / src / Model_Settings.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #pragma once
23
24 class QSettings;
25 class QString;
26
27 #define MAKE_OPTION_DEC1(OPT) \
28 int OPT(void); \
29 void OPT(int value);
30
31 #define MAKE_OPTION_DEC2(OPT) \
32 QString OPT(void); \
33 void OPT(const QString &value);
34
35 #define MAKE_OPTION_DEC3(OPT) \
36 bool OPT(void); \
37 void OPT(bool value);
38
39 class SettingsModel
40 {
41 public:
42         SettingsModel(void);
43         ~SettingsModel(void);
44
45         //Enums
46         enum Encoder
47         {
48                 MP3Encoder = 0,
49                 VorbisEncoder = 1,
50                 AACEncoder = 2,
51                 FLACEncoder = 3,
52                 PCMEncoder = 4
53         };
54         enum RCMode
55         {
56                 VBRMode = 0,
57                 ABRMode = 1,
58                 CBRMode = 2
59         };
60         
61         //Consts
62         static const int mp3Bitrates[15];
63
64         //Getters & setters
65         MAKE_OPTION_DEC1(licenseAccepted);
66         MAKE_OPTION_DEC1(interfaceStyle);
67         MAKE_OPTION_DEC1(compressionEncoder);
68         MAKE_OPTION_DEC1(compressionRCMode);
69         MAKE_OPTION_DEC1(compressionBitrate);
70         MAKE_OPTION_DEC2(outputDir);
71         MAKE_OPTION_DEC3(outputToSourceDir);
72         MAKE_OPTION_DEC3(prependRelativeSourcePath);
73         MAKE_OPTION_DEC3(writeMetaTags);
74         MAKE_OPTION_DEC3(createPlaylist);
75         MAKE_OPTION_DEC2(autoUpdateLastCheck);
76         MAKE_OPTION_DEC3(autoUpdateEnabled);
77         MAKE_OPTION_DEC3(soundsEnabled);
78         MAKE_OPTION_DEC3(neroAacNotificationsEnabled)
79         MAKE_OPTION_DEC3(wmaDecoderNotificationsEnabled)
80         MAKE_OPTION_DEC3(dropBoxWidgetEnabled)
81         MAKE_OPTION_DEC2(currentLanguage);
82
83         //Misc
84         void validate(void);
85
86 private:
87         QSettings *m_settings;
88 };
89
90 #undef MAKE_OPTION_DEC1
91 #undef MAKE_OPTION_DEC2
92 #undef MAKE_OPTION_DEC3