summaryrefslogtreecommitdiffstats
path: root/kmix/mdwslider.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-05-20 01:19:55 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-05-25 13:24:33 +0900
commitb06d352d14d9d917ff23288dd6a9433e4e75f7df (patch)
tree5518cf17eab0c4d4f3d76e02c610deccbea63339 /kmix/mdwslider.cpp
parentc0249fdb66a93f3fd3b413f8c05d455f05ae8cdb (diff)
downloadtdemultimedia-b06d352d14d9d917ff23288dd6a9433e4e75f7df.tar.gz
tdemultimedia-b06d352d14d9d917ff23288dd6a9433e4e75f7df.zip
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 <michele.calgaro@yahoo.it>
Diffstat (limited to 'kmix/mdwslider.cpp')
-rw-r--r--kmix/mdwslider.cpp20
1 files changed, 2 insertions, 18 deletions
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);
}