1 /*****************************************************************************
2 * extended_panels.cpp : Extended controls panels
3 ****************************************************************************
4 * Copyright (C) 2006-2008 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Antoine Cellerier <dionoea .t videolan d@t org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * ( at your option ) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #define __STDC_FORMAT_MACROS 1
35 #include <QGridLayout>
36 #include <QSignalMapper>
39 #include "components/extended_panels.hpp"
40 #include "dialogs/preferences.hpp"
42 #include "input_manager.hpp"
44 #include "../../audio_filter/equalizer_presets.h"
46 #include <vlc_intf_strings.h>
49 #include <vlc_modules.h>
51 #include <vlc_charset.h> /* us_strtod */
54 class ConfClickHandler : public QObject
57 ConfClickHandler( intf_thread_t *_p_intf, ExtVideo *_e ) : QObject ( _e ) {
58 e = _e; p_intf = _p_intf;
60 virtual ~ConfClickHandler() {}
61 bool eventFilter( QObject *obj, QEvent *evt )
63 if( evt->type() == QEvent::MouseButtonPress )
72 intf_thread_t *p_intf;
76 QString ModuleFromWidgetName( QObject *obj )
78 return obj->objectName().replace( "Enable","" );
81 QString OptionFromWidgetName( QObject *obj )
84 QString option = obj->objectName().replace( "Slider", "" )
85 .replace( "Combo" , "" )
86 .replace( "Dial" , "" )
87 .replace( "Check" , "" )
88 .replace( "Spin" , "" )
89 .replace( "Text" , "" );
90 for( char a = 'A'; a <= 'Z'; a++ )
92 option = option.replace( QString( a ),
93 QString( '-' ) + QString( a + 'a' - 'A' ) );
98 ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) :
99 QObject( _parent ), p_intf( _p_intf )
101 ui.setupUi( _parent );
104 #define SETUP_VFILTER( widget ) \
106 vlc_object_t *p_obj = ( vlc_object_t * ) \
107 vlc_object_find_name( p_intf->p_libvlc, \
110 QCheckBox *checkbox = qobject_cast<QCheckBox*>( ui.widget##Enable ); \
111 QGroupBox *groupbox = qobject_cast<QGroupBox*>( ui.widget##Enable ); \
114 vlc_object_release( p_obj ); \
115 if( checkbox ) checkbox->setChecked( true ); \
116 else groupbox->setChecked( true ); \
120 if( checkbox ) checkbox->setChecked( false ); \
121 else groupbox->setChecked( false ); \
124 CONNECT( ui.widget##Enable, clicked(), this, updateFilters() );
125 #define SETUP_VFILTER_OPTION( widget, signal ) \
126 initComboBoxItems( ui.widget ); \
127 setWidgetValue( ui.widget ); \
128 CONNECT( ui.widget, signal, this, updateFilterOptions() );
130 SETUP_VFILTER( adjust )
131 SETUP_VFILTER_OPTION( hueSlider, valueChanged( int ) )
132 SETUP_VFILTER_OPTION( contrastSlider, valueChanged( int ) )
133 SETUP_VFILTER_OPTION( brightnessSlider, valueChanged( int ) )
134 SETUP_VFILTER_OPTION( saturationSlider, valueChanged( int ) )
135 SETUP_VFILTER_OPTION( gammaSlider, valueChanged( int ) )
136 SETUP_VFILTER_OPTION( brightnessThresholdCheck, stateChanged( int ) )
138 SETUP_VFILTER( extract )
139 SETUP_VFILTER_OPTION( extractComponentText, textChanged( const QString& ) )
141 SETUP_VFILTER( colorthres )
142 SETUP_VFILTER_OPTION( colorthresColorText, textChanged( const QString& ) )
143 SETUP_VFILTER_OPTION( colorthresSaturationthresSlider, valueChanged( int ) )
144 SETUP_VFILTER_OPTION( colorthresSimilaritythresSlider, valueChanged( int ) )
146 SETUP_VFILTER( invert )
148 SETUP_VFILTER( gradient )
149 SETUP_VFILTER_OPTION( gradientModeCombo, currentIndexChanged( QString ) )
150 SETUP_VFILTER_OPTION( gradientTypeCheck, stateChanged( int ) )
151 SETUP_VFILTER_OPTION( gradientCartoonCheck, stateChanged( int ) )
153 SETUP_VFILTER( motionblur )
154 SETUP_VFILTER_OPTION( blurFactorSlider, valueChanged( int ) )
156 SETUP_VFILTER( motiondetect )
158 SETUP_VFILTER( noise )
160 SETUP_VFILTER( psychedelic )
162 SETUP_VFILTER( sharpen )
163 SETUP_VFILTER_OPTION( sharpenSigmaSlider, valueChanged( int ) )
165 SETUP_VFILTER( ripple )
167 SETUP_VFILTER( wave )
169 SETUP_VFILTER( transform )
170 SETUP_VFILTER_OPTION( transformTypeCombo, currentIndexChanged( QString ) )
172 SETUP_VFILTER( rotate )
173 SETUP_VFILTER_OPTION( rotateAngleDial, valueChanged( int ) )
174 ui.rotateAngleDial->setWrapping( true );
175 ui.rotateAngleDial->setNotchesVisible( true );
177 SETUP_VFILTER( puzzle )
178 SETUP_VFILTER_OPTION( puzzleRowsSpin, valueChanged( int ) )
179 SETUP_VFILTER_OPTION( puzzleColsSpin, valueChanged( int ) )
180 SETUP_VFILTER_OPTION( puzzleBlackSlotCheck, stateChanged( int ) )
182 SETUP_VFILTER( magnify )
184 SETUP_VFILTER( clone )
185 SETUP_VFILTER_OPTION( cloneCountSpin, valueChanged( int ) )
187 SETUP_VFILTER( wall )
188 SETUP_VFILTER_OPTION( wallRowsSpin, valueChanged( int ) )
189 SETUP_VFILTER_OPTION( wallColsSpin, valueChanged( int ) )
191 SETUP_VFILTER( panoramix )
192 SETUP_VFILTER_OPTION( panoramixRowsSpin, valueChanged( int ) )
193 SETUP_VFILTER_OPTION( panoramixColsSpin, valueChanged( int ) )
196 SETUP_VFILTER( erase )
197 SETUP_VFILTER_OPTION( eraseMaskText, editingFinished() )
198 SETUP_VFILTER_OPTION( eraseYSpin, valueChanged( int ) )
199 SETUP_VFILTER_OPTION( eraseXSpin, valueChanged( int ) )
201 SETUP_VFILTER( marq )
202 SETUP_VFILTER_OPTION( marqMarqueeText, textChanged( const QString& ) )
203 SETUP_VFILTER_OPTION( marqPositionCombo, currentIndexChanged( QString ) )
205 SETUP_VFILTER( logo )
206 SETUP_VFILTER_OPTION( logoFileText, editingFinished() )
207 SETUP_VFILTER_OPTION( logoYSpin, valueChanged( int ) )
208 SETUP_VFILTER_OPTION( logoXSpin, valueChanged( int ) )
209 SETUP_VFILTER_OPTION( logoOpacitySlider, valueChanged( int ) )
211 if( module_exists( "atmo" ) )
213 SETUP_VFILTER( atmo )
214 SETUP_VFILTER_OPTION( atmoEdgeweightningSlider, valueChanged( int ) )
215 SETUP_VFILTER_OPTION( atmoBrightnessSlider, valueChanged( int ) )
216 SETUP_VFILTER_OPTION( atmoDarknesslimitSlider, valueChanged( int ) )
217 SETUP_VFILTER_OPTION( atmoMeanlengthSlider, valueChanged( int ) )
218 SETUP_VFILTER_OPTION( atmoMeanthresholdSlider, valueChanged( int ) )
219 SETUP_VFILTER_OPTION( atmoPercentnewSlider, valueChanged( int ) )
220 SETUP_VFILTER_OPTION( atmoFiltermodeCombo, currentIndexChanged( int ) )
221 SETUP_VFILTER_OPTION( atmoShowdotsCheck, stateChanged( int ) )
225 _parent->removeTab( _parent->indexOf( ui.tab_atmo ) );
229 #undef SETUP_VFILTER_OPTION
231 CONNECT( ui.cropTopPx, valueChanged( int ), this, cropChange() );
232 CONNECT( ui.cropBotPx, valueChanged( int ), this, cropChange() );
233 CONNECT( ui.cropLeftPx, valueChanged( int ), this, cropChange() );
234 CONNECT( ui.cropRightPx, valueChanged( int ), this, cropChange() );
235 CONNECT( ui.leftRightCropSync, toggled ( bool ), this, cropChange() );
236 CONNECT( ui.topBotCropSync, toggled ( bool ), this, cropChange() );
237 CONNECT( ui.topBotCropSync, toggled( bool ),
238 ui.cropBotPx, setDisabled( bool ) );
239 CONNECT( ui.leftRightCropSync, toggled( bool ),
240 ui.cropRightPx, setDisabled( bool ) );
243 ExtVideo::~ExtVideo()
247 void ExtVideo::cropChange()
249 if( ui.topBotCropSync->isChecked() )
250 ui.cropBotPx->setValue( ui.cropTopPx->value() );
251 if( ui.leftRightCropSync->isChecked() )
252 ui.cropRightPx->setValue( ui.cropLeftPx->value() );
254 p_vout = THEMIM->getVout();
257 var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
258 var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
259 var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
260 var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
261 vlc_object_release( p_vout );
265 void ExtVideo::clean()
267 ui.cropTopPx->setValue( 0 );
268 ui.cropBotPx->setValue( 0 );
269 ui.cropLeftPx->setValue( 0 );
270 ui.cropRightPx->setValue( 0 );
273 void ExtVideo::ChangeVFiltersString( const char *psz_name, bool b_add )
275 char *psz_parser, *psz_string;
276 const char *psz_filter_type;
278 /* FIXME temporary hack */
279 const char *psz_module_name = psz_name;
280 if( !strcmp( psz_name, "wall" ) ||
281 !strcmp( psz_name, "panoramix" ) ||
282 !strcmp( psz_name, "clone" ) )
283 psz_module_name = "video_filter_wrapper";
285 module_t *p_obj = module_find( psz_module_name );
288 msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name );
292 if( module_provides( p_obj, "video filter" ) )
294 psz_filter_type = "vout-filter";
296 else if( module_provides( p_obj, "video filter2" ) )
298 psz_filter_type = "video-filter";
300 else if( module_provides( p_obj, "sub filter" ) )
302 psz_filter_type = "sub-filter";
306 module_release (p_obj);
307 msg_Err( p_intf, "Unknown video filter type." );
310 module_release (p_obj);
312 psz_string = config_GetPsz( p_intf, psz_filter_type );
314 if( !psz_string ) psz_string = strdup( "" );
316 psz_parser = strstr( psz_string, psz_name );
322 psz_parser = psz_string;
323 if( asprintf( &psz_string, ( *psz_string ) ? "%s:%s" : "%s%s",
324 psz_string, psz_name ) == -1 )
340 if( *( psz_parser + strlen( psz_name ) ) == ':' )
342 memmove( psz_parser, psz_parser + strlen( psz_name ) + 1,
343 strlen( psz_parser + strlen( psz_name ) + 1 ) + 1 );
350 /* Remove trailing : : */
351 if( strlen( psz_string ) > 0 &&
352 *( psz_string + strlen( psz_string ) -1 ) == ':' )
354 *( psz_string + strlen( psz_string ) -1 ) = '\0';
363 /* Vout is not kept, so put that in the config */
364 config_PutPsz( p_intf, psz_filter_type, psz_string );
365 if( !strcmp( psz_filter_type, "video-filter" ) )
366 ui.videoFilterText->setText( psz_string );
367 else if( !strcmp( psz_filter_type, "vout-filter" ) )
368 ui.voutFilterText->setText( psz_string );
369 else if( !strcmp( psz_filter_type, "sub-filter" ) )
370 ui.subpictureFilterText->setText( psz_string );
372 /* Try to set on the fly */
373 p_vout = THEMIM->getVout();
376 var_SetString( p_vout, psz_filter_type, psz_string );
377 vlc_object_release( p_vout );
383 void ExtVideo::updateFilters()
385 QString module = ModuleFromWidgetName( sender() );
387 QCheckBox *checkbox = qobject_cast<QCheckBox*>( sender() );
388 QGroupBox *groupbox = qobject_cast<QGroupBox*>( sender() );
390 ChangeVFiltersString( qtu( module ),
391 checkbox ? checkbox->isChecked()
392 : groupbox->isChecked() );
395 void ExtVideo::initComboBoxItems( QObject *widget )
397 QComboBox *combobox = qobject_cast<QComboBox*>( widget );
398 if( !combobox ) return;
399 QString option = OptionFromWidgetName( widget );
400 module_config_t *p_item = config_FindConfig( VLC_OBJECT( p_intf ),
404 int i_type = p_item->i_type & CONFIG_ITEM;
405 for( int i_index = 0; i_index < p_item->i_list; i_index++ )
407 if( i_type == CONFIG_ITEM_INTEGER
408 || i_type == CONFIG_ITEM_BOOL )
409 combobox->addItem( qtr( p_item->ppsz_list_text[i_index] ),
410 p_item->pi_list[i_index] );
411 else if( i_type == CONFIG_ITEM_STRING )
412 combobox->addItem( qtr( p_item->ppsz_list_text[i_index] ),
413 p_item->ppsz_list[i_index] );
418 msg_Err( p_intf, "Couldn't find option \"%s\".",
423 void ExtVideo::setWidgetValue( QObject *widget )
425 QString module = ModuleFromWidgetName( widget->parent() );
426 //std::cout << "Module name: " << module.toStdString() << std::endl;
427 QString option = OptionFromWidgetName( widget );
428 //std::cout << "Option name: " << option.toStdString() << std::endl;
430 vlc_object_t *p_obj = ( vlc_object_t * )
431 vlc_object_find_name( p_intf->p_libvlc,
441 "Module instance %s not found, looking in config values.",
444 i_type = config_GetType( p_intf, qtu( option ) ) & VLC_VAR_CLASS;
447 case VLC_VAR_INTEGER:
449 val.i_int = config_GetInt( p_intf, qtu( option ) );
452 val.f_float = config_GetFloat( p_intf, qtu( option ) );
455 val.psz_string = config_GetPsz( p_intf, qtu( option ) );
461 i_type = var_Type( p_obj, qtu( option ) ) & VLC_VAR_CLASS;
462 var_Get( p_obj, qtu( option ), &val );
463 vlc_object_release( p_obj );
466 /* Try to cast to all the widgets we're likely to encounter. Only
467 * one of the casts is expected to work. */
468 QSlider *slider = qobject_cast<QSlider*> ( widget );
469 QCheckBox *checkbox = qobject_cast<QCheckBox*> ( widget );
470 QSpinBox *spinbox = qobject_cast<QSpinBox*> ( widget );
471 QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( widget );
472 QDial *dial = qobject_cast<QDial*> ( widget );
473 QLineEdit *lineedit = qobject_cast<QLineEdit*> ( widget );
474 QComboBox *combobox = qobject_cast<QComboBox*> ( widget );
476 if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
478 if( slider ) slider->setValue( val.i_int );
479 else if( checkbox ) checkbox->setCheckState( val.i_int? Qt::Checked
481 else if( spinbox ) spinbox->setValue( val.i_int );
482 else if( dial ) dial->setValue( ( 540-val.i_int )%360 );
486 snprintf( str, sizeof(str), "%06"PRIX64, val.i_int );
487 lineedit->setText( str );
489 else if( combobox ) combobox->setCurrentIndex(
490 combobox->findData( qlonglong(val.i_int) ) );
491 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
493 else if( i_type == VLC_VAR_FLOAT )
495 if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
496 else if( doublespinbox ) doublespinbox->setValue( val.f_float );
497 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
499 else if( i_type == VLC_VAR_STRING )
501 if( lineedit ) lineedit->setText( qfu( val.psz_string ) );
502 else if( combobox ) combobox->setCurrentIndex(
503 combobox->findData( qfu( val.psz_string ) ) );
504 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
505 free( val.psz_string );
509 "Module %s's %s variable is of an unsupported type ( %d )",
515 void ExtVideo::updateFilterOptions()
517 QString module = ModuleFromWidgetName( sender()->parent() );
518 //std::cout << "Module name: " << module.toStdString() << std::endl;
519 QString option = OptionFromWidgetName( sender() );
520 //std::cout << "Option name: " << option.toStdString() << std::endl;
522 vlc_object_t *p_obj = ( vlc_object_t * )
523 vlc_object_find_name( p_intf->p_libvlc,
530 msg_Warn( p_intf, "Module %s not found. You'll need to restart the filter to take the change into account.", qtu( module ) );
531 i_type = config_GetType( p_intf, qtu( option ) );
532 b_is_command = false;
536 i_type = var_Type( p_obj, qtu( option ) );
537 b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
542 msg_Warn( p_intf, "Module %s's %s variable isn't a command. You'll need to restart the filter to take change into account.",
545 /* FIXME: restart automatically somewhere near the end of this function */
548 /* Try to cast to all the widgets we're likely to encounter. Only
549 * one of the casts is expected to work. */
550 QSlider *slider = qobject_cast<QSlider*> ( sender() );
551 QCheckBox *checkbox = qobject_cast<QCheckBox*> ( sender() );
552 QSpinBox *spinbox = qobject_cast<QSpinBox*> ( sender() );
553 QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( sender() );
554 QDial *dial = qobject_cast<QDial*> ( sender() );
555 QLineEdit *lineedit = qobject_cast<QLineEdit*> ( sender() );
556 QComboBox *combobox = qobject_cast<QComboBox*> ( sender() );
558 i_type &= VLC_VAR_CLASS;
559 if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
562 if( slider ) i_int = slider->value();
563 else if( checkbox ) i_int = checkbox->checkState() == Qt::Checked;
564 else if( spinbox ) i_int = spinbox->value();
565 else if( dial ) i_int = ( 540-dial->value() )%360;
566 else if( lineedit ) i_int = lineedit->text().toInt( NULL,16 );
567 else if( combobox ) i_int = combobox->itemData( combobox->currentIndex() ).toInt();
568 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
569 config_PutInt( p_intf, qtu( option ), i_int );
572 if( i_type == VLC_VAR_INTEGER )
573 var_SetInteger( p_obj, qtu( option ), i_int );
575 var_SetBool( p_obj, qtu( option ), i_int );
578 else if( i_type == VLC_VAR_FLOAT )
581 if( slider ) f_float = ( double )slider->value()
582 / ( double )slider->tickInterval(); /* hack alert! */
583 else if( doublespinbox ) f_float = doublespinbox->value();
584 else if( lineedit ) f_float = lineedit->text().toDouble();
585 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
586 config_PutFloat( p_intf, qtu( option ), f_float );
588 var_SetFloat( p_obj, qtu( option ), f_float );
590 else if( i_type == VLC_VAR_STRING )
592 char *psz_string = NULL;
593 if( lineedit ) psz_string = strdup( qtu( lineedit->text() ) );
594 else if( combobox ) psz_string = strdup( qtu( combobox->itemData(
595 combobox->currentIndex() ).toString() ) );
596 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
597 config_PutPsz( p_intf, qtu( option ), psz_string );
599 var_SetString( p_obj, qtu( option ), psz_string );
604 "Module %s's %s variable is of an unsupported type ( %d )",
609 if( p_obj ) vlc_object_release( p_obj );
613 void ExtVideo::gotoConf( QObject* src )
615 #define SHOWCONF( module ) \
616 if( src->objectName().contains( module ) ) \
618 PrefsDialog::getInstance( p_intf )->showModulePrefs( module ); \
622 SHOWCONF( "magnify" );
624 SHOWCONF( "ripple" );
625 SHOWCONF( "invert" );
626 SHOWCONF( "puzzle" );
628 SHOWCONF( "gradient" );
629 SHOWCONF( "colorthres" )
633 /**********************************************************************
635 **********************************************************************/
637 ExtV4l2::ExtV4l2( intf_thread_t *_p_intf, QWidget *_parent )
638 : QWidget( _parent ), p_intf( _p_intf )
642 BUTTONACT( ui.refresh, Refresh() );
652 void ExtV4l2::showEvent( QShowEvent *event )
654 QWidget::showEvent( event );
658 void ExtV4l2::Refresh( void )
660 vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
664 ui.vboxLayout->removeWidget( box );
670 vlc_value_t val, text, name;
671 int i_ret = var_Change( p_obj, "controls", VLC_VAR_GETCHOICES,
675 msg_Err( p_intf, "Oops, v4l2 object doesn't have a 'controls' variable." );
677 vlc_object_release( p_obj );
681 box = new QGroupBox( this );
682 ui.vboxLayout->addWidget( box );
683 QVBoxLayout *layout = new QVBoxLayout( box );
684 box->setLayout( layout );
686 for( int i = 0; i < val.p_list->i_count; i++ )
688 const char *psz_var = text.p_list->p_values[i].psz_string;
689 var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &name, NULL );
690 const char *psz_label = name.psz_string;
691 msg_Dbg( p_intf, "v4l2 control \"%"PRIx64"\": %s (%s)",
692 val.p_list->p_values[i].i_int, psz_var, name.psz_string );
694 int i_type = var_Type( p_obj, psz_var );
695 switch( i_type & VLC_VAR_TYPE )
697 case VLC_VAR_INTEGER:
699 QLabel *label = new QLabel( psz_label, box );
700 QHBoxLayout *hlayout = new QHBoxLayout();
701 hlayout->addWidget( label );
702 int i_val = var_GetInteger( p_obj, psz_var );
703 if( i_type & VLC_VAR_HASCHOICE )
705 QComboBox *combobox = new QComboBox( box );
706 combobox->setObjectName( psz_var );
708 vlc_value_t val2, text2;
709 var_Change( p_obj, psz_var, VLC_VAR_GETCHOICES,
711 for( int j = 0; j < val2.p_list->i_count; j++ )
714 text2.p_list->p_values[j].psz_string,
715 qlonglong( val2.p_list->p_values[j].i_int) );
716 if( i_val == val2.p_list->p_values[j].i_int )
717 combobox->setCurrentIndex( j );
719 var_FreeList( &val2, &text2 );
721 CONNECT( combobox, currentIndexChanged( int ), this,
722 ValueChange( int ) );
723 hlayout->addWidget( combobox );
727 QSlider *slider = new QSlider( box );
728 slider->setObjectName( psz_var );
729 slider->setOrientation( Qt::Horizontal );
731 var_Change( p_obj, psz_var, VLC_VAR_GETMIN,
733 slider->setMinimum( val2.i_int );
734 var_Change( p_obj, psz_var, VLC_VAR_GETMAX,
736 slider->setMaximum( val2.i_int );
737 var_Change( p_obj, psz_var, VLC_VAR_GETSTEP,
739 slider->setSingleStep( val2.i_int );
740 slider->setValue( i_val );
742 CONNECT( slider, valueChanged( int ), this,
743 ValueChange( int ) );
744 hlayout->addWidget( slider );
746 layout->addLayout( hlayout );
751 QCheckBox *button = new QCheckBox( psz_label, box );
752 button->setObjectName( psz_var );
753 button->setChecked( var_GetBool( p_obj, psz_var ) );
755 CONNECT( button, clicked( bool ), this,
756 ValueChange( bool ) );
757 layout->addWidget( button );
762 if( i_type & VLC_VAR_ISCOMMAND )
764 QPushButton *button = new QPushButton( psz_label, box );
765 button->setObjectName( psz_var );
767 CONNECT( button, clicked( bool ), this,
768 ValueChange( bool ) );
769 layout->addWidget( button );
773 QLabel *label = new QLabel( psz_label, box );
774 layout->addWidget( label );
779 msg_Warn( p_intf, "Unhandled var type for %s", psz_var );
782 free( name.psz_string );
784 var_FreeList( &val, &text );
785 vlc_object_release( p_obj );
789 msg_Dbg( p_intf, "Couldn't find v4l2 instance" );
794 void ExtV4l2::ValueChange( bool value )
796 ValueChange( (int)value );
799 void ExtV4l2::ValueChange( int value )
801 QObject *s = sender();
802 vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
805 char *psz_var = strdup( qtu( s->objectName() ) );
806 int i_type = var_Type( p_obj, psz_var );
807 switch( i_type & VLC_VAR_TYPE )
809 case VLC_VAR_INTEGER:
810 if( i_type & VLC_VAR_HASCHOICE )
812 QComboBox *combobox = qobject_cast<QComboBox*>( s );
813 value = combobox->itemData( value ).toInt();
815 var_SetInteger( p_obj, psz_var, value );
818 var_SetBool( p_obj, psz_var, value );
821 var_TriggerCallback( p_obj, psz_var );
825 vlc_object_release( p_obj );
829 msg_Warn( p_intf, "Oops, v4l2 object isn't available anymore" );
834 /**********************************************************************
836 **********************************************************************/
838 static const QString band_frequencies[] =
840 " 60 Hz ", " 170 Hz ", " 310 Hz ", " 600 Hz ", " 1 kHz ",
841 " 3 kHz ", " 6 kHz ", " 12 kHz ", " 14 kHz ", " 16 kHz "
844 Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
845 QWidget( _parent ) , p_intf( _p_intf )
847 QFont smallFont = QApplication::font();
848 smallFont.setPointSize( smallFont.pointSize() - 3 );
851 ui.preampLabel->setFont( smallFont );
853 /* Setup of presetsComboBox */
854 presetsComboBox = ui.presetsCombo;
855 CONNECT( presetsComboBox, activated( int ), this, setCorePreset( int ) );
857 /* Add the sliders for the Bands */
858 QGridLayout *grid = new QGridLayout( ui.frame );
859 grid->setMargin( 0 );
860 for( int i = 0 ; i < BANDS ; i++ )
862 bands[i] = new QSlider( Qt::Vertical );
863 bands[i]->setMaximum( 400 );
864 bands[i]->setValue( 200 );
865 CONNECT( bands[i], valueChanged( int ), this, setCoreBands() );
867 band_texts[i] = new QLabel( band_frequencies[i] + "\n0.0dB" );
868 band_texts[i]->setFont( smallFont );
870 grid->addWidget( bands[i], 0, i );
871 grid->addWidget( band_texts[i], 1, i );
874 /* Add the listed presets */
875 for( int i = 0 ; i < NB_PRESETS ; i ++ )
877 presetsComboBox->addItem( qtr( preset_list_text[i] ),
878 QVariant( preset_list[i] ) );
882 BUTTONACT( ui.enableCheck, enable() );
883 BUTTONACT( ui.eq2PassCheck, set2Pass() );
884 CONNECT( ui.preampSlider, valueChanged( int ), this, setPreamp() );
886 /* Do the update from the value of the core */
890 Equalizer::~Equalizer()
894 void Equalizer::clean()
898 /* Write down initial values */
899 void Equalizer::updateUIFromCore()
901 char *psz_af, *psz_pres, *psz_bands;
905 aout_instance_t *p_aout = THEMIM->getAout();
908 psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
909 psz_pres = var_GetString( p_aout, "equalizer-preset" );
910 if( var_GetBool( p_aout, "equalizer-2pass" ) )
911 ui.eq2PassCheck->setChecked( true );
912 f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
913 psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
914 i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
915 vlc_object_release( p_aout );
919 psz_af = config_GetPsz( p_intf, "audio-filter" );
920 psz_pres = config_GetPsz( p_intf, "equalizer-preset" );
921 if( config_GetInt( p_intf, "equalizer-2pass" ) )
922 ui.eq2PassCheck->setChecked( true );
923 f_preamp = config_GetFloat( p_intf, "equalizer-preamp" );
924 psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
925 i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
927 if( psz_af && strstr( psz_af, "equalizer" ) != NULL )
928 ui.enableCheck->setChecked( true );
929 enable( ui.enableCheck->isChecked() );
931 presetsComboBox->setCurrentIndex( i_preset );
933 ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
935 if( psz_bands && strlen( psz_bands ) > 1 )
937 char *psz_bands_orig = psz_bands;
938 for( int i = 0; i < BANDS; i++ )
940 const float f = us_strtod(psz_bands, &psz_bands );
941 bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
942 if( psz_bands == NULL || *psz_bands == '\0' ) break;
944 if( *psz_bands == '\0' ) break;
946 free( psz_bands_orig );
948 else free( psz_bands );
954 /* Functin called when enableButton is toggled */
955 void Equalizer::enable()
957 bool en = ui.enableCheck->isChecked();
958 aout_EnableFilter( THEPL, "equalizer", en );
959 // aout_EnableFilter( THEPL, "upmixer", en );
960 // aout_EnableFilter( THEPL, "vsurround", en );
963 if( presetsComboBox->currentIndex() < 0 )
964 presetsComboBox->setCurrentIndex( 0 );
968 void Equalizer::enable( bool en )
970 ui.eq2PassCheck->setEnabled( en );
971 presetsComboBox->setEnabled( en );
972 ui.presetLabel->setEnabled( en );
973 ui.preampLabel->setEnabled( en );
974 ui.preampSlider->setEnabled( en );
975 for( int i = 0 ; i< BANDS; i++ )
977 bands[i]->setEnabled( en ); band_texts[i]->setEnabled( en );
981 /* Function called when the set2Pass button is activated */
982 void Equalizer::set2Pass()
984 aout_instance_t *p_aout= THEMIM->getAout();
985 bool b_2p = ui.eq2PassCheck->isChecked();
989 var_SetBool( p_aout, "equalizer-2pass", b_2p );
990 vlc_object_release( p_aout );
992 config_PutInt( p_intf, "equalizer-2pass", b_2p );
995 /* Function called when the preamp slider is moved */
996 void Equalizer::setPreamp()
998 const float f = ( float )( ui.preampSlider->value() ) /10 - 20;
999 aout_instance_t *p_aout = THEMIM->getAout();
1001 ui.preampLabel->setText( qtr( "Preamp\n" ) + QString::number( f, 'f', 1 )
1005 //delCallbacks( p_aout );
1006 var_SetFloat( p_aout, "equalizer-preamp", f );
1007 //addCallbacks( p_aout );
1008 vlc_object_release( p_aout );
1010 config_PutFloat( p_intf, "equalizer-preamp", f );
1013 void Equalizer::setCoreBands()
1015 /**\todo smoothing */
1018 for( int i = 0; i < BANDS; i++ )
1020 const float f_val = (float)( bands[i]->value() ) / 10 - 20;
1021 QString val = QString("%1").arg( f_val, 5, 'f', 1 );
1023 band_texts[i]->setText( band_frequencies[i] + "\n" + val + "dB" );
1024 values += " " + val;
1026 const char *psz_values = values.toAscii().constData();
1028 aout_instance_t *p_aout = THEMIM->getAout();
1031 //delCallbacks( p_aout );
1032 var_SetString( p_aout, "equalizer-bands", psz_values );
1033 //addCallbacks( p_aout );
1034 vlc_object_release( p_aout );
1038 char * Equalizer::createValuesFromPreset( int i_preset )
1042 /* Create the QString in Qt */
1043 for( int i = 0 ; i< BANDS ;i++ )
1044 values += QString( " %1" ).arg( eqz_preset_10b[i_preset]->f_amp[i] );
1046 /* Convert it to char * */
1047 return strdup( values.toAscii().constData() );
1050 void Equalizer::setCorePreset( int i_preset )
1055 /* Update pre-amplification in the UI */
1056 float f_preamp = eqz_preset_10b[i_preset]->f_preamp;
1057 ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
1058 ui.preampLabel->setText( qtr( "Preamp\n" )
1059 + QString::number( f_preamp, 'f', 1 ) + qtr( "dB" ) );
1061 char *psz_values = createValuesFromPreset( i_preset );
1062 if( !psz_values ) return ;
1064 char *p = psz_values;
1065 for( int i = 0; i < BANDS && *p; i++ )
1067 const float f = us_strtod( p, &p );
1069 bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
1070 band_texts[i]->setText( band_frequencies[i] + "\n"
1071 + QString("%1").arg( f, 5, 'f', 1 ) + "dB" );
1073 p++; /* skip separator */
1076 /* Apply presets to audio output */
1077 aout_instance_t *p_aout= THEMIM->getAout();
1080 var_SetString( p_aout , "equalizer-preset" , preset_list[i_preset] );
1082 var_SetString( p_aout, "equalizer-bands", psz_values );
1083 var_SetFloat( p_aout, "equalizer-preamp",
1084 eqz_preset_10b[i_preset]->f_preamp );
1085 vlc_object_release( p_aout );
1087 config_PutPsz( p_intf, "equalizer-bands", psz_values );
1088 config_PutPsz( p_intf, "equalizer-preset", preset_list[i_preset] );
1089 config_PutFloat( p_intf, "equalizer-preamp",
1090 eqz_preset_10b[i_preset]->f_preamp );
1094 static int PresetCallback( vlc_object_t *p_this, char const *psz_cmd,
1095 vlc_value_t oldval, vlc_value_t newval, void *p_data )
1097 char *psz_preset = newval.psz_string;
1098 Equalizer *eq = ( Equalizer * )p_data;
1099 int i_preset = eq->presetsComboBox->findData( QVariant( psz_preset ) );
1100 eq->presetsComboBox->setCurrentIndex( i_preset );
1104 void Equalizer::delCallbacks( aout_instance_t *p_aout )
1106 //var_DelCallback( p_aout, "equalizer-bands", EqzCallback, this );
1107 //var_DelCallback( p_aout, "equalizer-preamp", EqzCallback, this );
1108 var_DelCallback( p_aout, "equalizer-preset", PresetCallback, this );
1111 void Equalizer::addCallbacks( aout_instance_t *p_aout )
1113 //var_AddCallback( p_aout, "equalizer-bands", EqzCallback, this );
1114 //var_AddCallback( p_aout, "equalizer-preamp", EqzCallback, this );
1115 var_AddCallback( p_aout, "equalizer-preset", PresetCallback, this );
1118 /**********************************************************************
1120 **********************************************************************/
1122 /**********************************************************************
1124 **********************************************************************/
1125 static const char *psz_control_names[] =
1127 "spatializer-roomsize", "spatializer-width",
1128 "spatializer-wet", "spatializer-dry", "spatializer-damp"
1131 Spatializer::Spatializer( intf_thread_t *_p_intf, QWidget *_parent ) :
1132 QWidget( _parent ) , p_intf( _p_intf )
1134 QFont smallFont = QApplication::font();
1135 smallFont.setPointSize( smallFont.pointSize() - 3 );
1137 QGridLayout *layout = new QGridLayout( this );
1138 layout->setMargin( 0 );
1140 enableCheck = new QCheckBox( qtr( "Enable spatializer" ) );
1141 layout->addWidget( enableCheck, 0, 0, 1, NUM_SP_CTRL );
1143 for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
1145 spatCtrl[i] = new QSlider( Qt::Vertical );
1148 spatCtrl[i]->setMaximum( 10 );
1149 spatCtrl[i]->setValue( 2 );
1153 spatCtrl[i]->setMaximum( 10 );
1154 spatCtrl[i]->setValue( 0 );
1155 spatCtrl[i]->setMinimum( -10 );
1157 oldControlVars[i] = spatCtrl[i]->value();
1158 CONNECT( spatCtrl[i], valueChanged( int ), this, setInitValues() );
1159 ctrl_texts[i] = new QLabel( qfu( psz_control_names[i] ) + "\n" );
1160 ctrl_texts[i]->setFont( smallFont );
1161 ctrl_readout[i] = new QLabel( "" );
1162 ctrl_readout[i]->setFont( smallFont );
1163 layout->addWidget( spatCtrl[i], 1, i );
1164 layout->addWidget( ctrl_readout[i], 2, i );
1165 layout->addWidget( ctrl_texts[i], 3, i );
1168 BUTTONACT( enableCheck, enable() );
1170 /* Write down initial values */
1171 aout_instance_t *p_aout = THEMIM->getAout();
1176 psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
1177 for( int i = 0; i < NUM_SP_CTRL ; i++ )
1179 controlVars[i] = var_GetFloat( p_aout, psz_control_names[i] );
1181 vlc_object_release( p_aout );
1185 psz_af = config_GetPsz( p_intf, "audio-filter" );
1186 for( int i = 0; i < NUM_SP_CTRL ; i++ )
1188 controlVars[i] = config_GetFloat( p_intf, psz_control_names[i] );
1191 if( psz_af && strstr( psz_af, "spatializer" ) != NULL )
1192 enableCheck->setChecked( true );
1194 enable( enableCheck->isChecked() );
1195 setValues( controlVars );
1198 Spatializer::~Spatializer()
1202 void Spatializer::enable()
1204 bool en = enableCheck->isChecked();
1205 aout_EnableFilter( THEPL, "spatializer", en );
1209 void Spatializer::enable( bool en )
1211 for( int i = 0 ; i< NUM_SP_CTRL; i++ )
1213 spatCtrl[i]->setEnabled( en );
1214 ctrl_texts[i]->setEnabled( en );
1215 ctrl_readout[i]->setEnabled( en );
1218 void Spatializer::setInitValues()
1220 setValues( controlVars );
1223 void Spatializer::setValues( float *controlVars )
1225 aout_instance_t *p_aout = THEMIM->getAout();
1227 for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
1229 float f = (float)( spatCtrl[i]->value() );
1230 ctrl_readout[i]->setText( QString::number( f, 'f', 1 ) );
1234 for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
1236 if( oldControlVars[i] != spatCtrl[i]->value() )
1238 var_SetFloat( p_aout, psz_control_names[i],
1239 ( float )spatCtrl[i]->value() );
1240 config_PutFloat( p_intf, psz_control_names[i],
1241 ( float ) spatCtrl[i]->value() );
1242 oldControlVars[i] = ( float ) spatCtrl[i]->value();
1245 vlc_object_release( p_aout );
1249 void Spatializer::delCallbacks( aout_instance_t *p_aout )
1251 // var_DelCallback( p_aout, "Spatializer-bands", EqzCallback, this );
1252 // var_DelCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
1255 void Spatializer::addCallbacks( aout_instance_t *p_aout )
1257 // var_AddCallback( p_aout, "Spatializer-bands", EqzCallback, this );
1258 // var_AddCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
1261 #include <QToolButton>
1262 #include <QGridLayout>
1264 SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
1265 QWidget( _parent ) , p_intf( _p_intf )
1267 QGroupBox *AVBox, *subsBox;
1269 QToolButton *moinsAV, *plusAV;
1270 QToolButton *moinssubs, *plussubs;
1271 QToolButton *moinssubSpeed, *plussubSpeed;
1273 QToolButton *updateButton;
1275 b_userAction = true;
1277 QGridLayout *mainLayout = new QGridLayout( this );
1280 AVBox = new QGroupBox( qtr( "Audio/Video" ) );
1281 QGridLayout *AVLayout = new QGridLayout( AVBox );
1283 moinsAV = new QToolButton;
1284 moinsAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
1285 moinsAV->setAutoRaise( true );
1286 moinsAV->setText( "-" );
1287 AVLayout->addWidget( moinsAV, 0, 1, 1, 1 );
1289 plusAV = new QToolButton;
1290 plusAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
1291 plusAV->setAutoRaise( true );
1292 plusAV->setText( "+" );
1293 AVLayout->addWidget( plusAV, 0, 3, 1, 1 );
1295 QLabel *AVLabel = new QLabel;
1296 AVLabel->setText( qtr( "Advance of audio over video:" ) );
1297 AVLayout->addWidget( AVLabel, 0, 0, 1, 1 );
1299 AVSpin = new QDoubleSpinBox;
1300 AVSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
1301 AVSpin->setDecimals( 3 );
1302 AVSpin->setMinimum( -600.0 );
1303 AVSpin->setMaximum( 600.0 );
1304 AVSpin->setSingleStep( 0.1 );
1305 AVSpin->setToolTip( qtr( "A positive value means that\n"
1306 "the audio is ahead of the video" ) );
1307 AVSpin->setSuffix( " s" );
1308 AVLayout->addWidget( AVSpin, 0, 2, 1, 1 );
1309 mainLayout->addWidget( AVBox, 1, 0, 1, 5 );
1313 subsBox = new QGroupBox( qtr( "Subtitles/Video" ) );
1314 QGridLayout *subsLayout = new QGridLayout( subsBox );
1316 moinssubs = new QToolButton;
1317 moinssubs->setToolButtonStyle( Qt::ToolButtonTextOnly );
1318 moinssubs->setAutoRaise( true );
1319 moinssubs->setText( "-" );
1320 subsLayout->addWidget( moinssubs, 0, 1, 1, 1 );
1322 plussubs = new QToolButton;
1323 plussubs->setToolButtonStyle( Qt::ToolButtonTextOnly );
1324 plussubs->setAutoRaise( true );
1325 plussubs->setText( "+" );
1326 subsLayout->addWidget( plussubs, 0, 3, 1, 1 );
1328 QLabel *subsLabel = new QLabel;
1329 subsLabel->setText( qtr( "Advance of subtitles over video:" ) );
1330 subsLayout->addWidget( subsLabel, 0, 0, 1, 1 );
1332 subsSpin = new QDoubleSpinBox;
1333 subsSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
1334 subsSpin->setDecimals( 3 );
1335 subsSpin->setMinimum( -600.0 );
1336 subsSpin->setMaximum( 600.0 );
1337 subsSpin->setSingleStep( 0.1 );
1338 subsSpin->setToolTip( qtr( "A positive value means that\n"
1339 "the subtitles are ahead of the video" ) );
1340 subsSpin->setSuffix( " s" );
1341 subsLayout->addWidget( subsSpin, 0, 2, 1, 1 );
1344 moinssubSpeed = new QToolButton;
1345 moinssubSpeed->setToolButtonStyle( Qt::ToolButtonTextOnly );
1346 moinssubSpeed->setAutoRaise( true );
1347 moinssubSpeed->setText( "-" );
1348 subsLayout->addWidget( moinssubSpeed, 1, 1, 1, 1 );
1350 plussubSpeed = new QToolButton;
1351 plussubSpeed->setToolButtonStyle( Qt::ToolButtonTextOnly );
1352 plussubSpeed->setAutoRaise( true );
1353 plussubSpeed->setText( "+" );
1354 subsLayout->addWidget( plussubSpeed, 1, 3, 1, 1 );
1356 QLabel *subSpeedLabel = new QLabel;
1357 subSpeedLabel->setText( qtr( "Speed of the subtitles:" ) );
1358 subsLayout->addWidget( subSpeedLabel, 1, 0, 1, 1 );
1360 subSpeedSpin = new QDoubleSpinBox;
1361 subSpeedSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
1362 subSpeedSpin->setDecimals( 3 );
1363 subSpeedSpin->setMinimum( 1 );
1364 subSpeedSpin->setMaximum( 100 );
1365 subSpeedSpin->setSingleStep( 0.2 );
1366 subSpeedSpin->setSuffix( " fps" );
1367 subsLayout->addWidget( subSpeedSpin, 1, 2, 1, 1 );
1369 mainLayout->addWidget( subsBox, 2, 0, 2, 5 );
1371 updateButton = new QToolButton;
1372 updateButton->setAutoRaise( true );
1373 mainLayout->addWidget( updateButton, 0, 4, 1, 1 );
1376 /* Various Connects */
1377 CONNECT( moinsAV, clicked(), AVSpin, stepDown () );
1378 CONNECT( plusAV, clicked(), AVSpin, stepUp () );
1379 CONNECT( moinssubs, clicked(), subsSpin, stepDown () );
1380 CONNECT( plussubs, clicked(), subsSpin, stepUp () );
1381 CONNECT( moinssubSpeed, clicked(), subSpeedSpin, stepDown () );
1382 CONNECT( plussubSpeed, clicked(), subSpeedSpin, stepUp () );
1383 CONNECT( AVSpin, valueChanged ( double ), this, advanceAudio( double ) ) ;
1384 CONNECT( subsSpin, valueChanged ( double ), this, advanceSubs( double ) ) ;
1385 CONNECT( subSpeedSpin, valueChanged ( double ),
1386 this, adjustSubsSpeed( double ) );
1388 CONNECT( THEMIM->getIM(), synchroChanged(), this, update() );
1389 BUTTON_SET_ACT_I( updateButton, "", update,
1390 qtr( "Force update of this dialog's values" ), update() );
1396 void SyncControls::clean()
1398 b_userAction = false;
1399 AVSpin->setValue( 0.0 );
1400 subsSpin->setValue( 0.0 );
1401 subSpeedSpin->setValue( 1.0 );
1402 b_userAction = true;
1405 void SyncControls::update()
1407 b_userAction = false;
1410 if( THEMIM->getInput() )
1412 i_delay = var_GetTime( THEMIM->getInput(), "audio-delay" );
1413 AVSpin->setValue( ( (double)i_delay ) / 1000000 );
1414 i_delay = var_GetTime( THEMIM->getInput(), "spu-delay" );
1415 subsSpin->setValue( ( (double)i_delay ) / 1000000 );
1416 subSpeedSpin->setValue( var_GetFloat( THEMIM->getInput(), "sub-fps" ) );
1418 b_userAction = true;
1421 void SyncControls::advanceAudio( double f_advance )
1423 if( THEMIM->getInput() && b_userAction )
1425 int64_t i_delay = f_advance * 1000000;
1426 var_SetTime( THEMIM->getInput(), "audio-delay", i_delay );
1430 void SyncControls::advanceSubs( double f_advance )
1432 if( THEMIM->getInput() && b_userAction )
1434 int64_t i_delay = f_advance * 1000000;
1435 var_SetTime( THEMIM->getInput(), "spu-delay", i_delay );
1439 void SyncControls::adjustSubsSpeed( double f_fps )
1441 if( THEMIM->getInput() && b_userAction )
1443 var_SetFloat( THEMIM->getInput(), "sub-fps", f_fps );
1447 /**********************************************************************
1448 * Video filters / Adjust
1449 **********************************************************************/
1451 /**********************************************************************
1452 * Extended playbak controls
1453 **********************************************************************/