author | llornkcor <llornkcor> | 2002-04-07 00:46:35 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-07 00:46:35 (UTC) |
commit | e237c0758206c34f96c11870e033412b89e37463 (patch) (unidiff) | |
tree | ff61337aafa002a494a134cb61daaeda10aa0a44 /core/applets/volumeapplet/volume.h | |
parent | 014a5c29fc8a1b2e6bc2ec550134163bea86443c (diff) | |
download | opie-e237c0758206c34f96c11870e033412b89e37463.zip opie-e237c0758206c34f96c11870e033412b89e37463.tar.gz opie-e237c0758206c34f96c11870e033412b89e37463.tar.bz2 |
re-commit buttons
Diffstat (limited to 'core/applets/volumeapplet/volume.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/volumeapplet/volume.h | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h index a982f53..9fc12d8 100644 --- a/core/applets/volumeapplet/volume.h +++ b/core/applets/volumeapplet/volume.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
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 | ** |
@@ -14,47 +14,48 @@ | |||
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 | |||
20 | #ifndef __VOLUME_APPLET_H__ | 21 | #ifndef __VOLUME_APPLET_H__ |
21 | #define __VOLUME_APPLET_H__ | 22 | #define __VOLUME_APPLET_H__ |
22 | 23 | ||
23 | 24 | ||
24 | #include <qwidget.h> | 25 | #include <qwidget.h> |
25 | #include <qframe.h> | 26 | #include <qframe.h> |
26 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
27 | #include <qguardedptr.h> | 28 | #include <qguardedptr.h> |
29 | #include <qtimer.h> | ||
28 | 30 | ||
29 | class QSlider; | 31 | class QSlider; |
30 | class QCheckBox; | 32 | class QCheckBox; |
31 | class QPushButton; | ||
32 | class QTimer; | ||
33 | 33 | ||
34 | class VolumeControl : public QFrame | 34 | class VolumeControl : public QFrame |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | VolumeControl( QWidget *parent=0, const char *name=0 ); | 38 | VolumeControl( bool showMic=FALSE, QWidget *parent=0, const char *name=0 ); |
39 | 39 | ||
40 | public: | 40 | public: |
41 | QSlider *slider; | 41 | QSlider *slider; |
42 | QSlider *mic; | ||
42 | QCheckBox *muteBox; | 43 | QCheckBox *muteBox; |
43 | 44 | ||
44 | private: | 45 | private: |
46 | QPushButton *upButton; | ||
47 | QPushButton *downButton; | ||
48 | QTimer *rateTimer; | ||
49 | |||
45 | void keyPressEvent( QKeyEvent * ); | 50 | void keyPressEvent( QKeyEvent * ); |
46 | 51 | void createView(bool showMic = FALSE); | |
47 | private slots: | 52 | private slots: |
48 | void ButtonChanged(); | 53 | void ButtonChanged(); |
49 | void rateTimerDone(); | 54 | void rateTimerDone(); |
50 | 55 | ||
51 | private: | ||
52 | QPushButton *upButton; | ||
53 | QPushButton *downButton; | ||
54 | QTimer *rateTimer; | ||
55 | }; | 56 | }; |
56 | 57 | ||
57 | class VolumeApplet : public QWidget | 58 | class VolumeApplet : public QWidget |
58 | { | 59 | { |
59 | Q_OBJECT | 60 | Q_OBJECT |
60 | public: | 61 | public: |
@@ -62,24 +63,38 @@ public: | |||
62 | ~VolumeApplet(); | 63 | ~VolumeApplet(); |
63 | bool isMute( ) { return muted; } | 64 | bool isMute( ) { return muted; } |
64 | int percent( ) { return volumePercent; } | 65 | int percent( ) { return volumePercent; } |
65 | 66 | ||
66 | public slots: | 67 | public slots: |
67 | void volumeChanged( bool muted ); | 68 | void volumeChanged( bool muted ); |
68 | void setVolume( int percent ); | 69 | void micChanged( bool muted ); |
69 | void sliderMoved( int percent ); | 70 | void sliderMoved( int percent ); |
70 | void mute( bool ); | 71 | void mute( bool ); |
71 | 72 | ||
73 | void micMoved( int percent ); | ||
74 | void setVolume( int percent ); | ||
75 | void setMic( int percent ); | ||
76 | |||
77 | void showVolControl(bool showMic = FALSE); | ||
78 | void advVolControl(); | ||
79 | |||
72 | private: | 80 | private: |
81 | int volumePercent, micPercent; | ||
82 | bool muted, micMuted; | ||
83 | QPixmap volumePixmap; | ||
84 | QTimer *advancedTimer; | ||
85 | |||
73 | void readSystemVolume(); | 86 | void readSystemVolume(); |
74 | void writeSystemVolume(); | 87 | void writeSystemVolume(); |
75 | void mousePressEvent( QMouseEvent * ); | 88 | void mousePressEvent( QMouseEvent * ); |
76 | void paintEvent( QPaintEvent* ); | 89 | void paintEvent( QPaintEvent* ); |
77 | 90 | ||
78 | private: | 91 | void readSystemMic(); |
79 | int volumePercent; | 92 | void keyPressEvent ( QKeyEvent * e ); |
80 | bool muted; | 93 | void mouseReleaseEvent( QMouseEvent *); |
81 | QPixmap volumePixmap; | 94 | void writeSystemMic(); |
95 | |||
82 | }; | 96 | }; |
83 | 97 | ||
84 | 98 | ||
85 | #endif // __VOLUME_APPLET_H__ | 99 | #endif // __VOLUME_APPLET_H__ |
100 | |||