Changeset 175 for smplayer/vendor/current/src/preferences.cpp
- Timestamp:
- May 3, 2016, 2:14:41 PM (10 years ago)
- File:
-
- 1 edited
-
smplayer/vendor/current/src/preferences.cpp (modified) (55 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/preferences.cpp
r168 r175 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <[email protected]>2 Copyright (C) 2006-201 Ricardo Villalba <[email protected]> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 25 25 #include "filters.h" 26 26 #include "autohidewidget.h" 27 27 28 28 29 #include <QSettings> … … 31 32 #include <QDir> 32 33 #include <QLocale> 34 33 35 34 36 #if QT_VERSION >= 0x050000 … … 87 89 88 90 use_screenshot = true; 91 92 93 94 89 95 screenshot_directory=""; 90 96 #ifdef PORTABLE_APP … … 99 105 #endif 100 106 107 108 109 110 101 111 dont_remember_media_settings = false; 102 112 dont_remember_time_pos = false; … … 133 143 #endif 134 144 145 146 147 135 148 use_soft_vol = true; 149 136 150 softvol_max = 110; // 110 = default value in mplayer 137 151 use_scaletempo = Detect; … … 156 170 157 171 osd = None; 172 173 158 174 osd_delay = 2200; 159 175 … … 199 215 HD_height = 720; 200 216 217 201 218 // MPlayer 1.0rc1 require restart, new versions don't 202 219 fast_audio_change = Detect; 220 221 203 222 #if !SMART_DVD_CHAPTERS 204 223 fast_chapter_change = false; … … 206 225 207 226 threads = 1; 227 208 228 209 229 cache_for_files = 2048; … … 214 234 cache_for_tv = 3000; 215 235 216 #ifdef YOUTUBE_SUPPORT217 yt_quality = RetrieveYoutubeUrl::MP4_720p;218 //yt_user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1";219 yt_user_agent = "";220 yt_use_https_main = false;221 yt_use_https_vi = false;222 #endif223 224 236 225 237 /* ********* … … 227 239 ********* */ 228 240 229 font_file = "";230 font_name = "";231 use_fontconfig = false;232 241 subcp = "ISO-8859-1"; 233 242 use_enca = false; 234 243 enca_lang = QString(QLocale::system().name()).section("_",0,0); 235 font_autoscale = 1;236 244 subfuzziness = 1; 237 245 autoload_sub = true; 238 246 239 247 use_ass_subtitles = true; 248 240 249 ass_line_spacing = 0; 241 250 … … 246 255 subtitles_on_screenshots = false; 247 256 248 use_new_sub_commands = Detect;249 257 change_sub_scale_should_restart = Detect; 250 258 … … 259 267 260 268 freetype_support = true; 261 #ifdef Q_OS_WIN269 #ifdef 262 270 use_windowsfontdir = false; 263 271 #endif … … 284 292 285 293 mplayer_additional_options=""; 286 #if def PORTABLE_APP294 #if 287 295 mplayer_additional_options="-nofontconfig"; 288 296 #endif … … 313 321 use_edl_files = true; 314 322 323 324 325 326 315 327 prefer_ipv4 = true; 316 328 … … 328 340 329 341 time_to_kill_mplayer = 1000; 342 343 344 345 330 346 331 347 … … 346 362 #endif 347 363 348 move_when_dragging= false;349 364 = false; 365 center_window_if_outside = true; 350 366 351 367 #if DVDNAV_SUPPORT … … 363 379 wheel_function_seeking_reverse = false; 364 380 381 382 365 383 seeking1 = 10; 366 384 seeking2 = 60; … … 404 422 allow_video_movement = false; 405 423 406 #ifdef SKINS407 gui = "SkinGUI";408 iconset = "Gonzo";409 #else410 424 gui = "DefaultGUI"; 411 iconset = " ";412 #endif 425 iconset = ""; 426 413 427 414 428 #if USE_MINIMUMSIZE … … 443 457 last_dvb_channel = ""; 444 458 last_tv_channel = ""; 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 445 485 446 486 … … 489 529 mplayer_detected_version = -1; //None version parsed yet 490 530 mplayer_user_supplied_version = -1; 531 491 532 mplayer_is_mplayer2 = false; 492 533 mplayer2_detected_version = QString::null; 534 493 535 494 536 … … 561 603 562 604 set->setValue("use_screenshot", use_screenshot); 605 606 607 608 563 609 #if QT_VERSION >= 0x040400 564 610 set->setValue("screenshot_folder", screenshot_directory); 565 611 #else 566 612 set->setValue("screenshot_directory", screenshot_directory); 613 614 615 616 567 617 #endif 568 618 … … 623 673 624 674 set->setValue("osd", osd); 675 676 625 677 set->setValue("osd_delay", osd_delay); 626 678 … … 668 720 set->setValue("HD_height", HD_height); 669 721 722 670 723 set->setValue("fast_audio_change", fast_audio_change); 724 725 671 726 #if !SMART_DVD_CHAPTERS 672 727 set->setValue("fast_chapter_change", fast_chapter_change); … … 674 729 675 730 set->setValue("threads", threads); 731 676 732 677 733 set->setValue("cache_for_files", cache_for_files); … … 684 740 set->endGroup(); // performance 685 741 686 #ifdef YOUTUBE_SUPPORT687 set->beginGroup("youtube");688 set->setValue("quality", yt_quality);689 set->setValue("user_agent", yt_user_agent);690 set->setValue("yt_use_https_main", yt_use_https_main);691 set->setValue("yt_use_https_vi", yt_use_https_vi);692 set->endGroup();693 #endif694 695 742 696 743 /* ********* … … 700 747 set->beginGroup("subtitles"); 701 748 702 set->setValue("font_file", font_file);703 set->setValue("font_name", font_name);704 705 set->setValue("use_fontconfig", use_fontconfig);706 749 set->setValue("subcp", subcp); 707 750 set->setValue("use_enca", use_enca); 708 751 set->setValue("enca_lang", enca_lang); 709 set->setValue("font_autoscale", font_autoscale);710 752 set->setValue("subfuzziness", subfuzziness); 711 753 set->setValue("autoload_sub", autoload_sub); 712 754 713 755 set->setValue("use_ass_subtitles", use_ass_subtitles); 756 714 757 set->setValue("ass_line_spacing", ass_line_spacing); 715 758 set->setValue("use_forced_subs_only", use_forced_subs_only); … … 719 762 set->setValue("subtitles_on_screenshots", subtitles_on_screenshots); 720 763 721 set->setValue("use_new_sub_commands", use_new_sub_commands);722 764 set->setValue("change_sub_scale_should_restart", change_sub_scale_should_restart); 723 765 … … 730 772 731 773 set->setValue("freetype_support", freetype_support); 732 #ifdef Q_OS_WIN774 #ifdef 733 775 set->setValue("use_windowsfontdir", use_windowsfontdir); 734 776 #endif … … 780 822 set->setValue("use_edl_files", use_edl_files); 781 823 824 825 826 827 782 828 set->setValue("prefer_ipv4", prefer_ipv4); 783 829 … … 795 841 796 842 set->setValue("time_to_kill_mplayer", time_to_kill_mplayer); 843 844 845 846 797 847 798 848 set->endGroup(); // advanced … … 817 867 #endif 818 868 819 set->setValue("move_when_dragging", move_when_dragging); 869 set->setValue("center_window", center_window); 870 set->setValue("center_window_if_outside", center_window_if_outside); 820 871 821 872 set->setValue("mouse_left_click_function", mouse_left_click_function); … … 829 880 set->setValue("wheel_function_seeking_reverse", wheel_function_seeking_reverse); 830 881 882 883 831 884 set->setValue("seeking1", seeking1); 832 885 set->setValue("seeking2", seeking2); … … 903 956 set->setValue("last_tv_channel", last_tv_channel); 904 957 set->endGroup(); // tv 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 905 986 906 987 /* *********** … … 961 1042 set->setValue("mplayer_detected_version", mplayer_detected_version); 962 1043 set->setValue("mplayer_user_supplied_version", mplayer_user_supplied_version); 1044 963 1045 set->setValue("is_mplayer2", mplayer_is_mplayer2); 964 1046 set->setValue("mplayer2_detected_version", mplayer2_detected_version); 1047 965 1048 set->endGroup(); // mplayer_info 966 1049 … … 1054 1137 1055 1138 use_screenshot = set->value("use_screenshot", use_screenshot).toBool(); 1139 1140 1141 1142 1056 1143 #if QT_VERSION >= 0x040400 1057 1144 screenshot_directory = set->value("screenshot_folder", screenshot_directory).toString(); … … 1059 1146 #else 1060 1147 screenshot_directory = set->value("screenshot_directory", screenshot_directory).toString(); 1148 1149 1150 1151 1061 1152 #endif 1062 1153 … … 1118 1209 1119 1210 osd = set->value("osd", osd).toInt(); 1211 1212 1120 1213 osd_delay = set->value("osd_delay", osd_delay).toInt(); 1121 1214 … … 1163 1256 HD_height = set->value("HD_height", HD_height).toInt(); 1164 1257 1258 1165 1259 fast_audio_change = (OptionState) set->value("fast_audio_change", fast_audio_change).toInt(); 1260 1261 1166 1262 #if !SMART_DVD_CHAPTERS 1167 1263 fast_chapter_change = set->value("fast_chapter_change", fast_chapter_change).toBool(); … … 1169 1265 1170 1266 threads = set->value("threads", threads).toInt(); 1267 1171 1268 1172 1269 cache_for_files = set->value("cache_for_files", cache_for_files).toInt(); … … 1179 1276 set->endGroup(); // performance 1180 1277 1181 #ifdef YOUTUBE_SUPPORT1182 set->beginGroup("youtube");1183 yt_quality = set->value("quality", yt_quality).toInt();1184 yt_user_agent = set->value("user_agent", yt_user_agent).toString();1185 yt_use_https_main = set->value("yt_use_https_main", yt_use_https_main).toBool();1186 yt_use_https_vi = set->value("yt_use_https_vi", yt_use_https_vi).toBool();1187 set->endGroup();1188 #endif1189 1190 1278 1191 1279 /* ********* … … 1195 1283 set->beginGroup("subtitles"); 1196 1284 1197 font_file = set->value("font_file", font_file).toString();1198 font_name = set->value("font_name", font_name).toString();1199 1200 use_fontconfig = set->value("use_fontconfig", use_fontconfig).toBool();1201 1285 subcp = set->value("subcp", subcp).toString(); 1202 1286 use_enca = set->value("use_enca", use_enca).toBool(); 1203 1287 enca_lang = set->value("enca_lang", enca_lang).toString(); 1204 font_autoscale = set->value("font_autoscale", font_autoscale).toInt();1205 1288 subfuzziness = set->value("subfuzziness", subfuzziness).toInt(); 1206 1289 autoload_sub = set->value("autoload_sub", autoload_sub).toBool(); 1207 1290 1208 1291 use_ass_subtitles = set->value("use_ass_subtitles", use_ass_subtitles).toBool(); 1292 1209 1293 ass_line_spacing = set->value("ass_line_spacing", ass_line_spacing).toInt(); 1210 1294 … … 1215 1299 subtitles_on_screenshots = set->value("subtitles_on_screenshots", subtitles_on_screenshots).toBool(); 1216 1300 1217 use_new_sub_commands = (OptionState) set->value("use_new_sub_commands", use_new_sub_commands).toInt();1218 1301 change_sub_scale_should_restart = (OptionState) set->value("change_sub_scale_should_restart", change_sub_scale_should_restart).toInt(); 1219 1302 … … 1226 1309 1227 1310 freetype_support = set->value("freetype_support", freetype_support).toBool(); 1228 #ifdef Q_OS_WIN1311 #ifdef 1229 1312 use_windowsfontdir = set->value("use_windowsfontdir", use_windowsfontdir).toBool(); 1230 1313 #endif … … 1281 1364 use_edl_files = set->value("use_edl_files", use_edl_files).toBool(); 1282 1365 1366 1367 1368 1369 1283 1370 prefer_ipv4 = set->value("prefer_ipv4", prefer_ipv4).toBool(); 1284 1371 … … 1294 1381 1295 1382 time_to_kill_mplayer = set->value("time_to_kill_mplayer", time_to_kill_mplayer).toInt(); 1383 1384 1385 1386 1296 1387 1297 1388 set->endGroup(); // advanced … … 1316 1407 #endif 1317 1408 1318 move_when_dragging = set->value("move_when_dragging", move_when_dragging).toBool(); 1409 center_window = set->value("center_window", center_window).toBool(); 1410 center_window_if_outside = set->value("center_window_if_outside", center_window_if_outside).toBool(); 1319 1411 1320 1412 mouse_left_click_function = set->value("mouse_left_click_function", mouse_left_click_function).toString(); … … 1331 1423 wheel_function_seeking_reverse = set->value("wheel_function_seeking_reverse", wheel_function_seeking_reverse).toBool(); 1332 1424 1425 1426 1333 1427 seeking1 = set->value("seeking1", seeking1).toInt(); 1334 1428 seeking2 = set->value("seeking2", seeking2).toInt(); … … 1405 1499 last_tv_channel = set->value("last_tv_channel", last_tv_channel).toString(); 1406 1500 set->endGroup(); // tv 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1407 1528 1408 1529 … … 1461 1582 mplayer_detected_version = set->value("mplayer_detected_version", mplayer_detected_version).toInt(); 1462 1583 mplayer_user_supplied_version = set->value("mplayer_user_supplied_version", mplayer_user_supplied_version).toInt(); 1584 1463 1585 mplayer_is_mplayer2 = set->value("is_mplayer2", mplayer_is_mplayer2).toBool(); 1464 1586 mplayer2_detected_version = set->value("mplayer2_detected_version", mplayer2_detected_version).toString(); 1465 1587 #endif 1466 1588 set->endGroup(); // mplayer_info 1467 1589 … … 1517 1639 ********* */ 1518 1640 1641 1519 1642 #ifdef CHECK_UPGRADED 1520 set->beginGroup("smplayer");1521 1643 smplayer_stable_version = set->value("stable_version", smplayer_stable_version).toString(); 1522 1644 check_if_upgraded = set->value("check_if_upgraded", check_if_upgraded).toBool(); … … 1562 1684 1563 1685 resize_method = Never; 1564 move_when_dragging = false;1686 move_when_dragging = false; 1565 1687 } 1566 1688 config_version = CURRENT_CONFIG_VERSION; … … 1570 1692 // Check if the mplayer binary exists and try to fix it 1571 1693 if (!QFile::exists(mplayer_bin)) { 1572 qWarning("mplayer_bin '%s' doesn' exist", mplayer_bin.toLatin1().constData());1694 qWarning("mplayer_bin '%s' doesn' exist", mplayer_bin.toLatin1().constData()); 1573 1695 bool fixed = false; 1574 1696 if (QFile::exists("mplayer/mplayer.exe")) { 1575 1697 mplayer_bin = "mplayer/mplayer.exe"; 1576 1698 fixed = true; 1577 } else 1699 } 1700 else 1578 1701 if (QFile::exists("mplayer/mplayer2.exe")) { 1579 1702 mplayer_bin = "mplayer/mplayer2.exe"; 1580 1703 fixed = true; 1581 1704 } 1705 1706 1707 1708 1709 1582 1710 if (fixed) { 1583 1711 qWarning("mplayer_bin changed to '%s'", mplayer_bin.toLatin1().constData()); 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1584 1732 } 1585 1733 } … … 1629 1777 pdir = "/tmp"; 1630 1778 } 1631 QString default_screenshot_path = pdir + "/smplayer_screenshots";1779 QString default_screenshot_path = ; 1632 1780 if (!QFile::exists(default_screenshot_path)) { 1633 1781 qDebug("Preferences::setupScreenshotFolder: creating '%s'", default_screenshot_path.toUtf8().constData()); … … 1640 1788 } 1641 1789 } 1790 1791 1792 1642 1793 #endif 1643 1794 }
Note:
See TracChangeset
for help on using the changeset viewer.
