Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index aa8891f..e0f2cf1 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -26,48 +26,55 @@ | |||
26 | #include <qwidget.h> | 26 | #include <qwidget.h> |
27 | 27 | ||
28 | #include "mediaplayerstate.h" | 28 | #include "mediaplayerstate.h" |
29 | #include "playlistwidget.h" | 29 | #include "playlistwidget.h" |
30 | 30 | ||
31 | #include <vector> | 31 | #include <vector> |
32 | 32 | ||
33 | class MediaWidget : public QWidget | 33 | class MediaWidget : public QWidget |
34 | { | 34 | { |
35 | Q_OBJECT | 35 | Q_OBJECT |
36 | public: | 36 | public: |
37 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; | 37 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; |
38 | enum ButtonType { NormalButton, ToggleButton }; | 38 | enum ButtonType { NormalButton, ToggleButton }; |
39 | 39 | ||
40 | struct Button | 40 | struct Button |
41 | { | 41 | { |
42 | Button() : buttonType( NormalButton ), isHeld( false ), isDown( false ) {} | 42 | Button() : buttonType( NormalButton ), isHeld( false ), isDown( false ) {} |
43 | 43 | ||
44 | ButtonType buttonType : 1; | 44 | ButtonType buttonType : 1; |
45 | bool isHeld : 1; | 45 | bool isHeld : 1; |
46 | bool isDown : 1; | 46 | bool isDown : 1; |
47 | }; | 47 | }; |
48 | typedef std::vector<Button> ButtonVector; | 48 | typedef std::vector<Button> ButtonVector; |
49 | 49 | ||
50 | struct SkinButtonInfo | ||
51 | { | ||
52 | Command command; | ||
53 | const char *fileName; | ||
54 | ButtonType buttonType; | ||
55 | }; | ||
56 | |||
50 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); | 57 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); |
51 | virtual ~MediaWidget(); | 58 | virtual ~MediaWidget(); |
52 | 59 | ||
53 | public slots: | 60 | public slots: |
54 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; | 61 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; |
55 | virtual void setLength( long length ) = 0; | 62 | virtual void setLength( long length ) = 0; |
56 | virtual void setPlaying( bool playing ) = 0; | 63 | virtual void setPlaying( bool playing ) = 0; |
57 | 64 | ||
58 | signals: | 65 | signals: |
59 | void moreReleased(); | 66 | void moreReleased(); |
60 | void lessReleased(); | 67 | void lessReleased(); |
61 | void forwardReleased(); | 68 | void forwardReleased(); |
62 | void backReleased(); | 69 | void backReleased(); |
63 | 70 | ||
64 | protected: | 71 | protected: |
65 | virtual void closeEvent( QCloseEvent * ); | 72 | virtual void closeEvent( QCloseEvent * ); |
66 | 73 | ||
67 | void handleCommand( Command command, bool buttonDown ); | 74 | void handleCommand( Command command, bool buttonDown ); |
68 | 75 | ||
69 | bool isOverButton( const QPoint &position, int buttonId ) const; | 76 | bool isOverButton( const QPoint &position, int buttonId ) const; |
70 | 77 | ||
71 | void paintButton( int buttonId ); | 78 | void paintButton( int buttonId ); |
72 | virtual void paintButton( QPainter &p, int i ) = 0; | 79 | virtual void paintButton( QPainter &p, int i ) = 0; |
73 | 80 | ||