summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 376f8d3..d135647 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -142,65 +142,67 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
142 //NoFrame 142 //NoFrame
143// songInfo.setForegroundColor(Qt::white); 143// songInfo.setForegroundColor(Qt::white);
144 144
145 slider.setFixedHeight( 20 ); 145 slider.setFixedHeight( 20 );
146 slider.setMinValue( 0 ); 146 slider.setMinValue( 0 );
147 slider.setMaxValue( 1 ); 147 slider.setMaxValue( 1 );
148 slider.setFocusPolicy( QWidget::NoFocus ); 148 slider.setFocusPolicy( QWidget::NoFocus );
149 149
150 slider.setBackgroundPixmap( *pixBg ); 150 slider.setBackgroundPixmap( *pixBg );
151 151
152 time.setFocusPolicy( QWidget::NoFocus ); 152 time.setFocusPolicy( QWidget::NoFocus );
153 time.setAlignment( Qt::AlignCenter ); 153 time.setAlignment( Qt::AlignCenter );
154 time.setFrame(FALSE); 154 time.setFrame(FALSE);
155 changeTextColor( &time ); 155 changeTextColor( &time );
156 156
157 resizeEvent( NULL ); 157 resizeEvent( NULL );
158 158
159 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 159 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
160 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 160 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
161 161
162 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); 162 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
163 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); 163 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
164 connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); 164 connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
165// connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); 165// connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
166 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); 166 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
167 167
168 // Intialise state 168 // Intialise state
169 setLength( mediaPlayerState->length() ); 169 setLength( mediaPlayerState->length() );
170 setPosition( mediaPlayerState->position() ); 170 setPosition( mediaPlayerState->position() );
171 setLooping( mediaPlayerState->fullscreen() ); 171 setLooping( mediaPlayerState->fullscreen() );
172// setPaused( mediaPlayerState->paused() ); 172// setPaused( mediaPlayerState->paused() );
173 setPlaying( mediaPlayerState->playing() ); 173 setPlaying( mediaPlayerState->playing() );
174this->setFocus(); 174 this->setFocus();
175 if(this->x() < 0 || this->y() < 0)
176 this->move(0,0);
175} 177}
176 178
177 179
178AudioWidget::~AudioWidget() { 180AudioWidget::~AudioWidget() {
179 // setPlaying( false); 181 // setPlaying( false);
180 182
181 for ( int i = 0; i < 10; i++ ) { 183 for ( int i = 0; i < 10; i++ ) {
182 if(buttonPixUp[i]) delete buttonPixUp[i]; 184 if(buttonPixUp[i]) delete buttonPixUp[i];
183 if(buttonPixDown[i]) delete buttonPixDown[i]; 185 if(buttonPixDown[i]) delete buttonPixDown[i];
184 } 186 }
185 if(pixBg) delete pixBg; 187 if(pixBg) delete pixBg;
186 if(imgUp) delete imgUp; 188 if(imgUp) delete imgUp;
187 if(imgDn) delete imgDn; 189 if(imgDn) delete imgDn;
188 if(imgButtonMask) delete imgButtonMask; 190 if(imgButtonMask) delete imgButtonMask;
189 for ( int i = 0; i < 10; i++ ) { 191 for ( int i = 0; i < 10; i++ ) {
190 if(masks[i]) delete masks[i]; 192 if(masks[i]) delete masks[i];
191 } 193 }
192} 194}
193 195
194 196
195QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { 197QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
196 QPixmap pix( img.width(), img.height() ); 198 QPixmap pix( img.width(), img.height() );
197 QPainter p( &pix ); 199 QPainter p( &pix );
198 p.drawTiledPixmap( pix.rect(), bg, offset ); 200 p.drawTiledPixmap( pix.rect(), bg, offset );
199 p.drawImage( 0, 0, img ); 201 p.drawImage( 0, 0, img );
200 return new QPixmap( pix ); 202 return new QPixmap( pix );
201} 203}
202 204
203 205
204QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) 206QPixmap *maskPixToMask( QPixmap pix, QBitmap mask )
205{ 207{
206 QPixmap *pixmap = new QPixmap( pix ); 208 QPixmap *pixmap = new QPixmap( pix );