-rw-r--r-- | noncore/applets/volumeapplet2/volumeapplet.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/noncore/applets/volumeapplet2/volumeapplet.cpp b/noncore/applets/volumeapplet2/volumeapplet.cpp index c153a78..2f61f48 100644 --- a/noncore/applets/volumeapplet2/volumeapplet.cpp +++ b/noncore/applets/volumeapplet2/volumeapplet.cpp | |||
@@ -1,47 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> | 4 | =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "volumeapplet.h" | 31 | #include "volumeapplet.h" |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | #include <opie2/otaskbarapplet.h> | 35 | #include <opie2/otaskbarapplet.h> |
36 | #include <opie2/osoundsystem.h> | 36 | #include <opie2/osoundsystem.h> |
37 | #include <opie2/oledbox.h> | 37 | #include <opie2/oledbox.h> |
38 | #include <opie2/oresource.h> | ||
39 | |||
38 | #include <qpe/applnk.h> | 40 | #include <qpe/applnk.h> |
39 | #include <qpe/resource.h> | 41 | |
40 | using namespace Opie::Core; | 42 | using namespace Opie::Core; |
41 | using namespace Opie::MM; | 43 | using namespace Opie::MM; |
42 | using namespace Opie::Ui; | 44 | using namespace Opie::Ui; |
43 | 45 | ||
44 | /* QT */ | 46 | /* QT */ |
45 | #include <qpainter.h> | 47 | #include <qpainter.h> |
46 | #include <qlabel.h> | 48 | #include <qlabel.h> |
47 | #include <qlayout.h> | 49 | #include <qlayout.h> |
@@ -86,17 +88,17 @@ void VolumeAppletControl::build() | |||
86 | OSoundSystem* sound = OSoundSystem::instance(); | 88 | OSoundSystem* sound = OSoundSystem::instance(); |
87 | OSoundSystem::CardIterator it = sound->iterator(); | 89 | OSoundSystem::CardIterator it = sound->iterator(); |
88 | 90 | ||
89 | OMixerInterface* mixer = new OMixerInterface( this, "/dev/mixer" ); | 91 | OMixerInterface* mixer = new OMixerInterface( this, "/dev/mixer" ); |
90 | 92 | ||
91 | QStringList channels = mixer->allChannels(); | 93 | QStringList channels = mixer->allChannels(); |
92 | 94 | ||
93 | int x = 0; | 95 | int x = 0; |
94 | int y = 0; | 96 | // int y = 0; |
95 | 97 | ||
96 | for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) | 98 | for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) |
97 | { | 99 | { |
98 | odebug << "OSSDEMO: Mixer has channel " << *it << "" << oendl; | 100 | odebug << "OSSDEMO: Mixer has channel " << *it << "" << oendl; |
99 | odebug << "OSSDEMO: +--- volume " << ( mixer->volume( *it ) & 0xff ) | 101 | odebug << "OSSDEMO: +--- volume " << ( mixer->volume( *it ) & 0xff ) |
100 | << " (left) | " << ( mixer->volume( *it ) >> 8 ) << " (right)" << oendl; | 102 | << " (left) | " << ( mixer->volume( *it ) >> 8 ) << " (right)" << oendl; |
101 | 103 | ||
102 | l->addWidget( new Channel( mixer, this, *it ), 0, x++, AlignCenter ); | 104 | l->addWidget( new Channel( mixer, this, *it ), 0, x++, AlignCenter ); |
@@ -130,17 +132,17 @@ QSize VolumeAppletControl::sizeHint() const | |||
130 | } | 132 | } |
131 | 133 | ||
132 | 134 | ||
133 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) | 135 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) |
134 | :OTaskbarApplet( parent, name ) | 136 | :OTaskbarApplet( parent, name ) |
135 | { | 137 | { |
136 | setFixedHeight( AppLnk::smallIconSize() ); | 138 | setFixedHeight( AppLnk::smallIconSize() ); |
137 | setFixedWidth( AppLnk::smallIconSize() ); | 139 | setFixedWidth( AppLnk::smallIconSize() ); |
138 | _pixmap.convertFromImage( Resource::loadImage( "volumeapplet/volume" ).smoothScale( height(), width() ) ); | 140 | _pixmap = Opie::Core::OResource::loadPixmap( "volume", Opie::Core::OResource::SmallIcon ); |
139 | _control = new VolumeAppletControl( this, "control" ); | 141 | _control = new VolumeAppletControl( this, "control" ); |
140 | } | 142 | } |
141 | 143 | ||
142 | 144 | ||
143 | VolumeApplet::~VolumeApplet() | 145 | VolumeApplet::~VolumeApplet() |
144 | { | 146 | { |
145 | } | 147 | } |
146 | 148 | ||