Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index c829e03..a4d09f5 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -26,98 +26,98 @@ | |||
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include "videowidget.h" | 34 | #include "videowidget.h" |
35 | #include "mediaplayerstate.h" | 35 | #include "mediaplayerstate.h" |
36 | #include "playlistwidget.h" | 36 | #include "playlistwidget.h" |
37 | 37 | ||
38 | 38 | ||
39 | #ifdef Q_WS_QWS | 39 | #ifdef Q_WS_QWS |
40 | # define USE_DIRECT_PAINTER | 40 | # define USE_DIRECT_PAINTER |
41 | # include <qdirectpainter_qws.h> | 41 | # include <qdirectpainter_qws.h> |
42 | # include <qgfxraster_qws.h> | 42 | # include <qgfxraster_qws.h> |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | 45 | ||
46 | namespace | 46 | namespace |
47 | { | 47 | { |
48 | 48 | ||
49 | const int xo = 2; // movable x offset | 49 | const int xo = 2; // movable x offset |
50 | const int yo = 0; // movable y offset | 50 | const int yo = 0; // movable y offset |
51 | 51 | ||
52 | const MediaWidget::SkinButtonInfo skinInfo[] = | 52 | const MediaWidget::SkinButtonInfo skinInfo[] = |
53 | { | 53 | { |
54 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, | 54 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, |
55 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, | 55 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, |
56 | { MediaWidget::Next, "fwd", MediaWidget::NormalButton }, | 56 | { MediaWidget::Next, "fwd", MediaWidget::NormalButton }, |
57 | { MediaWidget::Previous, "back", MediaWidget::NormalButton }, | 57 | { MediaWidget::Previous, "back", MediaWidget::NormalButton }, |
58 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, | 58 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, |
59 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, | 59 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, |
60 | { MediaWidget::FullScreen, "full", MediaWidget::ToggleButton } | 60 | { MediaWidget::FullScreen, "full", MediaWidget::ToggleButton } |
61 | }; | 61 | }; |
62 | 62 | ||
63 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); | 63 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); |
64 | 64 | ||
65 | } | 65 | } |
66 | 66 | ||
67 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 67 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
68 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) | 68 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) |
69 | { | 69 | { |
70 | setCaption( tr("OpiePlayer - Video") ); | 70 | setCaption( tr("OpiePlayer - Video") ); |
71 | 71 | ||
72 | videoFrame = new XineVideoWidget ( this, "Video frame" ); | 72 | videoFrame = new XineVideoWidget ( this, "Video frame" ); |
73 | 73 | ||
74 | connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); | 74 | connect ( videoFrame, SIGNAL( videoResized(const QSize&)), this, SIGNAL( videoResized(const QSize&))); |
75 | connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); | 75 | connect ( videoFrame, SIGNAL( clicked() ), this, SLOT ( backToNormal() ) ); |
76 | 76 | ||
77 | slider = 0; | 77 | slider = 0; |
78 | 78 | ||
79 | loadSkin(); | 79 | loadSkin(); |
80 | 80 | ||
81 | setLength( mediaPlayerState.length() ); | 81 | setLength( mediaPlayerState.length() ); |
82 | setPosition( mediaPlayerState.position() ); | 82 | setPosition( mediaPlayerState.position() ); |
83 | setFullscreen( mediaPlayerState.isFullscreen() ); | 83 | setFullscreen( mediaPlayerState.isFullscreen() ); |
84 | setPlaying( mediaPlayerState.isPlaying() ); | 84 | setPlaying( mediaPlayerState.isPlaying() ); |
85 | } | 85 | } |
86 | 86 | ||
87 | 87 | ||
88 | VideoWidget::~VideoWidget() | 88 | VideoWidget::~VideoWidget() |
89 | { | 89 | { |
90 | } | 90 | } |
91 | 91 | ||
92 | MediaWidget::GUIInfo VideoWidget::guiInfo() | 92 | MediaWidget::GUIInfo VideoWidget::guiInfo() |
93 | { | 93 | { |
94 | return GUIInfo( "V" /* infix */, ::skinInfo, ::buttonCount ); | 94 | return GUIInfo( "V" /* infix */, ::skinInfo, ::buttonCount ); |
95 | } | 95 | } |
96 | 96 | ||
97 | void VideoWidget::resizeEvent( QResizeEvent *e ) { | 97 | void VideoWidget::resizeEvent( QResizeEvent *e ) { |
98 | int h = height(); | 98 | int h = height(); |
99 | int w = width(); | 99 | int w = width(); |
100 | //int Vh = 160; | 100 | //int Vh = 160; |
101 | //int Vw = 220; | 101 | //int Vw = 220; |
102 | 102 | ||
103 | slider->setFixedWidth( w - 20 ); | 103 | slider->setFixedWidth( w - 20 ); |
104 | slider->setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); | 104 | slider->setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); |
105 | slider->setBackgroundOrigin( QWidget::ParentOrigin ); | 105 | slider->setBackgroundOrigin( QWidget::ParentOrigin ); |
106 | slider->setFocusPolicy( QWidget::NoFocus ); | 106 | slider->setFocusPolicy( QWidget::NoFocus ); |
107 | slider->setBackgroundPixmap( backgroundPixmap ); | 107 | slider->setBackgroundPixmap( backgroundPixmap ); |
108 | 108 | ||
109 | upperLeftOfButtonMask.rx() = 0;// ( imgUp->width() ) / 2; | 109 | upperLeftOfButtonMask.rx() = 0;// ( imgUp->width() ) / 2; |
110 | if(w>h) | 110 | if(w>h) |
111 | upperLeftOfButtonMask.ry() = 0; | 111 | upperLeftOfButtonMask.ry() = 0; |
112 | else | 112 | else |
113 | upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10; | 113 | upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10; |
114 | 114 | ||
115 | MediaWidget::resizeEvent( e ); | 115 | MediaWidget::resizeEvent( e ); |
116 | } | 116 | } |
117 | 117 | ||
118 | void VideoWidget::sliderPressed() { | 118 | void VideoWidget::sliderPressed() { |
119 | videoSliderBeingMoved = TRUE; | 119 | videoSliderBeingMoved = TRUE; |
120 | } | 120 | } |
121 | 121 | ||
122 | void VideoWidget::sliderReleased() { | 122 | void VideoWidget::sliderReleased() { |
123 | videoSliderBeingMoved = FALSE; | 123 | videoSliderBeingMoved = FALSE; |