-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 | |||
@@ -48,58 +48,58 @@ | |||
48 | 48 | ||
49 | #include "audiowidget.h" | 49 | #include "audiowidget.h" |
50 | #include "mediaplayerstate.h" | 50 | #include "mediaplayerstate.h" |
51 | #include "playlistwidget.h" | 51 | #include "playlistwidget.h" |
52 | 52 | ||
53 | namespace | 53 | namespace |
54 | { | 54 | { |
55 | 55 | ||
56 | const int xo = -2; // movable x offset | 56 | const int xo = -2; // movable x offset |
57 | const int yo = 22; // movable y offset | 57 | const int yo = 22; // movable y offset |
58 | 58 | ||
59 | struct MediaButton { | 59 | struct MediaButton { |
60 | bool isToggle, isHeld, isDown; | 60 | bool isToggle, isHeld, isDown; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | //Layout information for the audioButtons (and if it is a toggle button or not) | 63 | //Layout information for the audioButtons (and if it is a toggle button or not) |
64 | MediaButton audioButtons[] = { | 64 | MediaWidget::Button audioButtons[] = { |
65 | { TRUE, FALSE, FALSE }, // play | 65 | { TRUE, FALSE, FALSE }, // play |
66 | { FALSE, FALSE, FALSE }, // stop | 66 | { FALSE, FALSE, FALSE }, // stop |
67 | { FALSE, FALSE, FALSE }, // next | 67 | { FALSE, FALSE, FALSE }, // next |
68 | { FALSE, FALSE, FALSE }, // previous | 68 | { FALSE, FALSE, FALSE }, // previous |
69 | { FALSE, FALSE, FALSE }, // volume up | 69 | { FALSE, FALSE, FALSE }, // volume up |
70 | { FALSE, FALSE, FALSE }, // volume down | 70 | { FALSE, FALSE, FALSE }, // volume down |
71 | { TRUE, FALSE, FALSE }, // repeat/loop | 71 | { TRUE, FALSE, FALSE }, // repeat/loop |
72 | { FALSE, FALSE, FALSE }, // playlist | 72 | { FALSE, FALSE, FALSE }, // playlist |
73 | { FALSE, FALSE, FALSE }, // forward | 73 | { FALSE, FALSE, FALSE }, // forward |
74 | { FALSE, FALSE, FALSE } // back | 74 | { FALSE, FALSE, FALSE } // back |
75 | }; | 75 | }; |
76 | 76 | ||
77 | const char * const skin_mask_file_names[10] = { | 77 | const char * const skin_mask_file_names[10] = { |
78 | "play", "stop", "next", "prev", "up", | 78 | "play", "stop", "next", "prev", "up", |
79 | "down", "loop", "playlist", "forward", "back" | 79 | "down", "loop", "playlist", "forward", "back" |
80 | }; | 80 | }; |
81 | 81 | ||
82 | void changeTextColor( QWidget * w) { | 82 | void changeTextColor( QWidget * w) { |
83 | QPalette p = w->palette(); | 83 | QPalette p = w->palette(); |
84 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); | 84 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); |
85 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); | 85 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); |
86 | w->setPalette( p ); | 86 | w->setPalette( p ); |
87 | } | 87 | } |
88 | 88 | ||
89 | const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | 89 | const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button)); |
90 | 90 | ||
91 | } | 91 | } |
92 | 92 | ||
93 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 93 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : |
94 | 94 | ||
95 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { | 95 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { |
96 | 96 | ||
97 | setCaption( tr("OpiePlayer") ); | 97 | setCaption( tr("OpiePlayer") ); |
98 | 98 | ||
99 | Config cfg("OpiePlayer"); | 99 | Config cfg("OpiePlayer"); |
100 | cfg.setGroup("Options"); | 100 | cfg.setGroup("Options"); |
101 | skin = cfg.readEntry("Skin","default"); | 101 | skin = cfg.readEntry("Skin","default"); |
102 | //skin = "scaleTest"; | 102 | //skin = "scaleTest"; |
103 | // color of background, frame, degree of transparency | 103 | // color of background, frame, degree of transparency |
104 | 104 | ||
105 | QString skinPath = "opieplayer2/skins/" + skin; | 105 | QString skinPath = "opieplayer2/skins/" + skin; |
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 | |||
@@ -18,32 +18,41 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef MEDIAWIDGET_H | 20 | #ifndef MEDIAWIDGET_H |
21 | #define MEDIAWIDGET_H | 21 | #define MEDIAWIDGET_H |
22 | 22 | ||
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | 24 | ||
25 | #include "mediaplayerstate.h" | 25 | #include "mediaplayerstate.h" |
26 | #include "playlistwidget.h" | 26 | #include "playlistwidget.h" |
27 | 27 | ||
28 | class MediaWidget : public QWidget | 28 | class MediaWidget : public QWidget |
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | public: | 31 | public: |
32 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; | 32 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; |
33 | 33 | ||
34 | struct Button | ||
35 | { | ||
36 | // Button() : isToggle( false ), isHeld( false ), isDown( false ) {} | ||
37 | |||
38 | bool isToggle : 1; | ||
39 | bool isHeld : 1; | ||
40 | bool isDown : 1; | ||
41 | }; | ||
42 | |||
34 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); | 43 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); |
35 | virtual ~MediaWidget(); | 44 | virtual ~MediaWidget(); |
36 | 45 | ||
37 | public slots: | 46 | public slots: |
38 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; | 47 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; |
39 | virtual void setLength( long length ) = 0; | 48 | virtual void setLength( long length ) = 0; |
40 | virtual void setPlaying( bool playing ) = 0; | 49 | virtual void setPlaying( bool playing ) = 0; |
41 | 50 | ||
42 | signals: | 51 | signals: |
43 | void moreReleased(); | 52 | void moreReleased(); |
44 | void lessReleased(); | 53 | void lessReleased(); |
45 | void forwardReleased(); | 54 | void forwardReleased(); |
46 | void backReleased(); | 55 | void backReleased(); |
47 | 56 | ||
48 | protected: | 57 | protected: |
49 | virtual void closeEvent( QCloseEvent * ); | 58 | virtual void closeEvent( QCloseEvent * ); |
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 | |||
@@ -46,52 +46,47 @@ | |||
46 | #include "playlistwidget.h" | 46 | #include "playlistwidget.h" |
47 | 47 | ||
48 | 48 | ||
49 | #ifdef Q_WS_QWS | 49 | #ifdef Q_WS_QWS |
50 | # define USE_DIRECT_PAINTER | 50 | # define USE_DIRECT_PAINTER |
51 | # include <qdirectpainter_qws.h> | 51 | # include <qdirectpainter_qws.h> |
52 | # include <qgfxraster_qws.h> | 52 | # include <qgfxraster_qws.h> |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | 55 | ||
56 | namespace | 56 | namespace |
57 | { | 57 | { |
58 | 58 | ||
59 | const int xo = 2; // movable x offset | 59 | const int xo = 2; // movable x offset |
60 | const int yo = 0; // movable y offset | 60 | const int yo = 0; // movable y offset |
61 | 61 | ||
62 | 62 | MediaWidget::Button videoButtons[] = { | |
63 | struct MediaButton { | ||
64 | bool isToggle, isHeld, isDown; | ||
65 | }; | ||
66 | |||
67 | MediaButton videoButtons[] = { | ||
68 | { FALSE, FALSE, FALSE }, // stop | 63 | { FALSE, FALSE, FALSE }, // stop |
69 | { TRUE, FALSE, FALSE }, // play | 64 | { TRUE, FALSE, FALSE }, // play |
70 | { FALSE, FALSE, FALSE }, // previous | 65 | { FALSE, FALSE, FALSE }, // previous |
71 | { FALSE, FALSE, FALSE }, // next | 66 | { FALSE, FALSE, FALSE }, // next |
72 | { FALSE, FALSE, FALSE }, // volUp | 67 | { FALSE, FALSE, FALSE }, // volUp |
73 | { FALSE, FALSE, FALSE }, // volDown | 68 | { FALSE, FALSE, FALSE }, // volDown |
74 | { TRUE, FALSE, FALSE } // fullscreen | 69 | { TRUE, FALSE, FALSE } // fullscreen |
75 | }; | 70 | }; |
76 | 71 | ||
77 | const char * const skinV_mask_file_names[7] = { | 72 | const char * const skinV_mask_file_names[7] = { |
78 | "stop","play","back","fwd","up","down","full" | 73 | "stop","play","back","fwd","up","down","full" |
79 | }; | 74 | }; |
80 | 75 | ||
81 | const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); | 76 | const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button)); |
82 | 77 | ||
83 | } | 78 | } |
84 | 79 | ||
85 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 80 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
86 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) | 81 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) |
87 | { | 82 | { |
88 | setCaption( tr("OpiePlayer - Video") ); | 83 | setCaption( tr("OpiePlayer - Video") ); |
89 | 84 | ||
90 | videoFrame = new XineVideoWidget ( this, "Video frame" ); | 85 | videoFrame = new XineVideoWidget ( this, "Video frame" ); |
91 | 86 | ||
92 | connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); | 87 | connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); |
93 | connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); | 88 | connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); |
94 | 89 | ||
95 | Config cfg("OpiePlayer"); | 90 | Config cfg("OpiePlayer"); |
96 | cfg.setGroup("Options"); | 91 | cfg.setGroup("Options"); |
97 | skin = cfg.readEntry("Skin","default"); | 92 | skin = cfg.readEntry("Skin","default"); |