OSDN Git Service

Actually use selected encoder in progress dialog + forward output dir.
[lamexp/LameXP.git] / src / Model_Settings.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2010 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_GETTER_DEC(OPT) int OPT(void)
28 #define MAKE_SETTER_DEC(OPT) void OPT(int value)
29 #define MAKE_GETTER_DEC2(OPT) QString OPT(void)
30 #define MAKE_SETTER_DEC2(OPT) void OPT(const QString &value)
31
32 class SettingsModel
33 {
34 public:
35         SettingsModel(void);
36         ~SettingsModel(void);
37
38         //Enums
39         enum Encoder
40         {
41                 MP3Encoder = 0,
42                 VorbisEncoder = 1,
43                 AACEncoder = 2,
44                 FLACEncoder = 3,
45                 PCMEncoder = 4
46         };
47         enum RCMode
48         {
49                 VBRMode = 0,
50                 ABRMode = 1,
51                 CBRMode = 2
52         };
53         
54         //Consts
55         static const int mp3Bitrates[15];
56
57         //Getters
58         MAKE_GETTER_DEC(licenseAccepted);
59         MAKE_GETTER_DEC(interfaceStyle);
60         MAKE_GETTER_DEC(compressionEncoder);
61         MAKE_GETTER_DEC(compressionRCMode);
62         MAKE_GETTER_DEC(compressionBitrate);
63         MAKE_GETTER_DEC2(outputDir);
64
65
66         //Setters
67         MAKE_SETTER_DEC(licenseAccepted);
68         MAKE_SETTER_DEC(interfaceStyle);
69         MAKE_SETTER_DEC(compressionBitrate);
70         MAKE_SETTER_DEC(compressionRCMode);
71         MAKE_SETTER_DEC(compressionEncoder);
72         MAKE_SETTER_DEC2(outputDir);
73
74         void validate(void);
75
76 private:
77         QSettings *m_settings;
78 };
79
80 #undef MAKE_GETTER_DEC
81 #undef MAKE_SETTER_DEC
82 #undef MAKE_GETTER_DEC2
83 #undef MAKE_SETTER_DEC2