author | simon <simon> | 2002-12-08 20:44:22 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 20:44:22 (UTC) |
commit | 8824690b4900ebfac866b90cf3e715b62a2acc89 (patch) (side-by-side diff) | |
tree | 943b937168bc723402b4f94471dfdcc8db10f5ae | |
parent | 7c3bd0be34ef70a2297e6f27c592da62f3010da5 (diff) | |
download | opie-8824690b4900ebfac866b90cf3e715b62a2acc89.zip opie-8824690b4900ebfac866b90cf3e715b62a2acc89.tar.gz opie-8824690b4900ebfac866b90cf3e715b62a2acc89.tar.bz2 |
- merged duplicated MediaButton definition into common MediaWidget::Button
structure
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 9 |
3 files changed, 13 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 7bf3a19..879d0b4 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -52,50 +52,50 @@ namespace { const int xo = -2; // movable x offset const int yo = 22; // movable y offset struct MediaButton { bool isToggle, isHeld, isDown; }; //Layout information for the audioButtons (and if it is a toggle button or not) -MediaButton audioButtons[] = { +MediaWidget::Button audioButtons[] = { { TRUE, FALSE, FALSE }, // play { FALSE, FALSE, FALSE }, // stop { FALSE, FALSE, FALSE }, // next { FALSE, FALSE, FALSE }, // previous { FALSE, FALSE, FALSE }, // volume up { FALSE, FALSE, FALSE }, // volume down { TRUE, FALSE, FALSE }, // repeat/loop { FALSE, FALSE, FALSE }, // playlist { FALSE, FALSE, FALSE }, // forward { FALSE, FALSE, FALSE } // back }; const char * const skin_mask_file_names[10] = { "play", "stop", "next", "prev", "up", "down", "loop", "playlist", "forward", "back" }; void changeTextColor( QWidget * w) { QPalette p = w->palette(); p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); w->setPalette( p ); } -const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); +const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button)); } AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { setCaption( tr("OpiePlayer") ); Config cfg("OpiePlayer"); cfg.setGroup("Options"); skin = cfg.readEntry("Skin","default"); diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 2d92d65..0b9d826 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -22,24 +22,33 @@ #include <qwidget.h> #include "mediaplayerstate.h" #include "playlistwidget.h" class MediaWidget : public QWidget { Q_OBJECT public: enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; + struct Button + { +// Button() : isToggle( false ), isHeld( false ), isDown( false ) {} + + bool isToggle : 1; + bool isHeld : 1; + bool isDown : 1; + }; + MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); virtual ~MediaWidget(); public slots: virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; virtual void setLength( long length ) = 0; virtual void setPlaying( bool playing ) = 0; signals: void moreReleased(); void lessReleased(); void forwardReleased(); diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index a0aed62..7c20c6d 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -50,44 +50,39 @@ # define USE_DIRECT_PAINTER # include <qdirectpainter_qws.h> # include <qgfxraster_qws.h> #endif namespace { const int xo = 2; // movable x offset const int yo = 0; // movable y offset - -struct MediaButton { - bool isToggle, isHeld, isDown; -}; - -MediaButton videoButtons[] = { +MediaWidget::Button videoButtons[] = { { FALSE, FALSE, FALSE }, // stop { TRUE, FALSE, FALSE }, // play { FALSE, FALSE, FALSE }, // previous { FALSE, FALSE, FALSE }, // next { FALSE, FALSE, FALSE }, // volUp { FALSE, FALSE, FALSE }, // volDown { TRUE, FALSE, FALSE } // fullscreen }; const char * const skinV_mask_file_names[7] = { "stop","play","back","fwd","up","down","full" }; -const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); +const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button)); } VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) { setCaption( tr("OpiePlayer - Video") ); videoFrame = new XineVideoWidget ( this, "Video frame" ); connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); |