1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2012 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 ///////////////////////////////////////////////////////////////////////////////
22 #include "Thread_Initialization.h"
24 #include "LockedFile.h"
28 #include <QCoreApplication>
35 #include <QTextStream>
37 #include <QThreadPool>
39 #include <QMutexLocker>
42 #define PRINT_CPU_TYPE(X) case X: qDebug("Selected CPU is: " #X)
43 static const double g_allowedExtractDelay = 12.0;
45 ////////////////////////////////////////////////////////////
46 // ExtractorTask class
47 ////////////////////////////////////////////////////////////
49 class ExtractorTask : public QRunnable
52 ExtractorTask(const QDir &appDir, const QString &toolName, const QString &toolShortName, const QByteArray &toolHash, const unsigned int toolVersion)
54 QRunnable(), m_appDir(appDir), m_toolName(toolName), m_toolShortName(toolShortName), m_toolHash(toolHash), m_toolVersion(toolVersion)
59 static void clearFlags(void)
61 s_bAbort = s_bCustom = false;
65 static bool getAbort(void) { return s_bAbort; }
66 static bool getCustom(void) { return s_bCustom; }
67 static char *const getError(void) { return s_errMsg; }
74 LockedFile *lockedFile = NULL;
75 unsigned int version = m_toolVersion;
79 QFileInfo customTool(QString("%1/tools/%2/%3").arg(m_appDir.canonicalPath(), QString::number(lamexp_version_build()), m_toolShortName));
80 if(customTool.exists() && customTool.isFile())
82 qDebug("Setting up file: %s <- %s", m_toolShortName.toLatin1().constData(), m_appDir.relativeFilePath(customTool.canonicalFilePath()).toLatin1().constData());
83 lockedFile = new LockedFile(customTool.canonicalFilePath()); version = UINT_MAX; s_bCustom = true;
87 qDebug("Extracting file: %s -> %s", m_toolName.toLatin1().constData(), m_toolShortName.toLatin1().constData());
88 lockedFile = new LockedFile(QString(":/tools/%1").arg(m_toolName), QString("%1/lamexp_%2").arg(lamexp_temp_folder2(), m_toolShortName), m_toolHash);
93 QMutexLocker lock(&s_mutex);
94 lamexp_register_tool(m_toolShortName, lockedFile, version);
100 qWarning("At least one of the required tools could not be initialized:\n%s", errorMsg);
101 QMutexLocker lock(&s_mutex);
102 if(!s_bAbort) { s_bAbort = true; strncpy_s(s_errMsg, 1024, errorMsg, _TRUNCATE); }
108 const QString m_toolName;
109 const QString m_toolShortName;
110 const QByteArray m_toolHash;
111 const unsigned int m_toolVersion;
113 static volatile bool s_bAbort;
114 static volatile bool s_bCustom;
115 static QMutex s_mutex;
116 static char s_errMsg[1024];
119 volatile bool ExtractorTask::s_bAbort = false;
120 volatile bool ExtractorTask::s_bCustom = false;
121 char ExtractorTask::s_errMsg[1024] = {'\0'};
122 QMutex ExtractorTask::s_mutex;
124 ////////////////////////////////////////////////////////////
126 ////////////////////////////////////////////////////////////
128 InitializationThread::InitializationThread(const lamexp_cpu_t *cpuFeatures)
131 memset(&m_cpuFeatures, 0, sizeof(lamexp_cpu_t));
132 m_slowIndicator = false;
136 memcpy(&m_cpuFeatures, cpuFeatures, sizeof(lamexp_cpu_t));
140 ////////////////////////////////////////////////////////////
142 ////////////////////////////////////////////////////////////
144 void InitializationThread::run()
150 unsigned int cpuSupport = 0;
151 if(m_cpuFeatures.sse && m_cpuFeatures.sse2 && m_cpuFeatures.intel)
153 cpuSupport = m_cpuFeatures.x64 ? CPU_TYPE_X64_SSE : CPU_TYPE_X86_SSE;
157 cpuSupport = m_cpuFeatures.x64 ? CPU_TYPE_X64_GEN : CPU_TYPE_X86_GEN;
160 //Hack to disable x64 on Wine, as x64 binaries won't run under Wine (tested with Wine 1.4 under Ubuntu 12.04 x64)
161 if(cpuSupport & CPU_TYPE_X64_ALL)
163 //DWORD osVerNo = lamexp_get_os_version();
164 //if((HIWORD(osVerNo) == 6) && (LOWORD(osVerNo) == 2))
165 if(lamexp_detect_wine())
167 qWarning("Running under Wine on a 64-Bit system. Going to disable all x64 support!\n");
168 cpuSupport = (cpuSupport == CPU_TYPE_X64_SSE) ? CPU_TYPE_X86_SSE : CPU_TYPE_X86_GEN;
172 //Print selected CPU type
175 PRINT_CPU_TYPE(CPU_TYPE_X86_GEN); break;
176 PRINT_CPU_TYPE(CPU_TYPE_X86_SSE); break;
177 PRINT_CPU_TYPE(CPU_TYPE_X64_GEN); break;
178 PRINT_CPU_TYPE(CPU_TYPE_X64_SSE); break;
179 default: throw "CPU support undefined!";
183 QMap<QString, QString> mapChecksum;
184 QMap<QString, unsigned int> mapVersion;
185 QMap<QString, unsigned int> mapCpuType;
188 for(int i = 0; i < INT_MAX; i++)
190 if(!g_lamexp_tools[i].pcName && !g_lamexp_tools[i].pcHash && !g_lamexp_tools[i].uiVersion)
194 else if(g_lamexp_tools[i].pcName && g_lamexp_tools[i].pcHash && g_lamexp_tools[i].uiVersion)
196 const QString currentTool = QString::fromLatin1(g_lamexp_tools[i].pcName);
197 mapChecksum.insert(currentTool, QString::fromLatin1(g_lamexp_tools[i].pcHash));
198 mapCpuType.insert(currentTool, g_lamexp_tools[i].uiCpuType);
199 mapVersion.insert(currentTool, g_lamexp_tools[i].uiVersion);
203 qFatal("Inconsistent checksum data detected. Take care!");
207 QDir toolsDir(":/tools/");
208 QList<QFileInfo> toolsList = toolsDir.entryInfoList(QStringList("*.*"), QDir::Files, QDir::Name);
209 QDir appDir = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
211 QThreadPool *pool = new QThreadPool();
212 int idealThreadCount = QThread::idealThreadCount();
213 if(idealThreadCount > 0)
215 pool->setMaxThreadCount(idealThreadCount * 2);
218 ExtractorTask::clearFlags();
224 while(!toolsList.isEmpty())
228 QFileInfo currentTool = toolsList.takeFirst();
229 QString toolName = currentTool.fileName().toLower();
230 QString toolShortName = QString("%1.%2").arg(currentTool.baseName().toLower(), currentTool.suffix().toLower());
232 QByteArray toolHash = mapChecksum.take(toolName).toLatin1();
233 unsigned int toolCpuType = mapCpuType.take(toolName);
234 unsigned int toolVersion = mapVersion.take(toolName);
236 if(toolHash.size() != 72)
238 throw "The required checksum is missing, take care!";
241 if(toolCpuType & cpuSupport)
243 pool->start(new ExtractorTask(appDir, toolName, toolShortName, toolHash, toolVersion));
244 QThread::yieldCurrentThread();
247 catch(char *errorMsg)
249 qFatal("At least one of the required tools could not be initialized:\n%s", errorMsg);
254 //Wait for extrator threads to finish
258 //Make sure all files were extracted correctly
259 if(ExtractorTask::getAbort())
261 qFatal("At least one of the required tools could not be initialized:\n%s", ExtractorTask::getError());
265 //Make sure all files were extracted
266 if(!mapChecksum.isEmpty())
268 qFatal("At least one required tool could not be found:\n%s", toolsDir.filePath(mapChecksum.keys().first()).toLatin1().constData());
272 qDebug("All extracted.\n");
279 //Using any custom tools?
280 if(ExtractorTask::getCustom())
282 qWarning("Warning: Using custom tools, you might encounter unexpected problems!\n");
286 double delayExtract = static_cast<double>(timer.elapsed()) / 1000.0;
287 if(delayExtract > g_allowedExtractDelay)
289 m_slowIndicator = true;
290 qWarning("Extracting tools took %.3f seconds -> probably slow realtime virus scanner.", delayExtract);
291 qWarning("Please report performance problems to your anti-virus developer !!!\n");
294 //Register all translations
297 //Look for AAC encoders
306 ////////////////////////////////////////////////////////////
308 ////////////////////////////////////////////////////////////
310 void InitializationThread::delay(void)
312 const char *temp = "|/-\\";
313 printf("Thread is doing something important... ?\b", temp[4]);
315 for(int i = 0; i < 20; i++)
317 printf("%c\b", temp[i%4]);
324 void InitializationThread::initTranslations(void)
326 //Search for language files
327 QStringList qmFiles = QDir(":/localization").entryList(QStringList() << "LameXP_??.qm", QDir::Files, QDir::Name);
329 //Make sure we found at least one translation
330 if(qmFiles.count() < 1)
332 qFatal("Could not find any translation files!");
336 //Add all available translations
337 while(!qmFiles.isEmpty())
339 QString langId, langName;
340 unsigned int systemId = 0, country = 0;
341 QString qmFile = qmFiles.takeFirst();
343 QRegExp langIdExp("LameXP_(\\w\\w)\\.qm", Qt::CaseInsensitive);
344 if(langIdExp.indexIn(qmFile) >= 0)
346 langId = langIdExp.cap(1).toLower();
347 QResource langRes = QResource(QString(":/localization/%1.txt").arg(qmFile));
348 if(langRes.isValid() && langRes.size() > 0)
350 QByteArray data = QByteArray::fromRawData(reinterpret_cast<const char*>(langRes.data()), langRes.size());
351 QTextStream stream(&data, QIODevice::ReadOnly);
352 stream.setAutoDetectUnicode(false); stream.setCodec("UTF-8");
353 while(!stream.atEnd())
355 QStringList langInfo = stream.readLine().simplified().split(",", QString::SkipEmptyParts);
356 if(langInfo.count() == 3)
358 systemId = langInfo.at(0).trimmed().toUInt();
359 country = langInfo.at(1).trimmed().toUInt();
360 langName = langInfo.at(2).trimmed();
367 if(!(langId.isEmpty() || langName.isEmpty() || systemId == 0))
369 if(lamexp_translation_register(langId, qmFile, langName, systemId, country))
371 qDebug("Registering translation: %s = %s (%u) [%u]", qmFile.toUtf8().constData(), langName.toUtf8().constData(), systemId, country);
375 qWarning("Failed to register: %s", qmFile.toLatin1().constData());
380 qDebug("All registered.\n");
383 void InitializationThread::initNeroAac(void)
385 const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
387 QFileInfo neroFileInfo[3];
388 neroFileInfo[0] = QFileInfo(QString("%1/neroAacEnc.exe").arg(appPath));
389 neroFileInfo[1] = QFileInfo(QString("%1/neroAacDec.exe").arg(appPath));
390 neroFileInfo[2] = QFileInfo(QString("%1/neroAacTag.exe").arg(appPath));
392 bool neroFilesFound = true;
393 for(int i = 0; i < 3; i++) { if(!neroFileInfo[i].exists()) neroFilesFound = false; }
395 //Lock the Nero binaries
398 qDebug("Nero encoder binaries not found -> AAC encoding support will be disabled!\n");
402 qDebug("Found Nero AAC encoder binary:\n%s\n", neroFileInfo[0].canonicalFilePath().toUtf8().constData());
404 LockedFile *neroBin[3];
405 for(int i = 0; i < 3; i++) neroBin[i] = NULL;
409 for(int i = 0; i < 3; i++)
411 neroBin[i] = new LockedFile(neroFileInfo[i].canonicalFilePath());
416 for(int i = 0; i < 3; i++) LAMEXP_DELETE(neroBin[i]);
417 qWarning("Failed to get excluive lock to Nero encoder binary -> AAC encoding support will be disabled!");
422 process.setProcessChannelMode(QProcess::MergedChannels);
423 process.setReadChannel(QProcess::StandardOutput);
424 process.start(neroFileInfo[0].canonicalFilePath(), QStringList() << "-help");
426 if(!process.waitForStarted())
428 qWarning("Nero process failed to create!");
429 qWarning("Error message: \"%s\"\n", process.errorString().toLatin1().constData());
431 process.waitForFinished(-1);
432 for(int i = 0; i < 3; i++) LAMEXP_DELETE(neroBin[i]);
436 unsigned int neroVersion = 0;
438 while(process.state() != QProcess::NotRunning)
440 if(!process.waitForReadyRead())
442 if(process.state() == QProcess::Running)
444 qWarning("Nero process time out -> killing!");
446 process.waitForFinished(-1);
447 for(int i = 0; i < 3; i++) LAMEXP_DELETE(neroBin[i]);
452 while(process.canReadLine())
454 QString line = QString::fromUtf8(process.readLine().constData()).simplified();
455 QStringList tokens = line.split(" ", QString::SkipEmptyParts, Qt::CaseInsensitive);
456 int index1 = tokens.indexOf("Package");
457 int index2 = tokens.indexOf("version:");
458 if(index1 >= 0 && index2 >= 0 && index1 + 1 == index2 && index2 < tokens.count() - 1)
460 QStringList versionTokens = tokens.at(index2 + 1).split(".", QString::SkipEmptyParts, Qt::CaseInsensitive);
461 if(versionTokens.count() == 4)
464 neroVersion += qMin(9, qMax(0, versionTokens.at(3).toInt()));
465 neroVersion += qMin(9, qMax(0, versionTokens.at(2).toInt())) * 10;
466 neroVersion += qMin(9, qMax(0, versionTokens.at(1).toInt())) * 100;
467 neroVersion += qMin(9, qMax(0, versionTokens.at(0).toInt())) * 1000;
473 if(!(neroVersion > 0))
475 qWarning("Nero AAC version could not be determined -> AAC encoding support will be disabled!");
476 for(int i = 0; i < 3; i++) LAMEXP_DELETE(neroBin[i]);
480 for(int i = 0; i < 3; i++)
482 lamexp_register_tool(neroFileInfo[i].fileName(), neroBin[i], neroVersion);
486 void InitializationThread::initFhgAac(void)
488 const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
490 QFileInfo fhgFileInfo[4];
491 fhgFileInfo[0] = QFileInfo(QString("%1/fhgaacenc.exe").arg(appPath));
492 fhgFileInfo[1] = QFileInfo(QString("%1/enc_fhgaac.dll").arg(appPath));
493 fhgFileInfo[2] = QFileInfo(QString("%1/nsutil.dll").arg(appPath));
494 fhgFileInfo[3] = QFileInfo(QString("%1/libmp4v2.dll").arg(appPath));
496 bool fhgFilesFound = true;
497 for(int i = 0; i < 4; i++) { if(!fhgFileInfo[i].exists()) fhgFilesFound = false; }
499 //Lock the FhgAacEnc binaries
502 qDebug("FhgAacEnc binaries not found -> FhgAacEnc support will be disabled!\n");
506 qDebug("Found FhgAacEnc cli_exe:\n%s\n", fhgFileInfo[0].canonicalFilePath().toUtf8().constData());
507 qDebug("Found FhgAacEnc enc_dll:\n%s\n", fhgFileInfo[1].canonicalFilePath().toUtf8().constData());
509 LockedFile *fhgBin[4];
510 for(int i = 0; i < 4; i++) fhgBin[i] = NULL;
514 for(int i = 0; i < 4; i++)
516 fhgBin[i] = new LockedFile(fhgFileInfo[i].canonicalFilePath());
521 for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
522 qWarning("Failed to get excluive lock to FhgAacEnc binary -> FhgAacEnc support will be disabled!");
527 process.setProcessChannelMode(QProcess::MergedChannels);
528 process.setReadChannel(QProcess::StandardOutput);
529 process.start(fhgFileInfo[0].canonicalFilePath(), QStringList() << "--version");
531 if(!process.waitForStarted())
533 qWarning("FhgAacEnc process failed to create!");
534 qWarning("Error message: \"%s\"\n", process.errorString().toLatin1().constData());
536 process.waitForFinished(-1);
537 for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
541 QRegExp fhgAacEncSig("fhgaacenc version (\\d+) by tmkk", Qt::CaseInsensitive);
542 unsigned int fhgVersion = 0;
544 while(process.state() != QProcess::NotRunning)
546 process.waitForReadyRead();
547 if(!process.bytesAvailable() && process.state() == QProcess::Running)
549 qWarning("FhgAacEnc process time out -> killing!");
551 process.waitForFinished(-1);
552 for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
555 while(process.bytesAvailable() > 0)
557 QString line = QString::fromUtf8(process.readLine().constData()).simplified();
558 if(fhgAacEncSig.lastIndexIn(line) >= 0)
561 unsigned int temp = fhgAacEncSig.cap(1).toUInt(&ok);
562 if(ok) fhgVersion = temp;
567 if(!(fhgVersion > 0))
569 qWarning("FhgAacEnc version couldn't be determined -> FhgAacEnc support will be disabled!");
570 for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
573 else if(fhgVersion < lamexp_toolver_fhgaacenc())
575 qWarning("FhgAacEnc version is too much outdated -> FhgAacEnc support will be disabled!");
576 for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
580 for(int i = 0; i < 4; i++)
582 lamexp_register_tool(fhgFileInfo[i].fileName(), fhgBin[i], fhgVersion);
586 void InitializationThread::initQAac(void)
588 const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
590 QFileInfo qaacFileInfo[2];
591 qaacFileInfo[0] = QFileInfo(QString("%1/qaac.exe").arg(appPath));
592 qaacFileInfo[1] = QFileInfo(QString("%1/libsoxrate.dll").arg(appPath));
594 bool qaacFilesFound = true;
595 for(int i = 0; i < 2; i++) { if(!qaacFileInfo[i].exists()) qaacFilesFound = false; }
597 //Lock the QAAC binaries
600 qDebug("QAAC binaries not found -> QAAC support will be disabled!\n");
604 qDebug("Found QAAC encoder:\n%s\n", qaacFileInfo[0].canonicalFilePath().toUtf8().constData());
606 LockedFile *qaacBin[2];
607 for(int i = 0; i < 2; i++) qaacBin[i] = NULL;
611 for(int i = 0; i < 2; i++)
613 qaacBin[i] = new LockedFile(qaacFileInfo[i].canonicalFilePath());
618 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
619 qWarning("Failed to get excluive lock to QAAC binary -> QAAC support will be disabled!");
624 process.setProcessChannelMode(QProcess::MergedChannels);
625 process.setReadChannel(QProcess::StandardOutput);
626 process.start(qaacFileInfo[0].canonicalFilePath(), QStringList() << "--check");
628 if(!process.waitForStarted())
630 qWarning("QAAC process failed to create!");
631 qWarning("Error message: \"%s\"\n", process.errorString().toLatin1().constData());
633 process.waitForFinished(-1);
634 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
638 QRegExp qaacEncSig("qaac (\\d)\\.(\\d)(\\d)", Qt::CaseInsensitive);
639 QRegExp coreEncSig("CoreAudioToolbox (\\d)\\.(\\d)\\.(\\d)\\.(\\d)", Qt::CaseInsensitive);
640 unsigned int qaacVersion = 0;
641 unsigned int coreVersion = 0;
643 while(process.state() != QProcess::NotRunning)
645 process.waitForReadyRead();
646 if(!process.bytesAvailable() && process.state() == QProcess::Running)
648 qWarning("QAAC process time out -> killing!");
650 process.waitForFinished(-1);
651 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
654 while(process.bytesAvailable() > 0)
656 QString line = QString::fromUtf8(process.readLine().constData()).simplified();
657 if(qaacEncSig.lastIndexIn(line) >= 0)
659 unsigned int tmp[3] = {0, 0, 0};
660 bool ok[3] = {false, false, false};
661 tmp[0] = qaacEncSig.cap(1).toUInt(&ok[0]);
662 tmp[1] = qaacEncSig.cap(2).toUInt(&ok[1]);
663 tmp[2] = qaacEncSig.cap(3).toUInt(&ok[2]);
664 if(ok[0] && ok[1] && ok[2])
666 qaacVersion = (qBound(0U, tmp[0], 9U) * 100) + (qBound(0U, tmp[1], 9U) * 10) + qBound(0U, tmp[2], 9U);
669 if(coreEncSig.lastIndexIn(line) >= 0)
671 unsigned int tmp[4] = {0, 0, 0, 0};
672 bool ok[4] = {false, false, false, false};
673 tmp[0] = coreEncSig.cap(1).toUInt(&ok[0]);
674 tmp[1] = coreEncSig.cap(2).toUInt(&ok[1]);
675 tmp[2] = coreEncSig.cap(3).toUInt(&ok[2]);
676 tmp[3] = coreEncSig.cap(4).toUInt(&ok[3]);
677 if(ok[0] && ok[1] && ok[2] && ok[3])
679 coreVersion = (qBound(0U, tmp[0], 9U) * 1000) + (qBound(0U, tmp[1], 9U) * 100) + (qBound(0U, tmp[2], 9U) * 10) + qBound(0U, tmp[3], 9U);
685 //qDebug("qaac %d, CoreAudioToolbox %d", qaacVersion, coreVersion);
687 if(!(qaacVersion > 0))
689 qWarning("QAAC version couldn't be determined -> QAAC support will be disabled!");
690 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
693 else if(qaacVersion < lamexp_toolver_qaacenc())
695 qWarning("QAAC version is too much outdated (%s) -> QAAC support will be disabled!", lamexp_version2string("v?.??", qaacVersion, "N/A").toLatin1().constData());
696 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
700 if(!(coreVersion > 0))
702 qWarning("CoreAudioToolbox version couldn't be determined -> QAAC support will be disabled!");
703 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
706 else if(coreVersion < lamexp_toolver_coreaudio())
708 qWarning("CoreAudioToolbox version is too much outdated (%s) -> QAAC support will be disabled!", lamexp_version2string("v?.?.?.?", coreVersion, "N/A").toLatin1().constData());
709 for(int i = 0; i < 2; i++) LAMEXP_DELETE(qaacBin[i]);
713 lamexp_register_tool(qaacFileInfo[0].fileName(), qaacBin[0], qaacVersion);
714 lamexp_register_tool(qaacFileInfo[1].fileName(), qaacBin[1], qaacVersion);
717 void InitializationThread::selfTest(void)
719 const unsigned int cpu[4] = {CPU_TYPE_X86_GEN, CPU_TYPE_X86_SSE, CPU_TYPE_X64_GEN, CPU_TYPE_X64_SSE};
721 for(size_t k = 0; k < 4; k++)
726 PRINT_CPU_TYPE(CPU_TYPE_X86_GEN); break;
727 PRINT_CPU_TYPE(CPU_TYPE_X86_SSE); break;
728 PRINT_CPU_TYPE(CPU_TYPE_X64_GEN); break;
729 PRINT_CPU_TYPE(CPU_TYPE_X64_SSE); break;
730 default: throw "CPU support undefined!";
733 for(int i = 0; i < INT_MAX; i++)
735 if(!g_lamexp_tools[i].pcName && !g_lamexp_tools[i].pcHash && !g_lamexp_tools[i].uiVersion)
739 if(g_lamexp_tools[i].uiCpuType & cpu[k])
741 qDebug("%02i -> %s", ++n, g_lamexp_tools[i].pcName);
746 qFatal("Tool count mismatch !!!");
752 ////////////////////////////////////////////////////////////
754 ////////////////////////////////////////////////////////////