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 "Dialog_About.h"
26 #include "Model_Settings.h"
29 #include <QApplication>
31 #include <QPushButton>
32 #include <QDesktopServices>
37 #include <QDesktopWidget>
39 #include <QMessageBox>
40 #include <QTextStream>
42 #include <QCloseEvent>
43 #include <QWindowsVistaStyle>
44 #include <QWindowsXPStyle>
51 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
52 #define TRIM_RIGHT(STR) do { while(STR.endsWith(QChar(' ')) || STR.endsWith(QChar('\t')) || STR.endsWith(QChar('\r')) || STR.endsWith(QChar('\n'))) STR.chop(1); } while(0)
53 #define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
57 const char *AboutDialog::neroAacUrl = "http://www.nero.com/eng/technologies-aac-codec.html";
58 const char *AboutDialog::disqueUrl = "http://mulder.brhack.net/?player_url=38X-MXOB014"; //http://mulder.brhack.net/?player_url=yF6W-w0iAMM; http://www.youtube.com/watch_popup?v=yF6W-w0iAMM&vq=large
68 g_lamexp_translators[] =
70 {"en", L"Englisch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
71 {"de", L"Deutsch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
72 {"", L"", L"Bodo Thevissen", "Bodo@thevissen.de" },
73 {"es", L"Español", L"Rub3nCT", "Rub3nCT@gmail.com" },
74 {"fr", L"Française", L"Dodich Informatique", "Dodich@live.fr" },
75 {"it", L"Italiano", L"Roberto", "Gulliver_69@libero.it" },
76 {"kr", L"한국어", L"JaeHyung Lee", "Kolanp@gmail.com" },
77 {"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
78 {"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
79 {"", L"", L"Иван Митин", "bardak@inbox.ru" },
80 {"sv", L"Svenska", L"Åke Engelbrektson", "eson57@gmail.com" },
81 {"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
82 {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
83 {"zh", L"简体中文", L"456Vv", "123@456vv.com" },
84 {NULL, NULL, NULL, NULL}
87 ////////////////////////////////////////////////////////////
89 ////////////////////////////////////////////////////////////
91 AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstStart)
95 m_initFlags(new QMap<QWidget*,bool>),
99 m_disqueDelay(_I64_MAX),
102 //Init the dialog, from the .ui file
104 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
105 resize(this->minimumSize());
110 if(HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE))
112 EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
117 for(int i = 0; i < 4; i++)
123 connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
126 QStyle *style = qApp->style();
127 if((dynamic_cast<QWindowsVistaStyle*>(style)) || (dynamic_cast<QWindowsXPStyle*>(style)))
129 MAKE_TRANSPARENT(infoScrollArea);
130 MAKE_TRANSPARENT(contributorsScrollArea);
131 MAKE_TRANSPARENT(softwareScrollArea);
132 MAKE_TRANSPARENT(licenseScrollArea);
135 //Show about dialog for the first time?
138 acceptButton->hide();
139 declineButton->hide();
140 aboutQtButton->show();
143 QPixmap disque(":/images/Disque.png");
144 QRect screenGeometry = QApplication::desktop()->availableGeometry();
145 m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
146 m_disque->installEventFilter(this);
147 m_disque->setStyleSheet("background:transparent;");
148 m_disque->setAttribute(Qt::WA_TranslucentBackground);
149 m_disque->setGeometry(qrand() % (screenGeometry.width() - disque.width()), qrand() % (screenGeometry.height() - disque.height()), disque.width(), disque.height());
150 m_disque->setPixmap(disque);
151 m_disque->setWindowOpacity(0.01);
153 m_disqueFlags[0] = (qrand() > (RAND_MAX/2));
154 m_disqueFlags[1] = (qrand() > (RAND_MAX/2));
155 m_disqueTimer = new QTimer;
156 connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
157 m_disqueTimer->setInterval(10);
158 m_disqueTimer->start();
160 connect(aboutQtButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
164 acceptButton->show();
165 declineButton->show();
166 aboutQtButton->hide();
170 //Activate "show license" button
171 showLicenseButton->show();
172 connect(showLicenseButton, SIGNAL(clicked()), this, SLOT(gotoLicenseTab()));
174 m_firstShow = firstStart;
177 AboutDialog::~AboutDialog(void)
182 LAMEXP_DELETE(m_disque);
186 m_disqueTimer->stop();
187 LAMEXP_DELETE(m_disqueTimer);
189 for(int i = 0; i < 4; i++)
191 LAMEXP_DELETE(m_cartoon[i]);
193 LAMEXP_DELETE(m_initFlags);
196 ////////////////////////////////////////////////////////////
198 ////////////////////////////////////////////////////////////
200 int AboutDialog::exec()
202 if(m_settings->soundsEnabled())
206 if(!playResoureSound("imageres.dll", 5080, true))
208 PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC);
213 PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
217 switch(QDialog::exec())
231 ////////////////////////////////////////////////////////////
233 ////////////////////////////////////////////////////////////
235 #define TEMP_HIDE_DISQUE(CMD) \
236 if(m_disque) { bool _tmp = m_disque->isVisible(); if(_tmp) m_disque->hide(); {CMD}; if(_tmp) { m_disque->show(); m_disque->setWindowOpacity(0.01); } } else {CMD}
238 void AboutDialog::tabChanged(int index)
240 bool bInitialized = m_initFlags->value(tabWidget->widget(index), false);
244 qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
246 if(QWidget *tab = tabWidget->widget(index))
250 if(tab == infoTab) { initInformationTab(); ok = true; }
251 if(tab == contributorsTab) { initContributorsTab(); ok = true; }
252 if(tab == softwareTab) { initSoftwareTab(); ok = true; }
253 if(tab == licenseTab) { initLicenseTab(); ok = true; }
257 m_initFlags->insert(tab, true);
261 qWarning("Unknown tab %p encountered, cannot initialize !!!", tab);
266 tabWidget->widget(index)->update();
267 qApp->processEvents();
268 qApp->restoreOverrideCursor();
272 if(QWidget *tab = tabWidget->widget(index))
274 if(tab == infoTab) infoScrollArea->verticalScrollBar()->setSliderPosition(0);
275 if(tab == contributorsTab) contributorsScrollArea->verticalScrollBar()->setSliderPosition(0);
276 if(tab == softwareTab) softwareScrollArea->verticalScrollBar()->setSliderPosition(0);
277 if(tab == licenseTab) licenseScrollArea->verticalScrollBar()->setSliderPosition(0);
280 //Update license button
281 showLicenseButton->setChecked(tabWidget->widget(index) == licenseTab);
282 if(tabWidget->widget(index) != licenseTab) m_lastTab = index;
285 void AboutDialog::enableButtons(void)
287 acceptButton->setEnabled(true);
288 declineButton->setEnabled(true);
289 setCursor(QCursor(Qt::ArrowCursor));
292 void AboutDialog::openURL(const QString &url)
294 if(!QDesktopServices::openUrl(QUrl(url)))
296 ShellExecuteW(this->winId(), L"open", QWCHAR(url), NULL, NULL, SW_SHOW);
300 void AboutDialog::showAboutQt(void)
304 QMessageBox::aboutQt(this);
308 void AboutDialog::gotoLicenseTab(void)
310 tabWidget->setCurrentIndex(tabWidget->indexOf(showLicenseButton->isChecked() ? licenseTab : tabWidget->widget(m_lastTab)));
313 void AboutDialog::moveDisque(void)
316 LARGE_INTEGER perfCount, perfFrequ;
318 if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount))
320 if(m_disqueDelay != _I64_MAX)
322 const double delay = static_cast<double>(perfCount.QuadPart) - static_cast<double>(m_disqueDelay);
323 delta = qMax(1, qMin(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
325 m_disqueDelay = perfCount.QuadPart;
330 QRect screenGeometry = QApplication::desktop()->availableGeometry();
331 const int minX = screenGeometry.left();
332 const int maxX = screenGeometry.width() - m_disque->width() + screenGeometry.left();
333 const int minY = screenGeometry.top();
334 const int maxY = screenGeometry.height() - m_disque->height() + screenGeometry.top();
336 QPoint pos = m_disque->pos();
337 pos.setX(m_disqueFlags[0] ? pos.x() + delta : pos.x() - delta);
338 pos.setY(m_disqueFlags[1] ? pos.y() + delta : pos.y() - delta);
342 m_disqueFlags[0] = true;
346 else if(pos.x() >= maxX)
348 m_disqueFlags[0] = false;
354 m_disqueFlags[1] = true;
358 else if(pos.y() >= maxY)
360 m_disqueFlags[1] = false;
369 QPixmap *cartoon = NULL;
370 if(m_disqueFlags[0] == true && m_disqueFlags[1] != true) cartoon = m_cartoon[0];
371 if(m_disqueFlags[0] == true && m_disqueFlags[1] == true) cartoon = m_cartoon[1];
372 if(m_disqueFlags[0] != true && m_disqueFlags[1] == true) cartoon = m_cartoon[2];
373 if(m_disqueFlags[0] != true && m_disqueFlags[1] != true) cartoon = m_cartoon[3];
376 m_disque->setPixmap(*cartoon);
377 m_disque->resize(cartoon->size());
379 m_rotateNext = false;
382 if(m_disque->windowOpacity() < 0.9)
384 m_disque->setWindowOpacity(m_disque->windowOpacity() + 0.01);
388 ////////////////////////////////////////////////////////////
389 // Protected Functions
390 ////////////////////////////////////////////////////////////
392 void AboutDialog::showEvent(QShowEvent *e)
394 QDialog::showEvent(e);
396 tabWidget->setCurrentIndex(tabWidget->indexOf(infoTab));
397 tabChanged(m_lastTab = tabWidget->currentIndex());
401 acceptButton->setEnabled(false);
402 declineButton->setEnabled(false);
403 QTimer::singleShot(5000, this, SLOT(enableButtons()));
404 setCursor(QCursor(Qt::WaitCursor));
408 void AboutDialog::closeEvent(QCloseEvent *e)
410 if(m_firstShow) e->ignore();
413 bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
415 if((obj == m_disque) && (event->type() == QEvent::MouseButtonPress))
417 QPixmap cartoon(":/images/Cartoon.png");
418 for(int i = 0; i < 4; i++)
422 m_cartoon[i] = new QPixmap(cartoon.transformed(QMatrix().rotate(static_cast<double>(i*90) + 45.0), Qt::SmoothTransformation));
426 QDesktopServices::openUrl(QUrl(disqueUrl));
432 ////////////////////////////////////////////////////////////
434 ////////////////////////////////////////////////////////////
436 void AboutDialog::initInformationTab(void)
438 const QString versionStr = QString().sprintf
440 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
441 lamexp_version_major(),
442 lamexp_version_minor(),
443 lamexp_version_release(),
444 lamexp_version_build(),
445 lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
446 lamexp_version_compiler(),
447 lamexp_version_arch(),
451 const QString copyrightStr = QString().sprintf
453 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
454 qMax(lamexp_version_date().year(), QDate::currentDate().year())
459 aboutText += QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
460 aboutText += QString("<b>%1</b><br>").arg(NOBR(copyrightStr));
461 aboutText += QString("<b>%1</b><br><br>").arg(NOBR(versionStr));
462 aboutText += QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
464 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
467 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
468 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
470 else if(lamexp_version_demo())
472 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
473 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
478 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0i64);
479 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
481 else if(lamexp_version_demo())
483 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0i64);
484 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
488 aboutText += "<hr><br>";
489 aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
490 aboutText += "modify it under the terms of the GNU General Public License<br>";
491 aboutText += "as published by the Free Software Foundation; either version 2<br>";
492 aboutText += "of the License, or (at your option) any later version.<br><br>";
493 aboutText += "This program is distributed in the hope that it will be useful,<br>";
494 aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
495 aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
496 aboutText += "GNU General Public License for more details.<br><br>";
497 aboutText += "You should have received a copy of the GNU General Public License<br>";
498 aboutText += "along with this program; if not, write to the Free Software<br>";
499 aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
500 aboutText += "<hr><table style=\"margin-top:4px\"><tr>";
501 aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
502 aboutText += QString("<td><font color=\"darkred\">%1</font></td>").arg(tr("Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!!"));
503 aboutText += "</tr></table>";
504 //aboutText += QString("%1<br>").arg(NOBR(tr("Special thanks go out to \"John33\" from %1 for his continuous support.")).arg(LINK("http://www.rarewares.org/")));
506 infoLabel->setText(aboutText);
507 infoIcon->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
508 connect(infoLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
511 void AboutDialog::initContributorsTab(void)
513 const QString spaces(" ");
514 const QString extraVSpace("<font style=\"font-size:7px\"><br> </font>");
516 QString contributorsAboutText;
517 contributorsAboutText += QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
518 contributorsAboutText += "<table style=\"margin-top:12px;white-space:nowrap\">";
520 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraVSpace);
521 QString icon = QString("<img src=\":/icons/%1.png\">").arg("user_gray");
522 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon, spaces);
523 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces);
524 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%2\"><%3></a></td></tr>").arg("LoRd_MuldeR", spaces, "MuldeR2@GMX.de");
525 contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
527 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace);
528 for(int i = 0; g_lamexp_translators[i].pcName; i++)
530 QString flagIcon = (strlen(g_lamexp_translators[i].pcFlag) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators[i].pcFlag) : QString();
531 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon, spaces);
532 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(WCHAR2QSTR(g_lamexp_translators[i].pcLanguage), spaces);
533 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%2\"><%3></a></td></tr>").arg(WCHAR2QSTR(g_lamexp_translators[i].pcName), spaces, g_lamexp_translators[i].pcMail);
536 contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
537 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Special thanks to:"), extraVSpace);
539 QString webIcon = QString("<img src=\":/icons/%1.png\">").arg("world");
540 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
541 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Doom9's Forum"), spaces, "http://forum.doom9.org/");
542 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
543 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Gleitz | German Doom9"), spaces, "http://forum.gleitz.info/");
544 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
545 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Hydrogenaudio Forums"), spaces, "http://www.hydrogenaudio.org/");
546 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
547 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("RareWares"), spaces, "http://www.rarewares.org/");
548 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
549 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("GitHub"), spaces, "http://github.com/");
550 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
551 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("SourceForge"), spaces, "http://sourceforge.net/");
552 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
553 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Qt Developer Network"), spaces, "http://qt-project.org/");
554 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
555 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Marius Hudea"), spaces, "http://savedonthe.net/");
557 contributorsAboutText += "</table><br><br><br>";
558 contributorsAboutText += QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
560 contributorsLabel->setText(contributorsAboutText);
561 contributorsIcon->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
562 connect(contributorsLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
565 void AboutDialog::initSoftwareTab(void)
567 QString moreAboutText;
569 moreAboutText += QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
570 moreAboutText += "<div style=\"margin-left:-25px;white-space:nowrap\"><table><tr><td><ul>"; //;font-size:7pt
572 moreAboutText += makeToolText
574 tr("LAME - OpenSource mp3 Encoder"),
575 "lame.exe", "v?.??, Final-?",
576 tr("Released under the terms of the GNU Lesser General Public License."),
577 "http://lame.sourceforge.net/"
579 moreAboutText += makeToolText
581 tr("OggEnc - Ogg Vorbis Encoder"),
582 "oggenc2.exe", "v?.??, aoTuV Beta-?.??",
583 tr("Completely open and patent-free audio encoding technology."),
584 "http://www.vorbis.com/"
586 moreAboutText += makeToolText
588 tr("Nero AAC Reference MPEG-4 Encoder"),
589 "neroAacEnc.exe", "v?.?.?.?",
590 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
592 tr("Available from vendor web-site as free download:")
594 moreAboutText += makeToolText
596 tr("Aften - A/52 audio encoder"),
597 "aften.exe", "v?.?.?",
598 tr("Released under the terms of the GNU Lesser General Public License."),
599 "http://aften.sourceforge.net/"
601 moreAboutText += makeToolText
603 tr("FLAC - Free Lossless Audio Codec"),
604 "flac.exe", "v?.?.?",
605 tr("Open and patent-free lossless audio compression technology."),
606 "http://flac.sourceforge.net/"
608 moreAboutText += makeToolText
610 tr("Opus Audio Codec"),
611 "opusenc_std.exe", "????-??-??",
612 tr("Totally open, royalty-free, highly versatile audio codec."),
613 "http://www.opus-codec.org/"
615 moreAboutText += makeToolText
617 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
618 "mpg123.exe", "v?.??.?",
619 tr("Released under the terms of the GNU Lesser General Public License."),
620 "http://www.mpg123.de/"
622 moreAboutText += makeToolText
624 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
626 tr("Released under the terms of the GNU General Public License."),
627 "http://www.audiocoding.com/"
629 moreAboutText += makeToolText
631 tr("AC3Filter Tools - AC3/DTS Decoder"),
632 "valdec.exe", "v?.??",
633 tr("Released under the terms of the GNU Lesser General Public License."),
634 "http://www.ac3filter.net/projects/tools"
636 moreAboutText += makeToolText
638 tr("WavPack - Hybrid Lossless Compression"),
639 "wvunpack.exe", "v?.??.?",
640 tr("Completely open audio compression format."),
641 "http://www.wavpack.com/"
643 moreAboutText += makeToolText
645 tr("Musepack - Living Audio Compression"),
646 "mpcdec.exe", "r???",
647 tr("Released under the terms of the GNU Lesser General Public License."),
648 "http://www.musepack.net/"
650 moreAboutText += makeToolText
652 tr("Monkey's Audio - Lossless Audio Compressor"),
654 tr("Freely available source code, simple SDK and non-restrictive licensing."),
655 "http://www.monkeysaudio.com/"
657 moreAboutText += makeToolText
659 tr("Shorten - Lossless Audio Compressor"),
660 "shorten.exe", "v?.?.?",
661 tr("Released under the terms of the GNU Lesser General Public License."),
662 "http://etree.org/shnutils/shorten/"
664 moreAboutText += makeToolText
666 tr("Speex - Free Codec For Free Speech"),
667 "speexdec.exe", "v?.?",
668 tr("Open Source patent-free audio format designed for speech."),
669 "http://www.speex.org/"
671 moreAboutText += makeToolText
673 tr("The True Audio - Lossless Audio Codec"),
675 tr("Released under the terms of the GNU Lesser General Public License."),
676 "http://tta.sourceforge.net/"
678 moreAboutText += makeToolText
681 "alac.exe", "v?.?.?",
682 tr("Copyright (c) 2004 David Hammerton. Contributions by Cody Brocious."),
683 "http://craz.net/programs/itunes/alac.html"
685 moreAboutText += makeToolText
687 tr("wma2wav - Dump WMA files to Wave Audio"),
688 "wma2wav.exe", "????-??-??",
689 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
690 "http://forum.doom9.org/showthread.php?t=140273"
692 moreAboutText += makeToolText
694 tr("avs2wav - Avisynth to Wave Audio converter"),
695 "avs2wav.exe", "v?.?",
696 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
697 "http://forum.doom9.org/showthread.php?t=70882"
699 moreAboutText += makeToolText
702 "dcaenc.exe", "????-??-??",
703 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
704 "http://gitorious.org/dtsenc/dtsenc/trees/master"
706 moreAboutText += makeToolText
708 tr("MediaInfo - Media File Analysis Tool"),
709 "mediainfo.exe", "v?.?.??",
710 tr("Released under the terms of the GNU Lesser General Public License."),
711 "http://mediainfo.sourceforge.net/"
713 moreAboutText += makeToolText
715 tr("SoX - Sound eXchange"),
716 "sox.exe", "v??.?.?",
717 tr("Released under the terms of the GNU Lesser General Public License."),
718 "http://sox.sourceforge.net/"
720 moreAboutText += makeToolText
722 tr("GnuPG - The GNU Privacy Guard"),
723 "gpgv.exe", "v?.?.??",
724 tr("Released under the terms of the GNU Lesser General Public License."),
725 "http://www.gnupg.org/"
727 moreAboutText += makeToolText
729 tr("GNU Wget - Software for retrieving files using HTTP"),
730 "wget.exe", "v?.??.?",
731 tr("Released under the terms of the GNU Lesser General Public License."),
732 "http://www.gnu.org/software/wget/"
734 moreAboutText += makeToolText
736 tr("UPX - The Ultimate Packer for eXecutables"),
738 tr("Released under the terms of the GNU Lesser General Public License."),
739 "http://upx.sourceforge.net/"
741 moreAboutText += makeToolText
743 tr("Silk Icons - Over 700 icons in PNG format"),
745 tr("By Mark James, released under the Creative Commons 'by' License."),
746 "http://www.famfamfam.com/lab/icons/silk/"
748 moreAboutText += QString("</ul></td><td> </td></tr></table></div><br><i>%1</i><br>").arg
750 tr("The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors.")
753 softwareLabel->setText(moreAboutText);
754 softwareIcon->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65)));
755 connect(softwareLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
758 void AboutDialog::initLicenseTab(void)
761 licenseText += ("<tt>");
763 QFile file(":/License.txt");
764 if(file.open(QIODevice::ReadOnly))
766 QTextStream stream(&file);
767 unsigned int counter = 0;
768 while((!stream.atEnd()) && (stream.status() == QTextStream::Ok))
770 QString line = stream.readLine();
771 const bool bIsBlank = line.trimmed().isEmpty();
772 line.replace('<', "<").replace('>', ">");
777 if(!bIsBlank) licenseText += QString("<font size=\"+2\">%1</font><br>").arg(line.simplified());
780 if(!bIsBlank) licenseText += QString("<font size=\"+1\">%1</font><br>").arg(line.simplified());
784 licenseText += QString("<nobr>%1</nobr><br>").arg(line.replace(' ', " "));
788 if(!bIsBlank) counter++;
790 licenseText += QString("<br><br>%1").arg(LINK("http://www.gnu.org/licenses/gpl-2.0.html"));
791 stream.device()->close();
795 licenseText += QString("<font color=\"darkred\">Oups, failed to load license text. Please refer to:</font><br>");
796 licenseText += LINK("http://www.gnu.org/licenses/gpl-2.0.html");
799 licenseText += ("</tt>");
801 licenseLabel->setText(licenseText);
802 licenseIcon->setPixmap(QIcon(":/images/Logo_GNU.png").pixmap(QSize(72,65)));
803 connect(licenseLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
807 QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo)
809 QString toolText, verStr(toolVerFmt);
811 if(!toolBin.isEmpty())
813 verStr = lamexp_version2string(toolVerFmt, lamexp_tool_version(toolBin), tr("n/a"));
816 toolText += QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName, verStr)));
817 toolText += QString("%1<br>").arg(NOBR(toolLicense));
818 if(!extraInfo.isEmpty()) toolText += QString("<i>%1</i><br>").arg(NOBR(extraInfo));
819 toolText += QString("<nobr>%1</nobr>").arg(LINK(toolWebsite));
820 toolText += QString("<font style=\"font-size:9px\"><br> </font>");
826 bool AboutDialog::playResoureSound(const QString &library, const unsigned long soundId, const bool async)
829 DWORD flags = SND_RESOURCE;
832 QFileInfo libraryFile(library);
833 if(!libraryFile.isAbsolute())
835 unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1;
836 wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t));
837 unsigned int result = GetSystemDirectory(buffer, buffSize);
838 if(result > 0 && result < buffSize)
840 libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer))), library));
854 module = LoadLibraryW(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(libraryFile.absoluteFilePath()).utf16()));
858 result = PlaySound((LPCTSTR) soundId, module, flags);