OSDN Git Service

Code refactoring: Now "Preferences" and "Recently" used models are in separate classe...
[x264-launcher/x264-launcher.git] / src / model_preferences.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2013 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 PreferencesModel
25 {
26 public:
27         PreferencesModel(void);
28
29         enum
30         {
31                 X264_PRIORITY_ABOVENORMAL = 0,
32                 X264_PRIORITY_NORMAL = 1,
33                 X264_PRIORITY_BELOWNORMAL = 2,
34                 X264_PRIORITY_IDLE = 3,
35         }
36         x264_priority_t;
37
38         //Getter
39         bool autoRunNextJob(void) { return m_autoRunNextJob; }
40         unsigned int maxRunningJobCount(void) { return m_maxRunningJobCount; }
41         bool shutdownComputer(void) { return m_shutdownComputer; }
42         bool use10BitEncoding(void) { return m_use10BitEncoding; }
43         bool useAvisyth64Bit(void) { return m_useAvisyth64Bit; }
44         bool saveLogFiles(void) { return m_saveLogFiles; }
45         bool saveToSourcePath(void) { return m_saveToSourcePath; }
46         int processPriority(void) { return m_processPriority; }
47         bool enableSounds(void) { return m_enableSounds; }
48
49         //Setter
50         void setAutoRunNextJob(const bool autoRunNextJob) { m_autoRunNextJob = autoRunNextJob; }
51         void setMaxRunningJobCount(const unsigned int maxRunningJobCount) { m_maxRunningJobCount = maxRunningJobCount; }
52         void setShutdownComputer(const bool shutdownComputer) { m_shutdownComputer = shutdownComputer; }
53         void setUse10BitEncoding(const bool use10BitEncoding) { m_use10BitEncoding = use10BitEncoding; }
54         void setUseAvisyth64Bit(const bool useAvisyth64Bit) { m_useAvisyth64Bit = useAvisyth64Bit; }
55         void setSaveLogFiles(const bool saveLogFiles) { m_saveLogFiles = saveLogFiles; }
56         void setSaveToSourcePath(const bool saveToSourcePath) { m_saveToSourcePath = saveToSourcePath; }
57         void setProcessPriority(const int processPriority) { m_processPriority = processPriority; }
58         void setEnableSounds(const bool enableSounds) { m_enableSounds = enableSounds; }
59
60         //Static
61         static void initPreferences(PreferencesModel *preferences);
62         static void loadPreferences(PreferencesModel *preferences);
63         static void savePreferences(PreferencesModel *preferences);
64
65 protected:
66         bool m_autoRunNextJob;
67         unsigned int m_maxRunningJobCount;
68         bool m_shutdownComputer;
69         bool m_use10BitEncoding;
70         bool m_useAvisyth64Bit;
71         bool m_saveLogFiles;
72         bool m_saveToSourcePath;
73         int m_processPriority;
74         bool m_enableSounds;
75 };