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( logoTransparencySlider, valueChanged( int ) )
209 #undef SETUP_VFILTER_OPTION
211 CONNECT( ui.cropTopPx, valueChanged( int ), this, cropChange() );
212 CONNECT( ui.cropBotPx, valueChanged( int ), this, cropChange() );
213 CONNECT( ui.cropLeftPx, valueChanged( int ), this, cropChange() );
214 CONNECT( ui.cropRightPx, valueChanged( int ), this, cropChange() );
215 CONNECT( ui.leftRightCropSync, toggled ( bool ), this, cropChange() );
216 CONNECT( ui.topBotCropSync, toggled ( bool ), this, cropChange() );
217 CONNECT( ui.topBotCropSync, toggled( bool ),
218 ui.cropBotPx, setDisabled( bool ) );
219 CONNECT( ui.leftRightCropSync, toggled( bool ),
220 ui.cropRightPx, setDisabled( bool ) );
223 ExtVideo::~ExtVideo()
227 void ExtVideo::cropChange()
229 if( ui.topBotCropSync->isChecked() )
230 ui.cropBotPx->setValue( ui.cropTopPx->value() );
231 if( ui.leftRightCropSync->isChecked() )
232 ui.cropRightPx->setValue( ui.cropLeftPx->value() );
234 p_vout = THEMIM->getVout();
237 var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
238 var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
239 var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
240 var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
241 vlc_object_release( p_vout );
245 void ExtVideo::clean()
247 ui.cropTopPx->setValue( 0 );
248 ui.cropBotPx->setValue( 0 );
249 ui.cropLeftPx->setValue( 0 );
250 ui.cropRightPx->setValue( 0 );
253 void ExtVideo::ChangeVFiltersString( const char *psz_name, bool b_add )
255 char *psz_parser, *psz_string;
256 const char *psz_filter_type;
258 /* FIXME temporary hack */
259 const char *psz_module_name = psz_name;
260 if( !strcmp( psz_name, "magnify" ) ||
261 !strcmp( psz_name, "puzzle" ) ||
262 !strcmp( psz_name, "logo" ) ||
263 !strcmp( psz_name, "wall" ) ||
264 !strcmp( psz_name, "panoramix" ) ||
265 !strcmp( psz_name, "clone" ) )
266 psz_module_name = "video_filter_wrapper";
268 module_t *p_obj = module_find( psz_module_name );
271 msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name );
275 if( module_provides( p_obj, "video filter" ) )
277 psz_filter_type = "vout-filter";
279 else if( module_provides( p_obj, "video filter2" ) )
281 psz_filter_type = "video-filter";
283 else if( module_provides( p_obj, "sub filter" ) )
285 psz_filter_type = "sub-filter";
289 module_release (p_obj);
290 msg_Err( p_intf, "Unknown video filter type." );
293 module_release (p_obj);
295 psz_string = config_GetPsz( p_intf, psz_filter_type );
297 if( !psz_string ) psz_string = strdup( "" );
299 psz_parser = strstr( psz_string, psz_name );
305 psz_parser = psz_string;
306 if( asprintf( &psz_string, ( *psz_string ) ? "%s:%s" : "%s%s",
307 psz_string, psz_name ) == -1 )
323 if( *( psz_parser + strlen( psz_name ) ) == ':' )
325 memmove( psz_parser, psz_parser + strlen( psz_name ) + 1,
326 strlen( psz_parser + strlen( psz_name ) + 1 ) + 1 );
333 /* Remove trailing : : */
334 if( strlen( psz_string ) > 0 &&
335 *( psz_string + strlen( psz_string ) -1 ) == ':' )
337 *( psz_string + strlen( psz_string ) -1 ) = '\0';
346 /* Vout is not kept, so put that in the config */
347 config_PutPsz( p_intf, psz_filter_type, psz_string );
348 if( !strcmp( psz_filter_type, "video-filter" ) )
349 ui.videoFilterText->setText( psz_string );
350 else if( !strcmp( psz_filter_type, "vout-filter" ) )
351 ui.voutFilterText->setText( psz_string );
352 else if( !strcmp( psz_filter_type, "sub-filter" ) )
353 ui.subpictureFilterText->setText( psz_string );
355 /* Try to set on the fly */
356 p_vout = THEMIM->getVout();
359 if( !strcmp( psz_filter_type, "sub-filter" ) )
360 var_SetString( vout_GetSpu( p_vout ), psz_filter_type, psz_string );
362 var_SetString( p_vout, psz_filter_type, psz_string );
363 vlc_object_release( p_vout );
369 void ExtVideo::updateFilters()
371 QString module = ModuleFromWidgetName( sender() );
373 QCheckBox *checkbox = qobject_cast<QCheckBox*>( sender() );
374 QGroupBox *groupbox = qobject_cast<QGroupBox*>( sender() );
376 ChangeVFiltersString( qtu( module ),
377 checkbox ? checkbox->isChecked()
378 : groupbox->isChecked() );
381 void ExtVideo::initComboBoxItems( QObject *widget )
383 QComboBox *combobox = qobject_cast<QComboBox*>( widget );
384 if( !combobox ) return;
385 QString option = OptionFromWidgetName( widget );
386 module_config_t *p_item = config_FindConfig( VLC_OBJECT( p_intf ),
390 int i_type = p_item->i_type & CONFIG_ITEM;
391 for( int i_index = 0; i_index < p_item->i_list; i_index++ )
393 if( i_type == CONFIG_ITEM_INTEGER
394 || i_type == CONFIG_ITEM_BOOL )
395 combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ),
396 p_item->pi_list[i_index] );
397 else if( i_type == CONFIG_ITEM_STRING )
398 combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ),
399 p_item->ppsz_list[i_index] );
404 msg_Err( p_intf, "Couldn't find option \"%s\".",
409 void ExtVideo::setWidgetValue( QObject *widget )
411 QString module = ModuleFromWidgetName( widget->parent() );
412 //std::cout << "Module name: " << module.toStdString() << std::endl;
413 QString option = OptionFromWidgetName( widget );
414 //std::cout << "Option name: " << option.toStdString() << std::endl;
416 vlc_object_t *p_obj = ( vlc_object_t * )
417 vlc_object_find_name( p_intf->p_libvlc,
427 "Module instance %s not found, looking in config values.",
430 i_type = config_GetType( p_intf, qtu( option ) ) & VLC_VAR_CLASS;
433 case VLC_VAR_INTEGER:
435 val.i_int = config_GetInt( p_intf, qtu( option ) );
438 val.f_float = config_GetFloat( p_intf, qtu( option ) );
441 val.psz_string = config_GetPsz( p_intf, qtu( option ) );
447 i_type = var_Type( p_obj, qtu( option ) ) & VLC_VAR_CLASS;
448 var_Get( p_obj, qtu( option ), &val );
449 vlc_object_release( p_obj );
452 /* Try to cast to all the widgets we're likely to encounter. Only
453 * one of the casts is expected to work. */
454 QSlider *slider = qobject_cast<QSlider*> ( widget );
455 QCheckBox *checkbox = qobject_cast<QCheckBox*> ( widget );
456 QSpinBox *spinbox = qobject_cast<QSpinBox*> ( widget );
457 QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( widget );
458 QDial *dial = qobject_cast<QDial*> ( widget );
459 QLineEdit *lineedit = qobject_cast<QLineEdit*> ( widget );
460 QComboBox *combobox = qobject_cast<QComboBox*> ( widget );
462 if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
464 if( slider ) slider->setValue( val.i_int );
465 else if( checkbox ) checkbox->setCheckState( val.i_int? Qt::Checked
467 else if( spinbox ) spinbox->setValue( val.i_int );
468 else if( dial ) dial->setValue( ( 540-val.i_int )%360 );
472 snprintf( str, sizeof(str), "%06X", val.i_int );
473 lineedit->setText( str );
475 else if( combobox ) combobox->setCurrentIndex(
476 combobox->findData( val.i_int ) );
477 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
479 else if( i_type == VLC_VAR_FLOAT )
481 if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
482 else if( doublespinbox ) doublespinbox->setValue( val.f_float );
483 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
485 else if( i_type == VLC_VAR_STRING )
487 if( lineedit ) lineedit->setText( qfu( val.psz_string ) );
488 else if( combobox ) combobox->setCurrentIndex(
489 combobox->findData( qfu( val.psz_string ) ) );
490 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
491 free( val.psz_string );
495 "Module %s's %s variable is of an unsupported type ( %d )",
501 void ExtVideo::updateFilterOptions()
503 QString module = ModuleFromWidgetName( sender()->parent() );
504 //std::cout << "Module name: " << module.toStdString() << std::endl;
505 QString option = OptionFromWidgetName( sender() );
506 //std::cout << "Option name: " << option.toStdString() << std::endl;
508 vlc_object_t *p_obj = ( vlc_object_t * )
509 vlc_object_find_name( p_intf->p_libvlc,
516 msg_Warn( p_intf, "Module %s not found. You'll need to restart the filter to take the change into account.", qtu( module ) );
517 i_type = config_GetType( p_intf, qtu( option ) );
518 b_is_command = false;
522 i_type = var_Type( p_obj, qtu( option ) );
523 b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
528 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.",
531 /* FIXME: restart automatically somewhere near the end of this function */
534 /* Try to cast to all the widgets we're likely to encounter. Only
535 * one of the casts is expected to work. */
536 QSlider *slider = qobject_cast<QSlider*> ( sender() );
537 QCheckBox *checkbox = qobject_cast<QCheckBox*> ( sender() );
538 QSpinBox *spinbox = qobject_cast<QSpinBox*> ( sender() );
539 QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( sender() );
540 QDial *dial = qobject_cast<QDial*> ( sender() );
541 QLineEdit *lineedit = qobject_cast<QLineEdit*> ( sender() );
542 QComboBox *combobox = qobject_cast<QComboBox*> ( sender() );
544 i_type &= VLC_VAR_CLASS;
545 if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL )
548 if( slider ) i_int = slider->value();
549 else if( checkbox ) i_int = checkbox->checkState() == Qt::Checked;
550 else if( spinbox ) i_int = spinbox->value();
551 else if( dial ) i_int = ( 540-dial->value() )%360;
552 else if( lineedit ) i_int = lineedit->text().toInt( NULL,16 );
553 else if( combobox ) i_int = combobox->itemData( combobox->currentIndex() ).toInt();
554 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
555 config_PutInt( p_intf, qtu( option ), i_int );
558 if( i_type == VLC_VAR_INTEGER )
559 var_SetInteger( p_obj, qtu( option ), i_int );
561 var_SetBool( p_obj, qtu( option ), i_int );
564 else if( i_type == VLC_VAR_FLOAT )
567 if( slider ) f_float = ( double )slider->value()
568 / ( double )slider->tickInterval(); /* hack alert! */
569 else if( doublespinbox ) f_float = doublespinbox->value();
570 else if( lineedit ) f_float = lineedit->text().toDouble();
571 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
572 config_PutFloat( p_intf, qtu( option ), f_float );
574 var_SetFloat( p_obj, qtu( option ), f_float );
576 else if( i_type == VLC_VAR_STRING )
578 char *psz_string = NULL;
579 if( lineedit ) psz_string = strdup( qtu( lineedit->text() ) );
580 else if( combobox ) psz_string = strdup( qtu( combobox->itemData(
581 combobox->currentIndex() ).toString() ) );
582 else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ );
583 config_PutPsz( p_intf, qtu( option ), psz_string );
585 var_SetString( p_obj, qtu( option ), psz_string );
590 "Module %s's %s variable is of an unsupported type ( %d )",
595 if( p_obj ) vlc_object_release( p_obj );
599 void ExtVideo::gotoConf( QObject* src )
601 #define SHOWCONF( module ) \
602 if( src->objectName().contains( module ) ) \
604 PrefsDialog::getInstance( p_intf )->showModulePrefs( module ); \
608 SHOWCONF( "magnify" );
610 SHOWCONF( "ripple" );
611 SHOWCONF( "invert" );
612 SHOWCONF( "puzzle" );
614 SHOWCONF( "gradient" );
615 SHOWCONF( "colorthres" )
619 /**********************************************************************
621 **********************************************************************/
623 ExtV4l2::ExtV4l2( intf_thread_t *_p_intf, QWidget *_parent )
624 : QWidget( _parent ), p_intf( _p_intf )
628 BUTTONACT( ui.refresh, Refresh() );
638 void ExtV4l2::showEvent( QShowEvent *event )
640 QWidget::showEvent( event );
644 void ExtV4l2::Refresh( void )
646 vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
650 ui.vboxLayout->removeWidget( box );
656 vlc_value_t val, text, name;
657 int i_ret = var_Change( p_obj, "controls", VLC_VAR_GETCHOICES,
661 msg_Err( p_intf, "Oops, v4l2 object doesn't have a 'controls' variable." );
663 vlc_object_release( p_obj );
667 box = new QGroupBox( this );
668 ui.vboxLayout->addWidget( box );
669 QVBoxLayout *layout = new QVBoxLayout( box );
670 box->setLayout( layout );
672 for( int i = 0; i < val.p_list->i_count; i++ )
674 const char *psz_var = text.p_list->p_values[i].psz_string;
675 var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &name, NULL );
676 const char *psz_label = name.psz_string;
677 msg_Dbg( p_intf, "v4l2 control \"%x\": %s (%s)",
678 val.p_list->p_values[i].i_int, psz_var, name.psz_string );
680 int i_type = var_Type( p_obj, psz_var );
681 switch( i_type & VLC_VAR_TYPE )
683 case VLC_VAR_INTEGER:
685 QLabel *label = new QLabel( psz_label, box );
686 QHBoxLayout *hlayout = new QHBoxLayout();
687 hlayout->addWidget( label );
688 int i_val = var_GetInteger( p_obj, psz_var );
689 if( i_type & VLC_VAR_HASCHOICE )
691 QComboBox *combobox = new QComboBox( box );
692 combobox->setObjectName( psz_var );
694 vlc_value_t val2, text2;
695 var_Change( p_obj, psz_var, VLC_VAR_GETCHOICES,
697 for( int j = 0; j < val2.p_list->i_count; j++ )
700 text2.p_list->p_values[j].psz_string,
701 val2.p_list->p_values[j].i_int );
702 if( i_val == val2.p_list->p_values[j].i_int )
703 combobox->setCurrentIndex( j );
705 var_FreeList( &val2, &text2 );
707 CONNECT( combobox, currentIndexChanged( int ), this,
708 ValueChange( int ) );
709 hlayout->addWidget( combobox );
713 QSlider *slider = new QSlider( box );
714 slider->setObjectName( psz_var );
715 slider->setOrientation( Qt::Horizontal );
717 var_Change( p_obj, psz_var, VLC_VAR_GETMIN,
719 slider->setMinimum( val2.i_int );
720 var_Change( p_obj, psz_var, VLC_VAR_GETMAX,
722 slider->setMaximum( val2.i_int );
723 var_Change( p_obj, psz_var, VLC_VAR_GETSTEP,
725 slider->setSingleStep( val2.i_int );
726 slider->setValue( i_val );
728 CONNECT( slider, valueChanged( int ), this,
729 ValueChange( int ) );
730 hlayout->addWidget( slider );
732 layout->addLayout( hlayout );
737 QCheckBox *button = new QCheckBox( psz_label, box );
738 button->setObjectName( psz_var );
739 button->setChecked( var_GetBool( p_obj, psz_var ) );
741 CONNECT( button, clicked( bool ), this,
742 ValueChange( bool ) );
743 layout->addWidget( button );
748 if( i_type & VLC_VAR_ISCOMMAND )
750 QPushButton *button = new QPushButton( psz_label, box );
751 button->setObjectName( psz_var );
753 CONNECT( button, clicked( bool ), this,
754 ValueChange( bool ) );
755 layout->addWidget( button );
759 QLabel *label = new QLabel( psz_label, box );
760 layout->addWidget( label );
765 msg_Warn( p_intf, "Unhandled var type for %s", psz_var );
768 free( name.psz_string );
770 var_FreeList( &val, &text );
771 vlc_object_release( p_obj );
775 msg_Dbg( p_intf, "Couldn't find v4l2 instance" );
780 void ExtV4l2::ValueChange( bool value )
782 ValueChange( (int)value );
785 void ExtV4l2::ValueChange( int value )
787 QObject *s = sender();
788 vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
791 char *psz_var = strdup( qtu( s->objectName() ) );
792 int i_type = var_Type( p_obj, psz_var );
793 switch( i_type & VLC_VAR_TYPE )
795 case VLC_VAR_INTEGER:
796 if( i_type & VLC_VAR_HASCHOICE )
798 QComboBox *combobox = qobject_cast<QComboBox*>( s );
799 value = combobox->itemData( value ).toInt();
801 var_SetInteger( p_obj, psz_var, value );
804 var_SetBool( p_obj, psz_var, value );
807 var_TriggerCallback( p_obj, psz_var );
811 vlc_object_release( p_obj );
815 msg_Warn( p_intf, "Oops, v4l2 object isn't available anymore" );
820 /**********************************************************************
822 **********************************************************************/
824 static const QString band_frequencies[] =
826 " 60 Hz ", " 170 Hz ", " 310 Hz ", " 600 Hz ", " 1 kHz ",
827 " 3 kHz ", " 6 kHz ", " 12 kHz ", " 14 kHz ", " 16 kHz "
830 Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
831 QWidget( _parent ) , p_intf( _p_intf )
833 QFont smallFont = QApplication::font( static_cast<QWidget*>( 0 ) );
834 smallFont.setPointSize( smallFont.pointSize() - 3 );
837 ui.preampLabel->setFont( smallFont );
839 /* Setup of presetsComboBox */
840 presetsComboBox = ui.presetsCombo;
841 CONNECT( presetsComboBox, currentIndexChanged( int ),
842 this, updateUISliderValues( int ) );
843 CONNECT( presetsComboBox, activated( int ), this, setCorePreset( int ) );
845 /* Add the sliders for the Bands */
846 QGridLayout *grid = new QGridLayout( ui.frame );
847 grid->setMargin( 0 );
848 for( int i = 0 ; i < BANDS ; i++ )
850 bands[i] = new QSlider( Qt::Vertical );
851 bands[i]->setMaximum( 400 );
852 bands[i]->setValue( 200 );
853 CONNECT( bands[i], valueChanged( int ), this, setCoreBands() );
855 band_texts[i] = new QLabel( band_frequencies[i] + "\n0.0dB" );
856 band_texts[i]->setFont( smallFont );
858 grid->addWidget( bands[i], 0, i );
859 grid->addWidget( band_texts[i], 1, i );
862 /* Add the listed presets */
863 for( int i = 0 ; i < NB_PRESETS ; i ++ )
865 presetsComboBox->addItem( qtr( preset_list_text[i] ),
866 QVariant( preset_list[i] ) );
870 BUTTONACT( ui.enableCheck, enable() );
871 BUTTONACT( ui.eq2PassCheck, set2Pass() );
872 CONNECT( ui.preampSlider, valueChanged( int ), this, setPreamp() );
874 /* Do the update from the value of the core */
878 Equalizer::~Equalizer()
882 void Equalizer::clean()
886 /* Write down initial values */
887 void Equalizer::updateUIFromCore()
889 char *psz_af, *psz_pres, *psz_bands;
893 aout_instance_t *p_aout = THEMIM->getAout();
896 psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
897 psz_pres = var_GetString( p_aout, "equalizer-preset" );
898 if( var_GetBool( p_aout, "equalizer-2pass" ) )
899 ui.eq2PassCheck->setChecked( true );
900 f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
901 psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
902 i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
903 vlc_object_release( p_aout );
907 psz_af = config_GetPsz( p_intf, "audio-filter" );
908 psz_pres = config_GetPsz( p_intf, "equalizer-preset" );
909 if( config_GetInt( p_intf, "equalizer-2pass" ) )
910 ui.eq2PassCheck->setChecked( true );
911 f_preamp = config_GetFloat( p_intf, "equalizer-preamp" );
912 psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
913 i_preset = presetsComboBox->findData( QVariant( psz_pres ) );
915 if( psz_af && strstr( psz_af, "equalizer" ) != NULL )
916 ui.enableCheck->setChecked( true );
917 enable( ui.enableCheck->isChecked() );
919 presetsComboBox->setCurrentIndex( i_preset );
921 ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
923 if( psz_bands && strlen( psz_bands ) > 1 )
925 char *psz_bands_orig = psz_bands;
926 for( int i = 0; i < BANDS; i++ )
928 const float f = us_strtod(psz_bands, &psz_bands );
929 bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
930 if( psz_bands == NULL || *psz_bands == '\0' ) break;
932 if( *psz_bands == '\0' ) break;
934 free( psz_bands_orig );
936 else free( psz_bands );
942 /* Functin called when enableButton is toggled */
943 void Equalizer::enable()
945 bool en = ui.enableCheck->isChecked();
946 aout_EnableFilter( THEPL, "equalizer", en );
947 // aout_EnableFilter( THEPL, "upmixer", en );
948 // aout_EnableFilter( THEPL, "vsurround", en );
951 if( presetsComboBox->currentIndex() < 0 )
952 presetsComboBox->setCurrentIndex( 0 );
956 void Equalizer::enable( bool en )
958 ui.eq2PassCheck->setEnabled( en );
959 presetsComboBox->setEnabled( en );
960 ui.presetLabel->setEnabled( en );
961 ui.preampLabel->setEnabled( en );
962 ui.preampSlider->setEnabled( en );
963 for( int i = 0 ; i< BANDS; i++ )
965 bands[i]->setEnabled( en ); band_texts[i]->setEnabled( en );
969 /* Function called when the set2Pass button is activated */
970 void Equalizer::set2Pass()
972 aout_instance_t *p_aout= THEMIM->getAout();
973 bool b_2p = ui.eq2PassCheck->isChecked();
977 var_SetBool( p_aout, "equalizer-2pass", b_2p );
978 vlc_object_release( p_aout );
980 config_PutInt( p_intf, "equalizer-2pass", b_2p );
983 /* Function called when the preamp slider is moved */
984 void Equalizer::setPreamp()
986 const float f = ( float )( ui.preampSlider->value() ) /10 - 20;
987 aout_instance_t *p_aout = THEMIM->getAout();
989 ui.preampLabel->setText( qtr( "Preamp\n" ) + QString::number( f, 'f', 1 )
993 //delCallbacks( p_aout );
994 var_SetFloat( p_aout, "equalizer-preamp", f );
995 //addCallbacks( p_aout );
996 vlc_object_release( p_aout );
998 config_PutFloat( p_intf, "equalizer-preamp", f );
1001 void Equalizer::setCoreBands()
1003 /**\todo smoothing */
1006 for( int i = 0; i < BANDS; i++ )
1008 const float f_val = (float)( bands[i]->value() ) / 10 - 20;
1009 QString val = QString("%1").arg( f_val, 5, 'f', 1 );
1011 band_texts[i]->setText( band_frequencies[i] + "\n" + val + "dB" );
1012 values += " " + val;
1014 const char *psz_values = values.toAscii().constData();
1016 aout_instance_t *p_aout = THEMIM->getAout();
1019 //delCallbacks( p_aout );
1020 var_SetString( p_aout, "equalizer-bands", psz_values );
1021 //addCallbacks( p_aout );
1022 vlc_object_release( p_aout );
1026 void Equalizer::updateUISliderValues( int i_preset )
1028 if( i_preset < 0 ) return;
1030 char *p = createValuesFromPreset( i_preset );
1032 float f_preamp = eqz_preset_10b[i_preset]->f_preamp;
1036 for( int i = 0; i < BANDS; i++ )
1038 const float f = us_strtod(p, &p );
1040 bands[i]->setValue( (int)( ( f + 20 ) * 10 ) );
1042 band_texts[i]->setText( band_frequencies[i] + "\n"
1043 + QString("%1").arg( f, 5, 'f', 1 ) + "dB" );
1044 if( p == NULL || *p == '\0' )
1052 ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
1053 ui.preampLabel->setText( qtr( "Preamp\n" )
1054 + QString::number( f_preamp, 'f', 1 ) + qtr( "dB" ) );
1057 char * Equalizer::createValuesFromPreset( int i_preset )
1061 /* Create the QString in Qt */
1062 for( int i = 0 ; i< BANDS ;i++ )
1063 values += QString( " %1" ).arg( eqz_preset_10b[i_preset]->f_amp[i] );
1065 /* Convert it to char * */
1066 return strdup( values.toAscii().constData() );
1069 void Equalizer::setCorePreset( int i_preset )
1071 char *psz_values = createValuesFromPreset( i_preset );
1072 if( !psz_values ) return ;
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 **********************************************************************/