-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
4 files changed, 2 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 8e9bbf1..23d12ec 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -312,53 +312,48 @@ void AudioWidget::skipFor() { | |||
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::showEvent( QShowEvent* ) { | ||
337 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | ||
338 | mouseMoveEvent( &event ); | ||
339 | } | ||
340 | |||
341 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { | 336 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { |
342 | switch ( e->key() ) { | 337 | switch ( e->key() ) { |
343 | ////////////////////////////// Zaurus keys | 338 | ////////////////////////////// Zaurus keys |
344 | case Key_Home: | 339 | case Key_Home: |
345 | break; | 340 | break; |
346 | case Key_F9: //activity | 341 | case Key_F9: //activity |
347 | hide(); | 342 | hide(); |
348 | // qDebug("Audio F9"); | 343 | // qDebug("Audio F9"); |
349 | e->accept(); | 344 | e->accept(); |
350 | break; | 345 | break; |
351 | case Key_F10: //contacts | 346 | case Key_F10: //contacts |
352 | break; | 347 | break; |
353 | case Key_F11: //menu | 348 | case Key_F11: //menu |
354 | mediaPlayerState.toggleBlank(); | 349 | mediaPlayerState.toggleBlank(); |
355 | e->accept(); | 350 | e->accept(); |
356 | break; | 351 | break; |
357 | case Key_F12: //home | 352 | case Key_F12: //home |
358 | break; | 353 | break; |
359 | case Key_F13: //mail | 354 | case Key_F13: //mail |
360 | mediaPlayerState.toggleBlank(); | 355 | mediaPlayerState.toggleBlank(); |
361 | e->accept(); | 356 | e->accept(); |
362 | break; | 357 | break; |
363 | case Key_Space: { | 358 | case Key_Space: { |
364 | e->accept(); | 359 | e->accept(); |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index e2e2314..53982a1 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -53,48 +53,47 @@ 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 ); | ||
78 | void resizeEvent( QResizeEvent *re ); | 77 | void resizeEvent( QResizeEvent *re ); |
79 | void timerEvent( QTimerEvent *event ); | 78 | void timerEvent( QTimerEvent *event ); |
80 | void keyReleaseEvent( QKeyEvent *e); | 79 | void keyReleaseEvent( QKeyEvent *e); |
81 | private slots: | 80 | private slots: |
82 | void skipFor(); | 81 | void skipFor(); |
83 | void skipBack(); | 82 | void skipBack(); |
84 | void stopSkip(); | 83 | void stopSkip(); |
85 | private: | 84 | private: |
86 | int skipDirection; | 85 | int skipDirection; |
87 | QString skin; | 86 | QString skin; |
88 | QImage imgUp; | 87 | QImage imgUp; |
89 | QImage imgDn; | 88 | QImage imgDn; |
90 | 89 | ||
91 | OTicker songInfo; | 90 | OTicker songInfo; |
92 | QSlider slider; | 91 | QSlider slider; |
93 | QLineEdit time; | 92 | QLineEdit time; |
94 | bool isStreaming : 1; | 93 | bool isStreaming : 1; |
95 | bool audioSliderBeingMoved : 1; | 94 | bool audioSliderBeingMoved : 1; |
96 | }; | 95 | }; |
97 | 96 | ||
98 | 97 | ||
99 | #endif // AUDIO_WIDGET_H | 98 | #endif // AUDIO_WIDGET_H |
100 | 99 | ||
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 04b09f9..4901e47 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -228,58 +228,52 @@ 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::mouseReleaseEvent( QMouseEvent *event ) { | 244 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { |
245 | if ( mediaPlayerState.isFullscreen() ) { | 245 | if ( mediaPlayerState.isFullscreen() ) { |
246 | mediaPlayerState.setFullscreen( FALSE ); | 246 | mediaPlayerState.setFullscreen( FALSE ); |
247 | makeVisible(); | 247 | makeVisible(); |
248 | } | 248 | } |
249 | MediaWidget::mouseReleaseEvent( event ); | 249 | MediaWidget::mouseReleaseEvent( event ); |
250 | } | 250 | } |
251 | 251 | ||
252 | void VideoWidget::showEvent( QShowEvent* ) { | 252 | void VideoWidget::backToNormal() { |
253 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | ||
254 | mouseMoveEvent( &event ); | ||
255 | } | ||
256 | |||
257 | |||
258 | void VideoWidget::backToNormal() { | ||
259 | mediaPlayerState.setFullscreen( FALSE ); | 253 | mediaPlayerState.setFullscreen( FALSE ); |
260 | makeVisible(); | 254 | makeVisible(); |
261 | } | 255 | } |
262 | 256 | ||
263 | void VideoWidget::makeVisible() { | 257 | void VideoWidget::makeVisible() { |
264 | if ( mediaPlayerState.isFullscreen() ) { | 258 | if ( mediaPlayerState.isFullscreen() ) { |
265 | setBackgroundMode( QWidget::NoBackground ); | 259 | setBackgroundMode( QWidget::NoBackground ); |
266 | showFullScreen(); | 260 | showFullScreen(); |
267 | resize( qApp->desktop()->size() ); | 261 | resize( qApp->desktop()->size() ); |
268 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 262 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
269 | 263 | ||
270 | slider->hide(); | 264 | slider->hide(); |
271 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 265 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
272 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 266 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
273 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 267 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
274 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 268 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
275 | 269 | ||
276 | } else { | 270 | } else { |
277 | showNormal(); | 271 | showNormal(); |
278 | showMaximized(); | 272 | showMaximized(); |
279 | setBackgroundPixmap( backgroundPixmap ); | 273 | setBackgroundPixmap( backgroundPixmap ); |
280 | QWidget *d = QApplication::desktop(); | 274 | QWidget *d = QApplication::desktop(); |
281 | int w = d->width(); | 275 | int w = d->width(); |
282 | int h = d->height(); | 276 | int h = d->height(); |
283 | 277 | ||
284 | if(w>h) { | 278 | if(w>h) { |
285 | int newW=(w/2)-(246/2); //this will only work with 320x240 | 279 | int newW=(w/2)-(246/2); //this will only work with 320x240 |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 985c094..21a4e9e 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -54,49 +54,48 @@ public: | |||
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 ); | ||
79 | void mouseReleaseEvent( QMouseEvent *event ); | 78 | void mouseReleaseEvent( QMouseEvent *event ); |
80 | void keyReleaseEvent( QKeyEvent *e); | 79 | void keyReleaseEvent( QKeyEvent *e); |
81 | 80 | ||
82 | private: | 81 | private: |
83 | // Ticker songInfo; | 82 | // Ticker songInfo; |
84 | QImage imgUp; | 83 | QImage imgUp; |
85 | QImage imgDn; | 84 | QImage imgDn; |
86 | QString skin; | 85 | QString skin; |
87 | 86 | ||
88 | 87 | ||
89 | 88 | ||
90 | QString backgroundPix; | 89 | QString backgroundPix; |
91 | QSlider *slider; | 90 | QSlider *slider; |
92 | QImage *currentFrame; | 91 | QImage *currentFrame; |
93 | int scaledWidth; | 92 | int scaledWidth; |
94 | int scaledHeight; | 93 | int scaledHeight; |
95 | XineVideoWidget* videoFrame; | 94 | XineVideoWidget* videoFrame; |
96 | 95 | ||
97 | bool videoSliderBeingMoved; | 96 | bool videoSliderBeingMoved; |
98 | }; | 97 | }; |
99 | 98 | ||
100 | #endif // VIDEO_WIDGET_H | 99 | #endif // VIDEO_WIDGET_H |
101 | 100 | ||
102 | 101 | ||