diff options
author | Mateusz Łukasik <mati75@linuxmint.pl> | 2017-08-13 11:58:52 +0200 |
---|---|---|
committer | Mateusz Łukasik <mati75@linuxmint.pl> | 2017-08-13 11:58:52 +0200 |
commit | f6d0340806ec11f417006a3704eca7ec7d537eab (patch) | |
tree | aae9e8304e0af967c132c147e3df09eb108a5b34 /src/mpvoptions.cpp | |
parent | d0b2aaf71b59021d384cd81727e55edd07843987 (diff) |
New upstream version 17.8.0~ds0
Diffstat (limited to 'src/mpvoptions.cpp')
-rw-r--r-- | src/mpvoptions.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/mpvoptions.cpp b/src/mpvoptions.cpp index f03d575..791a7f2 100644 --- a/src/mpvoptions.cpp +++ b/src/mpvoptions.cpp @@ -21,6 +21,8 @@ #include "inforeader.h" #include "deviceinfo.h" +//#define USE_ANEQUALIZER + void MPVProcess::addArgument(const QString & /*a*/) { } @@ -652,14 +654,26 @@ void MPVProcess::addAF(const QString & filter_name, const QVariant & value) { } else if (filter_name == "equalizer") { + AudioEqualizerList l = value.toList(); + #ifndef USE_ANEQUALIZER + option = Helper::equalizerListToString(l); previous_eq = option; arg << "--af-add=equalizer=" + option; + #else + option = Helper::equalizerListToString(l, true); + previous_eq = option; + arg << "--af-add=lavfi=[anequalizer=" + option + "]"; + #endif } else if (filter_name == "extrastereo") { arg << "--af-add=lavfi=[extrastereo]"; } else + if (filter_name == "earwax") { + arg << "--af-add=lavfi=[earwax]"; + } + else if (filter_name == "karaoke") { /* Not supported anymore */ /* Ignore */ @@ -887,7 +901,13 @@ void MPVProcess::enableVolnorm(bool b, const QString & option) { if (b) writeToStdin("af add lavfi=[" + s + "]"); else writeToStdin("af del lavfi=[" + s + "]"); } -void MPVProcess::setAudioEqualizer(const QString & values) { +void MPVProcess::enableEarwax(bool b) { + if (b) writeToStdin("af add lavfi=[earwax]"); else writeToStdin("af del lavfi=[earwax]"); +} + +void MPVProcess::setAudioEqualizer(AudioEqualizerList l) { +#ifndef USE_ANEQUALIZER + QString values = Helper::equalizerListToString(l); if (values == previous_eq) return; if (!previous_eq.isEmpty()) { @@ -895,6 +915,19 @@ void MPVProcess::setAudioEqualizer(const QString & values) { } writeToStdin("af add equalizer=" + values); previous_eq = values; +#else + /* Not working */ + #if 0 + QString values = Helper::equalizerListToString(l, true); + if (values == previous_eq) return; + + if (!previous_eq.isEmpty()) { + writeToStdin("af del lavfi=[anequalizer=" + previous_eq + "]"); + } + writeToStdin("af add lavfi=[anequalizer=" + values + "]"); + previous_eq = values; + #endif +#endif } void MPVProcess::setAudioDelay(double delay) { |