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 *****************************************************************************/
33 #include <QGridLayout>
34 #include <QSignalMapper>
37 #include "components/extended_panels.hpp"
38 #include "dialogs/preferences.hpp"
40 #include "input_manager.hpp"
42 #include "../../audio_filter/equalizer_presets.h"
44 #include <vlc_intf_strings.h>
48 #include <vlc_charset.h> /* us_strtod */
51 class ConfClickHandler : public QObject
54 ConfClickHandler( intf_thread_t *_p_intf, ExtVideo *_e ) : QObject ( _e ) {
55 e = _e; p_intf = _p_intf;
57 virtual ~ConfClickHandler() {}
58 bool eventFilter( QObject *obj, QEvent *evt )
60 if( evt->type() == QEvent::MouseButtonPress )
69 intf_thread_t *p_intf;
73 QString ModuleFromWidgetName( QObject *obj )
75 return obj->objectName().replace( "Enable","" );
78 QString OptionFromWidgetName( QObject *obj )
81 QString option = obj->objectName().replace( "Slider", "" )
82 .replace( "Combo" , "" )
83 .replace( "Dial" , "" )
84 .replace( "Check" , "" )
85 .replace( "Spin" , "" )
86 .replace( "Text" , "" );
87 for( char a = 'A'; a <= 'Z'; a++ )
89 option = option.replace( QString( a ),
90 QString( '-' ) + QString( a + 'a' - 'A' ) );
95 ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) :
96 QObject( _parent ), p_intf( _p_intf )
98 ui.setupUi( _parent );
101 #define SETUP_VFILTER( widget ) \
103 vlc_object_t *p_obj = ( vlc_object_t * ) \
104 vlc_object_find_name( p_intf->p_libvlc, \
107 QCheckBox *checkbox = qobject_cast<QCheckBox*>( ui.widget##Enable ); \
108 QGroupBox *groupbox = qobject_cast<QGroupBox*>( ui.widget##Enable ); \
111 vlc_object_release( p_obj ); \
112 if( checkbox ) checkbox->setChecked( true ); \
113 else groupbox->setChecked( true ); \
117 if( checkbox ) checkbox->setChecked( false ); \
118 else groupbox->setChecked( false ); \
121 CONNECT( ui.widget##Enable, clicked(), this, updateFilters() );
122 #define SETUP_VFILTER_OPTION( widget, signal ) \
123 initComboBoxItems( ui.widget ); \
124 setWidgetValue( ui.widget ); \
125 CONNECT( ui.widget, signal, this, updateFilterOptions() );
127 SETUP_VFILTER( adjust )
128 SETUP_VFILTER_OPTION( hueSlider, valueChanged( int ) )
129 SETUP_VFILTER_OPTION( contrastSlider, valueChanged( int ) )
130 SETUP_VFILTER_OPTION( brightnessSlider, valueChanged( int ) )
131 SETUP_VFILTER_OPTION( saturationSlider, valueChanged( int ) )
132 SETUP_VFILTER_OPTION( gammaSlider, valueChanged( int ) )
133 SETUP_VFILTER_OPTION( brightnessThresholdCheck, stateChanged( int ) )
135 SETUP_VFILTER( extract )
136 SETUP_VFILTER_OPTION( extractComponentText, textChanged( const QString& ) )
138 SETUP_VFILTER( colorthres )
139 SETUP_VFILTER_OPTION( colorthresColorText, textChanged( const QString& ) )
140 SETUP_VFILTER_OPTION( colorthresSaturationthresSlider, valueChanged( int ) )
141 SETUP_VFILTER_OPTION( colorthresSimilaritythresSlider, valueChanged( int ) )
143 SETUP_VFILTER( invert )
145 SETUP_VFILTER( gradient )
146 SETUP_VFILTER_OPTION( gradientModeCombo, currentIndexChanged( QString ) )
147 SETUP_VFILTER_OPTION( gradientTypeCheck, stateChanged( int ) )
148 SETUP_VFILTER_OPTION( gradientCartoonCheck, stateChanged( int ) )
150 SETUP_VFILTER( motionblur )
151 SETUP_VFILTER_OPTION( blurFactorSlider, valueChanged( int ) )
153 SETUP_VFILTER( motiondetect )
155 SETUP_VFILTER( noise )
157 SETUP_VFILTER( psychedelic )
159 SETUP_VFILTER( sharpen )
160 SETUP_VFILTER_OPTION( sharpenSigmaSlider, valueChanged( int ) )
162 SETUP_VFILTER( ripple )
164 SETUP_VFILTER( wave )
166 SETUP_VFILTER( transform )
167 SETUP_VFILTER_OPTION( transformTypeCombo, currentIndexChanged( QString ) )
169 SETUP_VFILTER( rotate )
170 SETUP_VFILTER_OPTION( rotateAngleDial, valueChanged( int ) )
171 ui.rotateAngleDial->setWrapping( true );
172 ui.rotateAngleDial->setNotchesVisible( true );
174 SETUP_VFILTER( puzzle )
175 SETUP_VFILTER_OPTION( puzzleRowsSpin, valueChanged( int ) )
176 SETUP_VFILTER_OPTION( puzzleColsSpin, valueChanged( int ) )
177 SETUP_VFILTER_OPTION( puzzleBlackSlotCheck, stateChanged( int ) )
179 SETUP_VFILTER( magnify )
181 SETUP_VFILTER( clone )
182 SETUP_VFILTER_OPTION( cloneCountSpin, valueChanged( int ) )
184 SETUP_VFILTER( wall )
185 SETUP_VFILTER_OPTION( wallRowsSpin, valueChanged( int ) )
186 SETUP_VFILTER_OPTION( wallColsSpin, valueChanged( int ) )
188 SETUP_VFILTER( panoramix )
189 SETUP_VFILTER_OPTION( panoramixRowsSpin, valueChanged( int ) )
190 SETUP_VFILTER_OPTION( panoramixColsSpin, valueChanged( int ) )
193 SETUP_VFILTER( erase )
194 SETUP_VFILTER_OPTION( eraseMaskText, editingFinished() )
195 SETUP_VFILTER_OPTION( eraseYSpin, valueChanged( int ) )
196 SETUP_VFILTER_OPTION( eraseXSpin, valueChanged( int ) )
198 SETUP_VFILTER( marq )
199 SETUP_VFILTER_OPTION( marqMarqueeText, textChanged( const QString& ) )
200 SETUP_VFILTER_OPTION( marqPositionCombo, currentIndexChanged( QString ) )
202 SETUP_VFILTER( logo )
203 SETUP_VFILTER_OPTION( logoFileText, editingFinished() )
204 SETUP_VFILTER_OPTION( logoYSpin, valueChanged( int ) )
205 SETUP_VFILTER_OPTION( logoXSpin, valueChanged( int ) )
206 SETUP_VFILTER_OPTION( logoOpacitySlider, valueChanged( int ) )
208 if( module_exists( "atmo" ) )
210 SETUP_VFILTER( atmo )
211 SETUP_VFILTER_OPTION( atmoEdgeweightningSlider, valueChanged( int ) )
212 SETUP_VFILTER_OPTION( atmoBrightnessSlider, valueChanged( int ) )
213 SETUP_VFILTER_OPTION( atmoDarknesslimitSlider, valueChanged( int ) )
214 SETUP_VFILTER_OPTION( atmoMeanlengthSlider, valueChanged( int ) )
215 SETUP_VFILTER_OPTION( atmoMeanthresholdSlider, valueChanged( int ) )
216 SETUP_VFILTER_OPTION( atmoPercentnewSlider, valueChanged( int ) )
217 SETUP_VFILTER_OPTION( atmoFiltermodeCombo, currentIndexChanged( int ) )
218 SETUP_VFILTER_OPTION( atmoShowdotsCheck, stateChanged( int ) )
222 _parent->removeTab( _parent->indexOf( ui.tab_atmo ) );
226 #undef SETUP_VFILTER_OPTION
228 CONNECT( ui.cropTopPx, valueChanged( int ), this, cropChange() );
229 CONNECT( ui.cropBotPx, valueChanged( int ), this, cropChange() );
230 CONNECT( ui.cropLeftPx, valueChanged( int ), this, cropChange() );
231 CONNECT( ui.cropRightPx, valueChanged( int ), this, cropChange() );
232 CONNECT( ui.leftRightCropSync, toggled ( bool ), this, cropChange() );
233 CONNECT( ui.topBotCropSync, toggled ( bool ), this, cropChange() );
234 CONNECT( ui.topBotCropSync, toggled( bool ),
235 ui.cropBotPx, setDisabled( bool ) );
236 CONNECT( ui.leftRightCropSync, toggled( bool ),
237 ui.cropRightPx, setDisabled( bool ) );
240 ExtVideo::~ExtVideo()
244 void ExtVideo::cropChange()
246 if( ui.topBotCropSync->isChecked() )
247 ui.cropBotPx->setValue( ui.cropTopPx->value() );
248 if( ui.leftRightCropSync->isChecked() )
249 ui.cropRightPx->setValue( ui.cropLeftPx->value() );
251 p_vout = THEMIM->getVout();
254 var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
255 var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
256 var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
257 var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
258 vlc_object_release( p_vout );
262 void ExtVideo::clean()
264 ui.cropTopPx->setValue( 0 );
265 ui.cropBotPx->setValue( 0 );
266 ui.cropLeftPx->setValue( 0 );
267 ui.cropRightPx->setValue( 0 );
270 void ExtVideo::ChangeVFiltersString( const char *psz_name, bool b_add )
272 char *psz_parser, *psz_string;
273 const char *psz_filter_type;
275 /* FIXME temporary hack */
276 const char *psz_module_name = psz_name;
277 if( !strcmp( psz_name, "wall" ) ||
278 !strcmp( psz_name, "panoramix" ) ||
279 !strcmp( psz_name, "clone" ) )
280 psz_module_name = "video_filter_wrapper";
282 module_t *p_obj = module_find( psz_module_name );
285 msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name );
289 if( module_provides( p_obj, "video filter" ) )
291 psz_filter_type = "vout-filter";
293 else if( module_provides( p_obj, "video filter2" ) )
295 psz_filter_type = "video-filter";
297 else if( module_provides( p_obj, "sub filter" ) )
299 psz_filter_type = "sub-filter";
303 module_release (p_obj);
304 msg_Err( p_intf, "Unknown video filter type." );
307 module_release (p_obj);
309 psz_string = config_GetPsz( p_intf, psz_filter_type );
311 if( !psz_string ) psz_string = strdup( "" );
313 psz_parser = strstr( psz_string, psz_name );
319 psz_parser = psz_string;
320 if( asprintf( &psz_string, ( *psz_string ) ? "%s:%s" : "%s%s",
321 psz_string, psz_name ) == -1 )
337 if( *( psz_parser + strlen( psz_name ) ) == ':' )
339 memmove( psz_parser, psz_parser + strlen( psz_name ) + 1,
340 strlen( psz_parser + strlen( psz_name ) + 1 ) + 1 );
347 /* Remove trailing : : */
348 if( strlen( psz_string ) > 0 &&
349 *( psz_string + strlen( psz_string ) -1 ) == ':' )
351 *( psz_string + strlen( psz_string ) -1 ) = '\0';
360 /* Vout is not kept, so put that in the config */
361 config_PutPsz( p_intf, psz_filter_type, psz_string );
362 if( !strcmp( psz_filter_type, "video-filter" ) )
363 ui.videoFilterText->setText( psz_string );
364 else if( !strcmp( psz_filter_type, "vout-filter" ) )
365 ui.voutFilterText->setText( psz_string );
366 else if( !strcmp( psz_filter_type, "sub-filter" ) )
367 ui.subpictureFilterText->setText( psz_string );
369 /* Try to set on the fly */
370 p_vout = THEMIM->getVout();
373 var_SetString( p_vout, psz_filter_type, psz_string );
374 vlc_object_release( p_vout );
380 void ExtVideo::updateFilters()
382 QString module = ModuleFromWidgetName( sender() );
384 QCheckBox *checkbox = qobject_cast<QCheckBox*>( sender() );
385 QGroupBox *groupbox = qobject_cast<QGroupBox*>( sender() );
387 ChangeVFiltersString( qtu( module ),
388 checkbox ? checkbox->isChecked()
389 : groupbox->isChecked() );
392 void ExtVideo::initComboBoxItems( QObject *widget )
394 QComboBox *combobox = qobject_cast<QComboBox*>( widget );
395 if( !combobox ) return;
396 QString option = OptionFromWidgetName( widget );
397 module_config_t *p_item = config_FindConfig( VLC_OBJECT( p_intf ),
401 int i_type = p_item->i_type & CONFIG_ITEM;
402 for( int i_index = 0; i_index < p_item->i_list; i_index++ )
404 if( i_type == CONFIG_ITEM_INTEGER
405 || i_type == CONFIG_ITEM_BOOL )
406 combobox->addItem( qtr( p_item->ppsz_list_text[i_index] ),
407 p_item->pi_list[i_index] );
408 else if( i_type == CONFIG_ITEM_STRING )
409 combobox->addItem( qtr( p_item->ppsz_list_text[i_index] ),
410 p_item->ppsz_list[i_index] );
415 msg_Err( p_intf, "Couldn't find option \"%s\".",
420 void ExtVideo::setWidgetValue( QObject *widget )
422 QString module = ModuleFromWidgetName( widget->parent() );
423 //std::cout << "Module name: " << module.toStdString() << std::endl;
424 QString option = OptionFromWidgetName( widget );
425 //std::cout << "Option name: " << option.toStdString() << std::endl;
427 vlc_object_t *p_obj = ( vlc_object_t * )
428 vlc_object_find_name( p_intf->p_libvlc,
438 "Module instance %s not found, looking in config values.",
441 i_type = config_GetType( p_intf, qtu( option ) ) & VLC_VAR_CLASS;
444 case VLC_VAR_INTEGER:
446 val.i_int = config_GetInt( p_intf, qtu( option ) );
449 val.f_float = config_GetFloat( p_intf, qtu( option ) );
452 val.psz_string = config_GetPsz( p_intf, qtu( option ) );
458 i_type = var_Type( p_obj, qtu( option ) ) & VLC_VAR_CLASS;
459 var_Get( p_obj, qtu( option ), &val );
460 vlc_object_release( p_obj );
463 /* Try to cast to all the widgets we're likely to encounter. Only
464 * one of the casts is expected to work. */
465 QSlider *slider = qobject_cast<QSlider*> ( widget );
466 QCheckBox *checkbox = qobject_cast<QCheckBox*> ( widget );
467 QSpinBox *spinbox = qobject_cast<QSpinBox*> ( widget );
468 QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( widget );
469 QDial *dial = qobject_cast<QDial*> ( widget );
470 QLineEdit *lineedit = qobject_cast<QLineEdit*> ( widget );
471 QComboBox *combobox = qobject_cast<QComboBox*> ( widget );
473 if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
475 if( slider ) slider->setValue( val.i_int );
476 else if( checkbox ) checkbox->setCheckState( val.i_int? Qt::Checked
478 else if( spinbox ) spinbox->setValue( val.i_int );
479 else if( dial ) dial->setValue( ( 540-val.i_int )%360 );
483 snprintf( str, sizeof(str), "%06X", val.i_int );
484 lineedit->setText( str );
486 else if( combobox ) combobox->setCurrentIndex(
487 combobox->findData( val.i_int ) );
488 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
490 else if( i_type == VLC_VAR_FLOAT )
492 if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
493 else if( doublespinbox ) doublespinbox->setValue( val.f_float );
494 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
496 else if( i_type == VLC_VAR_STRING )
498 if( lineedit ) lineedit->setText( qfu( val.psz_string ) );
499 else if( combobox ) combobox->setCurrentIndex(
500 combobox->findData( qfu( val.psz_string ) ) );
501 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
502 free( val.psz_string );
506 "Module %s's %s variable is of an unsupported type ( %d )",
512 void ExtVideo::updateFilterOptions()
514 QString module = ModuleFromWidgetName( sender()->parent() );
515 //std::cout << "Module name: " << module.toStdString() << std::endl;
516 QString option = OptionFromWidgetName( sender() );
517 //std::cout << "Option name: " << option.toStdString() << std::endl;
519 vlc_object_t *p_obj = ( vlc_object_t * )
520 vlc_object_find_name( p_intf->p_libvlc,
527 msg_Warn( p_intf, "Module %s not found. You'll need to restart the filter to take the change into account.", qtu( module ) );
528 i_type = config_GetType( p_intf, qtu( option ) );
529 b_is_command = false;
533 i_type = var_Type( p_obj, qtu( option ) );
534 b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
539 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.",
542 /* FIXME: restart automatically somewhere near the end of this function */
545 /* Try to cast to all the widgets we're likely to encounter. Only
546 * one of the casts is expected to work. */
547 QSlider *slider = qobject_cast<QSlider*> ( sender() );
548 QCheckBox *checkbox = qobject_cast<QCheckBox*> ( sender() );
549 QSpinBox *spinbox = qobject_cast<QSpinBox*> ( sender() );
550 QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( sender() );
551 QDial *dial = qobject_cast<QDial*> ( sender() );
552 QLineEdit *lineedit = qobject_cast<QLineEdit*> ( sender() );
553 QComboBox *combobox = qobject_cast<QComboBox*> ( sender() );
555 i_type &= VLC_VAR_CLASS;
556 if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
559 if( slider ) i_int = slider->value();
560 else if( checkbox ) i_int = checkbox->checkState() == Qt::Checked;
561 else if( spinbox ) i_int = spinbox->value();
562 else if( dial ) i_int = ( 540-dial->value() )%360;
563 else if( lineedit ) i_int = lineedit->text().toInt( NULL,16 );
564 else if( combobox ) i_int = combobox->itemData( combobox->currentIndex() ).toInt();
565 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
566 config_PutInt( p_intf, qtu( option ), i_int );
569 if( i_type == VLC_VAR_INTEGER )
570 var_SetInteger( p_obj, qtu( option ), i_int );
572 var_SetBool( p_obj, qtu( option ), i_int );
575 else if( i_type == VLC_VAR_FLOAT )
578 if( slider ) f_float = ( double )slider->value()
579 / ( double )slider->tickInterval(); /* hack alert! */
580 else if( doublespinbox ) f_float = doublespinbox->value();
581 else if( lineedit ) f_float = lineedit->text().toDouble();
582 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
583 config_PutFloat( p_intf, qtu( option ), f_float );
585 var_SetFloat( p_obj, qtu( option ), f_float );
587 else if( i_type == VLC_VAR_STRING )
589 char *psz_string = NULL;
590 if( lineedit ) psz_string = strdup( qtu( lineedit->text() ) );
591 else if( combobox ) psz_string = strdup( qtu( combobox->itemData(
592 combobox->currentIndex() ).toString() ) );
593 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
594 config_PutPsz( p_intf, qtu( option ), psz_string );
596 var_SetString( p_obj, qtu( option ), psz_string );
601 "Module %s's %s variable is of an unsupported type ( %d )",
606 if( p_obj ) vlc_object_release( p_obj );
610 void ExtVideo::gotoConf( QObject* src )
612 #define SHOWCONF( module ) \
613 if( src->objectName().contains( module ) ) \
615 PrefsDialog::getInstance( p_intf )->showModulePrefs( module ); \
619 SHOWCONF( "magnify" );
621 SHOWCONF( "ripple" );
622 SHOWCONF( "invert" );
623 SHOWCONF( "puzzle" );
625 SHOWCONF( "gradient" );
626 SHOWCONF( "colorthres" )
630 /**********************************************************************
632 **********************************************************************/
634 ExtV4l2::ExtV4l2( intf_thread_t *_p_intf, QWidget *_parent )
635 : QWidget( _parent ), p_intf( _p_intf )
639 BUTTONACT( ui.refresh, Refresh() );
649 void ExtV4l2::showEvent( QShowEvent *event )
651 QWidget::showEvent( event );
655 void ExtV4l2::Refresh( void )
657 vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
661 ui.vboxLayout->removeWidget( box );
667 vlc_value_t val, text, name;
668 int i_ret = var_Change( p_obj, "controls", VLC_VAR_GETCHOICES,
672 msg_Err( p_intf, "Oops, v4l2 object doesn't have a 'controls' variable." );
674 vlc_object_release( p_obj );
678 box = new QGroupBox( this );
679 ui.vboxLayout->addWidget( box );
680 QVBoxLayout *layout = new QVBoxLayout( box );
681 box->setLayout( layout );
683 for( int i = 0; i < val.p_list->i_count; i++ )
685 const char *psz_var = text.p_list->p_values[i].psz_string;
686 var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &name, NULL );
687 const char *psz_label = name.psz_string;
688 msg_Dbg( p_intf, "v4l2 control \"%x\": %s (%s)",
689 val.p_list->p_values[i].i_int, psz_var, name.psz_string );
691 int i_type = var_Type( p_obj, psz_var );
692 switch( i_type & VLC_VAR_TYPE )
694 case VLC_VAR_INTEGER:
696 QLabel *label = new QLabel( psz_label, box );
697 QHBoxLayout *hlayout = new QHBoxLayout();
698 hlayout->addWidget( label );
699 int i_val = var_GetInteger( p_obj, psz_var );
700 if( i_type & VLC_VAR_HASCHOICE )
702 QComboBox *combobox = new QComboBox( box );
703 combobox->setObjectName( psz_var );
705 vlc_value_t val2, text2;
706 var_Change( p_obj, psz_var, VLC_VAR_GETCHOICES,
708 for( int j = 0; j < val2.p_list->i_count; j++ )
711 text2.p_list->p_values[j].psz_string,
712 val2.p_list->p_values[j].i_int );
713 if( i_val == val2.p_list->p_values[j].i_int )
714 combobox->setCurrentIndex( j );
716 var_FreeList( &val2, &text2 );
718 CONNECT( combobox, currentIndexChanged( int ), this,
719 ValueChange( int ) );
720 hlayout->addWidget( combobox );
724 QSlider *slider = new QSlider( box );
725 slider->setObjectName( psz_var );
726 slider->setOrientation( Qt::Horizontal );
728 var_Change( p_obj, psz_var, VLC_VAR_GETMIN,
730 slider->setMinimum( val2.i_int );
731 var_Change( p_obj, psz_var, VLC_VAR_GETMAX,
733 slider->setMaximum( val2.i_int );
734 var_Change( p_obj, psz_var, VLC_VAR_GETSTEP,
736 slider->setSingleStep( val2.i_int );
737 slider->setValue( i_val );
739 CONNECT( slider, valueChanged( int ), this,
740 ValueChange( int ) );
741 hlayout->addWidget( slider );
743 layout->addLayout( hlayout );
748 QCheckBox *button = new QCheckBox( psz_label, box );
749 button->setObjectName( psz_var );
750 button->setChecked( var_GetBool( p_obj, psz_var ) );
752 CONNECT( button, clicked( bool ), this,
753 ValueChange( bool ) );
754 layout->addWidget( button );
759 if( i_type & VLC_VAR_ISCOMMAND )
761 QPushButton *button = new QPushButton( psz_label, box );
762 button->setObjectName( psz_var );
764 CONNECT( button, clicked( bool ), this,
765 ValueChange( bool ) );
766 layout->addWidget( button );
770 QLabel *label = new QLabel( psz_label, box );
771 layout->addWidget( label );
776 msg_Warn( p_intf, "Unhandled var type for %s", psz_var );
779 free( name.psz_string );
781 var_FreeList( &val, &text );
782 vlc_object_release( p_obj );
786 msg_Dbg( p_intf, "Couldn't find v4l2 instance" );
791 void ExtV4l2::ValueChange( bool value )
793 ValueChange( (int)value );
796 void ExtV4l2::ValueChange( int value )
798 QObject *s = sender();
799 vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
802 char *psz_var = strdup( qtu( s->objectName() ) );
803 int i_type = var_Type( p_obj, psz_var );
804 switch( i_type & VLC_VAR_TYPE )
806 case VLC_VAR_INTEGER:
807 if( i_type & VLC_VAR_HASCHOICE )
809 QComboBox *combobox = qobject_cast<QComboBox*>( s );
810 value = combobox->itemData( value ).toInt();
812 var_SetInteger( p_obj, psz_var, value );
815 var_SetBool( p_obj, psz_var, value );
818 var_TriggerCallback( p_obj, psz_var );
822 vlc_object_release( p_obj );
826 msg_Warn( p_intf, "Oops, v4l2 object isn't available anymore" );
831 /**********************************************************************
833 **********************************************************************/
835 static const QString band_frequencies[] =
837 " 60 Hz ", " 170 Hz ", " 310 Hz ", " 600 Hz ", " 1 kHz ",
838 " 3 kHz ", " 6 kHz ", " 12 kHz ", " 14 kHz ", " 16 kHz "
841 Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
842 QWidget( _parent ) , p_intf( _p_intf )
844 QFont smallFont = QApplication::font( static_cast<QWidget*>( 0 ) );
845 smallFont.setPointSize( smallFont.pointSize() - 3 );
848 ui.preampLabel->setFont( smallFont );
850 /* Setup of presetsComboBox */
851 presetsComboBox = ui.presetsCombo;
852 CONNECT( presetsComboBox, activated( int ), this, setCorePreset( int ) );
854 /* Add the sliders for the Bands */
855 QGridLayout *grid = new QGridLayout( ui.frame );
856 grid->setMargin( 0 );
857 for( int i = 0 ; i < BANDS ; i++ )
859 bands[i] = new QSlider( Qt::Vertical );
860 bands[i]->setMaximum( 400 );
861 bands[i]->setValue( 200 );
862 CONNECT( bands[i], valueChanged( int ), this, setCoreBands() );
864 band_texts[i] = new QLabel( band_frequencies[i] + "\n0.0dB" );
865 band_texts[i]->setFont( smallFont );
867 grid->addWidget( bands[i], 0, i );
868 grid->addWidget( band_texts[i], 1, i );
871 /* Add the listed presets */
872 for( int i = 0 ; i < NB_PRESETS ; i ++ )
874 presetsComboBox->addItem( qtr( preset_list_text[i] ),
875 QVariant( preset_list[i] ) );
879 BUTTONACT( ui.enableCheck, enable() );
880 BUTTONACT( ui.eq2PassCheck, set2Pass() );
881 CONNECT( ui.preampSlider, valueChanged( int ), this, setPreamp() );
883 /* Do the update from the value of the core */
887 Equalizer::~Equalizer()
891 void Equalizer::clean()
895 /* Write down initial values */
896 void Equalizer::updateUIFromCore()
898 char *psz_af, *psz_pres, *psz_bands;
902 aout_instance_t *p_aout = THEMIM->getAout();
905 psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
906 psz_pres = var_GetString( p_aout, "equalizer-preset" );
907 if( var_GetBool( p_aout, "equalizer-2pass" ) )
908 ui.eq2PassCheck->setChecked( true );
909 f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
910 psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
911 i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
912 vlc_object_release( p_aout );
916 psz_af = config_GetPsz( p_intf, "audio-filter" );
917 psz_pres = config_GetPsz( p_intf, "equalizer-preset" );
918 if( config_GetInt( p_intf, "equalizer-2pass" ) )
919 ui.eq2PassCheck->setChecked( true );
920 f_preamp = config_GetFloat( p_intf, "equalizer-preamp" );
921 psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
922 i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
924 if( psz_af && strstr( psz_af, "equalizer" ) != NULL )
925 ui.enableCheck->setChecked( true );
926 enable( ui.enableCheck->isChecked() );
928 presetsComboBox->setCurrentIndex( i_preset );
930 ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
932 if( psz_bands && strlen( psz_bands ) > 1 )
934 char *psz_bands_orig = psz_bands;
935 for( int i = 0; i < BANDS; i++ )
937 const float f = us_strtod(psz_bands, &psz_bands );
938 bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
939 if( psz_bands == NULL || *psz_bands == '\0' ) break;
941 if( *psz_bands == '\0' ) break;
943 free( psz_bands_orig );
945 else free( psz_bands );
951 /* Functin called when enableButton is toggled */
952 void Equalizer::enable()
954 bool en = ui.enableCheck->isChecked();
955 aout_EnableFilter( THEPL, "equalizer", en );
956 // aout_EnableFilter( THEPL, "upmixer", en );
957 // aout_EnableFilter( THEPL, "vsurround", en );
960 if( presetsComboBox->currentIndex() < 0 )
961 presetsComboBox->setCurrentIndex( 0 );
965 void Equalizer::enable( bool en )
967 ui.eq2PassCheck->setEnabled( en );
968 presetsComboBox->setEnabled( en );
969 ui.presetLabel->setEnabled( en );
970 ui.preampLabel->setEnabled( en );
971 ui.preampSlider->setEnabled( en );
972 for( int i = 0 ; i< BANDS; i++ )
974 bands[i]->setEnabled( en ); band_texts[i]->setEnabled( en );
978 /* Function called when the set2Pass button is activated */
979 void Equalizer::set2Pass()
981 aout_instance_t *p_aout= THEMIM->getAout();
982 bool b_2p = ui.eq2PassCheck->isChecked();
986 var_SetBool( p_aout, "equalizer-2pass", b_2p );
987 vlc_object_release( p_aout );
989 config_PutInt( p_intf, "equalizer-2pass", b_2p );
992 /* Function called when the preamp slider is moved */
993 void Equalizer::setPreamp()
995 const float f = ( float )( ui.preampSlider->value() ) /10 - 20;
996 aout_instance_t *p_aout = THEMIM->getAout();
998 ui.preampLabel->setText( qtr( "Preamp\n" ) + QString::number( f, 'f', 1 )
1002 //delCallbacks( p_aout );
1003 var_SetFloat( p_aout, "equalizer-preamp", f );
1004 //addCallbacks( p_aout );
1005 vlc_object_release( p_aout );
1007 config_PutFloat( p_intf, "equalizer-preamp", f );
1010 void Equalizer::setCoreBands()
1012 /**\todo smoothing */
1015 for( int i = 0; i < BANDS; i++ )
1017 const float f_val = (float)( bands[i]->value() ) / 10 - 20;
1018 QString val = QString("%1").arg( f_val, 5, 'f', 1 );
1020 band_texts[i]->setText( band_frequencies[i] + "\n" + val + "dB" );
1021 values += " " + val;
1023 const char *psz_values = values.toAscii().constData();
1025 aout_instance_t *p_aout = THEMIM->getAout();
1028 //delCallbacks( p_aout );
1029 var_SetString( p_aout, "equalizer-bands", psz_values );
1030 //addCallbacks( p_aout );
1031 vlc_object_release( p_aout );
1035 char * Equalizer::createValuesFromPreset( int i_preset )
1039 /* Create the QString in Qt */
1040 for( int i = 0 ; i< BANDS ;i++ )
1041 values += QString( " %1" ).arg( eqz_preset_10b[i_preset]->f_amp[i] );
1043 /* Convert it to char * */
1044 return strdup( values.toAscii().constData() );
1047 void Equalizer::setCorePreset( int i_preset )
1052 /* Update pre-amplification in the UI */
1053 float f_preamp = eqz_preset_10b[i_preset]->f_preamp;
1054 ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
1055 ui.preampLabel->setText( qtr( "Preamp\n" )
1056 + QString::number( f_preamp, 'f', 1 ) + qtr( "dB" ) );
1058 char *psz_values = createValuesFromPreset( i_preset );
1059 if( !psz_values ) return ;
1061 char *p = psz_values;
1062 for( int i = 0; i < BANDS && *p; i++ )
1064 const float f = us_strtod( p, &p );
1066 bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
1067 band_texts[i]->setText( band_frequencies[i] + "\n"
1068 + QString("%1").arg( f, 5, 'f', 1 ) + "dB" );
1070 p++; /* skip separator */
1073 /* Apply presets to audio output */
1074 aout_instance_t *p_aout= THEMIM->getAout();
1077 var_SetString( p_aout , "equalizer-preset" , preset_list[i_preset] );
1079 var_SetString( p_aout, "equalizer-bands", psz_values );
1080 var_SetFloat( p_aout, "equalizer-preamp",
1081 eqz_preset_10b[i_preset]->f_preamp );
1082 vlc_object_release( p_aout );
1084 config_PutPsz( p_intf, "equalizer-bands", psz_values );
1085 config_PutPsz( p_intf, "equalizer-preset", preset_list[i_preset] );
1086 config_PutFloat( p_intf, "equalizer-preamp",
1087 eqz_preset_10b[i_preset]->f_preamp );
1091 static int PresetCallback( vlc_object_t *p_this, char const *psz_cmd,
1092 vlc_value_t oldval, vlc_value_t newval, void *p_data )
1094 char *psz_preset = newval.psz_string;
1095 Equalizer *eq = ( Equalizer * )p_data;
1096 int i_preset = eq->presetsComboBox->findData( QVariant( psz_preset ) );
1097 eq->presetsComboBox->setCurrentIndex( i_preset );
1101 void Equalizer::delCallbacks( aout_instance_t *p_aout )
1103 //var_DelCallback( p_aout, "equalizer-bands", EqzCallback, this );
1104 //var_DelCallback( p_aout, "equalizer-preamp", EqzCallback, this );
1105 var_DelCallback( p_aout, "equalizer-preset", PresetCallback, this );
1108 void Equalizer::addCallbacks( aout_instance_t *p_aout )
1110 //var_AddCallback( p_aout, "equalizer-bands", EqzCallback, this );
1111 //var_AddCallback( p_aout, "equalizer-preamp", EqzCallback, this );
1112 var_AddCallback( p_aout, "equalizer-preset", PresetCallback, this );
1115 /**********************************************************************
1117 **********************************************************************/
1119 /**********************************************************************
1121 **********************************************************************/
1122 static const char *psz_control_names[] =
1124 "spatializer-roomsize", "spatializer-width",
1125 "spatializer-wet", "spatializer-dry", "spatializer-damp"
1128 Spatializer::Spatializer( intf_thread_t *_p_intf, QWidget *_parent ) :
1129 QWidget( _parent ) , p_intf( _p_intf )
1131 QFont smallFont = QApplication::font( static_cast<QWidget*>( 0 ) );
1132 smallFont.setPointSize( smallFont.pointSize() - 3 );
1134 QGridLayout *layout = new QGridLayout( this );
1135 layout->setMargin( 0 );
1137 enableCheck = new QCheckBox( qtr( "Enable spatializer" ) );
1138 layout->addWidget( enableCheck, 0, 0, 1, NUM_SP_CTRL );
1140 for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
1142 spatCtrl[i] = new QSlider( Qt::Vertical );
1145 spatCtrl[i]->setMaximum( 10 );
1146 spatCtrl[i]->setValue( 2 );
1150 spatCtrl[i]->setMaximum( 10 );
1151 spatCtrl[i]->setValue( 0 );
1152 spatCtrl[i]->setMinimum( -10 );
1154 oldControlVars[i] = spatCtrl[i]->value();
1155 CONNECT( spatCtrl[i], valueChanged( int ), this, setInitValues() );
1156 ctrl_texts[i] = new QLabel( qfu( psz_control_names[i] ) + "\n" );
1157 ctrl_texts[i]->setFont( smallFont );
1158 ctrl_readout[i] = new QLabel( "" );
1159 ctrl_readout[i]->setFont( smallFont );
1160 layout->addWidget( spatCtrl[i], 1, i );
1161 layout->addWidget( ctrl_readout[i], 2, i );
1162 layout->addWidget( ctrl_texts[i], 3, i );
1165 BUTTONACT( enableCheck, enable() );
1167 /* Write down initial values */
1168 aout_instance_t *p_aout = THEMIM->getAout();
1173 psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
1174 for( int i = 0; i < NUM_SP_CTRL ; i++ )
1176 controlVars[i] = var_GetFloat( p_aout, psz_control_names[i] );
1178 vlc_object_release( p_aout );
1182 psz_af = config_GetPsz( p_intf, "audio-filter" );
1183 for( int i = 0; i < NUM_SP_CTRL ; i++ )
1185 controlVars[i] = config_GetFloat( p_intf, psz_control_names[i] );
1188 if( psz_af && strstr( psz_af, "spatializer" ) != NULL )
1189 enableCheck->setChecked( true );
1191 enable( enableCheck->isChecked() );
1192 setValues( controlVars );
1195 Spatializer::~Spatializer()
1199 void Spatializer::enable()
1201 bool en = enableCheck->isChecked();
1202 aout_EnableFilter( VLC_OBJECT( p_intf ), "spatializer",
1203 en ? true : false );
1207 void Spatializer::enable( bool en )
1209 for( int i = 0 ; i< NUM_SP_CTRL; i++ )
1211 spatCtrl[i]->setEnabled( en );
1212 ctrl_texts[i]->setEnabled( en );
1213 ctrl_readout[i]->setEnabled( en );
1216 void Spatializer::setInitValues()
1218 setValues( controlVars );
1221 void Spatializer::setValues( float *controlVars )
1223 aout_instance_t *p_aout = THEMIM->getAout();
1225 for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
1227 float f = (float)( spatCtrl[i]->value() );
1228 ctrl_readout[i]->setText( QString::number( f, 'f', 1 ) );
1232 for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
1234 if( oldControlVars[i] != spatCtrl[i]->value() )
1236 var_SetFloat( p_aout, psz_control_names[i],
1237 ( float )spatCtrl[i]->value() );
1238 config_PutFloat( p_intf, psz_control_names[i],
1239 ( float ) spatCtrl[i]->value() );
1240 oldControlVars[i] = ( float ) spatCtrl[i]->value();
1243 vlc_object_release( p_aout );
1247 void Spatializer::delCallbacks( aout_instance_t *p_aout )
1249 // var_DelCallback( p_aout, "Spatializer-bands", EqzCallback, this );
1250 // var_DelCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
1253 void Spatializer::addCallbacks( aout_instance_t *p_aout )
1255 // var_AddCallback( p_aout, "Spatializer-bands", EqzCallback, this );
1256 // var_AddCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
1259 #include <QToolButton>
1260 #include <QGridLayout>
1262 SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
1263 QWidget( _parent ) , p_intf( _p_intf )
1265 QGroupBox *AVBox, *subsBox;
1267 QToolButton *moinsAV, *plusAV;
1268 QToolButton *moinssubs, *plussubs;
1269 QToolButton *moinssubSpeed, *plussubSpeed;
1271 QToolButton *updateButton;
1273 b_userAction = true;
1275 QGridLayout *mainLayout = new QGridLayout( this );
1278 AVBox = new QGroupBox( qtr( "Audio/Video" ) );
1279 QGridLayout *AVLayout = new QGridLayout( AVBox );
1281 moinsAV = new QToolButton;
1282 moinsAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
1283 moinsAV->setAutoRaise( true );
1284 moinsAV->setText( "-" );
1285 AVLayout->addWidget( moinsAV, 0, 1, 1, 1 );
1287 plusAV = new QToolButton;
1288 plusAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
1289 plusAV->setAutoRaise( true );
1290 plusAV->setText( "+" );
1291 AVLayout->addWidget( plusAV, 0, 3, 1, 1 );
1293 QLabel *AVLabel = new QLabel;
1294 AVLabel->setText( qtr( "Advance of audio over video:" ) );
1295 AVLayout->addWidget( AVLabel, 0, 0, 1, 1 );
1297 AVSpin = new QDoubleSpinBox;
1298 AVSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
1299 AVSpin->setDecimals( 3 );
1300 AVSpin->setMinimum( -100.0 );
1301 AVSpin->setMaximum( 100.0 );
1302 AVSpin->setSingleStep( 0.1 );
1303 AVSpin->setToolTip( qtr( "A positive value means that\n"
1304 "the audio is ahead of the video" ) );
1305 AVSpin->setSuffix( " s" );
1306 AVLayout->addWidget( AVSpin, 0, 2, 1, 1 );
1307 mainLayout->addWidget( AVBox, 1, 0, 1, 5 );
1311 subsBox = new QGroupBox( qtr( "Subtitles/Video" ) );
1312 QGridLayout *subsLayout = new QGridLayout( subsBox );
1314 moinssubs = new QToolButton;
1315 moinssubs->setToolButtonStyle( Qt::ToolButtonTextOnly );
1316 moinssubs->setAutoRaise( true );
1317 moinssubs->setText( "-" );
1318 subsLayout->addWidget( moinssubs, 0, 1, 1, 1 );
1320 plussubs = new QToolButton;
1321 plussubs->setToolButtonStyle( Qt::ToolButtonTextOnly );
1322 plussubs->setAutoRaise( true );
1323 plussubs->setText( "+" );
1324 subsLayout->addWidget( plussubs, 0, 3, 1, 1 );
1326 QLabel *subsLabel = new QLabel;
1327 subsLabel->setText( qtr( "Advance of subtitles over video:" ) );
1328 subsLayout->addWidget( subsLabel, 0, 0, 1, 1 );
1330 subsSpin = new QDoubleSpinBox;
1331 subsSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
1332 subsSpin->setDecimals( 3 );
1333 subsSpin->setMinimum( -100.0 );
1334 subsSpin->setMaximum( 100.0 );
1335 subsSpin->setSingleStep( 0.1 );
1336 subsSpin->setToolTip( qtr( "A positive value means that\n"
1337 "the subtitles are ahead of the video" ) );
1338 subsSpin->setSuffix( " s" );
1339 subsLayout->addWidget( subsSpin, 0, 2, 1, 1 );
1342 moinssubSpeed = new QToolButton;
1343 moinssubSpeed->setToolButtonStyle( Qt::ToolButtonTextOnly );
1344 moinssubSpeed->setAutoRaise( true );
1345 moinssubSpeed->setText( "-" );
1346 subsLayout->addWidget( moinssubSpeed, 1, 1, 1, 1 );
1348 plussubSpeed = new QToolButton;
1349 plussubSpeed->setToolButtonStyle( Qt::ToolButtonTextOnly );
1350 plussubSpeed->setAutoRaise( true );
1351 plussubSpeed->setText( "+" );
1352 subsLayout->addWidget( plussubSpeed, 1, 3, 1, 1 );
1354 QLabel *subSpeedLabel = new QLabel;
1355 subSpeedLabel->setText( qtr( "Speed of the subtitles:" ) );
1356 subsLayout->addWidget( subSpeedLabel, 1, 0, 1, 1 );
1358 subSpeedSpin = new QDoubleSpinBox;
1359 subSpeedSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
1360 subSpeedSpin->setDecimals( 3 );
1361 subSpeedSpin->setMinimum( 1 );
1362 subSpeedSpin->setMaximum( 100 );
1363 subSpeedSpin->setSingleStep( 0.2 );
1364 subSpeedSpin->setSuffix( " fps" );
1365 subsLayout->addWidget( subSpeedSpin, 1, 2, 1, 1 );
1367 mainLayout->addWidget( subsBox, 2, 0, 2, 5 );
1369 updateButton = new QToolButton;
1370 updateButton->setAutoRaise( true );
1371 mainLayout->addWidget( updateButton, 0, 4, 1, 1 );
1374 /* Various Connects */
1375 CONNECT( moinsAV, clicked(), AVSpin, stepDown () );
1376 CONNECT( plusAV, clicked(), AVSpin, stepUp () );
1377 CONNECT( moinssubs, clicked(), subsSpin, stepDown () );
1378 CONNECT( plussubs, clicked(), subsSpin, stepUp () );
1379 CONNECT( moinssubSpeed, clicked(), subSpeedSpin, stepDown () );
1380 CONNECT( plussubSpeed, clicked(), subSpeedSpin, stepUp () );
1381 CONNECT( AVSpin, valueChanged ( double ), this, advanceAudio( double ) ) ;
1382 CONNECT( subsSpin, valueChanged ( double ), this, advanceSubs( double ) ) ;
1383 CONNECT( subSpeedSpin, valueChanged ( double ),
1384 this, adjustSubsSpeed( double ) );
1386 CONNECT( THEMIM->getIM(), synchroChanged(), this, update() );
1387 BUTTON_SET_ACT_I( updateButton, "", update,
1388 qtr( "Force update of this dialog's values" ), update() );
1394 void SyncControls::clean()
1396 b_userAction = false;
1397 AVSpin->setValue( 0.0 );
1398 subsSpin->setValue( 0.0 );
1399 subSpeedSpin->setValue( 1.0 );
1400 b_userAction = true;
1403 void SyncControls::update()
1405 b_userAction = false;
1408 if( THEMIM->getInput() )
1410 i_delay = var_GetTime( THEMIM->getInput(), "audio-delay" );
1411 AVSpin->setValue( ( (double)i_delay ) / 1000000 );
1412 i_delay = var_GetTime( THEMIM->getInput(), "spu-delay" );
1413 subsSpin->setValue( ( (double)i_delay ) / 1000000 );
1414 subSpeedSpin->setValue( var_GetFloat( THEMIM->getInput(), "sub-fps" ) );
1416 b_userAction = true;
1419 void SyncControls::advanceAudio( double f_advance )
1421 if( THEMIM->getInput() && b_userAction )
1423 int64_t i_delay = f_advance * 1000000;
1424 var_SetTime( THEMIM->getInput(), "audio-delay", i_delay );
1428 void SyncControls::advanceSubs( double f_advance )
1430 if( THEMIM->getInput() && b_userAction )
1432 int64_t i_delay = f_advance * 1000000;
1433 var_SetTime( THEMIM->getInput(), "spu-delay", i_delay );
1437 void SyncControls::adjustSubsSpeed( double f_fps )
1439 if( THEMIM->getInput() && b_userAction )
1441 var_SetFloat( THEMIM->getInput(), "sub-fps", f_fps );
1445 /**********************************************************************
1446 * Video filters / Adjust
1447 **********************************************************************/
1449 /**********************************************************************
1450 * Extended playbak controls
1451 **********************************************************************/