-rw-r--r-- | noncore/multimedia/opieplayer2/volumecontrol.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/volumecontrol.cpp b/noncore/multimedia/opieplayer2/volumecontrol.cpp index 219f63e..a795f3b 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.cpp +++ b/noncore/multimedia/opieplayer2/volumecontrol.cpp | |||
@@ -1,62 +1,62 @@ | |||
1 | 1 | ||
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qpe/config.h> | 3 | #include <qpe/config.h> |
4 | #include "qpe/qcopenvelope_qws.h" | 4 | #include "qpe/qcopenvelope_qws.h" |
5 | #include <qmessagebox.h> | 5 | #include <qmessagebox.h> |
6 | 6 | ||
7 | #include "volumecontrol.h" | 7 | #include "volumecontrol.h" |
8 | 8 | ||
9 | int VolumeControl::getVolume() { | 9 | int VolumeControl::getVolume() { |
10 | int volumePerc; | 10 | int volumePerc; |
11 | Config cfg( "qpe" ); | 11 | Config cfg( "qpe" ); |
12 | cfg. setGroup( "Volume" ); | 12 | cfg. setGroup( "Volume" ); |
13 | volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); | 13 | volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); |
14 | m_volumePerc = volumePerc; | 14 | m_volumePerc = volumePerc; |
15 | return volumePerc; | 15 | return volumePerc; |
16 | } | 16 | } |
17 | 17 | ||
18 | 18 | ||
19 | void VolumeControl::setVolume( int volumePerc ) { | 19 | void VolumeControl::setVolume( int volumePerc ) { |
20 | Config cfg("qpe"); | 20 | Config cfg("qpe"); |
21 | cfg.setGroup("Volume"); | 21 | cfg.setGroup("Volume"); |
22 | 22 | ||
23 | if ( volumePerc > 100 ) { | 23 | if ( volumePerc > 100 ) { |
24 | volumePerc = 100; | 24 | volumePerc = 100; |
25 | } | 25 | } |
26 | if ( volumePerc < 0 ) { | 26 | if ( volumePerc < 0 ) { |
27 | volumePerc = 0; | 27 | volumePerc = 0; |
28 | } | 28 | } |
29 | 29 | ||
30 | m_volumePerc = volumePerc; | 30 | m_volumePerc = volumePerc; |
31 | cfg.writeEntry("VolumePercent", volumePerc ); | 31 | cfg.writeEntry("VolumePercent", volumePerc ); |
32 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 32 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
33 | QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; | 33 | // QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; |
34 | } | 34 | } |
35 | 35 | ||
36 | 36 | ||
37 | void VolumeControl::incVol( int ammount ) { | 37 | void VolumeControl::incVol( int ammount ) { |
38 | int oldVol = getVolume(); | 38 | int oldVol = getVolume(); |
39 | setVolume( oldVol + ammount); | 39 | setVolume( oldVol + ammount); |
40 | } | 40 | } |
41 | 41 | ||
42 | void VolumeControl::decVol( int ammount ) { | 42 | void VolumeControl::decVol( int ammount ) { |
43 | int oldVol = getVolume(); | 43 | int oldVol = getVolume(); |
44 | setVolume( oldVol - ammount); | 44 | setVolume( oldVol - ammount); |
45 | } | 45 | } |
46 | 46 | ||
47 | 47 | ||
48 | VolumeControl::VolumeControl( ) { | 48 | VolumeControl::VolumeControl( ) { |
49 | getVolume(); | 49 | getVolume(); |
50 | } | 50 | } |
51 | 51 | ||
52 | VolumeControl::~VolumeControl() { | 52 | VolumeControl::~VolumeControl() { |
53 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 53 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
54 | } | 54 | } |
55 | 55 | ||
56 | void VolumeControl::setMute(bool on) { | 56 | void VolumeControl::setMute(bool on) { |
57 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << on; | 57 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << on; |
58 | } | 58 | } |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||