00001 /* 00002 This file is part of the Opie Project 00003 00004 =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> 00005 .=l. 00006 .>+-= 00007 _;:, .> :=|. This program is free software; you can 00008 .> <`_, > . <= redistribute it and/or modify it under 00009 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00010 .="- .-=="i, .._ License as published by the Free Software 00011 - . .-<_> .<> Foundation; either version 2 of the License, 00012 ._= =} : or (at your option) any later version. 00013 .%`+i> _;_. 00014 .i_,=:_. -<s. This program is distributed in the hope that 00015 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00016 : .. .:, . . . without even the implied warranty of 00017 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00018 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00019 ..}^=.= = ; Library General Public License for more 00020 ++= -. .` .: details. 00021 : = ...= . :.=- 00022 -. .:....=;==+<; You should have received a copy of the GNU 00023 -_. . . )=. = Library General Public License along with 00024 -- :-=` this library; see the file COPYING.LIB. 00025 If not, write to the Free Software Foundation, 00026 Inc., 59 Temple Place - Suite 330, 00027 Boston, MA 02111-1307, USA. 00028 00029 */ 00030 00031 #ifndef VOLUMEAPPLET_H 00032 #define VOLUMEAPPLET_H 00033 00034 #include <opie2/otaskbarapplet.h> 00035 #include <opie2/osoundsystem.h> 00036 #include <qframe.h> 00037 #include <qstring.h> 00038 #include <qvbox.h> 00039 #include <qpixmap.h> 00040 //using namespace Opie::MM; 00041 00042 namespace Opie 00043 { 00044 namespace Ui { class OLedBox; } 00045 // namespace MM { class OMixerInterface; } 00046 } 00047 class QLabel; 00048 class QSlider; 00049 class QShowEvent; 00050 class QHideEvent; 00051 class QGridLayout; 00052 00053 class Channel : public QVBox 00054 { 00055 public: 00056 Channel( Opie::MM::OMixerInterface* mixer, QWidget* parent, const char* name ); 00057 virtual ~Channel(); 00058 00059 // public slots: 00060 // virtual void clicked(); 00061 00062 private: 00063 QLabel* _name; 00064 QSlider* _volume; 00065 Opie::Ui::OLedBox* _mute; 00066 Opie::MM::OMixerInterface* _mixer; 00067 }; 00068 00069 class VolumeAppletControl : public QFrame 00070 { 00071 public: 00072 VolumeAppletControl( Opie::Ui::OTaskbarApplet* parent, const char* name = 0 ); 00073 ~VolumeAppletControl(); 00074 bool volMuted() const; 00075 int volPercent() const; 00076 00077 int m_vol_percent; 00078 bool m_vol_muted; 00079 00080 Opie::MM::OMixerInterface* mixer; 00081 00082 virtual QSize sizeHint() const; 00083 00084 protected: 00085 virtual void showEvent( QShowEvent* ); 00086 virtual void hideEvent( QHideEvent* ); 00087 void build(); 00088 00089 private: 00090 00091 QGridLayout* l; 00092 }; 00093 00094 00095 class VolumeApplet : public Opie::Ui::OTaskbarApplet 00096 { 00097 public: 00098 VolumeApplet( QWidget* parent = 0, const char* name = 0 ); 00099 ~VolumeApplet(); 00100 00101 static int position(); 00102 protected: 00103 virtual void paintEvent( QPaintEvent* ); 00104 virtual void mousePressEvent( QMouseEvent* ); 00105 00106 private: 00107 VolumeAppletControl* _control; 00108 QPixmap _pixmap; 00109 }; 00110 00111 #endif 00112
1.4.2