OSDN Git Service

Actually make the Nero AAC Profile/2-Pass options work. Also make the MP3 Channel...
[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 int OPT##Default(void);
31
32 #define MAKE_OPTION_DEC2(OPT) \
33 QString OPT(void); \
34 void OPT(const QString &value); \
35 QString OPT##Default(void);
36
37 #define MAKE_OPTION_DEC3(OPT) \
38 bool OPT(void); \
39 void OPT(bool value); \
40 bool OPT##Default(void);
41
42 class SettingsModel
43 {
44 public:
45         SettingsModel(void);
46         ~SettingsModel(void);
47
48         //Enums
49         enum Encoder
50         {
51                 MP3Encoder = 0,
52                 VorbisEncoder = 1,
53                 AACEncoder = 2,
54                 FLACEncoder = 3,
55                 PCMEncoder = 4
56         };
57         enum RCMode
58         {
59                 VBRMode = 0,
60                 ABRMode = 1,
61                 CBRMode = 2
62         };
63         
64         //Consts
65         static const int mp3Bitrates[15];
66         static const int samplingRates[8];
67
68         //Getters & setters
69         MAKE_OPTION_DEC1(licenseAccepted);
70         MAKE_OPTION_DEC1(interfaceStyle);
71         MAKE_OPTION_DEC1(compressionEncoder);
72         MAKE_OPTION_DEC1(compressionRCMode);
73         MAKE_OPTION_DEC1(compressionBitrate);
74         MAKE_OPTION_DEC2(outputDir);
75         MAKE_OPTION_DEC3(outputToSourceDir);
76         MAKE_OPTION_DEC3(prependRelativeSourcePath);
77         MAKE_OPTION_DEC3(writeMetaTags);
78         MAKE_OPTION_DEC3(createPlaylist);
79         MAKE_OPTION_DEC2(autoUpdateLastCheck);
80         MAKE_OPTION_DEC3(autoUpdateEnabled);
81         MAKE_OPTION_DEC3(soundsEnabled);
82         MAKE_OPTION_DEC3(neroAacNotificationsEnabled)
83         MAKE_OPTION_DEC3(wmaDecoderNotificationsEnabled)
84         MAKE_OPTION_DEC3(dropBoxWidgetEnabled)
85         MAKE_OPTION_DEC2(currentLanguage);
86         MAKE_OPTION_DEC1(lameAlgoQuality);
87         MAKE_OPTION_DEC1(lameChannelMode);
88         MAKE_OPTION_DEC3(bitrateManagementEnabled);
89         MAKE_OPTION_DEC1(bitrateManagementMinRate);
90         MAKE_OPTION_DEC1(bitrateManagementMaxRate);
91         MAKE_OPTION_DEC1(samplingRate)
92         MAKE_OPTION_DEC3(neroAACEnable2Pass)
93         MAKE_OPTION_DEC1(neroAACProfile)
94
95         //Misc
96         void validate(void);
97
98 private:
99         QSettings *m_settings;
100         QString *m_defaultLanguage;
101         QString defaultLanguage(void);
102 };
103
104 #undef MAKE_OPTION_DEC1
105 #undef MAKE_OPTION_DEC2
106 #undef MAKE_OPTION_DEC3