-rw-r--r-- | noncore/multimedia/opieplayer2/volumecontrol.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/volumecontrol.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/volumecontrol.cpp b/noncore/multimedia/opieplayer2/volumecontrol.cpp index b8ec0df..219f63e 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.cpp +++ b/noncore/multimedia/opieplayer2/volumecontrol.cpp @@ -1,59 +1,62 @@ #include <qpe/qpeapplication.h> #include <qpe/config.h> #include "qpe/qcopenvelope_qws.h" #include <qmessagebox.h> #include "volumecontrol.h" int VolumeControl::getVolume() { int volumePerc; Config cfg( "qpe" ); cfg. setGroup( "Volume" ); volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); m_volumePerc = volumePerc; return volumePerc; } void VolumeControl::setVolume( int volumePerc ) { Config cfg("qpe"); cfg.setGroup("Volume"); if ( volumePerc > 100 ) { volumePerc = 100; } if ( volumePerc < 0 ) { volumePerc = 0; } m_volumePerc = volumePerc; cfg.writeEntry("VolumePercent", volumePerc ); - QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; +// QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; + QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; } void VolumeControl::incVol( int ammount ) { int oldVol = getVolume(); setVolume( oldVol + ammount); } void VolumeControl::decVol( int ammount ) { int oldVol = getVolume(); setVolume( oldVol - ammount); } VolumeControl::VolumeControl( ) { getVolume(); } VolumeControl::~VolumeControl() { QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; } - +void VolumeControl::setMute(bool on) { + QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << on; +} diff --git a/noncore/multimedia/opieplayer2/volumecontrol.h b/noncore/multimedia/opieplayer2/volumecontrol.h index 37be398..d0d34a2 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.h +++ b/noncore/multimedia/opieplayer2/volumecontrol.h @@ -1,47 +1,48 @@ /************* * this is only a quick hack and will be later replaced by osound * **********/ #ifndef VOLUMECONTROL_H #define VOLUMECONTROL_H #include <qobject.h> class VolumeControl : public QObject { Q_OBJECT public: VolumeControl(); ~VolumeControl(); // increase by "ammount" void incVol( int ammount ); void decVol( int ammount ); /** * Get the volume in percent * @return volume percentage */ int getVolume(); public slots: /** * Set the volume in percent * @value volumePerc between 0 and 100 */ void setVolume( int volumePerc ); + void setMute(bool); private: int m_volumePerc; }; #endif |