-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 28 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 |
2 files changed, 26 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 879d0b4..4172da0 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -63,2 +63,3 @@ struct MediaButton { | |||
63 | //Layout information for the audioButtons (and if it is a toggle button or not) | 63 | //Layout information for the audioButtons (and if it is a toggle button or not) |
64 | /* | ||
64 | MediaWidget::Button audioButtons[] = { | 65 | MediaWidget::Button audioButtons[] = { |
@@ -75,2 +76,3 @@ MediaWidget::Button audioButtons[] = { | |||
75 | }; | 76 | }; |
77 | */ | ||
76 | 78 | ||
@@ -88,3 +90,3 @@ void changeTextColor( QWidget * w) { | |||
88 | 90 | ||
89 | const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button)); | 91 | //const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button)); |
90 | 92 | ||
@@ -96,2 +98,20 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
96 | 98 | ||
99 | Button defaultButton; | ||
100 | defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; | ||
101 | Button toggleButton; | ||
102 | toggleButton.isToggle = true; | ||
103 | toggleButton.isHeld = toggleButton.isDown = false; | ||
104 | |||
105 | audioButtons.reserve( 10 ); | ||
106 | audioButtons.push_back( toggleButton ); // play | ||
107 | audioButtons.push_back( defaultButton ); // stop | ||
108 | audioButtons.push_back( defaultButton ); // next | ||
109 | audioButtons.push_back( defaultButton ); // previous | ||
110 | audioButtons.push_back( defaultButton ); // volume up | ||
111 | audioButtons.push_back( defaultButton ); // volume down | ||
112 | audioButtons.push_back( toggleButton ); // repeat/loop | ||
113 | audioButtons.push_back( defaultButton ); // playlist | ||
114 | audioButtons.push_back( defaultButton ); // forward | ||
115 | audioButtons.push_back( defaultButton ); // back | ||
116 | |||
97 | setCaption( tr("OpiePlayer") ); | 117 | setCaption( tr("OpiePlayer") ); |
@@ -382,3 +402,3 @@ void AudioWidget::timerEvent( QTimerEvent * ) { | |||
382 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | 402 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { |
383 | for ( int i = 0; i < numButtons; i++ ) { | 403 | for ( unsigned int i = 0; i < audioButtons.size(); i++ ) { |
384 | if ( event->state() == QMouseEvent::LeftButton ) { | 404 | if ( event->state() == QMouseEvent::LeftButton ) { |
@@ -450,3 +470,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { | |||
450 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); | 470 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); |
451 | for ( int i = 0; i < numButtons; i++ ) | 471 | for ( unsigned int i = 0; i < audioButtons.size(); i++ ) |
452 | paintButton( &p, i ); | 472 | paintButton( &p, i ); |
@@ -456,3 +476,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { | |||
456 | QPainter p( this ); | 476 | QPainter p( this ); |
457 | for ( int i = 0; i < numButtons; i++ ) | 477 | for ( unsigned int i = 0; i < audioButtons.size(); i++ ) |
458 | paintButton( &p, i ); | 478 | paintButton( &p, i ); |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 52a358c..e09c5f8 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -112,2 +112,4 @@ private: | |||
112 | bool isStreaming : 1; | 112 | bool isStreaming : 1; |
113 | |||
114 | ButtonVector audioButtons; | ||
113 | }; | 115 | }; |