1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
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.
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.
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.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
33 OptionsModel(const SysinfoModel *sysinfo);
34 OptionsModel(const OptionsModel &rhs);
51 EncVariant_LoBit = 0, // 8-Bit
52 EncVariant_HiBit = 1, //10-Bit (x264) or 16-Bit (x265)
63 static const char *const PROFILE_UNRESTRICTED;
66 EncType encType(void) const { return m_encoderType; }
67 EncArch encArch(void) const { return m_encoderArch; }
68 EncVariant encVariant(void) const { return m_encoderVariant; }
69 RCMode rcMode(void) const { return m_rcMode; }
70 unsigned int bitrate(void) const { return m_bitrate; }
71 double quantizer(void) const { return m_quantizer; }
72 QString preset(void) const { return m_preset; }
73 QString tune(void) const { return m_tune; }
74 QString profile(void) const { return m_profile; }
75 QString customEncParams(void) const { return m_custom_encoder; }
76 QString customAvs2YUV(void) const { return m_custom_avs2yuv; }
79 void setEncType(EncType type) { m_encoderType = qBound(EncType_X264, type, EncType_X265); }
80 void setEncArch(EncArch arch) { m_encoderArch = qBound(EncArch_x32, arch, EncArch_x64); }
81 void setEncVariant(EncVariant variant) { m_encoderVariant = qBound(EncVariant_LoBit, variant, EncVariant_HiBit); }
82 void setRCMode(RCMode mode) { m_rcMode = qBound(RCMode_CRF, mode, RCMode_ABR); }
83 void setBitrate(unsigned int bitrate) { m_bitrate = qBound(10U, bitrate, 800000U); }
84 void setQuantizer(double quantizer) { m_quantizer = qBound(0.0, quantizer, 52.0); }
85 void setPreset(const QString &preset) { m_preset = preset.trimmed(); }
86 void setTune(const QString &tune) { m_tune = tune.trimmed(); }
87 void setProfile(const QString &profile) { m_profile = profile.trimmed(); }
88 void setCustomEncParams(const QString &custom) { m_custom_encoder = custom.trimmed(); }
89 void setCustomAvs2YUV(const QString &custom) { m_custom_avs2yuv = custom.trimmed(); }
92 bool equals(const OptionsModel *model);
95 static QString rcMode2String(RCMode mode);
96 static bool saveTemplate(OptionsModel *model, const QString &name);
97 static bool loadTemplate(OptionsModel *model, const QString &name);
98 static QMap<QString, OptionsModel*> loadAllTemplates(const SysinfoModel *sysinfo);
99 static bool templateExists(const QString &name);
100 static bool deleteTemplate(const QString &name);
103 EncType m_encoderType;
104 EncArch m_encoderArch;
105 EncVariant m_encoderVariant;
107 unsigned int m_bitrate;
112 QString m_custom_encoder;
113 QString m_custom_avs2yuv;