1
1
/* smplayer, GUI front-end for mplayer.
2
Copyright (C) 2007 Ricardo Villalba <rvm@escomposlinux.org>
2
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
4
4
This program is free software; you can redistribute it and/or modify
5
5
it under the terms of the GNU General Public License as published by
54
52
void PrefPerformance::retranslateStrings() {
55
53
int priority = priority_combo->currentIndex();
54
int loop_filter = loopfilter_combo->currentIndex();
57
56
retranslateUi(this);
58
loopfilter_combo->clear();
59
loopfilter_combo->addItem( tr("Enabled"), Preferences::LoopEnabled );
60
loopfilter_combo->addItem( tr("Skip (always)"), Preferences::LoopDisabled );
61
loopfilter_combo->addItem( tr("Skip only on HD videos"), Preferences::LoopDisabledOnHD );
59
63
priority_combo->setCurrentIndex(priority);
64
loopfilter_combo->setCurrentIndex(loop_filter);
64
69
void PrefPerformance::setData(Preferences * pref) {
65
setCacheEnabled( pref->use_cache );
66
setCache( pref->cache );
70
setCacheForFiles( pref->cache_for_files );
71
setCacheForStreams( pref->cache_for_streams );
72
setCacheForDVDs( pref->cache_for_dvds );
67
74
setPriority( pref->priority );
68
75
setFrameDrop( pref->frame_drop );
69
76
setHardFrameDrop( pref->hard_frame_drop );
70
setSkipLoop( pref->h264_skip_loop );
71
/* setSkipFrames( pref->h264_skip_frames ); */
77
setSkipLoop( pref->h264_skip_loop_filter );
72
78
setAutoSyncActivated( pref->autosync );
73
79
setAutoSyncFactor( pref->autosync_factor );
74
80
setFastChapterSeeking( pref->fast_chapter_change );
79
85
void PrefPerformance::getData(Preferences * pref) {
80
86
requires_restart = false;
82
TEST_AND_SET(pref->use_cache, cacheEnabled());
83
TEST_AND_SET(pref->cache, cache());
88
TEST_AND_SET(pref->cache_for_files, cacheForFiles());
89
TEST_AND_SET(pref->cache_for_streams, cacheForStreams());
90
TEST_AND_SET(pref->cache_for_dvds, cacheForDVDs());
84
92
TEST_AND_SET(pref->priority, priority());
85
93
TEST_AND_SET(pref->frame_drop, frameDrop());
86
94
TEST_AND_SET(pref->hard_frame_drop, hardFrameDrop());
87
TEST_AND_SET(pref->h264_skip_loop, skipLoop());
88
/* TEST_AND_SET(pref->h264_skip_frames, skipFrames()); */
95
TEST_AND_SET(pref->h264_skip_loop_filter, skipLoop());
89
96
TEST_AND_SET(pref->autosync, autoSyncActivated());
90
97
TEST_AND_SET(pref->autosync_factor, autoSyncFactor());
91
98
TEST_AND_SET(pref->fast_chapter_change, fastChapterSeeking());
93
100
TEST_AND_SET(pref->use_idx, useIdx());
96
void PrefPerformance::setCacheEnabled(bool b) {
97
use_cache_check->setChecked(b);
100
bool PrefPerformance::cacheEnabled() {
101
return use_cache_check->isChecked();
104
void PrefPerformance::setCache(int n) {
105
cache_spin->setValue(n);
108
int PrefPerformance::cache() {
109
return cache_spin->value();
103
void PrefPerformance::setCacheForFiles(int n) {
104
cache_files_spin->setValue(n);
107
int PrefPerformance::cacheForFiles() {
108
return cache_files_spin->value();
111
void PrefPerformance::setCacheForStreams(int n) {
112
cache_streams_spin->setValue(n);
115
int PrefPerformance::cacheForStreams() {
116
return cache_streams_spin->value();
119
void PrefPerformance::setCacheForDVDs(int n) {
120
cache_dvds_spin->setValue(n);
123
int PrefPerformance::cacheForDVDs() {
124
return cache_dvds_spin->value();
112
128
void PrefPerformance::setPriority(int n) {
113
129
priority_combo->setCurrentIndex(n);
133
149
return hardframedrop_check->isChecked();
136
void PrefPerformance::setSkipLoop(bool b) {
137
skip_loop_filter_check->setChecked(b);
140
bool PrefPerformance::skipLoop() {
141
return skip_loop_filter_check->isChecked();
144
void PrefPerformance::setSkipFrames(bool b) {
145
skip_frames_check->setChecked(b);
148
bool PrefPerformance::skipFrames() {
149
return skip_frames_check->isChecked();
152
void PrefPerformance::setSkipLoop(Preferences::H264LoopFilter value) {
153
loopfilter_combo->setCurrentIndex(loopfilter_combo->findData(value));
156
Preferences::H264LoopFilter PrefPerformance::skipLoop() {
157
return (Preferences::H264LoopFilter) loopfilter_combo->itemData(loopfilter_combo->currentIndex()).toInt();
152
160
void PrefPerformance::setAutoSyncFactor(int factor) {
195
203
// Performance tab
196
205
setWhatsThis(priority_combo, tr("Priority"),
197
206
tr("Set process priority for mplayer according to the predefined "
198
207
"priorities available under Windows.<br>"
199
"<b>WARNING:</b> Using realtime priority can cause system lockup.")
201
+ tr("<br><b>Note:</b> This option is for Windows only.")
208
"<b>WARNING:</b> Using realtime priority can cause system lockup."));
205
setWhatsThis(cache_spin, tr("Cache"),
206
tr("This option specifies how much memory (in kBytes) to use when "
207
"precaching a file or URL. Especially useful on slow media.") );
209
211
setWhatsThis(framedrop_check, tr("Allow frame drop"),
210
212
tr("Skip displaying some frames to maintain A/V sync on slow systems." ) );
213
215
tr("More intense frame dropping (breaks decoding). "
214
216
"Leads to image distortion!") );
216
setWhatsThis(skip_loop_filter_check, tr("Skip loop filter"),
217
tr("Skips the loop filter (AKA deblocking) during H.264 decoding. "
218
setWhatsThis(loopfilter_combo, tr("Skip loop filter"),
219
tr("This option allows to skips the loop filter (AKA deblocking) "
220
"during H.264 decoding. "
218
221
"Since the filtered frame is supposed to be used as reference "
219
222
"for decoding dependent frames this has a worse effect on quality "
220
223
"than not doing deblocking on e.g. MPEG-2 video. But at least for "
221
224
"high bitrate HDTV this provides a big speedup with no visible "
225
setWhatsThis(skip_frames_check, tr("Skip frames"),
226
tr("Skips decoding of frames completely. Big speedup, but jerky "
227
"motion and sometimes bad artifacts.") );
225
"quality loss.") +"<br>"+
226
tr("Possible values:") +"<ul><li>" +
227
tr("<b>Enabled</b>: the loop filter is not skipped")+"</li><li>"+
228
tr("<b>Skip (always)</b>: the loop filter is skipped no matter the "
229
"resolution of the video")+"</li><li>"+
230
tr("<b>Skip only on HD videos</b>: the loop filter will be "
231
"skipped only on videos which height is %1 or "
232
"greater.").arg(pref->HD_height) +"</li></ul>" );
230
234
setWhatsThis(autosync_check, tr("Audio/video auto synchronization"),
231
235
tr("Gradually adjusts the A/V sync based on audio delay "
251
255
"seeking (i.e. not with stdin, pipe, etc).<br> "
252
256
"Note: the creation of the index may take some time.") );
258
setWhatsThis(cache_files_spin, tr("Cache for files"),
259
tr("This option specifies how much memory (in kBytes) to use when "
260
"precaching a file.") );
262
setWhatsThis(cache_streams_spin, tr("Cache for streams"),
263
tr("This option specifies how much memory (in kBytes) to use when "
264
"precaching a URL.") );
266
setWhatsThis(cache_dvds_spin, tr("Cache for DVDs"),
267
tr("This option specifies how much memory (in kBytes) to use when "
268
"precaching a DVD.<br><b>Warning:</b> Seeking might not work "
269
"properly (including chapter switching) when using a cache for DVDs.") );
256
272
#include "moc_prefperformance.cpp"