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>
47 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
50 const char *AboutDialog::neroAacUrl = "http://www.nero.com/eng/technologies-aac-codec.html";
51 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
61 g_lamexp_translators[] =
63 {"en", L"Englisch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
64 {"de", L"Deutsch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
65 {"", L"", L"Bodo Thevissen", "Bodo@thevissen.de" },
66 {"es", L"Español", L"Rub3nCT", "Rub3nCT@gmail.com" },
67 {"fr", L"Française", L"Dodich Informatique", "Dodich@live.fr" },
68 {"it", L"Italiano", L"Roberto", "Gulliver_69@libero.it" },
69 {"kr", L"한국어", L"JaeHyung Lee", "Kolanp@gmail.com" },
70 {"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
71 {"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
72 {"", L"", L"Иван Митин", "bardak@inbox.ru" },
73 {"sv", L"Svenska", L"Åke Engelbrektson", "eson57@gmail.com" },
74 {"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
75 {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
76 {"zh", L"简体中文", L"456Vv", "123@456vv.com" },
77 {NULL, NULL, NULL, NULL}
80 ////////////////////////////////////////////////////////////
82 ////////////////////////////////////////////////////////////
84 AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstStart)
91 m_disqueDelay(_I64_MAX)
93 //Init the dialog, from the .ui file
95 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
96 resize(this->minimumSize());
97 tabWidget->setCurrentIndex(tabWidget->indexOf(infoTab));
100 if(HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE))
102 EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
105 for(int i = 0; i < 4; i++)
111 initInformationTab();
112 initContributorsTab();
119 QPushButton *firstButton = addButton(tr("Show License Text"), QMessageBox::AcceptRole);
120 firstButton->setIcon(QIcon(":/icons/script.png"));
121 firstButton->setIconSize(QSize(16, 16));
122 firstButton->setMinimumWidth(135);
123 firstButton->disconnect();
124 connect(firstButton, SIGNAL(clicked()), this, SLOT(openLicenseText()));
126 QPushButton *secondButton = addButton(tr("Accept License"), QMessageBox::AcceptRole);
127 secondButton->setIcon(QIcon(":/icons/accept.png"));
128 secondButton->setIconSize(QSize(16, 16));
129 secondButton->setMinimumWidth(120);
131 QPushButton *thirdButton = addButton(tr("Decline License"), QMessageBox::AcceptRole);
132 thirdButton->setIcon(QIcon(":/icons/delete.png"));
133 thirdButton->setIconSize(QSize(16, 16));
134 thirdButton->setMinimumWidth(120);
135 thirdButton->setEnabled(false);
139 QPushButton *firstButton = addButton(tr("3rd Party S/W"), QMessageBox::AcceptRole);
140 firstButton->setIcon(QIcon(":/icons/page_white_cplusplus.png"));
141 firstButton->setIconSize(QSize(16, 16));
142 firstButton->setMinimumWidth(120);
143 firstButton->disconnect();
144 connect(firstButton, SIGNAL(clicked()), this, SLOT(showMoreAbout()));
146 QPushButton *secondButton = addButton(tr("Contributors"), QMessageBox::AcceptRole);
147 secondButton->setIcon(QIcon(":/icons/user_suit.png"));
148 secondButton->setIconSize(QSize(16, 16));
149 secondButton->setMinimumWidth(120);
150 secondButton->disconnect();
151 connect(secondButton, SIGNAL(clicked()), this, SLOT(showAboutContributors()));
153 static const bool isQt5 = (QT_VERSION >= QT_VERSION_CHECK(5,0,0));
154 QPushButton *thirdButton = addButton(isQt5 ? tr("About Qt5") : tr("About Qt4"), QMessageBox::AcceptRole);
155 thirdButton->setIcon(QIcon(":/icons/qt.png"));
156 thirdButton->setIconSize(QSize(16, 16));
157 thirdButton->setMinimumWidth(120);
158 thirdButton->disconnect();
159 connect(thirdButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
161 QPushButton *fourthButton = addButton(tr("Discard"), QMessageBox::AcceptRole);
162 fourthButton->setIcon(QIcon(":/icons/cross.png"));
163 fourthButton->setIconSize(QSize(16, 16));
164 fourthButton->setMinimumWidth(90);
170 acceptButton->hide();
171 declineButton->hide();
172 aboutQtButton->show();
175 QPixmap disque(":/images/Disque.png");
176 QRect screenGeometry = QApplication::desktop()->availableGeometry();
177 m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
178 m_disque->installEventFilter(this);
179 m_disque->setStyleSheet("background:transparent;");
180 m_disque->setAttribute(Qt::WA_TranslucentBackground);
181 m_disque->setGeometry(qrand() % (screenGeometry.width() - disque.width()), qrand() % (screenGeometry.height() - disque.height()), disque.width(), disque.height());
182 m_disque->setPixmap(disque);
183 m_disque->setWindowOpacity(0.01);
185 m_disqueFlags[0] = (qrand() > (RAND_MAX/2));
186 m_disqueFlags[1] = (qrand() > (RAND_MAX/2));
187 m_disqueTimer = new QTimer;
188 connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
189 m_disqueTimer->setInterval(10);
190 m_disqueTimer->start();
192 connect(aboutQtButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
196 acceptButton->show();
197 declineButton->show();
198 aboutQtButton->hide();
202 m_firstShow = firstStart;
205 AboutDialog::~AboutDialog(void)
210 LAMEXP_DELETE(m_disque);
214 m_disqueTimer->stop();
215 LAMEXP_DELETE(m_disqueTimer);
217 for(int i = 0; i < 4; i++)
219 LAMEXP_DELETE(m_cartoon[i]);
224 ////////////////////////////////////////////////////////////
226 ////////////////////////////////////////////////////////////
228 int AboutDialog::exec()
230 if(m_settings->soundsEnabled())
234 if(!playResoureSound("imageres.dll", 5080, true))
236 PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC);
241 PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
245 switch(QDialog::exec())
259 ////////////////////////////////////////////////////////////
261 ////////////////////////////////////////////////////////////
263 #define TEMP_HIDE_DISQUE(CMD) \
264 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}
266 void AboutDialog::enableButtons(void)
268 acceptButton->setEnabled(true);
269 declineButton->setEnabled(true);
270 setCursor(QCursor(Qt::ArrowCursor));
273 void AboutDialog::openURL(const QString &url)
275 if(!QDesktopServices::openUrl(QUrl(url)))
277 ShellExecuteW(this->winId(), L"open", QWCHAR(url), NULL, NULL, SW_SHOW);
281 void AboutDialog::showAboutQt(void)
285 QMessageBox::aboutQt(this);
289 void AboutDialog::moveDisque(void)
292 LARGE_INTEGER perfCount, perfFrequ;
294 if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount))
296 if(m_disqueDelay != _I64_MAX)
298 const double delay = static_cast<double>(perfCount.QuadPart) - static_cast<double>(m_disqueDelay);
299 delta = qMax(1, qMin(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
301 m_disqueDelay = perfCount.QuadPart;
306 QRect screenGeometry = QApplication::desktop()->availableGeometry();
307 const int minX = screenGeometry.left();
308 const int maxX = screenGeometry.width() - m_disque->width() + screenGeometry.left();
309 const int minY = screenGeometry.top();
310 const int maxY = screenGeometry.height() - m_disque->height() + screenGeometry.top();
312 QPoint pos = m_disque->pos();
313 pos.setX(m_disqueFlags[0] ? pos.x() + delta : pos.x() - delta);
314 pos.setY(m_disqueFlags[1] ? pos.y() + delta : pos.y() - delta);
318 m_disqueFlags[0] = true;
322 else if(pos.x() >= maxX)
324 m_disqueFlags[0] = false;
330 m_disqueFlags[1] = true;
334 else if(pos.y() >= maxY)
336 m_disqueFlags[1] = false;
345 QPixmap *cartoon = NULL;
346 if(m_disqueFlags[0] == true && m_disqueFlags[1] != true) cartoon = m_cartoon[0];
347 if(m_disqueFlags[0] == true && m_disqueFlags[1] == true) cartoon = m_cartoon[1];
348 if(m_disqueFlags[0] != true && m_disqueFlags[1] == true) cartoon = m_cartoon[2];
349 if(m_disqueFlags[0] != true && m_disqueFlags[1] != true) cartoon = m_cartoon[3];
352 m_disque->setPixmap(*cartoon);
353 m_disque->resize(cartoon->size());
355 m_rotateNext = false;
358 if(m_disque->windowOpacity() < 0.9)
360 m_disque->setWindowOpacity(m_disque->windowOpacity() + 0.01);
364 ////////////////////////////////////////////////////////////
365 // Protected Functions
366 ////////////////////////////////////////////////////////////
368 void AboutDialog::showEvent(QShowEvent *e)
370 QDialog::showEvent(e);
373 acceptButton->setEnabled(false);
374 declineButton->setEnabled(false);
375 QTimer::singleShot(5000, this, SLOT(enableButtons()));
376 setCursor(QCursor(Qt::WaitCursor));
380 bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
382 if((obj == m_disque) && (event->type() == QEvent::MouseButtonPress))
384 QPixmap cartoon(":/images/Cartoon.png");
385 for(int i = 0; i < 4; i++)
389 m_cartoon[i] = new QPixmap(cartoon.transformed(QMatrix().rotate(static_cast<double>(i*90) + 45.0), Qt::SmoothTransformation));
393 QDesktopServices::openUrl(QUrl(disqueUrl));
399 ////////////////////////////////////////////////////////////
401 ////////////////////////////////////////////////////////////
403 void AboutDialog::initInformationTab(void)
405 const QString versionStr = QString().sprintf
407 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
408 lamexp_version_major(),
409 lamexp_version_minor(),
410 lamexp_version_release(),
411 lamexp_version_build(),
412 lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
413 lamexp_version_compiler(),
414 lamexp_version_arch(),
418 const QString copyrightStr = QString().sprintf
420 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
421 qMax(lamexp_version_date().year(), QDate::currentDate().year())
426 aboutText += QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
427 aboutText += QString("<b>%1</b><br>").arg(NOBR(copyrightStr));
428 aboutText += QString("<b>%1</b><br><br>").arg(NOBR(versionStr));
429 aboutText += QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
431 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
434 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
435 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))));
437 else if(lamexp_version_demo())
439 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
440 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))));
445 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0i64);
446 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))));
448 else if(lamexp_version_demo())
450 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0i64);
451 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))));
455 aboutText += "<hr><br>";
456 aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
457 aboutText += "modify it under the terms of the GNU General Public License<br>";
458 aboutText += "as published by the Free Software Foundation; either version 2<br>";
459 aboutText += "of the License, or (at your option) any later version.<br><br>";
460 aboutText += "This program is distributed in the hope that it will be useful,<br>";
461 aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
462 aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
463 aboutText += "GNU General Public License for more details.<br><br>";
464 aboutText += "You should have received a copy of the GNU General Public License<br>";
465 aboutText += "along with this program; if not, write to the Free Software<br>";
466 aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
467 aboutText += "<hr><table><tr>";
468 aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
469 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 !!!"));
470 aboutText += "</tr></table><hr><br>";
471 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/")));
473 infoLabel->setText(aboutText);
474 infoIcon->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
475 connect(infoLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
478 void AboutDialog::initContributorsTab(void)
480 const QString extraSpace("<font style=\"font-size:5px\"><br> </font>");
482 QString contributorsAboutText;
483 contributorsAboutText += QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
484 contributorsAboutText += "<table style=\"margin-top:12px\">";
486 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraSpace);
487 QString icon = QString("<img src=\":/icons/%1.png\">").arg("page_white_cplusplus");
488 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td> </td>").arg(icon);
489 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td> </td>").arg(tr("Project Leader"));
490 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td> </td><td><a href=\"mailto:%2\"><%2></a></td></tr>").arg("LoRd_MuldeR", "MuldeR2@GMX.de");
491 contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
493 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"),extraSpace);
494 for(int i = 0; g_lamexp_translators[i].pcName; i++)
496 QString flagIcon = (strlen(g_lamexp_translators[i].pcFlag) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators[i].pcFlag) : QString();
497 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td> </td>").arg(flagIcon);
498 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td> </td>").arg(WCHAR2QSTR(g_lamexp_translators[i].pcLanguage));
499 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td> </td><td><a href=\"mailto:%2\"><%2></a></td></tr>").arg(WCHAR2QSTR(g_lamexp_translators[i].pcName), g_lamexp_translators[i].pcMail);
502 contributorsAboutText += "</table><br><br>";
503 contributorsAboutText += QString("<i>%1</i>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
505 contributorsLabel->setText(contributorsAboutText);
506 contributorsIcon->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
507 connect(contributorsLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
510 void AboutDialog::initSoftwareTab(void)
512 QString moreAboutText;
514 moreAboutText += QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
515 moreAboutText += "<div style=\"margin-left:-25px;white-space:nowrap\"><table><tr><td><ul>"; //;font-size:7pt
517 moreAboutText += makeToolText
519 tr("LAME - OpenSource mp3 Encoder"),
520 "lame.exe", "v?.??, Final-?",
521 tr("Released under the terms of the GNU Lesser General Public License."),
522 "http://lame.sourceforge.net/"
524 moreAboutText += makeToolText
526 tr("OggEnc - Ogg Vorbis Encoder"),
527 "oggenc2.exe", "v?.??, aoTuV Beta-?.??",
528 tr("Completely open and patent-free audio encoding technology."),
529 "http://www.vorbis.com/"
531 moreAboutText += makeToolText
533 tr("Nero AAC Reference MPEG-4 Encoder"),
534 "neroAacEnc.exe", "v?.?.?.?",
535 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
537 tr("Available from vendor web-site as free download:")
539 moreAboutText += makeToolText
541 tr("Aften - A/52 audio encoder"),
542 "aften.exe", "v?.?.?",
543 tr("Released under the terms of the GNU Lesser General Public License."),
544 "http://aften.sourceforge.net/"
546 moreAboutText += makeToolText
548 tr("FLAC - Free Lossless Audio Codec"),
549 "flac.exe", "v?.?.?",
550 tr("Open and patent-free lossless audio compression technology."),
551 "http://flac.sourceforge.net/"
553 moreAboutText += makeToolText
555 tr("Opus Audio Codec"),
556 "opusenc_std.exe", "????-??-??",
557 tr("Totally open, royalty-free, highly versatile audio codec."),
558 "http://www.opus-codec.org/"
560 moreAboutText += makeToolText
562 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
563 "mpg123.exe", "v?.??.?",
564 tr("Released under the terms of the GNU Lesser General Public License."),
565 "http://www.mpg123.de/"
567 moreAboutText += makeToolText
569 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
571 tr("Released under the terms of the GNU General Public License."),
572 "http://www.audiocoding.com/"
574 moreAboutText += makeToolText
576 tr("AC3Filter Tools - AC3/DTS Decoder"),
577 "valdec.exe", "v?.??",
578 tr("Released under the terms of the GNU Lesser General Public License."),
579 "http://www.ac3filter.net/projects/tools"
581 moreAboutText += makeToolText
583 tr("WavPack - Hybrid Lossless Compression"),
584 "wvunpack.exe", "v?.??.?",
585 tr("Completely open audio compression format."),
586 "http://www.wavpack.com/"
588 moreAboutText += makeToolText
590 tr("Musepack - Living Audio Compression"),
591 "mpcdec.exe", "r???",
592 tr("Released under the terms of the GNU Lesser General Public License."),
593 "http://www.musepack.net/"
595 moreAboutText += makeToolText
597 tr("Monkey's Audio - Lossless Audio Compressor"),
599 tr("Freely available source code, simple SDK and non-restrictive licensing."),
600 "http://www.monkeysaudio.com/"
602 moreAboutText += makeToolText
604 tr("Shorten - Lossless Audio Compressor"),
605 "shorten.exe", "v?.?.?",
606 tr("Released under the terms of the GNU Lesser General Public License."),
607 "http://etree.org/shnutils/shorten/"
609 moreAboutText += makeToolText
611 tr("Speex - Free Codec For Free Speech"),
612 "speexdec.exe", "v?.?",
613 tr("Open Source patent-free audio format designed for speech."),
614 "http://www.speex.org/"
616 moreAboutText += makeToolText
618 tr("The True Audio - Lossless Audio Codec"),
620 tr("Released under the terms of the GNU Lesser General Public License."),
621 "http://tta.sourceforge.net/"
623 moreAboutText += makeToolText
626 "alac.exe", "v?.?.?",
627 tr("Copyright (c) 2004 David Hammerton. Contributions by Cody Brocious."),
628 "http://craz.net/programs/itunes/alac.html"
630 moreAboutText += makeToolText
632 tr("wma2wav - Dump WMA files to Wave Audio"),
633 "wma2wav.exe", "????-??-??",
634 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
635 "http://forum.doom9.org/showthread.php?t=140273"
637 moreAboutText += makeToolText
639 tr("avs2wav - Avisynth to Wave Audio converter"),
640 "avs2wav.exe", "v?.?",
641 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
642 "http://forum.doom9.org/showthread.php?t=70882"
644 moreAboutText += makeToolText
647 "dcaenc.exe", "????-??-??",
648 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
649 "http://gitorious.org/dtsenc/dtsenc/trees/master"
651 moreAboutText += makeToolText
653 tr("MediaInfo - Media File Analysis Tool"),
654 "mediainfo.exe", "v?.?.??",
655 tr("Released under the terms of the GNU Lesser General Public License."),
656 "http://mediainfo.sourceforge.net/"
658 moreAboutText += makeToolText
660 tr("SoX - Sound eXchange"),
661 "sox.exe", "v??.?.?",
662 tr("Released under the terms of the GNU Lesser General Public License."),
663 "http://sox.sourceforge.net/"
665 moreAboutText += makeToolText
667 tr("GnuPG - The GNU Privacy Guard"),
668 "gpgv.exe", "v?.?.??",
669 tr("Released under the terms of the GNU Lesser General Public License."),
670 "http://www.gnupg.org/"
672 moreAboutText += makeToolText
674 tr("GNU Wget - Software for retrieving files using HTTP"),
675 "wget.exe", "v?.??.?",
676 tr("Released under the terms of the GNU Lesser General Public License."),
677 "http://www.gnu.org/software/wget/"
679 moreAboutText += makeToolText
681 tr("Silk Icons - Over 700 icons in PNG format"),
683 tr("By Mark James, released under the Creative Commons 'by' License."),
684 "http://www.famfamfam.com/lab/icons/silk/"
686 moreAboutText += QString("</ul></td><td> </td></tr></table></div><i>%1</i><br>").arg
688 tr("LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors.")
691 softwareLabel->setText(moreAboutText);
692 softwareIcon->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65)));
693 connect(softwareLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
696 void AboutDialog::initLicenseTab(void)
699 licenseText += ("<tt>");
701 QFile file(":/License.txt");
702 if(file.open(QIODevice::ReadOnly))
704 QTextStream stream(&file);
705 unsigned int counter = 0;
706 while((!stream.atEnd()) && (stream.status() == QTextStream::Ok))
708 QString line = stream.readLine().replace('<', "<").replace('>', ">");
712 if(!line.isEmpty()) licenseText += QString("<font size=\"+2\">%1</font><br>").arg(line.simplified());
715 if(!line.isEmpty()) licenseText += QString("<font size=\"+1\">%1</font><br>").arg(line.simplified());
718 licenseText += QString("<nobr>%1</nobr><br>").arg(line.replace(' ', " "));
721 if(!line.isEmpty()) counter++;
723 stream.device()->close();
727 licenseText += LINK("http://www.gnu.org/licenses/gpl-2.0.html");
730 licenseText += ("</tt>");
732 licenseLabel->setText(licenseText);
733 licenseIcon->setPixmap(QIcon(":/images/Logo_GNU.png").pixmap(QSize(72,65)));
737 QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo)
739 QString toolText, verStr(toolVerFmt);
741 if(!toolBin.isEmpty())
743 verStr = lamexp_version2string(toolVerFmt, lamexp_tool_version(toolBin), tr("n/a"));
746 toolText += QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName, verStr)));
747 toolText += QString("%1<br>").arg(NOBR(toolLicense));
748 if(!extraInfo.isEmpty()) toolText += QString("<i>%1</i><br>").arg(NOBR(extraInfo));
749 toolText += QString("<nobr>%1</nobr>").arg(LINK(toolWebsite));
750 toolText += QString("<div style=\"font-size:1pt\"><br></div>");
756 bool AboutDialog::playResoureSound(const QString &library, const unsigned long soundId, const bool async)
759 DWORD flags = SND_RESOURCE;
762 QFileInfo libraryFile(library);
763 if(!libraryFile.isAbsolute())
765 unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1;
766 wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t));
767 unsigned int result = GetSystemDirectory(buffer, buffSize);
768 if(result > 0 && result < buffSize)
770 libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer))), library));
784 module = LoadLibraryW(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(libraryFile.absoluteFilePath()).utf16()));
788 result = PlaySound((LPCTSTR) soundId, module, flags);