1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2015 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 ///////////////////////////////////////////////////////////////////////////////
25 #include "model_sysinfo.h"
26 #include "model_preferences.h"
27 #include "model_options.h"
29 /* --- Encooders --- */
31 QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel::EncType &encType, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant)
33 QString baseName, arch, variant;
38 case OptionsModel::EncType_X264: baseName = "x264"; break;
39 case OptionsModel::EncType_X265: baseName = "x265"; break;
45 case OptionsModel::EncArch_x32: arch = "x86"; break;
46 case OptionsModel::EncArch_x64: arch = "x64"; break;
52 case OptionsModel::EncVariant_LoBit:
55 case OptionsModel::EncType_X264:
56 case OptionsModel::EncType_X265: variant = "8bit"; break;
59 case OptionsModel::EncVariant_HiBit:
62 case OptionsModel::EncType_X264: variant = "10bit"; break;
63 case OptionsModel::EncType_X265: variant = "16bit"; break;
69 if(baseName.isEmpty() || arch.isEmpty() || variant.isEmpty())
71 THROW("Failed to determine the encoder binarty path!");
75 return QString("%1/toolset/%2/%3_%4_%2.exe").arg(sysinfo->getAppPath(), arch, baseName, variant);
78 QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel *options)
80 return ENC_BINARY(sysinfo, options->encType(), options->encArch(), options->encVariant());
83 /* --- Avisynth --- */
85 QString AVS_BINARY(const SysinfoModel *sysinfo, const bool& x64)
87 return QString("%1/toolset/%2/avs2yuv_%2.exe").arg(sysinfo->getAppPath(), (x64 ? "x64": "x86"));
90 QString AVS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences)
92 return AVS_BINARY(sysinfo, preferences->getUseAvisyth64Bit() && sysinfo->hasX64Support());
95 /* --- VapurSynth --- */
97 QString VPS_BINARY(const SysinfoModel *sysinfo, const bool& x64)
99 return QString("%1/vspipe.exe").arg(sysinfo->getVPSPath());
102 QString VPS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences)
104 return VPS_BINARY(sysinfo, sysinfo->hasX64Support());