34
39
// Read driver info from InfoReader:
35
40
InfoReader * i = InfoReader::obj();
36
setDrivers( i->voList(), i->aoList() );
41
vo_list = i->voList();
42
ao_list = i->aoList();
44
#if USE_DSOUND_DEVICES
45
dsound_devices = DeviceInfo::dsoundDevices();
49
alsa_devices = DeviceInfo::alsaDevices();
52
xv_adaptors = DeviceInfo::xvAdaptors();
39
56
channels_combo->addItem( "2", MediaSettings::ChStereo );
40
57
channels_combo->addItem( "4", MediaSettings::ChSurround );
41
58
channels_combo->addItem( "6", MediaSettings::ChFull51 );
60
connect(vo_combo, SIGNAL(currentIndexChanged(int)),
61
this, SLOT(vo_combo_changed(int)));
62
connect(ao_combo, SIGNAL(currentIndexChanged(int)),
63
this, SLOT(ao_combo_changed(int)));
43
65
retranslateStrings();
116
162
setPauseWhenHidden( pref->pause_when_hidden );
118
164
setEq2( pref->use_soft_video_eq );
165
setUseAudioEqualizer( pref->use_audio_equalizer );
119
166
setSoftVol( pref->use_soft_vol );
120
167
setAc3DTSPassthrough( pref->use_hwac3 );
121
168
setInitialVolNorm( pref->initial_volnorm );
122
169
setAmplification( pref->softvol_max );
123
170
setInitialPostprocessing( pref->initial_postprocessing );
124
171
setInitialDeinterlace( pref->initial_deinterlace );
172
setInitialZoom( pref->initial_panscan_factor );
125
173
setDirectRendering( pref->use_direct_rendering );
126
174
setDoubleBuffer( pref->use_double_buffer );
175
setUseSlices( pref->use_slices );
127
176
setStartInFullscreen( pref->start_in_fullscreen );
128
177
setDisableScreensaver( pref->disable_screensaver );
178
setBlackbordersOnFullscreen( pref->add_blackborders_on_fullscreen );
129
179
setAutoq( pref->autoq );
131
181
setInitialVolume( pref->initial_volume );
132
182
setDontChangeVolume( pref->dont_change_volume );
133
setUseVolume( pref->use_volume_option2 );
183
setUseVolume( pref->use_volume_option );
134
184
setAudioChannels( pref->initial_audio_channels );
135
185
setScaleTempoFilter( pref->use_scaletempo );
138
188
void PrefGeneral::getData(Preferences * pref) {
139
189
requires_restart = false;
190
filesettings_method_changed = false;
141
192
if (pref->mplayer_bin != mplayerPath()) {
142
193
requires_restart = true;
170
226
TEST_AND_SET(pref->use_soft_video_eq, eq2());
171
227
TEST_AND_SET(pref->use_soft_vol, softVol());
228
TEST_AND_SET(pref->use_audio_equalizer, useAudioEqualizer());
172
229
TEST_AND_SET(pref->use_hwac3, Ac3DTSPassthrough());
173
230
pref->initial_volnorm = initialVolNorm();
174
231
TEST_AND_SET(pref->softvol_max, amplification());
175
232
pref->initial_postprocessing = initialPostprocessing();
176
233
pref->initial_deinterlace = initialDeinterlace();
234
pref->initial_panscan_factor = initialZoom();
177
235
TEST_AND_SET(pref->use_direct_rendering, directRendering());
178
236
TEST_AND_SET(pref->use_double_buffer, doubleBuffer());
237
TEST_AND_SET(pref->use_slices, useSlices());
179
238
pref->start_in_fullscreen = startInFullscreen();
180
239
TEST_AND_SET(pref->disable_screensaver, disableScreensaver());
240
if (pref->add_blackborders_on_fullscreen != blackbordersOnFullscreen()) {
241
pref->add_blackborders_on_fullscreen = blackbordersOnFullscreen();
242
if (pref->fullscreen) requires_restart = true;
181
244
TEST_AND_SET(pref->autoq, autoq());
183
246
pref->initial_volume = initialVolume();
184
247
pref->dont_change_volume = dontChangeVolume();
185
pref->use_volume_option2 = useVolume();
248
pref->use_volume_option = useVolume();
186
249
pref->initial_audio_channels = audioChannels();
187
250
TEST_AND_SET(pref->use_scaletempo, scaleTempoFilter());
190
void PrefGeneral::setDrivers(InfoList vo_list, InfoList ao_list) {
253
void PrefGeneral::updateDriverCombos() {
254
int vo_current = vo_combo->currentIndex();
255
int ao_current = ao_combo->currentIndex();
191
261
for ( int n = 0; n < vo_list.count(); n++ ) {
192
vo_combo->addItem( vo_list[n].name() );
193
// Add directx:noaccel
194
if ( vo_list[n].name() == "directx" ) {
195
vo_combo->addItem( "directx:noaccel" );
198
if (vo_list[n].name() == "gl") {
199
vo_combo->addItem( "gl:yuv=3" );
200
vo_combo->addItem( "gl:yuv=2:force-pbo:ati-hack" );
201
//vo_combo->addItem( "gl:yuv=3:lscale=1" );
262
vo = vo_list[n].name();
264
if ( vo == "directx" ) {
265
vo_combo->addItem( "directx (" + tr("fast") + ")", "directx" );
266
vo_combo->addItem( "directx (" + tr("slow") + ")", "directx:noaccel" );
204
if (vo_list[n].name() == "gl2") {
205
vo_combo->addItem( "gl2:yuv=3" );
271
if (vo == "xv") vo_combo->addItem( "xv (" + tr("fastest") + ")", vo);
275
if ((vo == "xv") && (!xv_adaptors.isEmpty())) {
276
vo_combo->addItem(vo, vo);
277
for (int n=0; n < xv_adaptors.count(); n++) {
278
vo_combo->addItem( "xv (" + xv_adaptors[n].ID().toString() + " - " + xv_adaptors[n].desc() + ")",
279
"xv:adaptor=" + xv_adaptors[n].ID().toString() );
283
#endif // USE_XV_ADAPTORS
285
if (vo == "x11") vo_combo->addItem( "x11 (" + tr("slow") + ")", vo);
288
vo_combo->addItem( vo, vo);
289
vo_combo->addItem( "gl (" + tr("fast") + ")", "gl:yuv=2:force-pbo");
290
vo_combo->addItem( "gl (" + tr("fast - ATI cards") + ")", "gl:yuv=2:force-pbo:ati-hack");
291
vo_combo->addItem( "gl (yuv)", "gl:yuv=3");
295
vo_combo->addItem( vo, vo);
296
vo_combo->addItem( "gl2 (yuv)", "gl2:yuv=3");
299
if (vo == "null" || vo == "png" || vo == "jpeg" || vo == "gif89a" ||
300
vo == "tga" || vo == "pnm" || vo == "md5sum" )
305
vo_combo->addItem( vo, vo );
307
vo_combo->addItem( tr("User defined..."), "user_defined" );
210
310
for ( int n = 0; n < ao_list.count(); n++) {
211
ao_combo->addItem( ao_list[n].name() );
311
ao = ao_list[n].name();
312
ao_combo->addItem( ao, ao );
314
if ((ao == "alsa") && (!alsa_devices.isEmpty())) {
315
for (int n=0; n < alsa_devices.count(); n++) {
316
ao_combo->addItem( "alsa (" + alsa_devices[n].ID().toString() + " - " + alsa_devices[n].desc() + ")",
317
"alsa:device=hw=" + alsa_devices[n].ID().toString() );
321
#if USE_DSOUND_DEVICES
322
if ((ao == "dsound") && (!dsound_devices.isEmpty())) {
323
for (int n=0; n < dsound_devices.count(); n++) {
324
ao_combo->addItem( "dsound (" + dsound_devices[n].ID().toString() + " - " + dsound_devices[n].desc() + ")",
325
"dsound:device=" + dsound_devices[n].ID().toString() );
330
ao_combo->addItem( tr("User defined..."), "user_defined" );
332
vo_combo->setCurrentIndex( vo_current );
333
ao_combo->setCurrentIndex( ao_current );
215
336
void PrefGeneral::setMplayerPath( QString path ) {
231
352
void PrefGeneral::setVO( QString vo_driver ) {
232
vo_combo->setCurrentText( vo_driver );
353
int idx = vo_combo->findData( vo_driver );
355
vo_combo->setCurrentIndex(idx);
357
vo_combo->setCurrentIndex(vo_combo->findData("user_defined"));
358
vo_user_defined_edit->setText(vo_driver);
360
vo_combo_changed(vo_combo->currentIndex());
235
363
void PrefGeneral::setAO( QString ao_driver ) {
236
ao_combo->setCurrentText( ao_driver );
364
int idx = ao_combo->findData( ao_driver );
366
ao_combo->setCurrentIndex(idx);
368
ao_combo->setCurrentIndex(ao_combo->findData("user_defined"));
369
ao_user_defined_edit->setText(ao_driver);
371
ao_combo_changed(ao_combo->currentIndex());
239
374
QString PrefGeneral::VO() {
240
return vo_combo->currentText();
375
QString vo = vo_combo->itemData(vo_combo->currentIndex()).toString();
376
if (vo == "user_defined") {
377
vo = vo_user_defined_edit->text();
379
vo = vo_combo->itemData(0).toString();
380
qDebug("PrefGeneral::VO: user defined vo is empty, using %s", vo.toUtf8().constData());
243
386
QString PrefGeneral::AO() {
244
return ao_combo->currentText();
387
QString ao = ao_combo->itemData(ao_combo->currentIndex()).toString();
388
if (ao == "user_defined") {
389
ao = ao_user_defined_edit->text();
391
ao = ao_combo->itemData(0).toString();
392
qDebug("PrefGeneral::AO: user defined ao is empty, using %s", ao.toUtf8().constData());
247
398
void PrefGeneral::setRememberSettings(bool b) {
253
404
return remember_all_check->isChecked();
256
void PrefGeneral::setDontRememberTimePos(bool b) {
257
dont_remember_time_check->setChecked(b);
260
bool PrefGeneral::dontRememberTimePos() {
261
return dont_remember_time_check->isChecked();
407
void PrefGeneral::setRememberTimePos(bool b) {
408
remember_time_check->setChecked(b);
411
bool PrefGeneral::rememberTimePos() {
412
return remember_time_check->isChecked();
415
void PrefGeneral::setFileSettingsMethod(QString method) {
416
int index = filesettings_method_combo->findData(method);
417
if (index < 0) index = 0;
418
filesettings_method_combo->setCurrentIndex(index);
421
QString PrefGeneral::fileSettingsMethod() {
422
return filesettings_method_combo->itemData(filesettings_method_combo->currentIndex()).toString();
264
425
void PrefGeneral::setAudioLang(QString lang) {
474
681
setWhatsThis(mplayerbin_edit, tr("MPlayer executable"),
475
682
tr("Here you must specify the mplayer "
476
"executable that smplayer will use.<br>"
477
"smplayer requires at least mplayer 1.0rc1 (svn recommended).<br>"
478
"<b>If this setting is wrong, smplayer won't "
479
"be able to play anything!</b>") );
683
"executable that SMPlayer will use.<br>"
684
"SMPlayer requires at least MPlayer 1.0rc1 (although a recent "
685
"revision from SVN is highly recommended).") + "<br><b>" +
686
tr("If this setting is wrong, SMPlayer won't be able to play "
687
"anything!") + "</b>");
481
689
setWhatsThis(screenshot_edit, tr("Screenshots folder"),
482
690
tr("Here you can specify a folder where the screenshots taken by "
483
"smplayer will be stored. If this field is empty the "
691
"SMPlayer will be stored. If this field is empty the "
484
692
"screenshot feature will be disabled.") );
486
setWhatsThis(vo_combo, tr("Video output driver"),
487
tr("Select the video output driver. Usually xv (linux) "
488
"and directx (windows) provide the best performance.") );
490
setWhatsThis(ao_combo, tr("Audio output driver"),
491
tr("Select the audio output driver.") );
493
695
setWhatsThis(remember_all_check, tr("Remember settings"),
494
tr("Usually smplayer will remember the settings for each file you "
495
"play (audio track selected, volume, filters...). Uncheck this "
696
tr("Usually SMPlayer will remember the settings for each file you "
697
"play (audio track selected, volume, filters...). Disable this "
496
698
"option if you don't like this feature.") );
498
setWhatsThis(dont_remember_time_check, tr("Don't remember time position"),
499
tr("If you check this option, smplayer will play all files from "
700
setWhatsThis(remember_time_check, tr("Remember time position"),
701
tr("If you check this option, SMPlayer will remember the last position "
702
"of the file when you open it again. This option works only with "
703
"regular files (not with DVDs, CDs, URLs...).") );
705
setWhatsThis(filesettings_method_combo, tr("Method to store the file settings"),
706
tr("This option allows to change the way the file settings would be "
707
"stored. The following options are available:") +"<ul><li>" +
708
tr("<b>one ini file</b>: the settings for all played files will be "
709
"saved in a single ini file (%1)").arg(QString("<i>"+Paths::iniPath()+"/smplayer.ini</i>")) + "</li><li>" +
710
tr("<b>multiple ini files</b>: one ini file will be used for each played file. "
711
"Those ini files will be saved in the folder %1").arg(QString("<i>"+Paths::iniPath()+"/file_settings</i>")) + "</li></ul>" +
712
tr("The latter method could be faster if there is info for a lot of files.") );
502
714
setWhatsThis(close_on_finish_check, tr("Close when finished"),
503
715
tr("If this option is checked, the main window will be automatically "
506
718
setWhatsThis(pause_if_hidden_check, tr("Pause when minimized"),
507
719
tr("If this option is enabled, the file will be paused when the "
508
"main window is hidden. When the window is restored, play will be "
720
"main window is hidden. When the window is restored, playback "
721
"will be resumed.") );
511
724
addSectionTitle(tr("Video"));
514
setWhatsThis(eq2_check, tr("Software video equalizer"),
515
tr("You can check this option if video equalizer is not supported by "
516
"your graphic card or the selected video output driver.<br>"
517
"<b>Note:</b> this option can be incompatible "
518
"with some video output drivers.") );
726
setWhatsThis(vo_combo, tr("Video output driver"),
727
tr("Select the video output driver. %1 provides the best performance.")
729
.arg("<b><i>directx</i></b>")
731
.arg("<b><i>xv</i></b>")
520
735
setWhatsThis(postprocessing_check, tr("Enable postprocessing by default"),
521
736
tr("Postprocessing will be used by default on new opened files.") );
529
744
tr("Select the deinterlace filter that you want to be used for new "
530
745
"videos opened.") );
747
setWhatsThis(zoom_spin, tr("Default zoom"),
748
tr("This option sets the default zoom which will be used for "
751
setWhatsThis(eq2_check, tr("Software video equalizer"),
752
tr("You can check this option if video equalizer is not supported by "
753
"your graphic card or the selected video output driver.<br>"
754
"<b>Note:</b> this option can be incompatible with some video "
755
"output drivers.") );
532
757
setWhatsThis(direct_rendering_check, tr("Direct rendering"),
533
758
tr("If checked, turns on direct rendering (not supported by all "
534
759
"codecs and video outputs)<br>"
535
"<b>WARNING:</b> May cause OSD/SUB corruption!") );
760
"<b>Warning:</b> May cause OSD/SUB corruption!") );
537
762
setWhatsThis(double_buffer_check, tr("Double buffering"),
538
763
tr("Double buffering fixes flicker by storing two frames in memory, "
539
764
"and displaying one while decoding another. If disabled it can "
540
765
"affect OSD negatively, but often removes OSD flickering.") );
767
setWhatsThis(use_slices_check, tr("Draw video using slices"),
768
tr("Enable/disable drawing video by 16-pixel height slices/bands. "
769
"If disabled, the whole frame is drawn in a single run. "
770
"May be faster or slower, depending on video card and available "
771
"cache. It has effect only with libmpeg2 and libavcodec codecs.") );
542
773
setWhatsThis(start_fullscreen_check, tr("Start videos in fullscreen"),
543
774
tr("If this option is checked, all videos will start to play in "
544
775
"fullscreen mode.") );
777
setWhatsThis(blackborders_on_fs_check, tr("Add black borders on fullscreen"),
778
tr("If this option is enabled, black borders will be added to the "
779
"image in fullscreen mode. This allows subtitles to be displayed "
780
"on the black borders.") /* + "<br>" +
781
tr("This option will be ignored if MPlayer uses its own window, as "
782
"some video drivers (like gl) are already able to display the "
783
"subtitles automatically in the black borders.") */ );
546
785
setWhatsThis(screensaver_check, tr("Disable screensaver"),
547
786
tr("Check this option to disable the screensaver while playing.<br>"
548
"The screensaver will enabled again when play finishes.<br>"
549
"<b>Note:</b> This option works only in X11 and Windows.") );
787
"The screensaver will enabled again when play finishes.")
788
//+ tr("<br><b>Note:</b> This option works only in X11 and Windows.")
551
792
addSectionTitle(tr("Audio"));
794
setWhatsThis(ao_combo, tr("Audio output driver"),
795
tr("Select the audio output driver.")
798
tr("%1 is the recommended one. Try to avoid %2 and %3, they are slow "
799
"and can have an impact on performance.")
800
.arg("<b><i>alsa</i></b>")
801
.arg("<b><i>esd</i></b>")
802
.arg("<b><i>arts</i></b>")
806
setWhatsThis(audio_equalizer_check, tr("Enable the audio equalizer"),
807
tr("Check this option if you want to use the audio equalizer.") );
809
setWhatsThis(hwac3_check, tr("AC3/DTS pass-through S/PDIF"),
810
tr("Uses hardware AC3 passthrough") );
812
setWhatsThis(channels_combo, tr("Channels by default"),
813
tr("Requests the number of playback channels. MPlayer "
814
"asks the decoder to decode the audio into as many channels as "
815
"specified. Then it is up to the decoder to fulfill the "
816
"requirement. This is usually only important when playing "
817
"videos with AC3 audio (like DVDs). In that case liba52 does "
818
"the decoding by default and correctly downmixes the audio "
819
"into the requested number of channels. "
820
"<b>Note</b>: This option is honored by codecs (AC3 only), "
821
"filters (surround) and audio output drivers (OSS at least).") );
823
setWhatsThis(scaletempo_combo, tr("High speed playback without altering pitch"),
824
tr("Allows to change the playback speed without altering pitch. "
825
"Requires at least MPlayer dev-SVN-r24924.") );
553
827
setWhatsThis(softvol_check, tr("Software volume control"),
554
828
tr("Check this option to use the software mixer, instead of "
555
829
"using the sound card mixer.") );
572
843
"and will restore it when played again. For new files the default "
573
844
"volume will be used.") );
846
setWhatsThis(use_volume_combo, tr("Change volume just before playing"),
847
tr("If this option is checked the initial volume will be set just "
848
"before playback starts. This avoids a loud volume on startup. "
849
"Requires at least MPlayer SVN r27872."));
575
851
setWhatsThis(initial_volume_slider, tr("Default volume"),
576
852
tr("Sets the initial volume that new files will use.") );
578
setWhatsThis(use_volume_combo, tr("Change volume just before playing"),
579
tr("If this option is checked the initial volume will be set by "
580
"using the <i>-volume</i> option in MPlayer.<br> "
581
"<b>WARNING: THE OFFICIAL MPLAYER DOESN'T HAVE THAT "
582
"<i>-volume</i> OPTION, "
583
"YOU NEED A PATCHED ONE, OTHERWISE MPLAYER WILL FAIL AND WON'T PLAY "
586
setWhatsThis(channels_combo, tr("Channels by default"),
587
tr("Requests the number of playback channels. MPlayer "
588
"asks the decoder to decode the audio into as many channels as "
589
"specified. Then it is up to the decoder to fulfill the "
590
"requirement. This is usually only important when playing "
591
"videos with AC3 audio (like DVDs). In that case liba52 does "
592
"the decoding by default and correctly downmixes the audio "
593
"into the requested number of channels. "
594
"NOTE: This option is honored by codecs (AC3 only), "
595
"filters (surround) and audio output drivers (OSS at least).") );
597
setWhatsThis(scaletempo_combo, tr("High speed playback without altering pitch"),
598
tr("Allows to change the playback speed without altering pitch. "
599
"Requires at least MPlayer dev-SVN-r24924.") );
601
855
addSectionTitle(tr("Preferred audio and subtitles"));
603
857
setWhatsThis(audio_lang_edit, tr("Preferred audio language"),
604
858
tr("Here you can type your preferred language for the audio streams. "
605
"When a media with multiple audio streams is found, smplayer will "
859
"When a media with multiple audio streams is found, SMPlayer will "
606
860
"try to use your preferred language.<br>"
607
861
"This only will work with media that offer info about the language "
608
862
"of the audio streams, like DVDs or mkv files.<br>"