From b06d352d14d9d917ff23288dd6a9433e4e75f7df Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 20 May 2020 01:19:55 +0900 Subject: KMix: 1) added direct DCOP access to the user selected mixer/device channel used as master. 2) fixed bug with volume update 3) unlinked global keyboard shortcuts for volume control to avoid clashing with kmilo. A user can still link them manually if needed. Signed-off-by: Michele Calgaro --- kmix/mdwslider.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'kmix/mdwslider.cpp') diff --git a/kmix/mdwslider.cpp b/kmix/mdwslider.cpp index 042f3723..6b4c3f51 100644 --- a/kmix/mdwslider.cpp +++ b/kmix/mdwslider.cpp @@ -760,15 +760,7 @@ void MDWSlider::setDisabled( bool value ) */ void MDWSlider::increaseVolume() { - Volume vol = m_mixdevice->getVolume(); - long inc = vol.maxVolume() / 20; - if ( inc == 0 ) - inc = 1; - for ( int i = 0; i < vol.count(); i++ ) { - long newVal = (vol[i]) + inc; - m_mixdevice->setVolume( i, newVal < vol.maxVolume() ? newVal : vol.maxVolume() ); - } - m_mixer->commitVolumeChange(m_mixdevice); + m_mixer->increaseVolume(m_mixdevice->num(), 5); } /** @@ -777,15 +769,7 @@ void MDWSlider::increaseVolume() */ void MDWSlider::decreaseVolume() { - Volume vol = m_mixdevice->getVolume(); - long inc = vol.maxVolume() / 20; - if ( inc == 0 ) - inc = 1; - for ( int i = 0; i < vol.count(); i++ ) { - long newVal = (vol[i]) - inc; - m_mixdevice->setVolume( i, newVal > 0 ? newVal : 0 ); - } - m_mixer->commitVolumeChange(m_mixdevice); + m_mixer->decreaseVolume(m_mixdevice->num(), 5); } -- cgit v1.2.3