diff options
author | Mateusz Łukasik <mati75@linuxmint.pl> | 2015-12-06 19:08:44 +0100 |
---|---|---|
committer | Mateusz Łukasik <mati75@linuxmint.pl> | 2015-12-06 19:08:44 +0100 |
commit | ef3806d30c06fc3b5c2910ef4faebef27bbd6bad (patch) | |
tree | eacad504d5240c2354c1801d88542efc6ceccc2c /src/mpvoptions.cpp | |
parent | d21eb029cb664abe3893776c8345b300c084fe31 (diff) |
Imported Upstream version 15.11.0~ds0
Diffstat (limited to 'src/mpvoptions.cpp')
-rw-r--r-- | src/mpvoptions.cpp | 65 |
1 files changed, 60 insertions, 5 deletions
diff --git a/src/mpvoptions.cpp b/src/mpvoptions.cpp index 0f83c86..49df1c1 100644 --- a/src/mpvoptions.cpp +++ b/src/mpvoptions.cpp @@ -16,10 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <QDir> #include <QDebug> #include "inforeader.h" -void MPVProcess::addArgument(const QString & a) { +void MPVProcess::addArgument(const QString & /*a*/) { } void MPVProcess::setMedia(const QString & media, bool is_playlist) { @@ -69,6 +70,10 @@ void MPVProcess::setMedia(const QString & media, bool is_playlist) { } else { arg << media; } + +#ifdef CAPTURE_STREAM + capturing = false; +#endif } void MPVProcess::setFixedOptions() { @@ -108,6 +113,11 @@ void MPVProcess::addVFIfAvailable(const QString & vf, const QString & value) { } } +void MPVProcess::messageFilterNotSupported(const QString & filter_name) { + QString text = tr("the '%1' filter is not supported by mpv").arg(filter_name); + writeToStdin(QString("show_text \"%1\" 3000").arg(text)); +} + void MPVProcess::setOption(const QString & option_name, const QVariant & value) { if (option_name == "cache") { int cache = value.toInt(); @@ -253,6 +263,10 @@ void MPVProcess::setOption(const QString & option_name, const QVariant & value) arg << "--screenshot-template=" + value.toString(); } else + if (option_name == "screenshot_format") { + arg << "--screenshot-format=" + value.toString(); + } + else if (option_name == "threads") { arg << "--vd-lavc-threads=" + value.toString(); } @@ -308,6 +322,10 @@ void MPVProcess::setOption(const QString & option_name, const QVariant & value) verbose = true; } else + if (option_name == "mute") { + arg << "--mute=yes"; + } + else if (option_name == "vf-add") { if (!value.isNull()) arg << "--vf-add=" + value.toString(); } @@ -420,7 +438,9 @@ void MPVProcess::addVF(const QString & filter_name, const QVariant & value) { } else if (filter_name == "screenshot") { - //arg << "--screenshot-template=%{filename:shot}-%p-%04n"; + if (!screenshot_dir.isEmpty() && isOptionAvailable("--screenshot-directory")) { + arg << "--screenshot-directory=" + QDir::toNativeSeparators(screenshot_dir); + } } else if (filter_name == "rotate") { @@ -484,6 +504,11 @@ void MPVProcess::addAF(const QString & filter_name, const QVariant & value) { previous_eq = option; arg << "--af-add=equalizer=" + option; } + else + if (filter_name == "extrastereo" || filter_name == "karaoke") { + /* Not supported anymore */ + /* Ignore */ + } else { QString s = filter_name; if (!option.isEmpty()) s += "=" + option; @@ -511,7 +536,7 @@ void MPVProcess::setVideo(int ID) { writeToStdin("set vid " + QString::number(ID)); } -void MPVProcess::setSubtitle(int type, int ID) { +void MPVProcess::setSubtitle(int /*type*/, int ID) { writeToStdin("set sid " + QString::number(ID)); } @@ -613,6 +638,10 @@ void MPVProcess::setSubStep(int value) { writeToStdin("sub_step " + QString::number(value)); } +void MPVProcess::seekSub(int value) { + writeToStdin("sub-seek " + QString::number(value)); +} + void MPVProcess::setSubForcedOnly(bool b) { writeToStdin(QString("set sub-forced-only %1").arg(b ? "yes" : "no")); } @@ -621,13 +650,21 @@ void MPVProcess::setSpeed(double value) { writeToStdin("set speed " + QString::number(value)); } -void MPVProcess::enableKaraoke(bool b) { +#ifdef MPLAYER_SUPPORT +void MPVProcess::enableKaraoke(bool /*b*/) { + /* if (b) writeToStdin("af add karaoke"); else writeToStdin("af del karaoke"); + */ + messageFilterNotSupported("karaoke"); } -void MPVProcess::enableExtrastereo(bool b) { +void MPVProcess::enableExtrastereo(bool /*b*/) { + /* if (b) writeToStdin("af add extrastereo"); else writeToStdin("af del extrastereo"); + */ + messageFilterNotSupported("extrastereo"); } +#endif void MPVProcess::enableVolnorm(bool b, const QString & option) { if (b) writeToStdin("af add drc=" + option); else writeToStdin("af del drc=" + option); @@ -665,6 +702,24 @@ void MPVProcess::takeScreenshot(ScreenshotType t, bool include_subtitles) { writeToStdin(QString("screenshot %1 %2").arg(include_subtitles ? "subtitles" : "video").arg(t == Single ? "single" : "each-frame")); } +#ifdef CAPTURE_STREAM +void MPVProcess::switchCapturing() { + if (!capture_filename.isEmpty()) { + if (!capturing) { + QString f = capture_filename; + #ifdef Q_OS_WIN + // I hate Windows + f = f.replace("\\", "\\\\"); + #endif + writeToStdin("set stream-capture \"" + f + "\""); + } else { + writeToStdin("set stream-capture \"\""); + } + capturing = !capturing; + } +} +#endif + void MPVProcess::setTitle(int ID) { writeToStdin("set disc-title " + QString::number(ID)); } |