diff --git a/src/Lib/Utils.hh b/src/Lib/Utils.hh index 3c9bf0e873ed8cda00982d6e3919be0719c56f4c..1592afa4a5dd83294d1506ce32cdab4bf58224c2 100644 --- a/src/Lib/Utils.hh +++ b/src/Lib/Utils.hh @@ -37,8 +37,9 @@ concept PropertyConstViewable = requires(T element) namespace Vivy::Utils { -static const QStringList audioFileSuffix = { "wave", "wav", "ogg", "mp3", "m4a" }; -static const QStringList videoFileSuffix = { "mkv", "mp4" }; +static const QStringList audioFileSuffix = { "wave", "wav", "ogg", "mp3", "m4a", + "opus", "mp2", "aiff", "flac", "alac" }; +static const QStringList videoFileSuffix = { "mkv", "mp4", "mov", "avi", "av1", "m4v", "flv" }; static const QStringList assFileSuffix = { "ass" }; static const QStringList vivyFileSuffix = { "vivy" }; @@ -53,14 +54,24 @@ enum class DocumentType : quint64 { OGG = (1 << 4), MP3 = (1 << 5), M4A = (1 << 6), + OPUS = (1 << 7), + MP2 = (1 << 8), + AIFF = (1 << 9), + FLAC = (1 << 10), + ALAC = (1 << 11), /* Video */ - MKV = (1 << 7), - MP4 = (1 << 8), + MKV = (1 << 12), + MP4 = (1 << 13), + MOV = (1 << 14), + AVI = (1 << 14), + AV1 = (1 << 15), + M4V = (1 << 16), + FLV = (1 << 17), /* Meta-types */ - Audio = (WAVE | OGG | MP3), - Video = (MKV | MP4), + Audio = (WAVE | OGG | MP3 | M4A | OPUS | MP2 | AIFF | FLAC | ALAC), + Video = (MKV | MP4 | MOV | AVI | AV1 | M4V | FLV), }; template <typename E> diff --git a/src/UI/DialogHelp.cc b/src/UI/DialogHelp.cc index 1eabd5c73d68bd6c479fec5db26206813c92f41a..bd0abab31efb949dabe7df5a357e9eedb98b9953 100644 --- a/src/UI/DialogHelp.cc +++ b/src/UI/DialogHelp.cc @@ -8,6 +8,21 @@ using namespace Vivy; +// See https://doc.qt.io/qt-5/richtext-html-subset.html for the supported +// rich text subset. +static const char *aboutContentHeader = + "<body>" + "<h1>About Vivy</h1>" + "<p>Vivy is a replacement for Aegisub, writen in Qt5+and with less segfaults - hopefully.</p>" + "<p>The following libraries where used:</p>" + "<ul>" + " <li>Qt5</li>" + " <li>libavutils</li>" + " <li>libavcodec</li>" + " <li>libavformat</li>" + "</ul>"; +static const char *aboutContentFooter = "</body>"; + DialogHelp::DialogHelp(QWidget *parent) noexcept : QMessageBox(parent) { @@ -18,8 +33,22 @@ DialogHelp::DialogHelp(QWidget *parent) noexcept setSizePolicy(sizePolicy); setTextFormat(Qt::RichText); - setText(aboutContent); + setText(getAboutContent()); setTextInteractionFlags(Qt::NoTextInteraction); adjustSize(); } + +QString +DialogHelp::getAboutContent() const noexcept +{ + QString ret; + ret = aboutContentHeader; + + ret.append("<p>Vivy will handle the following most of the video and audio formats."); + ret.append("The audio formats are: " + Utils::audioFileSuffix.join(", ")); + ret.append("The video formats are: " + Utils::videoFileSuffix.join(", ") + "</p>"); + + ret.append(aboutContentFooter); + return ret; +} diff --git a/src/UI/DialogHelp.hh b/src/UI/DialogHelp.hh index 1ab9c7d9f3eff84d837438671f09b3b9a9ba917c..0bb5d9e09810ba60765cc462ae16237ccca8814e 100644 --- a/src/UI/DialogHelp.hh +++ b/src/UI/DialogHelp.hh @@ -18,22 +18,7 @@ public: ~DialogHelp() noexcept = default; private: - /* See https://doc.qt.io/qt-5/richtext-html-subset.html for the supported - * rich text subset. */ - // clang-format off - static inline const char *aboutContent = - "<body>" - "<h1>About Vivy</h1>" - "<p>Vivy is a replacement for Aegisub, writen in Qt5+and with less segfaults - hopefully.</p>" - "<p>The following libraries where used:</p>" - "<ul>" - " <li>Qt5</li>" - " <li>libavutils</li>" - " <li>libavcodec</li>" - " <li>libavformat</li>" - "</ul>" - "</body>"; - // clang-format on + QString getAboutContent() const noexcept; }; }