summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp22
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h6
2 files changed, 10 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index fe7ddc1..2081b4f 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -130,8 +130,6 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
130 } 130 }
131 131
132 for ( int i = 0; i < 10; i++ ) { 132 buttonPixUp.resize( masks.size(), QPixmap() );
133 buttonPixUp[i] = 0l; 133 buttonPixDown.resize( masks.size(), QPixmap() );
134 buttonPixDown[i] = 0l;
135 }
136 134
137 setBackgroundPixmap( pixBg ); 135 setBackgroundPixmap( pixBg );
@@ -181,8 +179,4 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
181AudioWidget::~AudioWidget() { 179AudioWidget::~AudioWidget() {
182 180
183 for ( int i = 0; i < 10; i++ ) {
184 delete buttonPixUp[i];
185 delete buttonPixDown[i];
186 }
187// mediaPlayerState->setPlaying(false); 181// mediaPlayerState->setPlaying(false);
188} 182}
@@ -199,7 +193,7 @@ QPixmap combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
199 193
200 194
201QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { 195QPixmap maskPixToMask( QPixmap pix, QBitmap mask ) {
202 QPixmap *pixmap = new QPixmap( pix ); 196 QPixmap pixmap( pix );
203 pixmap->setMask( mask ); 197 pixmap.setMask( mask );
204 return pixmap; 198 return pixmap;
205} 199}
@@ -226,6 +220,4 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
226 for ( int i = 0; i < 10; i++ ) { 220 for ( int i = 0; i < 10; i++ ) {
227 if ( !masks[i].isNull() ) { 221 if ( !masks[i].isNull() ) {
228 delete buttonPixUp[i];
229 delete buttonPixDown[i];
230 buttonPixUp[i] = maskPixToMask( pixUp, masks[i] ); 222 buttonPixUp[i] = maskPixToMask( pixUp, masks[i] );
231 buttonPixDown[i] = maskPixToMask( pixDn, masks[i] ); 223 buttonPixDown[i] = maskPixToMask( pixDn, masks[i] );
@@ -333,7 +325,7 @@ void AudioWidget::setToggleButton( int i, bool down ) {
333void AudioWidget::paintButton( QPainter &p, int i ) { 325void AudioWidget::paintButton( QPainter &p, int i ) {
334 if ( buttons[i].isDown ) { 326 if ( buttons[i].isDown ) {
335 p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); 327 p.drawPixmap( upperLeftOfButtonMask, buttonPixDown[i] );
336 } else { 328 } else {
337 p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); 329 p.drawPixmap( upperLeftOfButtonMask, buttonPixUp[i] );
338 } 330 }
339} 331}
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index bc7262c..73ce1e5 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -93,4 +93,5 @@ private slots:
93private: 93private:
94 typedef std::vector<QBitmap> MaskVector; 94 typedef std::vector<QBitmap> MaskVector;
95 typedef std::vector<QPixmap> PixmapVector;
95 96
96 void setToggleButton( int, bool ); 97 void setToggleButton( int, bool );
@@ -102,8 +103,7 @@ private:
102 QImage imgDn; 103 QImage imgDn;
103 MaskVector masks; 104 MaskVector masks;
104 QPixmap *buttonPixUp[10]; 105 PixmapVector buttonPixUp;
105 QPixmap *buttonPixDown[10]; 106 PixmapVector buttonPixDown;
106 107
107 QPixmap *pixmaps[4];
108 OTicker songInfo; 108 OTicker songInfo;
109 QSlider slider; 109 QSlider slider;