Changeset cacd39b8661a299781bbeb4c888a36d4a47215ca

Show
Ignore:
Timestamp:
10/31/07 21:26:52 (10 months ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1193862412 +0000
git-parent:

[ad9ca44d5979a242ef0781dbe793c3c7ae8d8caa]

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

Preferences, audio, save the normalizer activation and clean.

Files:

Legend:

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

    r9774edc rcacd39b  
    2929 *  - Improvements over WX 
    3030 *      - Validator for modulelist 
    31  *  - Implement update stuff using a general Updated signal 
    3231 */ 
    3332 
     
    686685        } 
    687686    } 
    688     emit Updated(); 
    689687} 
    690688 
  • modules/gui/qt4/components/preferences_widgets.hpp

    r9774edc rcacd39b  
    8686    QWidget *widget; 
    8787    bool _advanced; 
     88#if 0 
     89/* You shouldn't use that now..*/ 
    8890signals: 
    8991    void Updated(); 
     92#endif 
    9093}; 
    9194 
  • modules/gui/qt4/components/simple_preferences.cpp

    ra9cce62 rcacd39b  
    216216 
    217217            CONFIG_GENERIC( "headphone-dolby" , Bool , NULL, headphoneEffect ); 
    218 //          CONFIG_GENERIC( "" , Bool, NULL, ); activation of normalizer //FIXME 
     218 
    219219            CONFIG_GENERIC_NO_BOOL( "norm-max-level" , Float , NULL, 
    220                                     volNormalizer ); 
     220                                    volNormSpin ); 
    221221            CONFIG_GENERIC( "audio-visual" , Module , NULL, visualisation); 
    222222 
     
    271271            CONNECT( ui.lastfm, stateChanged( int ), this , 
    272272                    lastfm_Changed( int ) ); 
     273 
     274            /* Normalizer */ 
     275            normalizerBox = ui.volNormBox; 
     276            CONNECT( ui.volNormBox, toggled( bool ), ui.volNormSpin, setEnabled( bool ) ); 
     277            qs_filter = qfu( config_GetPsz( p_intf, "audio-filter" ) ); 
     278            bool b_normalizer = ( qs_filter.contains( "volnorm" ) ); 
     279            { 
     280                ui.volNormBox->setChecked( b_normalizer ); 
     281                ui.volNormSpin->setEnabled( b_normalizer ); 
     282            } 
    273283 
    274284        END_SPREFS_CAT; 
     
    298308          CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort ); 
    299309          CONFIG_GENERIC( "http-proxy", String , NULL, proxy ); 
    300  
     310             
    301311          /* Caching */ 
    302312/*          CONFIG_GENERIC( );*/ //FIXME 
     
    328338 
    329339           /* interface */ 
    330             p_config = config_FindConfig( VLC_OBJECT(p_intf), "intf" ); 
    331             if( p_config->value.psz && strcmp( p_config->value.psz, "qt4" )
     340            char *psz_intf = config_GetPsz( p_intf, "intf" ); 
     341            if( psz_intf
    332342            { 
    333                 ui.qt4->setChecked( true ); 
    334             } 
    335             if( p_config->value.psz && strcmp( p_config->value.psz, "skins2" )) 
    336             { 
    337                 ui.skins->setChecked( true ); 
     343                msg_Dbg( p_intf, "Interface in config file: %s", psz_intf ); 
     344                if( strstr( psz_intf, "skin" ) ) 
     345                    ui.skins->setChecked( true ); 
     346                else if( strstr( psz_intf, "qt" ) ) 
     347                    ui.qt4->setChecked( true ); 
    338348            } 
    339349            skinInterfaceButton = ui.skins; 
     
    436446            config_PutPsz( p_intf, "intf", "qt4" ); 
    437447    } 
     448     
     449    if( number == SPrefsAudio ) 
     450    { 
     451        bool b_normChecked = normalizerBox->isChecked(); 
     452        if( qs_filter.isEmpty() ) 
     453        { 
     454            /* the psz_filter is already empty, so we just append it needed */ 
     455            if( b_normChecked ) qs_filter = "volnorm"; 
     456        } 
     457        else /* Not Empty */ 
     458        { 
     459            if( qs_filter.contains( "volnorm" ) ) 
     460            { 
     461                /* The qs_filter not empty and contains "volnorm" that we have to remove */ 
     462                if( !b_normChecked ) 
     463                { 
     464                    /* Ugly :D */ 
     465                    qs_filter.remove( "volnorm:" ); 
     466                    qs_filter.remove( ":volnorm" ); 
     467                    qs_filter.remove( "volnorm" ); 
     468                } 
     469            } 
     470            else /* qs_filter not empty, but doesn't have volnorm inside already */ 
     471                if( b_normChecked ) qs_filter.append( ":volnorm" ); 
     472        } 
     473        config_PutPsz( p_intf, "audio-filter", qtu( qs_filter ) ); 
     474    } 
    438475} 
    439476 
  • modules/gui/qt4/components/simple_preferences.hpp

    r4d27e75 rcacd39b  
    4444class QLineEdit; 
    4545class QRadioButton; 
     46class QCheckBox; 
     47class QString; 
    4648 
    4749class SPrefsCatList : public QWidget 
     
    7375    int number; 
    7476 
     77    /* this is ugly and bad until I found a new solution */ 
    7578    QWidget *alsa_options; 
    7679    QWidget *oss_options; 
     
    8184    QRadioButton *skinInterfaceButton; 
    8285    QRadioButton *qtInterfaceButton; 
     86    QString qs_filter; 
     87    QCheckBox *normalizerBox; 
    8388 
    8489/* Display only the options for the selected audio output */ 
  • modules/gui/qt4/ui/sprefs_audio.ui

    r086d074 rcacd39b  
    256256      </item> 
    257257      <item row="1" column="0" > 
    258        <widget class="QCheckBox" name="volumeNormalizer" > 
     258       <widget class="QCheckBox" name="volNormBox" > 
    259259        <property name="text" > 
    260260         <string>_("Volume normalizer")</string> 
     
    270270      </item> 
    271271      <item row="1" column="1" > 
    272        <widget class="QDoubleSpinBox" name="volNormalizer" > 
     272       <widget class="QDoubleSpinBox" name="volNormSpin" > 
    273273        <property name="alignment" > 
    274274         <set>Qt::AlignRight</set> 
     
    334334  <tabstop>fileBrowseButton</tabstop> 
    335335  <tabstop>headphoneEffect</tabstop> 
    336   <tabstop>volumeNormalizer</tabstop> 
    337   <tabstop>volNormalizer</tabstop> 
     336  <tabstop>volNormBox</tabstop> 
     337  <tabstop>volNormSpin</tabstop> 
    338338  <tabstop>visualisation</tabstop> 
    339339 </tabstops>