diff options
author | Mateusz Łukasik <mati75@linuxmint.pl> | 2017-11-13 13:23:19 +0100 |
---|---|---|
committer | Mateusz Łukasik <mati75@linuxmint.pl> | 2017-11-13 13:23:19 +0100 |
commit | 257473284e04d45384e8e504d3c69b79872785b0 (patch) | |
tree | 8b851289adcaee8a6523ac946cc69b68571c927d /src/preferences.cpp | |
parent | 867f979d517190a0aaab06f4180cdd964a48677e (diff) |
New upstream version 17.11.0~ds0
Diffstat (limited to 'src/preferences.cpp')
-rw-r--r-- | src/preferences.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/preferences.cpp b/src/preferences.cpp index 80ece6e..126c86d 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -45,9 +45,9 @@ #include "retrieveyoutubeurl.h" #endif -//#define USE_CONFIG_VERSION +#define USE_CONFIG_VERSION #ifdef USE_CONFIG_VERSION -#define CURRENT_CONFIG_VERSION 4 +#define CURRENT_CONFIG_VERSION 5 #endif using namespace Global; @@ -81,11 +81,10 @@ void Preferences::reset() { #if defined(Q_OS_WIN) || defined(Q_OS_OS2) mplayer_bin= "mpv/mpv.exe"; - if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA) { + if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS7) { mplayer_bin= "mplayer/mplayer.exe"; } #else - //mplayer_bin = "mplayer"; mplayer_bin = "mpv"; #endif @@ -160,7 +159,11 @@ void Preferences::reset() { softvol_max = 110; // 110 = default value in mplayer use_scaletempo = Detect; use_hwac3 = false; +#ifdef Q_OS_WIN use_audio_equalizer = true; +#else + use_audio_equalizer = false; +#endif global_volume = true; volume = 50; @@ -505,6 +508,7 @@ void Preferences::reset() { #ifdef MPV_SUPPORT streaming_type = StreamingAuto; + ytdl_quality = ""; #else streaming_type = StreamingYT; #endif @@ -1037,6 +1041,9 @@ void Preferences::save() { set->beginGroup("streaming"); set->setValue("streaming_type", streaming_type); +#ifdef MPV_SUPPORT + set->setValue("ytdl_quality", ytdl_quality); +#endif #ifdef YOUTUBE_SUPPORT set->beginGroup("streaming/youtube"); @@ -1615,6 +1622,9 @@ void Preferences::load() { set->beginGroup("streaming"); streaming_type = set->value("streaming_type", streaming_type).toInt(); +#ifdef MPV_SUPPORT + ytdl_quality = set->value("ytdl_quality", ytdl_quality).toString(); +#endif #ifdef YOUTUBE_SUPPORT set->beginGroup("streaming/youtube"); @@ -1811,6 +1821,16 @@ void Preferences::load() { resize_method = Never; //move_when_dragging = false; } + if (config_version <= 5) { + #ifdef Q_OS_WIN + if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS7) { + mplayer_bin= "mplayer/mplayer.exe"; + } + #else + use_audio_equalizer = false; + initial_volnorm = false; + #endif + } config_version = CURRENT_CONFIG_VERSION; } #endif |