summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp7
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h10
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp16
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++ ) {