author | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
commit | e16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (unidiff) | |
tree | 9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/multimedia/opieplayer2/audiowidget.cpp | |
parent | 1c58d1407f9584fedcdae390a04e2b37e5853361 (diff) | |
download | opie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 5d929cb..2c54ae6 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -10,62 +10,48 @@ | |||
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpeapplication.h> | ||
35 | #include <qpe/resource.h> | ||
36 | #include <qpe/config.h> | ||
37 | #include <opie/oticker.h> | ||
38 | |||
39 | #include <qwidget.h> | ||
40 | #include <qpixmap.h> | ||
41 | #include <qbutton.h> | ||
42 | #include <qpainter.h> | ||
43 | #include <qframe.h> | ||
44 | #include <qlayout.h> | ||
45 | #include <qdir.h> | ||
46 | #include <stdlib.h> | ||
47 | #include <stdio.h> | ||
48 | 34 | ||
49 | #include "audiowidget.h" | 35 | #include "audiowidget.h" |
50 | #include "mediaplayerstate.h" | 36 | #include "mediaplayerstate.h" |
51 | #include "playlistwidget.h" | 37 | #include "playlistwidget.h" |
52 | 38 | ||
53 | namespace | 39 | namespace |
54 | { | 40 | { |
55 | 41 | ||
56 | const int xo = -2; // movable x offset | 42 | const int xo = -2; // movable x offset |
57 | const int yo = 22; // movable y offset | 43 | const int yo = 22; // movable y offset |
58 | 44 | ||
59 | const MediaWidget::SkinButtonInfo skinInfo[] = | 45 | const MediaWidget::SkinButtonInfo skinInfo[] = |
60 | { | 46 | { |
61 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, | 47 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, |
62 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, | 48 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, |
63 | { MediaWidget::Next, "next", MediaWidget::NormalButton }, | 49 | { MediaWidget::Next, "next", MediaWidget::NormalButton }, |
64 | { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, | 50 | { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, |
65 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, | 51 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, |
66 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, | 52 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, |
67 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, | 53 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, |
68 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, | 54 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, |
69 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, | 55 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, |
70 | { MediaWidget::Back, "back", MediaWidget::NormalButton } | 56 | { MediaWidget::Back, "back", MediaWidget::NormalButton } |
71 | }; | 57 | }; |
@@ -169,49 +155,49 @@ void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) { | |||
169 | 155 | ||
170 | void AudioWidget::loadSkin() | 156 | void AudioWidget::loadSkin() |
171 | { | 157 | { |
172 | loadDefaultSkin( guiInfo() ); | 158 | loadDefaultSkin( guiInfo() ); |
173 | 159 | ||
174 | songInfo.setFocusPolicy( QWidget::NoFocus ); | 160 | songInfo.setFocusPolicy( QWidget::NoFocus ); |
175 | // changeTextColor( &songInfo ); | 161 | // changeTextColor( &songInfo ); |
176 | // songInfo.setBackgroundColor( QColor( 167, 212, 167 )); | 162 | // songInfo.setBackgroundColor( QColor( 167, 212, 167 )); |
177 | // songInfo.setFrameStyle( QFrame::NoFrame); | 163 | // songInfo.setFrameStyle( QFrame::NoFrame); |
178 | songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); | 164 | songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); |
179 | // songInfo.setForegroundColor(Qt::white); | 165 | // songInfo.setForegroundColor(Qt::white); |
180 | 166 | ||
181 | slider.setFixedHeight( 20 ); | 167 | slider.setFixedHeight( 20 ); |
182 | slider.setMinValue( 0 ); | 168 | slider.setMinValue( 0 ); |
183 | slider.setMaxValue( 1 ); | 169 | slider.setMaxValue( 1 ); |
184 | slider.setFocusPolicy( QWidget::NoFocus ); | 170 | slider.setFocusPolicy( QWidget::NoFocus ); |
185 | slider.setBackgroundPixmap( backgroundPixmap ); | 171 | slider.setBackgroundPixmap( backgroundPixmap ); |
186 | 172 | ||
187 | // Config cofg("qpe"); | 173 | // Config cofg("qpe"); |
188 | // cofg.setGroup("Appearance"); | 174 | // cofg.setGroup("Appearance"); |
189 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); | 175 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); |
190 | 176 | ||
191 | time.setFocusPolicy( QWidget::NoFocus ); | 177 | time.setFocusPolicy( QWidget::NoFocus ); |
192 | time.setAlignment( Qt::AlignCenter ); | 178 | time.setAlignment( Qt::AlignCenter ); |
193 | 179 | ||
194 | // time.setFrame(FALSE); | 180 | // time.setFrame(FALSE); |
195 | // changeTextColor( &time ); | 181 | // changeTextColor( &time ); |
196 | 182 | ||
197 | resizeEvent( 0 ); | 183 | resizeEvent( 0 ); |
198 | } | 184 | } |
199 | 185 | ||
200 | void AudioWidget::setSeekable( bool isSeekable ) { | 186 | void AudioWidget::setSeekable( bool isSeekable ) { |
201 | 187 | ||
202 | if ( !isSeekable ) { | 188 | if ( !isSeekable ) { |
203 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 189 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); |
204 | if( !slider.isHidden()) { | 190 | if( !slider.isHidden()) { |
205 | slider.hide(); | 191 | slider.hide(); |
206 | } | 192 | } |
207 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 193 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
208 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 194 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
209 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 195 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
210 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 196 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
211 | } else { | 197 | } else { |
212 | // this stops the slider from being moved, thus | 198 | // this stops the slider from being moved, thus |
213 | // does not stop stream when it reaches the end | 199 | // does not stop stream when it reaches the end |
214 | slider.show(); | 200 | slider.show(); |
215 | qDebug( " CONNECT SET POSTION " ); | 201 | qDebug( " CONNECT SET POSTION " ); |
216 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 202 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
217 | connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 203 | connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |