author | sandman <sandman> | 2002-06-24 20:06:38 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-06-24 20:06:38 (UTC) |
commit | 793a63d9cce0502616cad6999643b1a61836a3db (patch) (unidiff) | |
tree | 3ea020afd5a06236e5e889f3acae429d87171488 /core/applets/volumeapplet/volumeappletimpl.cpp | |
parent | fe4cb014e959518e4835d15593f2c392174af55b (diff) | |
download | opie-793a63d9cce0502616cad6999643b1a61836a3db.zip opie-793a63d9cce0502616cad6999643b1a61836a3db.tar.gz opie-793a63d9cce0502616cad6999643b1a61836a3db.tar.bz2 |
Started as a bug fix this is a near complete restructuring/rewrite:
- Added a alarm volume slider on iPAQs
- Made mic mutable
- Correctly inform the launcher about tap/key sounds
Diffstat (limited to 'core/applets/volumeapplet/volumeappletimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/volumeapplet/volumeappletimpl.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/core/applets/volumeapplet/volumeappletimpl.cpp b/core/applets/volumeapplet/volumeappletimpl.cpp index 943e71a..47506cc 100644 --- a/core/applets/volumeapplet/volumeappletimpl.cpp +++ b/core/applets/volumeapplet/volumeappletimpl.cpp | |||
@@ -8,67 +8,58 @@ | |||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "volume.h" | 20 | #include "volume.h" |
21 | #include "volumeappletimpl.h" | 21 | #include "volumeappletimpl.h" |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | 24 | ||
25 | VolumeAppletImpl::VolumeAppletImpl() | 25 | VolumeAppletImpl::VolumeAppletImpl() |
26 | : volume(0), ref(0) | 26 | : volume(0), ref(0) |
27 | { | 27 | { |
28 | } | 28 | } |
29 | 29 | ||
30 | VolumeAppletImpl::~VolumeAppletImpl() | 30 | VolumeAppletImpl::~VolumeAppletImpl() |
31 | { | 31 | { |
32 | delete volume; | 32 | delete volume; |
33 | } | 33 | } |
34 | 34 | ||
35 | QWidget *VolumeAppletImpl::applet( QWidget *parent ) | 35 | QWidget *VolumeAppletImpl::applet( QWidget *parent ) |
36 | { | 36 | { |
37 | if ( !volume ) | 37 | if ( !volume ) |
38 | volume = new VolumeApplet( parent ); | 38 | volume = new VolumeApplet( parent ); |
39 | 39 | return volume; | |
40 | Config cfg("qpe"); | ||
41 | cfg.setGroup("Volume"); | ||
42 | QString foo = cfg.readEntry("Mute","TRUE"); | ||
43 | bool muted; | ||
44 | if(foo.find("TRUE",0,TRUE) != -1) | ||
45 | muted = TRUE; | ||
46 | else muted = FALSE; | ||
47 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << muted; //mute | ||
48 | return volume; | ||
49 | } | 40 | } |
50 | 41 | ||
51 | int VolumeAppletImpl::position() const | 42 | int VolumeAppletImpl::position() const |
52 | { | 43 | { |
53 | return 6; | 44 | return 6; |
54 | } | 45 | } |
55 | 46 | ||
56 | QRESULT VolumeAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 47 | QRESULT VolumeAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
57 | { | 48 | { |
58 | *iface = 0; | 49 | *iface = 0; |
59 | if ( uuid == IID_QUnknown ) | 50 | if ( uuid == IID_QUnknown ) |
60 | *iface = this; | 51 | *iface = this; |
61 | else if ( uuid == IID_TaskbarApplet ) | 52 | else if ( uuid == IID_TaskbarApplet ) |
62 | *iface = this; | 53 | *iface = this; |
63 | 54 | ||
64 | if ( *iface ) | 55 | if ( *iface ) |
65 | (*iface)->addRef(); | 56 | (*iface)->addRef(); |
66 | return QS_OK; | 57 | return QS_OK; |
67 | } | 58 | } |
68 | 59 | ||
69 | Q_EXPORT_INTERFACE() | 60 | Q_EXPORT_INTERFACE() |
70 | { | 61 | { |
71 | Q_CREATE_INSTANCE( VolumeAppletImpl ) | 62 | Q_CREATE_INSTANCE( VolumeAppletImpl ) |
72 | } | 63 | } |
73 | 64 | ||
74 | 65 | ||