author | simon <simon> | 2002-12-09 15:57:34 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 15:57:34 (UTC) |
commit | f676d71c1fe40539ceb0c0708fdaefcc9b5e1800 (patch) (side-by-side diff) | |
tree | 5298119bdbd8bffafcd1a31aed1c6fbcb908d3bc | |
parent | 743155915f659d701ad468eadcc2b2173b6e2770 (diff) | |
download | opie-f676d71c1fe40539ceb0c0708fdaefcc9b5e1800.zip opie-f676d71c1fe40539ceb0c0708fdaefcc9b5e1800.tar.gz opie-f676d71c1fe40539ceb0c0708fdaefcc9b5e1800.tar.bz2 |
- back to a vector :P
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 16 |
4 files changed, 19 insertions, 17 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 714509e..c3e206c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -106,2 +106,3 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye Button button; + button.command = skinInfo[ i ].command; button.type = skinInfo[ i ].type; @@ -122,3 +123,3 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye - buttons.insert( i, button ); + buttons.push_back( button ); } @@ -210,3 +211,3 @@ void AudioWidget::resizeEvent( QResizeEvent * ) { - for ( uint i = 0; i < buttons.count(); i++ ) { + for ( uint i = 0; i < buttons.size(); i++ ) { if ( !buttons[i].mask.isNull() ) { @@ -336,3 +337,3 @@ void AudioWidget::timerEvent( QTimerEvent * ) { void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { - for ( unsigned int i = 0; i < buttons.count(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 66129c9..7891a7e 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -84,2 +84,3 @@ void MediaWidget::handleCommand( Command command, bool buttonDown ) case Back: emit backReleased(); return; + default: assert( false ); } @@ -97,3 +98,3 @@ void MediaWidget::paintAllButtons( QPainter &p ) { - for ( ButtonMap::ConstIterator it = buttons.begin(); + for ( ButtonVector::const_iterator it = buttons.begin(); it != buttons.end(); ++it ) diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 05b7b71..efba6f3 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -37,3 +37,3 @@ class MediaWidget : public QWidget public: - enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; + enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, Undefined }; enum ButtonType { NormalButton, ToggleButton }; @@ -42,3 +42,5 @@ public: { - Button() : type( NormalButton ), isHeld( false ), isDown( false ) {} + Button() : command( Undefined ), type( NormalButton ), isHeld( false ), isDown( false ) {} + + Command command; @@ -53,4 +55,2 @@ public: typedef std::vector<Button> ButtonVector; - // when the transition is done this should be Command -> Button - typedef QMap<int, Button> ButtonMap; @@ -99,3 +99,3 @@ protected: - ButtonMap buttons; + ButtonVector buttons; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 9782b68..f59772e 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -76,9 +76,9 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye - buttons.insert( 0, toggleButton ); // play - buttons.insert( 1, toggleButton ); // stop - buttons.insert( 2, toggleButton ); // next - buttons.insert( 3, toggleButton ); // previous - buttons.insert( 4, toggleButton ); // volUp - buttons.insert( 5, toggleButton ); // volDown - buttons.insert( 6, toggleButton ); // fullscreen + buttons.push_back( toggleButton ); // play + buttons.push_back( toggleButton ); // stop + buttons.push_back( toggleButton ); // next + buttons.push_back( toggleButton ); // previous + buttons.push_back( toggleButton ); // volUp + buttons.push_back( toggleButton ); // volDown + buttons.push_back( toggleButton ); // fullscreen @@ -245,3 +245,3 @@ void VideoWidget::updateSlider( long i, long max ) { void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - for ( unsigned int i = 0; i < buttons.count(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { |