~ubuntu-branches/debian/sid/smplayer/sid

« back to all changes in this revision

Viewing changes to src/prefperformance.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2008-01-31 13:44:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080131134453-nc4dwsn5pkiw5s9h
Tags: 0.6.0~rc1-1
* New upstream release.
* debian/control:
  - Build-depend on CDBS.
  - Updated upstream homepage.
* debian/copyright:
  - Updated download address.
* debian/rules:
  - Migrated to CDBS.
  - Tweaked get-orig-source to work with release candidates.
* debian/docs:
  - Removed Translations.txt, upstream removed it from the tarball.
  - Added Release_notes.txt.
* debian/manpages, debian/smplayer.1:
  - Deleted, manpage merged upstream.
* debian/smplayer.install:
  - Install usr/share/man.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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>
3
3
 
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
19
19
 
20
20
#include "prefperformance.h"
21
21
#include "images.h"
 
22
#include "global.h"
22
23
#include "preferences.h"
23
24
 
24
25
 
32
33
        priority_group->hide();
33
34
#endif
34
35
 
35
 
        // This option is not good. Playing is awful, even with no H.264 videos.
36
 
        skip_frames_check->hide();
37
 
 
38
 
        createHelp();
 
36
        retranslateStrings();
39
37
}
40
38
 
41
39
PrefPerformance::~PrefPerformance()
53
51
 
54
52
void PrefPerformance::retranslateStrings() {
55
53
        int priority = priority_combo->currentIndex();
 
54
        int loop_filter = loopfilter_combo->currentIndex();
56
55
 
57
56
        retranslateUi(this);
58
57
 
 
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 );
 
62
 
59
63
        priority_combo->setCurrentIndex(priority);
 
64
        loopfilter_combo->setCurrentIndex(loop_filter);
60
65
 
61
66
        createHelp();
62
67
}
63
68
 
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 );
 
73
 
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;
81
87
 
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());
 
91
 
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());
94
101
}
95
102
 
96
 
void PrefPerformance::setCacheEnabled(bool b) {
97
 
        use_cache_check->setChecked(b);
98
 
}
99
 
 
100
 
bool PrefPerformance::cacheEnabled() {
101
 
        return use_cache_check->isChecked();
102
 
}
103
 
 
104
 
void PrefPerformance::setCache(int n) {
105
 
        cache_spin->setValue(n);
106
 
}
107
 
 
108
 
int PrefPerformance::cache() {
109
 
        return cache_spin->value();
110
 
}
 
103
void PrefPerformance::setCacheForFiles(int n) {
 
104
        cache_files_spin->setValue(n);
 
105
}
 
106
 
 
107
int PrefPerformance::cacheForFiles() {
 
108
        return cache_files_spin->value();
 
109
}
 
110
 
 
111
void PrefPerformance::setCacheForStreams(int n) {
 
112
        cache_streams_spin->setValue(n);
 
113
}
 
114
 
 
115
int PrefPerformance::cacheForStreams() {
 
116
        return cache_streams_spin->value();
 
117
}
 
118
 
 
119
void PrefPerformance::setCacheForDVDs(int n) {
 
120
        cache_dvds_spin->setValue(n);
 
121
}
 
122
 
 
123
int PrefPerformance::cacheForDVDs() {
 
124
        return cache_dvds_spin->value();
 
125
}
 
126
 
111
127
 
112
128
void PrefPerformance::setPriority(int n) {
113
129
        priority_combo->setCurrentIndex(n);
133
149
        return hardframedrop_check->isChecked();
134
150
}
135
151
 
136
 
void PrefPerformance::setSkipLoop(bool b) {
137
 
        skip_loop_filter_check->setChecked(b);
138
 
}
139
 
 
140
 
bool PrefPerformance::skipLoop() {
141
 
        return skip_loop_filter_check->isChecked();
142
 
}
143
 
 
144
 
void PrefPerformance::setSkipFrames(bool b) {
145
 
        skip_frames_check->setChecked(b);
146
 
}
147
 
 
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));
 
154
}
 
155
 
 
156
Preferences::H264LoopFilter PrefPerformance::skipLoop() {
 
157
        return (Preferences::H264LoopFilter) loopfilter_combo->itemData(loopfilter_combo->currentIndex()).toInt();
150
158
}
151
159
 
152
160
void PrefPerformance::setAutoSyncFactor(int factor) {
193
201
        clearHelp();
194
202
 
195
203
        // Performance tab
 
204
#ifdef Q_OS_WIN
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.")
200
 
#ifndef Q_OS_WIN
201
 
        + tr("<br><b>Note:</b> This option is for Windows only.") 
 
208
           "<b>WARNING:</b> Using realtime priority can cause system lockup."));
202
209
#endif
203
 
                );
204
 
 
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.") );
208
210
 
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!") );
215
217
 
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 "
222
 
           "quality loss.") );
223
 
 
224
 
        /*
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.") );
228
 
        */
 
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>" );
229
233
 
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.") );
253
257
 
 
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.") );
 
261
 
 
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.") );
 
265
 
 
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.") );
254
270
}
255
271
 
256
272
#include "moc_prefperformance.cpp"