Changeset e2e6f592915ef9d8c25bfba133ae0f9455a93f94

Show
Ignore:
Timestamp:
06/10/07 15:41:27 (1 year ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1191678087 +0000
git-parent:

[d0f00ee670c147f64e39d552767aa4924a77126a]

git-author:
Jean-Baptiste Kempf <jb@videolan.org> 1191678087 +0000
Message:

Qt4 - enable and modify the spatializer widget. Don't use a ui for a QCheckbox and a QFrame.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/components/extended_panels.cpp

    rd1503b1 re2e6f59  
    22 * extended_panels.cpp : Extended controls panels 
    33 **************************************************************************** 
    4  * Copyright (C) 2006-2007 the VideoLAN team 
     4 * Copyright ( C ) 2006-2007 the VideoLAN team 
    55 * $Id$ 
    66 * 
     
    1111 * it under the terms of the GNU General Public License as published by 
    1212 * the Free Software Foundation; either version 2 of the License, or 
    13  * (at your option) any later version. 
     13 * ( at your option ) any later version. 
    1414 * 
    1515 * This program is distributed in the hope that it will be useful, 
     
    4848{ 
    4949public: 
    50     ConfClickHandler( intf_thread_t *_p_intf, ExtVideo *_e ) : QObject (_e) { 
     50    ConfClickHandler( intf_thread_t *_p_intf, ExtVideo *_e ) : QObject ( _e ) { 
    5151        e = _e; p_intf = _p_intf; 
    5252    } 
     
    6969QString ModuleFromWidgetName( QObject *obj ) 
    7070{ 
    71     return obj->objectName().replace("Enable",""); 
     71    return obj->objectName().replace( "Enable","" ); 
    7272} 
    7373 
     
    9696#define SETUP_VFILTER( widget ) \ 
    9797    { \ 
    98         vlc_object_t *p_obj = (vlc_object_t *) \ 
     98        vlc_object_t *p_obj = ( vlc_object_t * ) \ 
    9999            vlc_object_find_name( p_intf->p_libvlc, \ 
    100100                                  #widget, \ 
    101101                                  FIND_CHILD ); \ 
    102         QCheckBox *checkbox = qobject_cast<QCheckBox*>(ui.widget##Enable); \ 
    103         QGroupBox *groupbox = qobject_cast<QGroupBox*>(ui.widget##Enable); \ 
     102        QCheckBox *checkbox = qobject_cast<QCheckBox*>( ui.widget##Enable ); \ 
     103        QGroupBox *groupbox = qobject_cast<QGroupBox*>( ui.widget##Enable ); \ 
    104104        if( p_obj ) \ 
    105105        { \ 
     
    121121 
    122122    SETUP_VFILTER( adjust ) 
    123     SETUP_VFILTER_OPTION( hueSlider, valueChanged(int) ) 
    124     SETUP_VFILTER_OPTION( contrastSlider, valueChanged(int) ) 
    125     SETUP_VFILTER_OPTION( brightnessSlider, valueChanged(int) ) 
    126     SETUP_VFILTER_OPTION( saturationSlider, valueChanged(int) ) 
    127     SETUP_VFILTER_OPTION( gammaSlider, valueChanged(int) ) 
    128     SETUP_VFILTER_OPTION( brightnessThresholdCheck, stateChanged(int) ) 
     123    SETUP_VFILTER_OPTION( hueSlider, valueChanged( int ) ) 
     124    SETUP_VFILTER_OPTION( contrastSlider, valueChanged( int ) ) 
     125    SETUP_VFILTER_OPTION( brightnessSlider, valueChanged( int ) ) 
     126    SETUP_VFILTER_OPTION( saturationSlider, valueChanged( int ) ) 
     127    SETUP_VFILTER_OPTION( gammaSlider, valueChanged( int ) ) 
     128    SETUP_VFILTER_OPTION( brightnessThresholdCheck, stateChanged( int ) ) 
    129129 
    130130    SETUP_VFILTER( extract ) 
    131     SETUP_VFILTER_OPTION( extractComponentText, textChanged(QString) ) 
     131    SETUP_VFILTER_OPTION( extractComponentText, textChanged( QString ) ) 
    132132 
    133133    SETUP_VFILTER( colorthres ) 
    134     SETUP_VFILTER_OPTION( colorthresColorText, textChanged(QString) ) 
    135     SETUP_VFILTER_OPTION( colorthresSaturationthresSlider, valueChanged(int) ) 
    136     SETUP_VFILTER_OPTION( colorthresSimilaritythresSlider, valueChanged(int) ) 
     134    SETUP_VFILTER_OPTION( colorthresColorText, textChanged( QString ) ) 
     135    SETUP_VFILTER_OPTION( colorthresSaturationthresSlider, valueChanged( int ) ) 
     136    SETUP_VFILTER_OPTION( colorthresSimilaritythresSlider, valueChanged( int ) ) 
    137137 
    138138    SETUP_VFILTER( invert ) 
    139139 
    140140    SETUP_VFILTER( gradient ) 
    141     SETUP_VFILTER_OPTION( gradientModeCombo, currentIndexChanged(QString) ) 
    142     SETUP_VFILTER_OPTION( gradientTypeCheck, stateChanged(int) ) 
    143     SETUP_VFILTER_OPTION( gradientCartoonCheck, stateChanged(int) ) 
     141    SETUP_VFILTER_OPTION( gradientModeCombo, currentIndexChanged( QString ) ) 
     142    SETUP_VFILTER_OPTION( gradientTypeCheck, stateChanged( int ) ) 
     143    SETUP_VFILTER_OPTION( gradientCartoonCheck, stateChanged( int ) ) 
    144144 
    145145    SETUP_VFILTER( motionblur ) 
    146     SETUP_VFILTER_OPTION( blurFactorSlider, valueChanged(int) ) 
     146    SETUP_VFILTER_OPTION( blurFactorSlider, valueChanged( int ) ) 
    147147 
    148148    SETUP_VFILTER( motiondetect ) 
     
    153153 
    154154    SETUP_VFILTER( sharpen ) 
    155     SETUP_VFILTER_OPTION( sharpenSigmaSlider, valueChanged(int) ) 
     155    SETUP_VFILTER_OPTION( sharpenSigmaSlider, valueChanged( int ) ) 
    156156 
    157157    SETUP_VFILTER( ripple ) 
     
    160160 
    161161    SETUP_VFILTER( transform ) 
    162     SETUP_VFILTER_OPTION( transformTypeCombo, currentIndexChanged(QString) ) 
     162    SETUP_VFILTER_OPTION( transformTypeCombo, currentIndexChanged( QString ) ) 
    163163 
    164164    SETUP_VFILTER( rotate ) 
    165     SETUP_VFILTER_OPTION( rotateAngleDial, valueChanged(int) ) 
     165    SETUP_VFILTER_OPTION( rotateAngleDial, valueChanged( int ) ) 
    166166    ui.rotateAngleDial->setWrapping( true ); 
    167167    ui.rotateAngleDial->setNotchesVisible( true ); 
    168168 
    169169    SETUP_VFILTER( puzzle ) 
    170     SETUP_VFILTER_OPTION( puzzleRowsSpin, valueChanged(int) ) 
    171     SETUP_VFILTER_OPTION( puzzleColsSpin, valueChanged(int) ) 
    172     SETUP_VFILTER_OPTION( puzzleBlackSlotCheck, stateChanged(int) ) 
     170    SETUP_VFILTER_OPTION( puzzleRowsSpin, valueChanged( int ) ) 
     171    SETUP_VFILTER_OPTION( puzzleColsSpin, valueChanged( int ) ) 
     172    SETUP_VFILTER_OPTION( puzzleBlackSlotCheck, stateChanged( int ) ) 
    173173 
    174174    SETUP_VFILTER( magnify ) 
    175175 
    176176    SETUP_VFILTER( clone ) 
    177     SETUP_VFILTER_OPTION( cloneCountSpin, valueChanged(int) ) 
     177    SETUP_VFILTER_OPTION( cloneCountSpin, valueChanged( int ) ) 
    178178 
    179179    SETUP_VFILTER( wall ) 
    180     SETUP_VFILTER_OPTION( wallRowsSpin, valueChanged(int) ) 
    181     SETUP_VFILTER_OPTION( wallColsSpin, valueChanged(int) ) 
     180    SETUP_VFILTER_OPTION( wallRowsSpin, valueChanged( int ) ) 
     181    SETUP_VFILTER_OPTION( wallColsSpin, valueChanged( int ) ) 
    182182 
    183183    SETUP_VFILTER( erase ) 
    184184    SETUP_VFILTER_OPTION( eraseMaskText, editingFinished() ) 
    185     SETUP_VFILTER_OPTION( eraseYSpin, valueChanged(int) ) 
    186     SETUP_VFILTER_OPTION( eraseXSpin, valueChanged(int) ) 
     185    SETUP_VFILTER_OPTION( eraseYSpin, valueChanged( int ) ) 
     186    SETUP_VFILTER_OPTION( eraseXSpin, valueChanged( int ) ) 
    187187 
    188188    SETUP_VFILTER( marq ) 
    189     SETUP_VFILTER_OPTION( marqMarqueeText, textChanged(QString) ) 
    190     SETUP_VFILTER_OPTION( marqPositionCombo, currentIndexChanged(QString) ) 
     189    SETUP_VFILTER_OPTION( marqMarqueeText, textChanged( QString ) ) 
     190    SETUP_VFILTER_OPTION( marqPositionCombo, currentIndexChanged( QString ) ) 
    191191 
    192192    SETUP_VFILTER( logo ) 
    193193    SETUP_VFILTER_OPTION( logoFileText, editingFinished() ) 
    194     SETUP_VFILTER_OPTION( logoYSpin, valueChanged(int) ) 
    195     SETUP_VFILTER_OPTION( logoXSpin, valueChanged(int) ) 
    196     SETUP_VFILTER_OPTION( logoTransparencySlider, valueChanged(int) ) 
     194    SETUP_VFILTER_OPTION( logoYSpin, valueChanged( int ) ) 
     195    SETUP_VFILTER_OPTION( logoXSpin, valueChanged( int ) ) 
     196    SETUP_VFILTER_OPTION( logoTransparencySlider, valueChanged( int ) ) 
    197197 
    198198#undef SETUP_VFILTER 
     
    241241    psz_string = config_GetPsz( p_intf, psz_filter_type ); 
    242242 
    243     if( !psz_string ) psz_string = strdup(""); 
     243    if( !psz_string ) psz_string = strdup( "" ); 
    244244 
    245245    psz_parser = strstr( psz_string, psz_name ); 
     
    250250        { 
    251251            psz_parser = psz_string; 
    252             asprintf( &psz_string, (*psz_string) ? "%s:%s" : "%s%s", 
     252            asprintf( &psz_string, ( *psz_string ) ? "%s:%s" : "%s%s", 
    253253                            psz_string, psz_name ); 
    254254            free( psz_parser ); 
     
    263263        if( psz_parser ) 
    264264        { 
    265             if( *(psz_parser + strlen(psz_name)) == ':' ) 
     265            if( *( psz_parser + strlen( psz_name ) ) == ':' ) 
    266266            { 
    267                 memmove( psz_parser, psz_parser + strlen(psz_name) + 1, 
    268                          strlen(psz_parser + strlen(psz_name) + 1 ) + 1 ); 
     267                memmove( psz_parser, psz_parser + strlen( psz_name ) + 1, 
     268                         strlen( psz_parser + strlen( psz_name ) + 1 ) + 1 ); 
    269269            } 
    270270            else 
     
    296296 
    297297    /* Try to set on the fly */ 
    298     p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, 
     298    p_vout = ( vout_thread_t * )vlc_object_find( p_intf, VLC_OBJECT_VOUT, 
    299299                                              FIND_ANYWHERE ); 
    300300    if( p_vout ) 
     
    315315    //std::cout << "Module name: " << module.toStdString() << std::endl; 
    316316 
    317     QCheckBox *checkbox = qobject_cast<QCheckBox*>(sender()); 
    318     QGroupBox *groupbox = qobject_cast<QGroupBox*>(sender()); 
    319  
    320     ChangeVFiltersString( qtu(module), 
     317    QCheckBox *checkbox = qobject_cast<QCheckBox*>( sender() ); 
     318    QGroupBox *groupbox = qobject_cast<QGroupBox*>( sender() ); 
     319 
     320    ChangeVFiltersString( qtu( module ), 
    321321                          checkbox ? checkbox->isChecked() 
    322322                                   : groupbox->isChecked() ); 
     
    325325void ExtVideo::initComboBoxItems( QObject *widget ) 
    326326{ 
    327     QComboBox *combobox = qobject_cast<QComboBox*>(widget); 
     327    QComboBox *combobox = qobject_cast<QComboBox*>( widget ); 
    328328    if( !combobox ) return; 
    329329    QString option = OptionFromWidgetName( widget ); 
    330     module_config_t *p_item = config_FindConfig( VLC_OBJECT(p_intf), 
     330    module_config_t *p_item = config_FindConfig( VLC_OBJECT( p_intf ), 
    331331                                                 option.toStdString().c_str() ); 
    332332    if( p_item ) 
     
    337337            if( i_type == CONFIG_ITEM_INTEGER 
    338338             || i_type == CONFIG_ITEM_BOOL ) 
    339                 combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ), p_item->pi_list[i_index] ); 
     339                combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ), 
     340                                   p_item->pi_list[i_index] ); 
    340341            else if( i_type == CONFIG_ITEM_STRING ) 
    341                 combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ), p_item->ppsz_list[i_index] ); 
     342                combobox->addItem( qfu( p_item->ppsz_list_text[i_index] ), 
     343                                   p_item->ppsz_list[i_index] ); 
    342344        } 
    343345    } 
     
    356358    //std::cout << "Option name: " << option.toStdString() << std::endl; 
    357359 
    358     vlc_object_t *p_obj = (vlc_object_t *
     360    vlc_object_t *p_obj = ( vlc_object_t *
    359361        vlc_object_find_name( p_intf->p_libvlc, 
    360362                              module.toStdString().c_str(), 
     
    394396    /* Try to cast to all the widgets we're likely to encounter. Only 
    395397     * one of the casts is expected to work. */ 
    396     QSlider        *slider        = qobject_cast<QSlider*>       (widget); 
    397     QCheckBox      *checkbox      = qobject_cast<QCheckBox*>     (widget); 
    398     QSpinBox       *spinbox       = qobject_cast<QSpinBox*>      (widget); 
    399     QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>(widget); 
    400     QDial          *dial          = qobject_cast<QDial*>         (widget); 
    401     QLineEdit      *lineedit      = qobject_cast<QLineEdit*>     (widget); 
    402     QComboBox      *combobox      = qobject_cast<QComboBox*>     (widget); 
     398    QSlider        *slider        = qobject_cast<QSlider*>       ( widget ); 
     399    QCheckBox      *checkbox      = qobject_cast<QCheckBox*>     ( widget ); 
     400    QSpinBox       *spinbox       = qobject_cast<QSpinBox*>      ( widget ); 
     401    QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( widget ); 
     402    QDial          *dial          = qobject_cast<QDial*>         ( widget ); 
     403    QLineEdit      *lineedit      = qobject_cast<QLineEdit*>     ( widget ); 
     404    QComboBox      *combobox      = qobject_cast<QComboBox*>     ( widget ); 
    403405 
    404406    if( i_type == VLC_VAR_INTEGER || i_type == VLC_VAR_BOOL ) 
     
    409411                                                              : Qt::Unchecked ); 
    410412        else if( spinbox )  spinbox->setValue( val.i_int ); 
    411         else if( dial )     dial->setValue( (540-val.i_int)%360 ); 
     413        else if( dial )     dial->setValue( ( 540-val.i_int )%360 ); 
    412414        else if( lineedit ) 
    413415        { 
     
    416418            lineedit->setText( str ); 
    417419        } 
    418         else if( combobox ) combobox->setCurrentIndex( 
     420        else if( combobox ) combobox->setCurrentIndex(  
    419421                            combobox->findData( val.i_int ) ); 
    420422        else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ ); 
     
    423425    { 
    424426        double f_float = 0; 
    425         if( slider ) slider->setValue( (int)(val.f_float*(double)slider->tickInterval())); /* hack alert! */ 
    426         else if( doublespinbox ) doublespinbox->setValue(val.f_float); 
     427        if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */ 
     428        else if( doublespinbox ) doublespinbox->setValue( val.f_float ); 
    427429        else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ ); 
    428430    } 
    429431    else if( i_type == VLC_VAR_STRING ) 
    430432    { 
    431         if( lineedit ) lineedit->setText( qfu(val.psz_string) ); 
    432         else if( combobox ) combobox->setCurrentIndex( 
     433        if( lineedit ) lineedit->setText( qfu( val.psz_string ) ); 
     434        else if( combobox ) combobox->setCurrentIndex(  
    433435                            combobox->findData( qfu( val.psz_string ) ) ); 
    434436        else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ ); 
     
    437439    else 
    438440        msg_Err( p_intf, 
    439                  "Module %s's %s variable is of an unsupported type (%d)", 
     441                 "Module %s's %s variable is of an unsupported type ( %d )", 
    440442                 module.toStdString().c_str(), 
    441443                 option.toStdString().c_str(), 
     
    450452    //std::cout << "Option name: " << option.toStdString() << std::endl; 
    451453 
    452     vlc_object_t *p_obj = (vlc_object_t *
     454    vlc_object_t *p_obj = ( vlc_object_t *
    453455        vlc_object_find_name( p_intf->p_libvlc, 
    454456                              module.toStdString().c_str(), 
     
    472474    /* Try to cast to all the widgets we're likely to encounter. Only 
    473475     * one of the casts is expected to work. */ 
    474     QSlider        *slider        = qobject_cast<QSlider*>       (sender()); 
    475     QCheckBox      *checkbox      = qobject_cast<QCheckBox*>     (sender()); 
    476     QSpinBox       *spinbox       = qobject_cast<QSpinBox*>      (sender()); 
    477     QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>(sender()); 
    478     QDial          *dial          = qobject_cast<QDial*>         (sender()); 
    479     QLineEdit      *lineedit      = qobject_cast<QLineEdit*>     (sender()); 
    480     QComboBox      *combobox      = qobject_cast<QComboBox*>     (sender()); 
     476    QSlider        *slider        = qobject_cast<QSlider*>       ( sender() ); 
     477    QCheckBox      *checkbox      = qobject_cast<QCheckBox*>     ( sender() ); 
     478    QSpinBox       *spinbox       = qobject_cast<QSpinBox*>      ( sender() ); 
     479    QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox*>( sender() ); 
     480    QDial          *dial          = qobject_cast<QDial*>         ( sender() ); 
     481    QLineEdit      *lineedit      = qobject_cast<QLineEdit*>     ( sender() ); 
     482    QComboBox      *combobox      = qobject_cast<QComboBox*>     ( sender() ); 
    481483 
    482484    i_type &= 0xf0; 
     
    487489        else if( checkbox ) i_int = checkbox->checkState() == Qt::Checked; 
    488490        else if( spinbox )  i_int = spinbox->value(); 
    489         else if( dial )     i_int = (540-dial->value())%360; 
    490         else if( lineedit ) i_int = lineedit->text().toInt(NULL,16); 
    491         else if( combobox ) i_int = combobox->itemData(combobox->currentIndex()).toInt(); 
     491        else if( dial )     i_int = ( 540-dial->value() )%360; 
     492        else if( lineedit ) i_int = lineedit->text().toInt( NULL,16 ); 
     493        else if( combobox ) i_int = combobox->itemData( combobox->currentIndex() ).toInt(); 
    492494        else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ ); 
    493495        config_PutInt( p_intf, option.toStdString().c_str(), i_int ); 
     
    503505    { 
    504506        double f_float = 0; 
    505         if( slider )             f_float = (double)slider->value() 
    506                                          / (double)slider->tickInterval(); /* hack alert! */ 
     507        if( slider )             f_float = ( double )slider->value() 
     508                                         / ( double )slider->tickInterval(); /* hack alert! */ 
    507509        else if( doublespinbox ) f_float = doublespinbox->value(); 
    508510        else if( lineedit ) f_float = lineedit->text().toDouble(); 
     
    515517    { 
    516518        char *psz_string = NULL; 
    517         if( lineedit ) psz_string = strdup(qtu(lineedit->text())); 
    518         else if( combobox ) psz_string = strdup(qtu(combobox->itemData( 
    519                                          combobox->currentIndex()).toString())); 
     519        if( lineedit ) psz_string = strdup( qtu( lineedit->text() ) ); 
     520        else if( combobox ) psz_string = strdup( qtu( combobox->itemData(  
     521                                         combobox->currentIndex() ).toString() ) ); 
    520522        else msg_Warn( p_intf, "Oops %s %s %d", __FILE__, __func__, __LINE__ ); 
    521523        config_PutPsz( p_intf, option.toStdString().c_str(), psz_string ); 
     
    526528    else 
    527529        msg_Err( p_intf, 
    528                  "Module %s's %s variable is of an unsupported type (%d)", 
     530                 "Module %s's %s variable is of an unsupported type ( %d )", 
    529531                 module.toStdString().c_str(), 
    530532                 option.toStdString().c_str(), 
     
    537539void ExtVideo::gotoConf( QObject* src ) 
    538540{ 
    539 #define SHOWCONF(module) \ 
    540     if( src->objectName().contains(module) ) \ 
     541#define SHOWCONF( module ) \ 
     542    if( src->objectName().contains( module ) ) \ 
    541543    { \ 
    542544        PrefsDialog::getInstance( p_intf )->showModulePrefs( module ); \ 
     
    568570                            QWidget( _parent ) , p_intf( _p_intf ) 
    569571{ 
    570     QFont smallFont = QApplication::font( static_cast<QWidget*>(0) ); 
     572    QFont smallFont = QApplication::font( static_cast<QWidget*>( 0 ) ); 
    571573    smallFont.setPointSize( smallFont.pointSize() - 3 ); 
    572574 
     
    586588    BUTTONACT( ui.eq2PassCheck, set2Pass() ); 
    587589 
    588     CONNECT( ui.preampSlider, valueChanged(int), this, setPreamp() ); 
     590    CONNECT( ui.preampSlider, valueChanged( int ), this, setPreamp() ); 
    589591 
    590592    QGridLayout *grid = new QGridLayout( ui.frame ); 
     
    595597        bands[i]->setMaximum( 400 ); 
    596598        bands[i]->setValue( 200 ); 
    597         CONNECT( bands[i], valueChanged(int), this, setBand() ); 
     599        CONNECT( bands[i], valueChanged( int ), this, setBand() ); 
    598600        band_texts[i] = new QLabel( band_frequencies[i] + "\n0.0dB" ); 
    599601        band_texts[i]->setFont( smallFont ); 
     
    603605 
    604606    /* Write down initial values */ 
    605     aout_instance_t *p_aout = (aout_instance_t *)vlc_object_find(p_intf, 
    606                                     VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     607    aout_instance_t *p_aout = ( aout_instance_t * )vlc_object_find( p_intf, 
     608                                    VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    607609    char *psz_af; 
    608610    char *psz_bands; 
     
    662664void Equalizer::set2Pass() 
    663665{ 
    664     aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, 
    665                                  VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     666    aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf, 
     667                                 VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    666668    vlc_bool_t b_2p = ui.eq2PassCheck->isChecked(); 
    667669 
     
    682684void Equalizer::setPreamp() 
    683685{ 
    684     float f= (float)(  ui.preampSlider->value() ) /10 - 20; 
     686    float f= ( float )(  ui.preampSlider->value() ) /10 - 20; 
    685687    char psz_val[5]; 
    686     aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, 
    687                                        VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     688    aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf, 
     689                                       VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    688690 
    689691    sprintf( psz_val, "%.1f", f ); 
    690     ui.preampLabel->setText( qtr("Preamp\n") + psz_val + qtr("dB") ); 
     692    ui.preampLabel->setText( qtr( "Preamp\n" ) + psz_val + qtr( "dB" ) ); 
    691693    if( p_aout ) 
    692694    { 
     
    708710    { 
    709711        char psz_val[5]; 
    710         float f_val = (float)(  bands[i]->value() ) / 10 - 20 ; 
     712        float f_val = ( float )(  bands[i]->value() ) / 10 - 20 ; 
    711713        sprintf( psz_values, "%s %f", psz_values, f_val ); 
    712714        sprintf( psz_val, "% 5.1f", f_val ); 
    713715        band_texts[i]->setText( band_frequencies[i] + "\n" + psz_val + "dB" ); 
    714716    } 
    715     aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, 
    716                                           VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     717    aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf, 
     718                                          VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    717719    if( p_aout ) 
    718720    { 
     
    732734            char psz_val[5]; 
    733735            float f = strtof( p, &p ); 
    734             int  i_val= (int)( ( f + 20 ) * 10 ); 
     736            int  i_val= ( int )( ( f + 20 ) * 10 ); 
    735737            bands[i]->setValue(  i_val ); 
    736738            sprintf( psz_val, "% 5.1f", f ); 
     
    743745    } 
    744746    char psz_val[5]; 
    745     int i_val = (int)( ( f_preamp + 20 ) * 10 ); 
     747    int i_val = ( int )( ( f_preamp + 20 ) * 10 ); 
    746748    sprintf( psz_val, "%.1f", f_preamp ); 
    747749    ui.preampSlider->setValue( i_val ); 
    748     ui.preampLabel->setText( qtr("Preamp\n") + psz_val + qtr("dB") ); 
     750    ui.preampLabel->setText( qtr( "Preamp\n" ) + psz_val + qtr( "dB" ) ); 
    749751} 
    750752 
    751753void Equalizer::setPreset( int preset ) 
    752754{ 
    753     aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, 
    754                                                 VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     755    aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf, 
     756                                                VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    755757 
    756758    char psz_values[102]; memset( psz_values, 0, 102 ); 
     
    779781{ 
    780782    char *psz_preset = newval.psz_string; 
    781     Equalizer *eq = (Equalizer *)p_data; 
    782     eq->presetsComboBox->setCurrentIndex( eq->presetsComboBox->findText( qfu( psz_preset) ) ); 
     783    Equalizer *eq = ( Equalizer * )p_data; 
     784    eq->presetsComboBox->setCurrentIndex( eq->presetsComboBox->findText( qfu( psz_preset ) ) ); 
    783785    return VLC_SUCCESS; 
    784786} 
     
    797799    var_AddCallback( p_aout, "equalizer-preset", PresetCallback, this ); 
    798800} 
     801 
     802/********************************************************************** 
     803 * Audio filters 
     804 **********************************************************************/ 
    799805 
    800806/********************************************************************** 
     
    805811    "Roomsize", "Width" , "Wet", "Dry", "Damp" 
    806812}; 
    807 static const QString control_names[] = 
    808 { 
    809     "Roomsize", "Width" , "Wet", "Dry", "Damp" 
    810 }; 
    811813 
    812814Spatializer::Spatializer( intf_thread_t *_p_intf, QWidget *_parent ) : 
    813815    QWidget( _parent ) , p_intf( _p_intf ) 
    814816{ 
    815     QFont smallFont = QApplication::font( static_cast<QWidget*>(0) ); 
     817    QFont smallFont = QApplication::font( static_cast<QWidget*>( 0 ) ); 
    816818    smallFont.setPointSize( smallFont.pointSize() - 3 ); 
    817819 
    818     ui.setupUi( this ); 
    819  
    820     QGridLayout *grid = new QGridLayout( ui.frame ); 
    821     grid->setMargin( 0 ); 
     820    QGridLayout *layout = new QGridLayout( this ); 
     821    layout->setMargin( 0 ); 
     822 
     823    enableCheck = new QCheckBox( qfu( "Enable spatializer" ) ); 
     824    layout->addWidget( enableCheck, 0, 0, 1, NUM_SP_CTRL ); 
    822825 
    823826    for( int i = 0 ; i < NUM_SP_CTRL ; i++ ) 
    824827    { 
    825828        spatCtrl[i] = new QSlider( Qt::Vertical ); 
    826         if( i < 2
     829        if( i < 2
    827830        { 
    828831            spatCtrl[i]->setMaximum( 10 ); 
     
    836839        } 
    837840        oldControlVars[i] = spatCtrl[i]->value(); 
    838         CONNECT( spatCtrl[i], valueChanged(int), this, setInitValues() ); 
    839         ctrl_texts[i] = new QLabel( control_names[i] + "\n" ); 
     841        CONNECT( spatCtrl[i], valueChanged( int ), this, setInitValues() ); 
     842        ctrl_texts[i] = new QLabel( qfu( psz_control_names[i] ) + "\n" ); 
    840843        ctrl_texts[i]->setFont( smallFont ); 
    841844        ctrl_readout[i] = new QLabel( "" ); 
    842845        ctrl_readout[i]->setFont( smallFont ); 
    843         grid->addWidget( spatCtrl[i], 0, i ); 
    844         grid->addWidget( ctrl_readout[i],1,i); 
    845         grid->addWidget( ctrl_texts[i], 2, i ); 
    846     } 
    847  
    848     BUTTONACT( ui.enableCheck, enable() ); 
     846        layout->addWidget( spatCtrl[i], 1, i ); 
     847        layout->addWidget( ctrl_readout[i], 2, i ); 
     848        layout->addWidget( ctrl_texts[i], 3, i ); 
     849    } 
     850 
     851    BUTTONACT( enableCheck, enable() ); 
    849852 
    850853    /* Write down initial values */ 
    851     aout_instance_t *p_aout = (aout_instance_t *
    852         vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     854    aout_instance_t *p_aout = ( aout_instance_t *
     855        vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    853856    char *psz_af; 
    854857 
     
    856859    { 
    857860        psz_af = var_GetNonEmptyString( p_aout, "audio-filter" ); 
    858         for( int i = 0; i < NUM_SP_CTRL ; i++
    859         { 
    860             controlVars[i] = var_GetFloat( p_aout, psz_control_names[i] ); 
     861        for( int i = 0; i < NUM_SP_CTRL ; i++
     862        { 
     863            controlVars[i] = var_GetFloat( p_aout, psz_control_names[i] ); 
    861864        } 
    862865        vlc_object_release( p_aout ); 
     
    865868    { 
    866869        psz_af = config_GetPsz( p_aout, "audio-filter" ); 
    867         for( int i = 0; i < NUM_SP_CTRL ; i++
    868         { 
    869             controlVars[i] = config_GetFloat( p_intf, psz_control_names[i] ); 
     870        for( int i = 0; i < NUM_SP_CTRL ; i++
     871        { 
     872            controlVars[i] = config_GetFloat( p_intf, psz_control_names[i] ); 
    870873        } 
    871874    } 
    872875    if( psz_af && strstr( psz_af, "spatializer" ) != NULL ) 
    873         ui.enableCheck->setChecked( true ); 
     876        enableCheck->setChecked( true ); 
    874877    free( psz_af ); 
    875     enable( ui.enableCheck->isChecked() ); 
     878    enable( enableCheck->isChecked() ); 
    876879    setValues( controlVars ); 
    877  
    878880} 
    879881 
     
    884886void Spatializer::enable() 
    885887{ 
    886     bool en = ui.enableCheck->isChecked(); 
     888    bool en = enableCheck->isChecked(); 
    887889    aout_EnableFilter( VLC_OBJECT( p_intf ), "spatializer", 
    888890            en ? VLC_TRUE : VLC_FALSE ); 
     
    901903void Spatializer::setInitValues() 
    902904{ 
    903     setValues(controlVars); 
    904 } 
    905  
    906 void Spatializer::setValues(float *controlVars
     905    setValues( controlVars ); 
     906} 
     907 
     908void Spatializer::setValues( float *controlVars
    907909{ 
    908910    char psz_val[5]; 
    909911    char var_name[5]; 
    910     aout_instance_t *p_aout= (aout_instance_t *
    911         vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE); 
     912    aout_instance_t *p_aout= ( aout_instance_t *
     913        vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    912914 
    913915    for( int i = 0 ; i < NUM_SP_CTRL ; i++ ) 
    914916    { 
    915         float f= (float)(  spatCtrl[i]->value() ); 
     917        float f= ( float )(  spatCtrl[i]->value() ); 
    916918        sprintf( psz_val, "%.1f", f ); 
    917919        ctrl_readout[i]->setText( psz_val ); 
     
    924926            { 
    925927                var_SetFloat( p_aout, psz_control_names[i], 
    926                         (float)spatCtrl[i]->value() ); 
     928                        ( float )spatCtrl[i]->value() ); 
    927929                config_PutFloat( p_intf, psz_control_names[i], 
    928                         (float) spatCtrl[i]->value()); 
    929                 oldControlVars[i] = (float) spatCtrl[i]->value(); 
     930                        ( float ) spatCtrl[i]->value() ); 
     931                oldControlVars[i] = ( float ) spatCtrl[i]->value(); 
    930932            } 
    931933        } 
    932934        vlc_object_release( p_aout ); 
    933935    } 
    934     //    printf("set callback values %s %s %d\n", __FILE__,__func__,__LINE__); 
    935936 
    936937} 
     
    952953 
    953954/********************************************************************** 
    954  * Audio filters 
    955  **********************************************************************/ 
    956  
    957 /********************************************************************** 
    958955 * Extended playbak controls 
    959956 **********************************************************************/ 
  • modules/gui/qt4/components/extended_panels.hpp

    r35c9f06 re2e6f59  
    3030#include "ui/equalizer.h" 
    3131#include "ui/video_effects.h" 
    32 #include "ui/spatializer.h" 
    3332 
    3433#define BANDS 10 
     
    9190 
    9291private: 
    93     Ui::SpatializerWidget ui; 
    9492    QSlider *spatCtrl[NUM_SP_CTRL]; 
    9593    QLabel *ctrl_texts[NUM_SP_CTRL]; 
     
    9795    float controlVars[5]; 
    9896    float oldControlVars[5]; 
     97 
     98    QCheckBox *enableCheck; 
    9999 
    100100    void delCallbacks( aout_instance_t * ); 
  • modules/gui/qt4/dialogs/extended.cpp

    r6ee1e19 re2e6f59  
    2222 *****************************************************************************/ 
    2323 
    24 #include "qt4.hpp" 
    2524#include "dialogs/extended.hpp" 
    2625#include "dialogs_provider.hpp" 
    27 #include "util/qvlcframe.hpp" 
    2826#include "components/extended_panels.hpp" 
    2927 
     
    4240 
    4341    QTabWidget *tab = new QTabWidget( this ); 
    44     Equalizer *foo = new Equalizer( p_intf, this ); 
    45     tab->addTab( foo, qtr( "Graphic Equalizer" ) ); 
     42    Equalizer *equal = new Equalizer( p_intf, this ); 
     43    tab->addTab( equal, qtr( "Graphic Equalizer" ) ); 
    4644 
    47     ExtVideo *bar = new ExtVideo( p_intf, this ); 
    48     tab->addTab( bar, qtr( "Video Adjustments and Effects" ) ); 
     45    Spatializer *spatial = new Spatializer( p_intf, this ); 
     46    tab->addTab( spatial, qtr( "Audio Effects" ) ); 
     47 
     48    ExtVideo *videoEffect = new ExtVideo( p_intf, this ); 
     49    tab->addTab( videoEffect, qtr( "Video Adjustments and Effects" ) ); 
    4950 
    5051    layout->addWidget( tab, 0, 0, 1, 5 );