-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
6 files changed, 13 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index dda039c..5986a72 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -304,74 +304,64 @@ void AudioWidget::updateSlider( long i, long max ) { | |||
304 | slider.setMaxValue( width ); | 304 | slider.setMaxValue( width ); |
305 | } | 305 | } |
306 | } | 306 | } |
307 | } | 307 | } |
308 | 308 | ||
309 | void AudioWidget::skipFor() { | 309 | void AudioWidget::skipFor() { |
310 | skipDirection = +1; | 310 | skipDirection = +1; |
311 | startTimer( 50 ); | 311 | startTimer( 50 ); |
312 | mediaPlayerState.setPosition( mediaPlayerState.position() + 2 ); | 312 | mediaPlayerState.setPosition( mediaPlayerState.position() + 2 ); |
313 | } | 313 | } |
314 | 314 | ||
315 | void AudioWidget::skipBack() { | 315 | void AudioWidget::skipBack() { |
316 | skipDirection = -1; | 316 | skipDirection = -1; |
317 | startTimer( 50 ); | 317 | startTimer( 50 ); |
318 | mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); | 318 | mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); |
319 | } | 319 | } |
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | void AudioWidget::stopSkip() { | 323 | void AudioWidget::stopSkip() { |
324 | killTimers(); | 324 | killTimers(); |
325 | } | 325 | } |
326 | 326 | ||
327 | 327 | ||
328 | void AudioWidget::timerEvent( QTimerEvent * ) { | 328 | void AudioWidget::timerEvent( QTimerEvent * ) { |
329 | if ( skipDirection == +1 ) { | 329 | if ( skipDirection == +1 ) { |
330 | mediaPlayerState.setPosition( mediaPlayerState.position() + 2 ); | 330 | mediaPlayerState.setPosition( mediaPlayerState.position() + 2 ); |
331 | } else if ( skipDirection == -1 ) { | 331 | } else if ( skipDirection == -1 ) { |
332 | mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); | 332 | mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); |
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
336 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | ||
337 | mouseMoveEvent( event ); | ||
338 | } | ||
339 | |||
340 | |||
341 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | ||
342 | mouseMoveEvent( event ); | ||
343 | } | ||
344 | |||
345 | |||
346 | void AudioWidget::showEvent( QShowEvent* ) { | 336 | void AudioWidget::showEvent( QShowEvent* ) { |
347 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 337 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
348 | mouseMoveEvent( &event ); | 338 | mouseMoveEvent( &event ); |
349 | } | 339 | } |
350 | 340 | ||
351 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { | 341 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { |
352 | switch ( e->key() ) { | 342 | switch ( e->key() ) { |
353 | ////////////////////////////// Zaurus keys | 343 | ////////////////////////////// Zaurus keys |
354 | case Key_Home: | 344 | case Key_Home: |
355 | break; | 345 | break; |
356 | case Key_F9: //activity | 346 | case Key_F9: //activity |
357 | hide(); | 347 | hide(); |
358 | // qDebug("Audio F9"); | 348 | // qDebug("Audio F9"); |
359 | break; | 349 | break; |
360 | case Key_F10: //contacts | 350 | case Key_F10: //contacts |
361 | break; | 351 | break; |
362 | case Key_F11: //menu | 352 | case Key_F11: //menu |
363 | mediaPlayerState.toggleBlank(); | 353 | mediaPlayerState.toggleBlank(); |
364 | break; | 354 | break; |
365 | case Key_F12: //home | 355 | case Key_F12: //home |
366 | break; | 356 | break; |
367 | case Key_F13: //mail | 357 | case Key_F13: //mail |
368 | mediaPlayerState.toggleBlank(); | 358 | mediaPlayerState.toggleBlank(); |
369 | break; | 359 | break; |
370 | case Key_Space: { | 360 | case Key_Space: { |
371 | mediaPlayerState.togglePaused(); | 361 | mediaPlayerState.togglePaused(); |
372 | } | 362 | } |
373 | break; | 363 | break; |
374 | case Key_Down: | 364 | case Key_Down: |
375 | // toggleButton(6); | 365 | // toggleButton(6); |
376 | emit lessClicked(); | 366 | emit lessClicked(); |
377 | emit lessReleased(); | 367 | emit lessReleased(); |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 690d1b3..e2e2314 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -47,56 +47,54 @@ | |||
47 | 47 | ||
48 | #include "mediawidget.h" | 48 | #include "mediawidget.h" |
49 | 49 | ||
50 | class QPixmap; | 50 | class QPixmap; |
51 | 51 | ||
52 | class AudioWidget : public MediaWidget { | 52 | class AudioWidget : public MediaWidget { |
53 | Q_OBJECT | 53 | Q_OBJECT |
54 | public: | 54 | public: |
55 | AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); | 55 | AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); |
56 | ~AudioWidget(); | 56 | ~AudioWidget(); |
57 | void setTickerText( const QString &text ) { songInfo.setText( text ); } | 57 | void setTickerText( const QString &text ) { songInfo.setText( text ); } |
58 | public slots: | 58 | public slots: |
59 | void updateSlider( long, long ); | 59 | void updateSlider( long, long ); |
60 | void sliderPressed( ); | 60 | void sliderPressed( ); |
61 | void sliderReleased( ); | 61 | void sliderReleased( ); |
62 | void setLooping( bool b) { setToggleButton( Loop, b ); } | 62 | void setLooping( bool b) { setToggleButton( Loop, b ); } |
63 | void setPosition( long ); | 63 | void setPosition( long ); |
64 | void setSeekable( bool ); | 64 | void setSeekable( bool ); |
65 | 65 | ||
66 | public: | 66 | public: |
67 | virtual void setLength( long ); | 67 | virtual void setLength( long ); |
68 | virtual void setPlaying( bool b) { setToggleButton( Play, b ); } | 68 | virtual void setPlaying( bool b) { setToggleButton( Play, b ); } |
69 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); | 69 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); |
70 | 70 | ||
71 | signals: | 71 | signals: |
72 | void sliderMoved(long); | 72 | void sliderMoved(long); |
73 | 73 | ||
74 | protected: | 74 | protected: |
75 | void doBlank(); | 75 | void doBlank(); |
76 | void doUnblank(); | 76 | void doUnblank(); |
77 | void showEvent( QShowEvent *se ); | 77 | void showEvent( QShowEvent *se ); |
78 | void resizeEvent( QResizeEvent *re ); | 78 | void resizeEvent( QResizeEvent *re ); |
79 | void mousePressEvent( QMouseEvent *event ); | ||
80 | void mouseReleaseEvent( QMouseEvent *event ); | ||
81 | void timerEvent( QTimerEvent *event ); | 79 | void timerEvent( QTimerEvent *event ); |
82 | void keyReleaseEvent( QKeyEvent *e); | 80 | void keyReleaseEvent( QKeyEvent *e); |
83 | private slots: | 81 | private slots: |
84 | void skipFor(); | 82 | void skipFor(); |
85 | void skipBack(); | 83 | void skipBack(); |
86 | void stopSkip(); | 84 | void stopSkip(); |
87 | private: | 85 | private: |
88 | int skipDirection; | 86 | int skipDirection; |
89 | QString skin; | 87 | QString skin; |
90 | QImage imgUp; | 88 | QImage imgUp; |
91 | QImage imgDn; | 89 | QImage imgDn; |
92 | 90 | ||
93 | OTicker songInfo; | 91 | OTicker songInfo; |
94 | QSlider slider; | 92 | QSlider slider; |
95 | QLineEdit time; | 93 | QLineEdit time; |
96 | bool isStreaming : 1; | 94 | bool isStreaming : 1; |
97 | bool audioSliderBeingMoved : 1; | 95 | bool audioSliderBeingMoved : 1; |
98 | }; | 96 | }; |
99 | 97 | ||
100 | 98 | ||
101 | #endif // AUDIO_WIDGET_H | 99 | #endif // AUDIO_WIDGET_H |
102 | 100 | ||
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 3533d74..439ba2e 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -84,64 +84,74 @@ void MediaWidget::mouseMoveEvent( QMouseEvent *event ) | |||
84 | toggleButton( button ); | 84 | toggleButton( button ); |
85 | switch ( command ) { | 85 | switch ( command ) { |
86 | case VolumeUp: | 86 | case VolumeUp: |
87 | emit moreClicked(); | 87 | emit moreClicked(); |
88 | return; | 88 | return; |
89 | case VolumeDown: | 89 | case VolumeDown: |
90 | emit lessClicked(); | 90 | emit lessClicked(); |
91 | return; | 91 | return; |
92 | case Forward: | 92 | case Forward: |
93 | emit forwardClicked(); | 93 | emit forwardClicked(); |
94 | return; | 94 | return; |
95 | case Back: | 95 | case Back: |
96 | emit backClicked(); | 96 | emit backClicked(); |
97 | return; | 97 | return; |
98 | default: break; | 98 | default: break; |
99 | } | 99 | } |
100 | } else if ( !isOnButton && button.isHeld ) { | 100 | } else if ( !isOnButton && button.isHeld ) { |
101 | button.isHeld = FALSE; | 101 | button.isHeld = FALSE; |
102 | toggleButton( button ); | 102 | toggleButton( button ); |
103 | } | 103 | } |
104 | } else { | 104 | } else { |
105 | if ( button.isHeld ) { | 105 | if ( button.isHeld ) { |
106 | button.isHeld = FALSE; | 106 | button.isHeld = FALSE; |
107 | if ( button.type != ToggleButton ) { | 107 | if ( button.type != ToggleButton ) { |
108 | setToggleButton( button, FALSE ); | 108 | setToggleButton( button, FALSE ); |
109 | } | 109 | } |
110 | handleCommand( command, button.isDown ); | 110 | handleCommand( command, button.isDown ); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | void MediaWidget::mousePressEvent( QMouseEvent *event ) | ||
117 | { | ||
118 | mouseMoveEvent( event ); | ||
119 | } | ||
120 | |||
121 | void MediaWidget::mouseReleaseEvent( QMouseEvent *event ) | ||
122 | { | ||
123 | mouseMoveEvent( event ); | ||
124 | } | ||
125 | |||
116 | void MediaWidget::makeVisible() | 126 | void MediaWidget::makeVisible() |
117 | { | 127 | { |
118 | } | 128 | } |
119 | 129 | ||
120 | void MediaWidget::handleCommand( Command command, bool buttonDown ) | 130 | void MediaWidget::handleCommand( Command command, bool buttonDown ) |
121 | { | 131 | { |
122 | switch ( command ) { | 132 | switch ( command ) { |
123 | case Play: mediaPlayerState.togglePaused(); | 133 | case Play: mediaPlayerState.togglePaused(); |
124 | case Stop: mediaPlayerState.setPlaying(FALSE); return; | 134 | case Stop: mediaPlayerState.setPlaying(FALSE); return; |
125 | case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; | 135 | case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; |
126 | case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; | 136 | case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; |
127 | case Loop: mediaPlayerState.setLooping( buttonDown ); return; | 137 | case Loop: mediaPlayerState.setLooping( buttonDown ); return; |
128 | case VolumeUp: emit moreReleased(); return; | 138 | case VolumeUp: emit moreReleased(); return; |
129 | case VolumeDown: emit lessReleased(); return; | 139 | case VolumeDown: emit lessReleased(); return; |
130 | case PlayList: mediaPlayerState.setList(); return; | 140 | case PlayList: mediaPlayerState.setList(); return; |
131 | case Forward: emit forwardReleased(); return; | 141 | case Forward: emit forwardReleased(); return; |
132 | case Back: emit backReleased(); return; | 142 | case Back: emit backReleased(); return; |
133 | case FullScreen: mediaPlayerState.setFullscreen( true ); makeVisible(); return; | 143 | case FullScreen: mediaPlayerState.setFullscreen( true ); makeVisible(); return; |
134 | default: assert( false ); | 144 | default: assert( false ); |
135 | } | 145 | } |
136 | } | 146 | } |
137 | 147 | ||
138 | bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const | 148 | bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const |
139 | { | 149 | { |
140 | return ( position.x() > 0 && position.y() > 0 && | 150 | return ( position.x() > 0 && position.y() > 0 && |
141 | position.x() < buttonMask.width() && | 151 | position.x() < buttonMask.width() && |
142 | position.y() < buttonMask.height() && | 152 | position.y() < buttonMask.height() && |
143 | buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); | 153 | buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); |
144 | } | 154 | } |
145 | 155 | ||
146 | void MediaWidget::paintAllButtons( QPainter &p ) | 156 | void MediaWidget::paintAllButtons( QPainter &p ) |
147 | { | 157 | { |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index c261728..9042d5b 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -59,62 +59,64 @@ public: | |||
59 | Command command; | 59 | Command command; |
60 | const char *fileName; | 60 | const char *fileName; |
61 | ButtonType type; | 61 | ButtonType type; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | typedef std::vector<QBitmap> MaskVector; | 64 | typedef std::vector<QBitmap> MaskVector; |
65 | typedef std::vector<QPixmap> PixmapVector; | 65 | typedef std::vector<QPixmap> PixmapVector; |
66 | 66 | ||
67 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); | 67 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); |
68 | virtual ~MediaWidget(); | 68 | virtual ~MediaWidget(); |
69 | 69 | ||
70 | public slots: | 70 | public slots: |
71 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; | 71 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; |
72 | virtual void setLength( long length ) = 0; | 72 | virtual void setLength( long length ) = 0; |
73 | virtual void setPlaying( bool playing ) = 0; | 73 | virtual void setPlaying( bool playing ) = 0; |
74 | 74 | ||
75 | signals: | 75 | signals: |
76 | void moreReleased(); | 76 | void moreReleased(); |
77 | void lessReleased(); | 77 | void lessReleased(); |
78 | void forwardReleased(); | 78 | void forwardReleased(); |
79 | void backReleased(); | 79 | void backReleased(); |
80 | void forwardClicked(); | 80 | void forwardClicked(); |
81 | void backClicked(); | 81 | void backClicked(); |
82 | void moreClicked(); | 82 | void moreClicked(); |
83 | void lessClicked(); | 83 | void lessClicked(); |
84 | 84 | ||
85 | protected: | 85 | protected: |
86 | virtual void closeEvent( QCloseEvent * ); | 86 | virtual void closeEvent( QCloseEvent * ); |
87 | 87 | ||
88 | virtual void paintEvent( QPaintEvent *pe ); | 88 | virtual void paintEvent( QPaintEvent *pe ); |
89 | 89 | ||
90 | virtual void mouseMoveEvent( QMouseEvent *event ); | 90 | virtual void mouseMoveEvent( QMouseEvent *event ); |
91 | virtual void mousePressEvent( QMouseEvent *event ); | ||
92 | virtual void mouseReleaseEvent( QMouseEvent *event ); | ||
91 | 93 | ||
92 | virtual void makeVisible(); | 94 | virtual void makeVisible(); |
93 | 95 | ||
94 | void handleCommand( Command command, bool buttonDown ); | 96 | void handleCommand( Command command, bool buttonDown ); |
95 | 97 | ||
96 | bool isOverButton( const QPoint &position, int buttonId ) const; | 98 | bool isOverButton( const QPoint &position, int buttonId ) const; |
97 | 99 | ||
98 | void paintAllButtons( QPainter &p ); | 100 | void paintAllButtons( QPainter &p ); |
99 | void paintButton( const Button &button ); | 101 | void paintButton( const Button &button ); |
100 | void paintButton( QPainter &p, const Button &button ); | 102 | void paintButton( QPainter &p, const Button &button ); |
101 | 103 | ||
102 | void setToggleButton( Button &button, bool down ); | 104 | void setToggleButton( Button &button, bool down ); |
103 | void setToggleButton( Command command, bool down ); | 105 | void setToggleButton( Command command, bool down ); |
104 | void toggleButton( Button &button ); | 106 | void toggleButton( Button &button ); |
105 | 107 | ||
106 | MediaPlayerState &mediaPlayerState; | 108 | MediaPlayerState &mediaPlayerState; |
107 | PlayListWidget &playList; | 109 | PlayListWidget &playList; |
108 | 110 | ||
109 | ButtonVector buttons; | 111 | ButtonVector buttons; |
110 | 112 | ||
111 | QImage buttonMask; | 113 | QImage buttonMask; |
112 | 114 | ||
113 | QPoint upperLeftOfButtonMask; | 115 | QPoint upperLeftOfButtonMask; |
114 | 116 | ||
115 | QPixmap backgroundPixmap; | 117 | QPixmap backgroundPixmap; |
116 | }; | 118 | }; |
117 | 119 | ||
118 | #endif // MEDIAWIDGET_H | 120 | #endif // MEDIAWIDGET_H |
119 | /* vim: et sw=4 ts=4 | 121 | /* vim: et sw=4 ts=4 |
120 | */ | 122 | */ |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 26777e6..04b09f9 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -212,74 +212,70 @@ void VideoWidget::setLength( long max ) { | |||
212 | } | 212 | } |
213 | 213 | ||
214 | void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) | 214 | void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) |
215 | { | 215 | { |
216 | if ( displayType == MediaPlayerState::Video ) { | 216 | if ( displayType == MediaPlayerState::Video ) { |
217 | makeVisible(); | 217 | makeVisible(); |
218 | return; | 218 | return; |
219 | } | 219 | } |
220 | 220 | ||
221 | // Effectively blank the view next time we show it so it looks nicer | 221 | // Effectively blank the view next time we show it so it looks nicer |
222 | scaledWidth = 0; | 222 | scaledWidth = 0; |
223 | scaledHeight = 0; | 223 | scaledHeight = 0; |
224 | hide(); | 224 | hide(); |
225 | } | 225 | } |
226 | 226 | ||
227 | void VideoWidget::updateSlider( long i, long max ) { | 227 | void VideoWidget::updateSlider( long i, long max ) { |
228 | // Will flicker too much if we don't do this | 228 | // Will flicker too much if we don't do this |
229 | if ( max == 0 ) { | 229 | if ( max == 0 ) { |
230 | return; | 230 | return; |
231 | } | 231 | } |
232 | int width = slider->width(); | 232 | int width = slider->width(); |
233 | int val = int((double)i * width / max); | 233 | int val = int((double)i * width / max); |
234 | if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { | 234 | if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { |
235 | if ( slider->value() != val ) { | 235 | if ( slider->value() != val ) { |
236 | slider->setValue( val ); | 236 | slider->setValue( val ); |
237 | } | 237 | } |
238 | if ( slider->maxValue() != width ) { | 238 | if ( slider->maxValue() != width ) { |
239 | slider->setMaxValue( width ); | 239 | slider->setMaxValue( width ); |
240 | } | 240 | } |
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { | ||
245 | mouseMoveEvent( event ); | ||
246 | } | ||
247 | |||
248 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | 244 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { |
249 | if ( mediaPlayerState.isFullscreen() ) { | 245 | if ( mediaPlayerState.isFullscreen() ) { |
250 | mediaPlayerState.setFullscreen( FALSE ); | 246 | mediaPlayerState.setFullscreen( FALSE ); |
251 | makeVisible(); | 247 | makeVisible(); |
252 | } | 248 | } |
253 | mouseMoveEvent( event ); | 249 | MediaWidget::mouseReleaseEvent( event ); |
254 | } | 250 | } |
255 | 251 | ||
256 | void VideoWidget::showEvent( QShowEvent* ) { | 252 | void VideoWidget::showEvent( QShowEvent* ) { |
257 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 253 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
258 | mouseMoveEvent( &event ); | 254 | mouseMoveEvent( &event ); |
259 | } | 255 | } |
260 | 256 | ||
261 | 257 | ||
262 | void VideoWidget::backToNormal() { | 258 | void VideoWidget::backToNormal() { |
263 | mediaPlayerState.setFullscreen( FALSE ); | 259 | mediaPlayerState.setFullscreen( FALSE ); |
264 | makeVisible(); | 260 | makeVisible(); |
265 | } | 261 | } |
266 | 262 | ||
267 | void VideoWidget::makeVisible() { | 263 | void VideoWidget::makeVisible() { |
268 | if ( mediaPlayerState.isFullscreen() ) { | 264 | if ( mediaPlayerState.isFullscreen() ) { |
269 | setBackgroundMode( QWidget::NoBackground ); | 265 | setBackgroundMode( QWidget::NoBackground ); |
270 | showFullScreen(); | 266 | showFullScreen(); |
271 | resize( qApp->desktop()->size() ); | 267 | resize( qApp->desktop()->size() ); |
272 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 268 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
273 | 269 | ||
274 | slider->hide(); | 270 | slider->hide(); |
275 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 271 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
276 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 272 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
277 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 273 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
278 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 274 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
279 | 275 | ||
280 | } else { | 276 | } else { |
281 | showNormal(); | 277 | showNormal(); |
282 | showMaximized(); | 278 | showMaximized(); |
283 | setBackgroundPixmap( backgroundPixmap ); | 279 | setBackgroundPixmap( backgroundPixmap ); |
284 | QWidget *d = QApplication::desktop(); | 280 | QWidget *d = QApplication::desktop(); |
285 | int w = d->width(); | 281 | int w = d->width(); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index bed2116..985c094 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -47,58 +47,57 @@ class QSlider; | |||
47 | class VideoWidget : public MediaWidget { | 47 | class VideoWidget : public MediaWidget { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | public: | 49 | public: |
50 | VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); | 50 | VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); |
51 | ~VideoWidget(); | 51 | ~VideoWidget(); |
52 | 52 | ||
53 | 53 | ||
54 | XineVideoWidget* vidWidget(); | 54 | XineVideoWidget* vidWidget(); |
55 | public slots: | 55 | public slots: |
56 | void updateSlider( long, long ); | 56 | void updateSlider( long, long ); |
57 | void sliderPressed( ); | 57 | void sliderPressed( ); |
58 | void sliderReleased( ); | 58 | void sliderReleased( ); |
59 | void setFullscreen( bool b ); | 59 | void setFullscreen( bool b ); |
60 | virtual void makeVisible(); | 60 | virtual void makeVisible(); |
61 | void backToNormal(); | 61 | void backToNormal(); |
62 | void setPosition( long ); | 62 | void setPosition( long ); |
63 | 63 | ||
64 | public: | 64 | public: |
65 | virtual void setPlaying( bool b); | 65 | virtual void setPlaying( bool b); |
66 | virtual void setLength( long ); | 66 | virtual void setLength( long ); |
67 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); | 67 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); |
68 | 68 | ||
69 | signals: | 69 | signals: |
70 | void moreClicked(); | 70 | void moreClicked(); |
71 | void lessClicked(); | 71 | void lessClicked(); |
72 | void sliderMoved( long ); | 72 | void sliderMoved( long ); |
73 | void videoResized ( const QSize &s ); | 73 | void videoResized ( const QSize &s ); |
74 | 74 | ||
75 | protected: | 75 | protected: |
76 | 76 | ||
77 | void resizeEvent( QResizeEvent * ); | 77 | void resizeEvent( QResizeEvent * ); |
78 | void showEvent( QShowEvent *se ); | 78 | void showEvent( QShowEvent *se ); |
79 | void mousePressEvent( QMouseEvent *event ); | ||
80 | void mouseReleaseEvent( QMouseEvent *event ); | 79 | void mouseReleaseEvent( QMouseEvent *event ); |
81 | void keyReleaseEvent( QKeyEvent *e); | 80 | void keyReleaseEvent( QKeyEvent *e); |
82 | 81 | ||
83 | private: | 82 | private: |
84 | // Ticker songInfo; | 83 | // Ticker songInfo; |
85 | QImage imgUp; | 84 | QImage imgUp; |
86 | QImage imgDn; | 85 | QImage imgDn; |
87 | QString skin; | 86 | QString skin; |
88 | 87 | ||
89 | 88 | ||
90 | 89 | ||
91 | QString backgroundPix; | 90 | QString backgroundPix; |
92 | QSlider *slider; | 91 | QSlider *slider; |
93 | QImage *currentFrame; | 92 | QImage *currentFrame; |
94 | int scaledWidth; | 93 | int scaledWidth; |
95 | int scaledHeight; | 94 | int scaledHeight; |
96 | XineVideoWidget* videoFrame; | 95 | XineVideoWidget* videoFrame; |
97 | 96 | ||
98 | bool videoSliderBeingMoved; | 97 | bool videoSliderBeingMoved; |
99 | }; | 98 | }; |
100 | 99 | ||
101 | #endif // VIDEO_WIDGET_H | 100 | #endif // VIDEO_WIDGET_H |
102 | 101 | ||
103 | 102 | ||
104 | 103 | ||