-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 { //Layout information for the audioButtons (and if it is a toggle button or not) +/* MediaWidget::Button audioButtons[] = { @@ -75,2 +76,3 @@ MediaWidget::Button audioButtons[] = { }; +*/ @@ -88,3 +90,3 @@ void changeTextColor( QWidget * w) { -const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button)); +//const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button)); @@ -96,2 +98,20 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye + Button defaultButton; + defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; + Button toggleButton; + toggleButton.isToggle = true; + toggleButton.isHeld = toggleButton.isDown = false; + + audioButtons.reserve( 10 ); + audioButtons.push_back( toggleButton ); // play + audioButtons.push_back( defaultButton ); // stop + audioButtons.push_back( defaultButton ); // next + audioButtons.push_back( defaultButton ); // previous + audioButtons.push_back( defaultButton ); // volume up + audioButtons.push_back( defaultButton ); // volume down + audioButtons.push_back( toggleButton ); // repeat/loop + audioButtons.push_back( defaultButton ); // playlist + audioButtons.push_back( defaultButton ); // forward + audioButtons.push_back( defaultButton ); // back + setCaption( tr("OpiePlayer") ); @@ -382,3 +402,3 @@ void AudioWidget::timerEvent( QTimerEvent * ) { void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { - for ( int i = 0; i < numButtons; i++ ) { + for ( unsigned int i = 0; i < audioButtons.size(); i++ ) { if ( event->state() == QMouseEvent::LeftButton ) { @@ -450,3 +470,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); - for ( int i = 0; i < numButtons; i++ ) + for ( unsigned int i = 0; i < audioButtons.size(); i++ ) paintButton( &p, i ); @@ -456,3 +476,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { QPainter p( this ); - for ( int i = 0; i < numButtons; i++ ) + for ( unsigned int i = 0; i < audioButtons.size(); i++ ) 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: bool isStreaming : 1; + + ButtonVector audioButtons; }; |