author | harlekin <harlekin> | 2002-08-15 16:30:24 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-15 16:30:24 (UTC) |
commit | 747a98bb3b2a92b6f3577fa383fc44a8644a7ce2 (patch) (unidiff) | |
tree | 59ec78ec83871cb52ef4b4332cd7c44fa18de737 | |
parent | 320f73ae9a8ffc6daf009b3fefb9035506b0f684 (diff) | |
download | opie-747a98bb3b2a92b6f3577fa383fc44a8644a7ce2.zip opie-747a98bb3b2a92b6f3577fa383fc44a8644a7ce2.tar.gz opie-747a98bb3b2a92b6f3577fa383fc44a8644a7ce2.tar.bz2 |
update
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index a3d34f4..2cb1385 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -1,569 +1,568 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
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> | 34 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | 37 | ||
38 | #include <qwidget.h> | 38 | #include <qwidget.h> |
39 | #include <qpixmap.h> | 39 | #include <qpixmap.h> |
40 | #include <qbutton.h> | 40 | #include <qbutton.h> |
41 | #include <qpainter.h> | 41 | #include <qpainter.h> |
42 | #include <qframe.h> | 42 | #include <qframe.h> |
43 | #include <qlayout.h> | 43 | #include <qlayout.h> |
44 | 44 | ||
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | #include <stdio.h> | 46 | #include <stdio.h> |
47 | 47 | ||
48 | #include "audiowidget.h" | 48 | #include "audiowidget.h" |
49 | #include "mediaplayerstate.h" | 49 | #include "mediaplayerstate.h" |
50 | 50 | ||
51 | extern MediaPlayerState *mediaPlayerState; | 51 | extern MediaPlayerState *mediaPlayerState; |
52 | 52 | ||
53 | static const int xo = -2; // movable x offset | 53 | static const int xo = -2; // movable x offset |
54 | static const int yo = 22; // movable y offset | 54 | static const int yo = 22; // movable y offset |
55 | 55 | ||
56 | 56 | ||
57 | Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { | 57 | Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { |
58 | setFrameStyle( WinPanel | Sunken ); | 58 | setFrameStyle( WinPanel | Sunken ); |
59 | setText( "No Song" ); | 59 | setText( "No Song" ); |
60 | } | 60 | } |
61 | 61 | ||
62 | Ticker::~Ticker() { | 62 | Ticker::~Ticker() { |
63 | } | 63 | } |
64 | 64 | ||
65 | void Ticker::setText( const QString& text ) { | 65 | void Ticker::setText( const QString& text ) { |
66 | pos = 0; // reset it everytime the text is changed | 66 | pos = 0; // reset it everytime the text is changed |
67 | scrollText = text; | 67 | scrollText = text; |
68 | pixelLen = fontMetrics().width( scrollText ); | 68 | pixelLen = fontMetrics().width( scrollText ); |
69 | killTimers(); | 69 | killTimers(); |
70 | if ( pixelLen > width() ) { | 70 | if ( pixelLen > width() ) { |
71 | startTimer( 50 ); | 71 | startTimer( 50 ); |
72 | } | 72 | } |
73 | update(); | 73 | update(); |
74 | } | 74 | } |
75 | 75 | ||
76 | 76 | ||
77 | void Ticker::timerEvent( QTimerEvent * ) { | 77 | void Ticker::timerEvent( QTimerEvent * ) { |
78 | pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; | 78 | pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; |
79 | scroll( -1, 0, contentsRect() ); | 79 | scroll( -1, 0, contentsRect() ); |
80 | repaint( FALSE ); | 80 | repaint( FALSE ); |
81 | } | 81 | } |
82 | 82 | ||
83 | void Ticker::drawContents( QPainter *p ) { | 83 | void Ticker::drawContents( QPainter *p ) { |
84 | for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) | 84 | for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) |
85 | p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); | 85 | p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); |
86 | QPixmap pm( width(), height() ); | 86 | QPixmap pm( width(), height() ); |
87 | pm.fill( colorGroup().base() ); | 87 | pm.fill( colorGroup().base() ); |
88 | QPainter pmp( &pm ); | 88 | QPainter pmp( &pm ); |
89 | for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) { | 89 | for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) { |
90 | pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); | 90 | pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); |
91 | } | 91 | } |
92 | p->drawPixmap( 0, 0, pm ); | 92 | p->drawPixmap( 0, 0, pm ); |
93 | } | 93 | } |
94 | 94 | ||
95 | struct MediaButton { | 95 | struct MediaButton { |
96 | bool isToggle, isHeld, isDown; | 96 | bool isToggle, isHeld, isDown; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | //Layout information for the audioButtons (and if it is a toggle button or not) | 99 | //Layout information for the audioButtons (and if it is a toggle button or not) |
100 | MediaButton audioButtons[] = { | 100 | MediaButton audioButtons[] = { |
101 | { TRUE, FALSE, FALSE }, // play | 101 | { TRUE, FALSE, FALSE }, // play |
102 | { FALSE, FALSE, FALSE }, // stop | 102 | { FALSE, FALSE, FALSE }, // stop |
103 | { FALSE, FALSE, FALSE }, // pause | 103 | { FALSE, FALSE, FALSE }, // pause |
104 | { FALSE, FALSE, FALSE }, // next | 104 | { FALSE, FALSE, FALSE }, // next |
105 | { FALSE, FALSE, FALSE }, // previous | 105 | { FALSE, FALSE, FALSE }, // previous |
106 | { FALSE, FALSE, FALSE }, // volume up | 106 | { FALSE, FALSE, FALSE }, // volume up |
107 | { FALSE, FALSE, FALSE }, // volume down | 107 | { FALSE, FALSE, FALSE }, // volume down |
108 | { TRUE, FALSE, FALSE }, // repeat/loop | 108 | { TRUE, FALSE, FALSE }, // repeat/loop |
109 | { FALSE, FALSE, FALSE }, // playlist | 109 | { FALSE, FALSE, FALSE }, // playlist |
110 | { FALSE, FALSE, FALSE }, // forward | 110 | { FALSE, FALSE, FALSE }, // forward |
111 | { FALSE, FALSE, FALSE } // back | 111 | { FALSE, FALSE, FALSE } // back |
112 | }; | 112 | }; |
113 | 113 | ||
114 | const char *skin_mask_file_names[11] = { | 114 | const char *skin_mask_file_names[11] = { |
115 | "play", "stop", "pause", "next", "prev", "up", | 115 | "play", "stop", "pause", "next", "prev", "up", |
116 | "down", "loop", "playlist", "forward", "back" | 116 | "down", "loop", "playlist", "forward", "back" |
117 | }; | 117 | }; |
118 | 118 | ||
119 | 119 | ||
120 | static void changeTextColor( QWidget *w ) { | 120 | static void changeTextColor( QWidget *w ) { |
121 | QPalette p = w->palette(); | 121 | QPalette p = w->palette(); |
122 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); | 122 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); |
123 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); | 123 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); |
124 | w->setPalette( p ); | 124 | w->setPalette( p ); |
125 | } | 125 | } |
126 | 126 | ||
127 | static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | 127 | static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); |
128 | 128 | ||
129 | 129 | ||
130 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | 130 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : |
131 | QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { | 131 | QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { |
132 | setCaption( tr("OpiePlayer") ); | 132 | setCaption( tr("OpiePlayer") ); |
133 | 133 | ||
134 | Config cfg("OpiePlayer"); | 134 | Config cfg("OpiePlayer"); |
135 | cfg.setGroup("Options"); | 135 | cfg.setGroup("Options"); |
136 | skin = cfg.readEntry("Skin","default"); | 136 | skin = cfg.readEntry("Skin","default"); |
137 | //skin = "scaleTest"; | 137 | //skin = "scaleTest"; |
138 | // color of background, frame, degree of transparency | 138 | // color of background, frame, degree of transparency |
139 | 139 | ||
140 | QString skinPath = "opieplayer2/skins/" + skin; | 140 | QString skinPath = "opieplayer2/skins/" + skin; |
141 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | 141 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); |
142 | imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); | 142 | imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); |
143 | imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); | 143 | imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); |
144 | 144 | ||
145 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); | 145 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); |
146 | imgButtonMask->fill( 0 ); | 146 | imgButtonMask->fill( 0 ); |
147 | 147 | ||
148 | for ( int i = 0; i < 11; i++ ) { | 148 | for ( int i = 0; i < 11; i++ ) { |
149 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; | 149 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; |
150 | masks[i] = new QBitmap( filename ); | 150 | masks[i] = new QBitmap( filename ); |
151 | 151 | ||
152 | if ( !masks[i]->isNull() ) { | 152 | if ( !masks[i]->isNull() ) { |
153 | QImage imgMask = masks[i]->convertToImage(); | 153 | QImage imgMask = masks[i]->convertToImage(); |
154 | uchar **dest = imgButtonMask->jumpTable(); | 154 | uchar **dest = imgButtonMask->jumpTable(); |
155 | for ( int y = 0; y < imgUp->height(); y++ ) { | 155 | for ( int y = 0; y < imgUp->height(); y++ ) { |
156 | uchar *line = dest[y]; | 156 | uchar *line = dest[y]; |
157 | for ( int x = 0; x < imgUp->width(); x++ ) | 157 | for ( int x = 0; x < imgUp->width(); x++ ) |
158 | if ( !qRed( imgMask.pixel( x, y ) ) ) | 158 | if ( !qRed( imgMask.pixel( x, y ) ) ) |
159 | line[x] = i + 1; | 159 | line[x] = i + 1; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | } | 163 | } |
164 | 164 | ||
165 | for ( int i = 0; i < 11; i++ ) { | 165 | for ( int i = 0; i < 11; i++ ) { |
166 | buttonPixUp[i] = NULL; | 166 | buttonPixUp[i] = NULL; |
167 | buttonPixDown[i] = NULL; | 167 | buttonPixDown[i] = NULL; |
168 | } | 168 | } |
169 | 169 | ||
170 | setBackgroundPixmap( *pixBg ); | 170 | setBackgroundPixmap( *pixBg ); |
171 | 171 | ||
172 | songInfo.setFocusPolicy( QWidget::NoFocus ); | 172 | songInfo.setFocusPolicy( QWidget::NoFocus ); |
173 | changeTextColor( &songInfo ); | 173 | changeTextColor( &songInfo ); |
174 | 174 | ||
175 | slider.setFixedHeight( 20 ); | 175 | slider.setFixedHeight( 20 ); |
176 | slider.setMinValue( 0 ); | 176 | slider.setMinValue( 0 ); |
177 | slider.setMaxValue( 1 ); | 177 | slider.setMaxValue( 1 ); |
178 | slider.setFocusPolicy( QWidget::NoFocus ); | 178 | slider.setFocusPolicy( QWidget::NoFocus ); |
179 | slider.setBackgroundPixmap( *pixBg ); | 179 | slider.setBackgroundPixmap( *pixBg ); |
180 | 180 | ||
181 | time.setFocusPolicy( QWidget::NoFocus ); | 181 | time.setFocusPolicy( QWidget::NoFocus ); |
182 | time.setAlignment( Qt::AlignCenter ); | 182 | time.setAlignment( Qt::AlignCenter ); |
183 | time.setFrame(FALSE); | 183 | time.setFrame(FALSE); |
184 | changeTextColor( &time ); | 184 | changeTextColor( &time ); |
185 | 185 | ||
186 | resizeEvent( NULL ); | 186 | resizeEvent( NULL ); |
187 | 187 | ||
188 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 188 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
189 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 189 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
190 | 190 | ||
191 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 191 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
192 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 192 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
193 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 193 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
194 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 194 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
195 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 195 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
196 | 196 | ||
197 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 197 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
198 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 198 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
199 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 199 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
200 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 200 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
201 | 201 | ||
202 | 202 | ||
203 | 203 | ||
204 | // Intialise state | 204 | // Intialise state |
205 | setLength( mediaPlayerState->length() ); | 205 | setLength( mediaPlayerState->length() ); |
206 | setPosition( mediaPlayerState->position() ); | 206 | setPosition( mediaPlayerState->position() ); |
207 | setLooping( mediaPlayerState->fullscreen() ); | 207 | setLooping( mediaPlayerState->fullscreen() ); |
208 | setPaused( mediaPlayerState->paused() ); | 208 | setPaused( mediaPlayerState->paused() ); |
209 | setPlaying( mediaPlayerState->playing() ); | 209 | setPlaying( mediaPlayerState->playing() ); |
210 | 210 | ||
211 | } | 211 | } |
212 | 212 | ||
213 | AudioWidget::~AudioWidget() { | 213 | AudioWidget::~AudioWidget() { |
214 | 214 | ||
215 | for ( int i = 0; i < 11; i++ ) { | 215 | for ( int i = 0; i < 11; i++ ) { |
216 | delete buttonPixUp[i]; | 216 | delete buttonPixUp[i]; |
217 | delete buttonPixDown[i]; | 217 | delete buttonPixDown[i]; |
218 | } | 218 | } |
219 | delete pixBg; | 219 | delete pixBg; |
220 | delete imgUp; | 220 | delete imgUp; |
221 | delete imgDn; | 221 | delete imgDn; |
222 | delete imgButtonMask; | 222 | delete imgButtonMask; |
223 | for ( int i = 0; i < 11; i++ ) { | 223 | for ( int i = 0; i < 11; i++ ) { |
224 | delete masks[i]; | 224 | delete masks[i]; |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 228 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
229 | QPixmap pix( img.width(), img.height() ); | 229 | QPixmap pix( img.width(), img.height() ); |
230 | QPainter p( &pix ); | 230 | QPainter p( &pix ); |
231 | p.drawTiledPixmap( pix.rect(), bg, offset ); | 231 | p.drawTiledPixmap( pix.rect(), bg, offset ); |
232 | p.drawImage( 0, 0, img ); | 232 | p.drawImage( 0, 0, img ); |
233 | return new QPixmap( pix ); | 233 | return new QPixmap( pix ); |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) | 237 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) |
238 | { | 238 | { |
239 | QPixmap *pixmap = new QPixmap( pix ); | 239 | QPixmap *pixmap = new QPixmap( pix ); |
240 | pixmap->setMask( mask ); | 240 | pixmap->setMask( mask ); |
241 | return pixmap; | 241 | return pixmap; |
242 | } | 242 | } |
243 | 243 | ||
244 | 244 | ||
245 | 245 | ||
246 | void AudioWidget::resizeEvent( QResizeEvent * ) { | 246 | void AudioWidget::resizeEvent( QResizeEvent * ) { |
247 | int h = height(); | 247 | int h = height(); |
248 | int w = width(); | 248 | int w = width(); |
249 | 249 | ||
250 | songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); | 250 | songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); |
251 | slider.setFixedWidth( w - 110 ); | 251 | slider.setFixedWidth( w - 110 ); |
252 | slider.setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); | 252 | slider.setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); |
253 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); | 253 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); |
254 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); | 254 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); |
255 | 255 | ||
256 | xoff = ( w - imgUp->width() ) / 2; | 256 | xoff = ( w - imgUp->width() ) / 2; |
257 | yoff = (( h - imgUp->height() ) / 2) - 10; | 257 | yoff = (( h - imgUp->height() ) / 2) - 10; |
258 | QPoint p( xoff, yoff ); | 258 | QPoint p( xoff, yoff ); |
259 | 259 | ||
260 | QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p ); | 260 | QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p ); |
261 | QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); | 261 | QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); |
262 | 262 | ||
263 | for ( int i = 0; i < 11; i++ ) { | 263 | for ( int i = 0; i < 11; i++ ) { |
264 | if ( !masks[i]->isNull() ) { | 264 | if ( !masks[i]->isNull() ) { |
265 | delete buttonPixUp[i]; | 265 | delete buttonPixUp[i]; |
266 | delete buttonPixDown[i]; | 266 | delete buttonPixDown[i]; |
267 | buttonPixUp[i] = maskPixToMask( *pixUp, *masks[i] ); | 267 | buttonPixUp[i] = maskPixToMask( *pixUp, *masks[i] ); |
268 | buttonPixDown[i] = maskPixToMask( *pixDn, *masks[i] ); | 268 | buttonPixDown[i] = maskPixToMask( *pixDn, *masks[i] ); |
269 | } | 269 | } |
270 | } | 270 | } |
271 | 271 | ||
272 | delete pixUp; | 272 | delete pixUp; |
273 | delete pixDn; | 273 | delete pixDn; |
274 | } | 274 | } |
275 | 275 | ||
276 | static bool audioSliderBeingMoved = FALSE; | 276 | static bool audioSliderBeingMoved = FALSE; |
277 | 277 | ||
278 | 278 | ||
279 | void AudioWidget::sliderPressed() { | 279 | void AudioWidget::sliderPressed() { |
280 | audioSliderBeingMoved = TRUE; | 280 | audioSliderBeingMoved = TRUE; |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | void AudioWidget::sliderReleased() { | 284 | void AudioWidget::sliderReleased() { |
285 | audioSliderBeingMoved = FALSE; | 285 | audioSliderBeingMoved = FALSE; |
286 | if ( slider.width() == 0 ) | 286 | if ( slider.width() == 0 ) |
287 | return; | 287 | return; |
288 | long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); | 288 | long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); |
289 | mediaPlayerState->setPosition( val ); | 289 | mediaPlayerState->setPosition( val ); |
290 | } | 290 | } |
291 | 291 | ||
292 | void AudioWidget::setPosition( long i ) { | 292 | void AudioWidget::setPosition( long i ) { |
293 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); | 293 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); |
294 | updateSlider( i, mediaPlayerState->length() ); | 294 | updateSlider( i, mediaPlayerState->length() ); |
295 | } | 295 | } |
296 | 296 | ||
297 | 297 | ||
298 | void AudioWidget::setLength( long max ) { | 298 | void AudioWidget::setLength( long max ) { |
299 | updateSlider( mediaPlayerState->position(), max ); | 299 | updateSlider( mediaPlayerState->position(), max ); |
300 | } | 300 | } |
301 | 301 | ||
302 | 302 | ||
303 | void AudioWidget::setView( char view ) { | 303 | void AudioWidget::setView( char view ) { |
304 | 304 | ||
305 | // this isnt working for some reason | 305 | // this isnt working for some reason |
306 | 306 | ||
307 | if ( mediaPlayerState->streaming() ) { | 307 | if ( mediaPlayerState->streaming() ) { |
308 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 308 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); |
309 | if( !slider.isHidden()) { | 309 | if( !slider.isHidden()) { |
310 | slider.hide(); | 310 | slider.hide(); |
311 | } | 311 | } |
312 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 312 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
313 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 313 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
314 | } else { | 314 | } else { |
315 | // this stops the slider from being moved, thus | 315 | // this stops the slider from being moved, thus |
316 | // does not stop stream when it reaches the end | 316 | // does not stop stream when it reaches the end |
317 | slider.show(); | 317 | slider.show(); |
318 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 318 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
319 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 319 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
320 | } | 320 | } |
321 | 321 | ||
322 | if ( view == 'a' ) { | 322 | if ( view == 'a' ) { |
323 | // startTimer( 150 ); | 323 | // startTimer( 150 ); |
324 | showMaximized(); | 324 | showMaximized(); |
325 | } else { | 325 | } else { |
326 | killTimers(); | 326 | killTimers(); |
327 | hide(); | 327 | hide(); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | 331 | ||
332 | static QString timeAsString( long length ) { | 332 | static QString timeAsString( long length ) { |
333 | int minutes = length / 60; | 333 | int minutes = length / 60; |
334 | int seconds = length % 60; | 334 | int seconds = length % 60; |
335 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); | 335 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); |
336 | } | 336 | } |
337 | 337 | ||
338 | void AudioWidget::updateSlider( long i, long max ) { | 338 | void AudioWidget::updateSlider( long i, long max ) { |
339 | 339 | ||
340 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); | 340 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); |
341 | // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; | 341 | // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; |
342 | 342 | ||
343 | if ( max == 0 ) { | 343 | if ( max == 0 ) { |
344 | return; | 344 | return; |
345 | } | 345 | } |
346 | // Will flicker too much if we don't do this | 346 | // Will flicker too much if we don't do this |
347 | // Scale to something reasonable | 347 | // Scale to something reasonable |
348 | int width = slider.width(); | 348 | int width = slider.width(); |
349 | int val = int((double)i * width / max); | 349 | int val = int((double)i * width / max); |
350 | if ( !audioSliderBeingMoved ) { | 350 | if ( !audioSliderBeingMoved ) { |
351 | if ( slider.value() != val ) { | 351 | if ( slider.value() != val ) { |
352 | slider.setValue( val ); | 352 | slider.setValue( val ); |
353 | } | 353 | } |
354 | 354 | ||
355 | if ( slider.maxValue() != width ) { | 355 | if ( slider.maxValue() != width ) { |
356 | slider.setMaxValue( width ); | 356 | slider.setMaxValue( width ); |
357 | } | 357 | } |
358 | } | 358 | } |
359 | } | 359 | } |
360 | 360 | ||
361 | 361 | ||
362 | void AudioWidget::setToggleButton( int i, bool down ) { | 362 | void AudioWidget::setToggleButton( int i, bool down ) { |
363 | if ( down != audioButtons[i].isDown ) { | 363 | if ( down != audioButtons[i].isDown ) { |
364 | toggleButton( i ); | 364 | toggleButton( i ); |
365 | } | 365 | } |
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
369 | void AudioWidget::toggleButton( int i ) { | 369 | void AudioWidget::toggleButton( int i ) { |
370 | audioButtons[i].isDown = !audioButtons[i].isDown; | 370 | audioButtons[i].isDown = !audioButtons[i].isDown; |
371 | QPainter p(this); | 371 | QPainter p(this); |
372 | paintButton ( &p, i ); | 372 | paintButton ( &p, i ); |
373 | } | 373 | } |
374 | 374 | ||
375 | 375 | ||
376 | void AudioWidget::paintButton( QPainter *p, int i ) { | 376 | void AudioWidget::paintButton( QPainter *p, int i ) { |
377 | if ( audioButtons[i].isDown ) | 377 | if ( audioButtons[i].isDown ) { |
378 | p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); | 378 | p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); |
379 | else | 379 | } else { |
380 | p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); | 380 | p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); |
381 | } | ||
381 | } | 382 | } |
382 | 383 | ||
383 | 384 | ||
384 | void AudioWidget::skipFor() { | 385 | void AudioWidget::skipFor() { |
385 | skipDirection = +1; | 386 | skipDirection = +1; |
386 | startTimer( 50 ); | 387 | startTimer( 50 ); |
387 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); | 388 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); |
388 | } | 389 | } |
389 | 390 | ||
390 | void AudioWidget::skipBack() { | 391 | void AudioWidget::skipBack() { |
391 | skipDirection = -1; | 392 | skipDirection = -1; |
392 | startTimer( 50 ); | 393 | startTimer( 50 ); |
393 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); | 394 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); |
394 | } | 395 | } |
395 | 396 | ||
396 | 397 | ||
397 | 398 | ||
398 | void AudioWidget::stopSkip() { | 399 | void AudioWidget::stopSkip() { |
399 | killTimers(); | 400 | killTimers(); |
400 | } | 401 | } |
401 | 402 | ||
402 | 403 | ||
403 | void AudioWidget::timerEvent( QTimerEvent * ) { | 404 | void AudioWidget::timerEvent( QTimerEvent * ) { |
404 | if ( skipDirection == +1 ) { | 405 | if ( skipDirection == +1 ) { |
405 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); | 406 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); |
406 | } else if ( skipDirection == -1 ) { | 407 | } else if ( skipDirection == -1 ) { |
407 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); | 408 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); |
408 | } | 409 | } |
409 | } | 410 | } |
410 | 411 | ||
411 | 412 | ||
412 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | 413 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { |
413 | for ( int i = 0; i < numButtons; i++ ) { | 414 | for ( int i = 0; i < numButtons; i++ ) { |
414 | if ( event->state() == QMouseEvent::LeftButton ) { | 415 | if ( event->state() == QMouseEvent::LeftButton ) { |
415 | 416 | // The test to see if the mouse click is inside the button or not | |
416 | // The test to see if the mouse click is inside the button or not | ||
417 | int x = event->pos().x() - xoff; | 417 | int x = event->pos().x() - xoff; |
418 | int y = event->pos().y() - yoff; | 418 | int y = event->pos().y() - yoff; |
419 | 419 | ||
420 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() | 420 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() |
421 | && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); | 421 | && y < imgButtonMask->height() |
422 | 422 | && imgButtonMask->pixelIndex( x, y ) == i + 1 ); | |
423 | if ( isOnButton && i == AudioVolumeUp ) | ||
424 | qDebug("on up"); | ||
425 | 423 | ||
426 | if ( isOnButton && !audioButtons[i].isHeld ) { | 424 | if ( isOnButton && !audioButtons[i].isHeld ) { |
427 | audioButtons[i].isHeld = TRUE; | 425 | audioButtons[i].isHeld = TRUE; |
428 | toggleButton(i); | 426 | toggleButton(i); |
427 | |||
429 | switch (i) { | 428 | switch (i) { |
430 | case AudioVolumeUp: | 429 | case AudioVolumeUp: |
431 | qDebug("more clicked"); | 430 | qDebug("more clicked"); |
432 | emit moreClicked(); | 431 | emit moreClicked(); |
433 | return; | 432 | return; |
434 | case AudioVolumeDown: | 433 | case AudioVolumeDown: |
435 | emit lessClicked(); | 434 | emit lessClicked(); |
436 | return; | 435 | return; |
437 | case AudioForward: | 436 | case AudioForward: |
438 | emit forwardClicked(); | 437 | emit forwardClicked(); |
439 | return; | 438 | return; |
440 | case AudioBack: | 439 | case AudioBack: |
441 | emit backClicked(); | 440 | emit backClicked(); |
442 | return; | 441 | return; |
443 | } | 442 | } |
444 | } else if ( !isOnButton && audioButtons[i].isHeld ) { | 443 | } else if ( !isOnButton && audioButtons[i].isHeld ) { |
445 | audioButtons[i].isHeld = FALSE; | 444 | audioButtons[i].isHeld = FALSE; |
446 | toggleButton(i); | 445 | toggleButton(i); |
447 | } | 446 | } |
448 | } else { | 447 | } else { |
449 | if ( audioButtons[i].isHeld ) { | 448 | if ( audioButtons[i].isHeld ) { |
450 | audioButtons[i].isHeld = FALSE; | 449 | audioButtons[i].isHeld = FALSE; |
451 | if ( !audioButtons[i].isToggle ) { | 450 | if ( !audioButtons[i].isToggle ) { |
452 | setToggleButton( i, FALSE ); | 451 | setToggleButton( i, FALSE ); |
453 | qDebug("button toggled3 %d",i); | 452 | qDebug("button toggled3 %d",i); |
454 | } | 453 | } |
455 | switch (i) { | 454 | switch (i) { |
456 | case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; | 455 | case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; |
457 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; | 456 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; |
458 | case AudioPause: mediaPlayerState->setPaused( audioButtons[i].isDown); return; | 457 | case AudioPause: mediaPlayerState->setPaused( audioButtons[i].isDown); return; |
459 | case AudioNext: mediaPlayerState->setNext(); return; | 458 | case AudioNext: mediaPlayerState->setNext(); return; |
460 | case AudioPrevious: mediaPlayerState->setPrev(); return; | 459 | case AudioPrevious: mediaPlayerState->setPrev(); return; |
461 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; | 460 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; |
462 | case AudioVolumeUp: emit moreReleased(); return; | 461 | case AudioVolumeUp: emit moreReleased(); return; |
463 | case AudioVolumeDown: emit lessReleased(); return; | 462 | case AudioVolumeDown: emit lessReleased(); return; |
464 | case AudioPlayList: mediaPlayerState->setList(); return; | 463 | case AudioPlayList: mediaPlayerState->setList(); return; |
465 | case AudioForward: emit forwardReleased(); return; | 464 | case AudioForward: emit forwardReleased(); return; |
466 | case AudioBack: emit backReleased(); return; | 465 | case AudioBack: emit backReleased(); return; |
467 | } | 466 | } |
468 | } | 467 | } |
469 | } | 468 | } |
470 | } | 469 | } |
471 | } | 470 | } |
472 | 471 | ||
473 | 472 | ||
474 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 473 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
475 | mouseMoveEvent( event ); | 474 | mouseMoveEvent( event ); |
476 | } | 475 | } |
477 | 476 | ||
478 | 477 | ||
479 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | 478 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { |
480 | mouseMoveEvent( event ); | 479 | mouseMoveEvent( event ); |
481 | } | 480 | } |
482 | 481 | ||
483 | 482 | ||
484 | void AudioWidget::showEvent( QShowEvent* ) { | 483 | void AudioWidget::showEvent( QShowEvent* ) { |
485 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 484 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
486 | mouseMoveEvent( &event ); | 485 | mouseMoveEvent( &event ); |
487 | } | 486 | } |
488 | 487 | ||
489 | 488 | ||
490 | void AudioWidget::closeEvent( QCloseEvent* ) { | 489 | void AudioWidget::closeEvent( QCloseEvent* ) { |
491 | mediaPlayerState->setList(); | 490 | mediaPlayerState->setList(); |
492 | } | 491 | } |
493 | 492 | ||
494 | 493 | ||
495 | void AudioWidget::paintEvent( QPaintEvent * pe) { | 494 | void AudioWidget::paintEvent( QPaintEvent * pe) { |
496 | if ( !pe->erased() ) { | 495 | if ( !pe->erased() ) { |
497 | // Combine with background and double buffer | 496 | // Combine with background and double buffer |
498 | QPixmap pix( pe->rect().size() ); | 497 | QPixmap pix( pe->rect().size() ); |
499 | QPainter p( &pix ); | 498 | QPainter p( &pix ); |
500 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 499 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
501 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 500 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
502 | for ( int i = 0; i < numButtons; i++ ) | 501 | for ( int i = 0; i < numButtons; i++ ) |
503 | paintButton( &p, i ); | 502 | paintButton( &p, i ); |
504 | QPainter p2( this ); | 503 | QPainter p2( this ); |
505 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 504 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
506 | } else { | 505 | } else { |
507 | QPainter p( this ); | 506 | QPainter p( this ); |
508 | for ( int i = 0; i < numButtons; i++ ) | 507 | for ( int i = 0; i < numButtons; i++ ) |
509 | paintButton( &p, i ); | 508 | paintButton( &p, i ); |
510 | } | 509 | } |
511 | } | 510 | } |
512 | 511 | ||
513 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) | 512 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) |
514 | { | 513 | { |
515 | switch ( e->key() ) { | 514 | switch ( e->key() ) { |
516 | ////////////////////////////// Zaurus keys | 515 | ////////////////////////////// Zaurus keys |
517 | case Key_Home: | 516 | case Key_Home: |
518 | break; | 517 | break; |
519 | case Key_F9: //activity | 518 | case Key_F9: //activity |
520 | hide(); | 519 | hide(); |
521 | // qDebug("Audio F9"); | 520 | // qDebug("Audio F9"); |
522 | break; | 521 | break; |
523 | case Key_F10: //contacts | 522 | case Key_F10: //contacts |
524 | break; | 523 | break; |
525 | case Key_F11: //menu | 524 | case Key_F11: //menu |
526 | break; | 525 | break; |
527 | case Key_F12: //home | 526 | case Key_F12: //home |
528 | break; | 527 | break; |
529 | case Key_F13: //mail | 528 | case Key_F13: //mail |
530 | break; | 529 | break; |
531 | case Key_Space: { | 530 | case Key_Space: { |
532 | if(mediaPlayerState->playing()) { | 531 | if(mediaPlayerState->playing()) { |
533 | // toggleButton(1); | 532 | // toggleButton(1); |
534 | mediaPlayerState->setPlaying(FALSE); | 533 | mediaPlayerState->setPlaying(FALSE); |
535 | // toggleButton(1); | 534 | // toggleButton(1); |
536 | } else { | 535 | } else { |
537 | // toggleButton(0); | 536 | // toggleButton(0); |
538 | mediaPlayerState->setPlaying(TRUE); | 537 | mediaPlayerState->setPlaying(TRUE); |
539 | // toggleButton(0); | 538 | // toggleButton(0); |
540 | } | 539 | } |
541 | } | 540 | } |
542 | break; | 541 | break; |
543 | case Key_Down: | 542 | case Key_Down: |
544 | toggleButton(6); | 543 | toggleButton(6); |
545 | emit lessClicked(); | 544 | emit lessClicked(); |
546 | emit lessReleased(); | 545 | emit lessReleased(); |
547 | toggleButton(6); | 546 | toggleButton(6); |
548 | break; | 547 | break; |
549 | case Key_Up: | 548 | case Key_Up: |
550 | toggleButton(5); | 549 | toggleButton(5); |
551 | emit moreClicked(); | 550 | emit moreClicked(); |
552 | emit moreReleased(); | 551 | emit moreReleased(); |
553 | toggleButton(5); | 552 | toggleButton(5); |
554 | break; | 553 | break; |
555 | case Key_Right: | 554 | case Key_Right: |
556 | // toggleButton(3); | 555 | // toggleButton(3); |
557 | mediaPlayerState->setNext(); | 556 | mediaPlayerState->setNext(); |
558 | // toggleButton(3); | 557 | // toggleButton(3); |
559 | break; | 558 | break; |
560 | case Key_Left: | 559 | case Key_Left: |
561 | // toggleButton(4); | 560 | // toggleButton(4); |
562 | mediaPlayerState->setPrev(); | 561 | mediaPlayerState->setPrev(); |
563 | // toggleButton(4); | 562 | // toggleButton(4); |
564 | break; | 563 | break; |
565 | case Key_Escape: | 564 | case Key_Escape: |
566 | break; | 565 | break; |
567 | 566 | ||
568 | }; | 567 | }; |
569 | } | 568 | } |