From kde-commits Tue Feb 28 23:09:57 2006 From: Christian Esken Date: Tue, 28 Feb 2006 23:09:57 +0000 To: kde-commits Subject: KDE/kdemultimedia/kmix Message-Id: <1141168197.219011.25470.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=114119260709371 SVN commit 514659 by esken: Implement/prepare profile switching. Currently you can "only" switch through your different sound cards. Profile switching is getting close now. :-) M +13 -3 kmix.cpp M +2 -0 kmix.h M +8 -2 kmixerwidget.cpp M +2 -0 kmixerwidget.h M +1 -1 mdwslider.cpp M +1 -1 viewdockareapopup.cpp --- trunk/KDE/kdemultimedia/kmix/kmix.cpp #514658:514659 @@ -18,6 +18,7 @@ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + // include files for QT #include //#include @@ -158,8 +159,6 @@ */ m_wsMixers = new QStackedWidget( centralWidget() ); - widgetsLayout->setStretchFactor( m_wsMixers, 10 ); - widgetsLayout->addWidget( m_wsMixers ); if ( m_showMenubar ) menuBar()->show(); @@ -325,6 +324,9 @@ else { // At least one card is present + //widgetsLayout->setStretchFactor( m_wsMixers, 10 ); + widgetsLayout->addWidget( m_wsMixers ); + unsigned int mixerCount; for ( int i=0; iinsertItem( mixer->mixerName() ); m_wsMixers->addWidget( mw ); + connect(mw, SIGNAL(activateNextlayout()), SLOT(showNextMixer()) ); QString grp(mw->id()); mw->loadConfig( KGlobal::config(), grp ); @@ -362,7 +365,7 @@ mw->setTicks( m_showTicks ); mw->setLabels( m_showLabels ); // !! I am still not sure whether this works 100% reliably - chris - mw->show(); + //mw->show(); mixerCount ++; } @@ -567,5 +570,12 @@ // !!! TODO m_wsMixers->raiseWidget( mixer ); } +void KMixWindow::showNextMixer() { + int nextIndex = m_wsMixers->currentIndex() + 1; + if ( nextIndex >= m_wsMixers->count() ) { + nextIndex = 0; + } + m_wsMixers->setCurrentIndex(nextIndex); +} #include "kmix.moc" --- trunk/KDE/kdemultimedia/kmix/kmix.h #514658:514659 @@ -87,6 +87,8 @@ virtual void applyPrefs( KMixPrefDlg *prefDlg ); void stopVisibilityUpdates(); + void showNextMixer(); + private: KAccel *m_keyAccel; /* --- trunk/KDE/kdemultimedia/kmix/kmixerwidget.cpp #514658:514659 @@ -120,7 +120,7 @@ m_profileButton->setIconSet( SmallIcon( "tab_new" ) ); m_profileButton->adjustSize(); // !!! m_profileButton->setPopup( m_tabbarSessionsCommands ); - connect(m_profileButton, SIGNAL(clicked()), SLOT(newSession())); + connect(m_profileButton, SIGNAL(clicked()), SLOT(nextLayout())); m_ioTab->setCornerWidget( m_profileButton, Qt::BottomLeftCorner ); QToolButton* m_closeButton = new QToolButton( m_ioTab ); @@ -173,8 +173,8 @@ mixerName->setText( _mixer->mixerName() ); mixerName->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + // 10 Pixels at the front; Balance-Slider; Mixer-Name; 10 Pixels at the end balanceAndDetail->addSpacing( 10 ); - balanceAndDetail->addWidget( m_balanceSlider ); balanceAndDetail->addWidget( mixerName ); balanceAndDetail->addSpacing( 10 ); @@ -205,6 +205,10 @@ return m_id; } +void KMixerWidget::nextLayout() { + kDebug(67100) << "KMixerWidget::nextLayout()\n"; + emit activateNextlayout(); // this a quick hack for replacing the ComboBox +} /** * Creates all the Views for the Tabs described in the GUIProfile @@ -296,6 +300,8 @@ */ void KMixerWidget::loadConfig( KConfig *config, const QString &grp ) { + config->setGroup( grp ); + const std::vector::const_iterator viewsEnd = _views.end(); for ( std::vector::const_iterator it = _views.begin(); it != viewsEnd; ++it) { ViewBase* view = *it; --- trunk/KDE/kdemultimedia/kmix/kmixerwidget.h #514658:514659 @@ -77,12 +77,14 @@ void masterMuted( bool ); void newMasterVolume(Volume vol); void toggleMenuBar(); + void activateNextlayout(); public slots: void setTicks( bool on ); void setLabels( bool on ); void setIcons( bool on ); void toggleMenuBarSlot(); + void nextLayout(); void saveConfig( KConfig *config, const QString &grp ); void loadConfig( KConfig *config, const QString &grp ); --- trunk/KDE/kdemultimedia/kmix/mdwslider.cpp #514658:514659 @@ -191,7 +191,7 @@ muteTip = muteTip.arg(m_mixdevice->name()); m_iconLabel->setToolTip( muteTip ); - sliLayout->addSpacing( 3 ); + //sliLayout->addSpacing( 3 ); // --- SLIDERS --------------------------- --- trunk/KDE/kdemultimedia/kmix/viewdockareapopup.cpp #514658:514659 @@ -63,7 +63,7 @@ -void ViewDockAreaPopup::mousePressEvent(QMouseEvent *me) +void ViewDockAreaPopup::mousePressEvent(QMouseEvent *) { /** Hide the popup: