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 ///////////////////////////////////////////////////////////////////////////////
26 #include "model_sysinfo.h"
27 #include "model_preferences.h"
28 #include "model_options.h"
31 #include <MUtils/Exception.h>
33 /* --- Encooders --- */
35 QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel::EncType &encType, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant)
37 QString baseName, arch, variant;
42 case OptionsModel::EncType_X264: baseName = "x264"; break;
43 case OptionsModel::EncType_X265: baseName = "x265"; break;
49 case OptionsModel::EncArch_x32: arch = "x86"; break;
50 case OptionsModel::EncArch_x64: arch = "x64"; break;
56 case OptionsModel::EncVariant_LoBit:
59 case OptionsModel::EncType_X264:
60 case OptionsModel::EncType_X265: variant = "8bit"; break;
63 case OptionsModel::EncVariant_HiBit:
66 case OptionsModel::EncType_X264: variant = "10bit"; break;
67 case OptionsModel::EncType_X265: variant = "16bit"; break;
73 if(baseName.isEmpty() || arch.isEmpty() || variant.isEmpty())
75 MUTILS_THROW("Failed to determine the encoder binarty path!");
79 return QString("%1/toolset/%2/%3_%4_%2.exe").arg(sysinfo->getAppPath(), arch, baseName, variant);
82 QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel *options)
84 return ENC_BINARY(sysinfo, options->encType(), options->encArch(), options->encVariant());
87 /* --- Avisynth --- */
89 QString AVS_BINARY(const SysinfoModel *sysinfo, const bool& x64)
91 return QString("%1/toolset/%2/avs2yuv_%2.exe").arg(sysinfo->getAppPath(), (x64 ? "x64": "x86"));
94 QString AVS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences)
96 return AVS_BINARY(sysinfo, preferences->getUseAvisyth64Bit() && sysinfo->hasX64Support());
99 /* --- VapurSynth --- */
101 QString VPS_BINARY(const SysinfoModel *sysinfo, const bool& x64)
103 return QString("%1/vspipe.exe").arg(sysinfo->getVPSPath());
106 QString VPS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences)
108 return VPS_BINARY(sysinfo, sysinfo->hasX64Support());