Changeset 176 for smplayer/trunk/src/prefperformance.cpp
- Timestamp:
- May 3, 2016, 5:25:45 PM (9 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 175
- Property svn:mergeinfo changed
-
smplayer/trunk/src/prefperformance.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 22 22 #include "global.h" 23 23 #include "preferences.h" 24 25 #ifdef YOUTUBE_SUPPORT 26 #include "retrieveyoutubeurl.h" 27 #endif 24 #include "playerid.h" 28 25 29 26 using namespace Global; … … 34 31 setupUi(this); 35 32 33 hwdec_combo->addItem(tr("None"), "no"); 34 hwdec_combo->addItem(tr("Auto"), "auto"); 35 #ifdef Q_OS_LINUX 36 hwdec_combo->addItem("vdpau", "vdpau"); 37 hwdec_combo->addItem("vaapi", "vaapi"); 38 hwdec_combo->addItem("vaapi-copy", "vaapi-copy"); 39 #endif 40 #ifdef Q_OS_OSX 41 hwdec_combo->addItem("vda", "vda"); 42 #endif 43 #ifdef Q_OS_WIN 44 hwdec_combo->addItem("dxva2-copy", "dxva2-copy"); 45 #endif 46 36 47 // Priority is only for windows, so we disable for other systems 37 48 #ifndef Q_OS_WIN … … 43 54 #endif 44 55 45 #ifdef YOUTUBE_SUPPORT 46 yt_quality_combo->addItem( "240p (flv)", RetrieveYoutubeUrl::FLV_240p ); 47 48 yt_quality_combo->addItem( "360p (flv)", RetrieveYoutubeUrl::FLV_360p ); 49 yt_quality_combo->addItem( "360p (mp4)", RetrieveYoutubeUrl::MP4_360p ); 50 yt_quality_combo->addItem( "360p (webm)", RetrieveYoutubeUrl::WEBM_360p ); 51 52 yt_quality_combo->addItem( "480p (flv)", RetrieveYoutubeUrl::FLV_480p ); 53 yt_quality_combo->addItem( "480p (webm)", RetrieveYoutubeUrl::WEBM_480p ); 54 55 yt_quality_combo->addItem( "720p (mp4)", RetrieveYoutubeUrl::MP4_720p ); 56 yt_quality_combo->addItem( "720p (webm)", RetrieveYoutubeUrl::WEBM_720p ); 57 58 yt_quality_combo->addItem( "1080p (mp4)", RetrieveYoutubeUrl::MP4_1080p ); 59 yt_quality_combo->addItem( "1080p (webm)", RetrieveYoutubeUrl::WEBM_1080p ); 60 #else 61 yt_label->hide(); 62 yt_quality_combo->hide(); 63 yt_line->hide(); 56 #ifndef OBSOLETE_FAST_AUDIO_CHANGE 57 fast_audio_label->hide(); 58 fast_audio_combo->hide(); 64 59 #endif 65 60 … … 113 108 setFastChapterSeeking( pref->fast_chapter_change ); 114 109 #endif 110 #ifdef OBSOLETE_FAST_AUDIO_CHANGE 115 111 setFastAudioSwitching( pref->fast_audio_change ); 112 #endif 116 113 setThreads( pref->threads ); 117 118 #ifdef YOUTUBE_SUPPORT 119 setYTQuality( pref->yt_quality ); 120 #endif 114 setHwdec( pref->hwdec ); 121 115 } 122 116 … … 139 133 TEST_AND_SET(pref->fast_chapter_change, fastChapterSeeking()); 140 134 #endif 135 #ifdef OBSOLETE_FAST_AUDIO_CHANGE 141 136 pref->fast_audio_change = fastAudioSwitching(); 137 #endif 142 138 TEST_AND_SET(pref->threads, threads()); 143 144 #ifdef YOUTUBE_SUPPORT 145 pref->yt_quality = YTQuality(); 146 #endif 139 TEST_AND_SET(pref->hwdec, hwdec()); 147 140 } 148 141 … … 245 238 #endif 246 239 240 #ifdef OBSOLETE_FAST_AUDIO_CHANGE 247 241 void PrefPerformance::setFastAudioSwitching(Preferences::OptionState value) { 248 242 fast_audio_combo->setState(value); … … 252 246 return fast_audio_combo->state(); 253 247 } 248 #endif 254 249 255 250 void PrefPerformance::setThreads(int v) { … … 261 256 } 262 257 263 #ifdef YOUTUBE_SUPPORT 264 void PrefPerformance::setYTQuality(int q) { 265 yt_quality_combo->setCurrentIndex(yt_quality_combo->findData(q));266 } 267 268 int PrefPerformance::YTQuality() { 269 int index = yt_quality_combo->currentIndex(); 270 return yt_quality_combo->itemData(index).toInt();271 } 272 #endif 258 void PrefPerformance::setHwdec(const QString & v) { 259 int idx = hwdec_combo->findData(v); 260 if (idx < 0) idx = 0; 261 hwdec_combo->setCurrentIndex(idx); 262 } 263 264 QString PrefPerformance::hwdec() { 265 int idx = hwdec_combo->currentIndex(); 266 return hwdec_combo->itemData(idx).toString(); 267 } 273 268 274 269 void PrefPerformance::createHelp() { … … 280 275 #ifdef Q_OS_WIN 281 276 setWhatsThis(priority_combo, tr("Priority"), 282 tr("Set process priority for mplayeraccording to the predefined "277 tr("Set process priority for %1 according to the predefined " 283 278 "priorities available under Windows.<br>" 284 "<b>Warning:</b> Using realtime priority can cause system lockup.") );279 "<b>Warning:</b> Using realtime priority can cause system lockup.").arg(PLAYER_NAME)); 285 280 #endif 286 281 … … 296 291 "MPEG-1/2 and H.264") ); 297 292 298 setWhatsThis(coreavc_check, tr("Use CoreAVC if no other codec specified"), 299 tr("Try to use non-free CoreAVC codec when no other codec is specified " 300 "and non-VDPAU video output selected. Requires MPlayer build with CoreAVC support.")); 293 setWhatsThis(hwdec_combo, tr("Hardware decoding"), 294 tr("Sets the hardware video decoding API. " 295 "If hardware decoding is not possible, software decoding will be used instead.") + " " + 296 tr("Available options:") + 297 "<ul>" 298 "<li>" + tr("None: only software decoding will be used.") + "</li>" 299 "<li>" + tr("Auto: it tries to automatically enable hardware decoding using the first available method.") + "</li>" 300 #ifdef Q_OS_LINUX 301 "<li>" + tr("vdpau: for the vdpau and opengl video outputs.") + "</li>" 302 "<li>" + tr("vaapi: for the opengl and vaapi video outputs. For Intel GPUs only.") + "</li>" 303 "<li>" + tr("vaapi-copy: it copies video back into system RAM. For Intel GPUs only.") + "</li>" 304 #endif 305 #ifdef Q_OS_WIN 306 "<li>" + tr("dxva2-copy: it copies video back to system RAM. Experimental.") + "</li>" 307 #endif 308 "</ul>" 309 #ifdef MPLAYER_SUPPORT 310 + tr("This option only works with mpv.") 311 #endif 312 ); 301 313 302 314 setWhatsThis(loopfilter_combo, tr("Skip loop filter"), … … 316 328 "greater.").arg(pref->HD_height) +"<br>" ); 317 329 330 setWhatsThis(coreavc_check, tr("Use CoreAVC if no other codec specified"), 331 tr("Try to use the non-free CoreAVC codec when no other codec is specified " 332 "and a non-VDPAU video output is selected.") +" "+ 333 tr("Requires a %1 build with CoreAVC support.").arg(PLAYER_NAME)); 334 335 #ifdef OBSOLETE_FAST_AUDIO_CHANGE 318 336 setWhatsThis(fast_audio_combo, tr("Fast audio track switching"), 319 337 tr("Possible values:<br> " … … 324 342 "<b>Auto</b>: SMPlayer will decide what to do according to the " 325 343 "MPlayer version." ) ); 344 #endif 326 345 327 346 #if !SMART_DVD_CHAPTERS … … 331 350 #endif 332 351 333 #ifdef YOUTUBE_SUPPORT334 setWhatsThis(yt_quality_combo, tr("Youtube quality"),335 tr("Select the preferred quality for youtube videos.") );336 #endif337 338 352 addSectionTitle(tr("Cache")); 339 353
Note:
See TracChangeset
for help on using the changeset viewer.