summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/audiowidget.cpp
authorsimon <simon>2002-12-08 21:19:07 (UTC)
committer simon <simon>2002-12-08 21:19:07 (UTC)
commit6c0988792eed5cefcc7d1f0c179ccf5317b5baab (patch) (side-by-side diff)
tree27349c3c72d2f623f92ae5ee4b6b871b068d1e55 /noncore/multimedia/opieplayer2/audiowidget.cpp
parentb3ae76e6afdfd734789a85c5e80e8e846b15d6cf (diff)
downloadopie-6c0988792eed5cefcc7d1f0c179ccf5317b5baab.zip
opie-6c0988792eed5cefcc7d1f0c179ccf5317b5baab.tar.gz
opie-6c0988792eed5cefcc7d1f0c179ccf5317b5baab.tar.bz2
- made audioButtons a member variable here, too
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp28
1 files changed, 24 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
@@ -61,6 +61,7 @@ struct MediaButton {
};
//Layout information for the audioButtons (and if it is a toggle button or not)
+/*
MediaWidget::Button audioButtons[] = {
{ TRUE, FALSE, FALSE }, // play
{ FALSE, FALSE, FALSE }, // stop
@@ -73,6 +74,7 @@ MediaWidget::Button audioButtons[] = {
{ FALSE, FALSE, FALSE }, // forward
{ FALSE, FALSE, FALSE } // back
};
+*/
const char * const skin_mask_file_names[10] = {
"play", "stop", "next", "prev", "up",
@@ -86,7 +88,7 @@ void changeTextColor( QWidget * w) {
w->setPalette( p );
}
-const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button));
+//const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button));
}
@@ -94,6 +96,24 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
+ 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") );
Config cfg("OpiePlayer");
@@ -380,7 +400,7 @@ 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 ) {
// The test to see if the mouse click is inside the button or not
int x = event->pos().x() - xoff;
@@ -448,13 +468,13 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
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 );
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
QPainter p( this );
- for ( int i = 0; i < numButtons; i++ )
+ for ( unsigned int i = 0; i < audioButtons.size(); i++ )
paintButton( &p, i );
}
}