summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-08-15 20:23:51 (UTC)
committer llornkcor <llornkcor>2002-08-15 20:23:51 (UTC)
commit645183c07c68dd420b8565d809bfc0340fee0ff3 (patch) (unidiff)
tree9182788bf3149f8c6c60019018ebf29fb9d6ea17
parent8ec3adb6685ea2342024254052e2ba110c6bb88d (diff)
downloadopie-645183c07c68dd420b8565d809bfc0340fee0ff3.zip
opie-645183c07c68dd420b8565d809bfc0340fee0ff3.tar.gz
opie-645183c07c68dd420b8565d809bfc0340fee0ff3.tar.bz2
new play/pause
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp31
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h6
2 files changed, 23 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 2cb1385..cc6187c 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -100,7 +100,6 @@ struct MediaButton {
100MediaButton audioButtons[] = { 100MediaButton 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
104 { FALSE, FALSE, FALSE }, // next 103 { FALSE, FALSE, FALSE }, // next
105 { FALSE, FALSE, FALSE }, // previous 104 { FALSE, FALSE, FALSE }, // previous
106 { FALSE, FALSE, FALSE }, // volume up 105 { FALSE, FALSE, FALSE }, // volume up
@@ -111,8 +110,8 @@ MediaButton audioButtons[] = {
111 { FALSE, FALSE, FALSE } // back 110 { FALSE, FALSE, FALSE } // back
112}; 111};
113 112
114const char *skin_mask_file_names[11] = { 113const char *skin_mask_file_names[10] = {
115 "play", "stop", "pause", "next", "prev", "up", 114 "play", "stop", "next", "prev", "up",
116 "down", "loop", "playlist", "forward", "back" 115 "down", "loop", "playlist", "forward", "back"
117}; 116};
118 117
@@ -145,7 +144,7 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
145 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); 144 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
146 imgButtonMask->fill( 0 ); 145 imgButtonMask->fill( 0 );
147 146
148 for ( int i = 0; i < 11; i++ ) { 147 for ( int i = 0; i < 10; i++ ) {
149 QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; 148 QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png";
150 masks[i] = new QBitmap( filename ); 149 masks[i] = new QBitmap( filename );
151 150
@@ -162,7 +161,7 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
162 161
163 } 162 }
164 163
165 for ( int i = 0; i < 11; i++ ) { 164 for ( int i = 0; i < 10; i++ ) {
166 buttonPixUp[i] = NULL; 165 buttonPixUp[i] = NULL;
167 buttonPixDown[i] = NULL; 166 buttonPixDown[i] = NULL;
168 } 167 }
@@ -212,7 +211,7 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
212 211
213AudioWidget::~AudioWidget() { 212AudioWidget::~AudioWidget() {
214 213
215 for ( int i = 0; i < 11; i++ ) { 214 for ( int i = 0; i < 10; i++ ) {
216 delete buttonPixUp[i]; 215 delete buttonPixUp[i];
217 delete buttonPixDown[i]; 216 delete buttonPixDown[i];
218 } 217 }
@@ -220,7 +219,7 @@ AudioWidget::~AudioWidget() {
220 delete imgUp; 219 delete imgUp;
221 delete imgDn; 220 delete imgDn;
222 delete imgButtonMask; 221 delete imgButtonMask;
223 for ( int i = 0; i < 11; i++ ) { 222 for ( int i = 0; i < 10; i++ ) {
224 delete masks[i]; 223 delete masks[i];
225 } 224 }
226} 225}
@@ -260,7 +259,7 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
260 QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p ); 259 QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p );
261 QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); 260 QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p );
262 261
263 for ( int i = 0; i < 11; i++ ) { 262 for ( int i = 0; i < 10; i++ ) {
264 if ( !masks[i]->isNull() ) { 263 if ( !masks[i]->isNull() ) {
265 delete buttonPixUp[i]; 264 delete buttonPixUp[i];
266 delete buttonPixDown[i]; 265 delete buttonPixDown[i];
@@ -427,7 +426,6 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
427 426
428 switch (i) { 427 switch (i) {
429 case AudioVolumeUp: 428 case AudioVolumeUp:
430 qDebug("more clicked");
431 emit moreClicked(); 429 emit moreClicked();
432 return; 430 return;
433 case AudioVolumeDown: 431 case AudioVolumeDown:
@@ -452,9 +450,20 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
452 qDebug("button toggled3 %d",i); 450 qDebug("button toggled3 %d",i);
453 } 451 }
454 switch (i) { 452 switch (i) {
455 case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; 453 case AudioPlay:
454 if( mediaPlayerState->isPaused ) {
455 setToggleButton( i, FALSE );
456 mediaPlayerState->setPaused( FALSE );
457 return;
458 } else if( !mediaPlayerState->isPaused ) {
459 setToggleButton( i, TRUE );
460 mediaPlayerState->setPaused( TRUE );
461 return;
462 } else {
463 // setToggleButton( i, TRUE );
464 // mediaPlayerState->setPlaying( videoButtons[i].isDown );
465 }
456 case AudioStop: mediaPlayerState->setPlaying(FALSE); return; 466 case AudioStop: mediaPlayerState->setPlaying(FALSE); return;
457 case AudioPause: mediaPlayerState->setPaused( audioButtons[i].isDown); return;
458 case AudioNext: mediaPlayerState->setNext(); return; 467 case AudioNext: mediaPlayerState->setNext(); return;
459 case AudioPrevious: mediaPlayerState->setPrev(); return; 468 case AudioPrevious: mediaPlayerState->setPrev(); return;
460 case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; 469 case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return;
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index e05188e..772d1d1 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -133,9 +133,9 @@ private:
133 QImage *imgUp; 133 QImage *imgUp;
134 QImage *imgDn; 134 QImage *imgDn;
135 QImage *imgButtonMask; 135 QImage *imgButtonMask;
136 QBitmap *masks[11]; 136 QBitmap *masks[10];
137 QPixmap *buttonPixUp[11]; 137 QPixmap *buttonPixUp[10];
138 QPixmap *buttonPixDown[11]; 138 QPixmap *buttonPixDown[10];
139 139
140 QPixmap *pixmaps[4]; 140 QPixmap *pixmaps[4];
141 Ticker songInfo; 141 Ticker songInfo;