summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp45
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h5
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp44
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h6
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp40
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
6 files changed, 50 insertions, 91 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 37c565b..dda039c 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -272,173 +272,128 @@ void AudioWidget::setSeekable( bool isSeekable ) {
272 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 272 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
273 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 273 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
274 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 274 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
275 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 275 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
276 } 276 }
277} 277}
278 278
279 279
280static QString timeAsString( long length ) { 280static QString timeAsString( long length ) {
281 int minutes = length / 60; 281 int minutes = length / 60;
282 int seconds = length % 60; 282 int seconds = length % 60;
283 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); 283 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 );
284} 284}
285 285
286void AudioWidget::updateSlider( long i, long max ) { 286void AudioWidget::updateSlider( long i, long max ) {
287 287
288 time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); 288 time.setText( timeAsString( i ) + " / " + timeAsString( max ) );
289// qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; 289// qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ;
290 290
291 if ( max == 0 ) { 291 if ( max == 0 ) {
292 return; 292 return;
293 } 293 }
294 // Will flicker too much if we don't do this 294 // Will flicker too much if we don't do this
295 // Scale to something reasonable 295 // Scale to something reasonable
296 int width = slider.width(); 296 int width = slider.width();
297 int val = int((double)i * width / max); 297 int val = int((double)i * width / max);
298 if ( !audioSliderBeingMoved ) { 298 if ( !audioSliderBeingMoved ) {
299 if ( slider.value() != val ) { 299 if ( slider.value() != val ) {
300 slider.setValue( val ); 300 slider.setValue( val );
301 } 301 }
302 302
303 if ( slider.maxValue() != width ) { 303 if ( slider.maxValue() != width ) {
304 slider.setMaxValue( width ); 304 slider.setMaxValue( width );
305 } 305 }
306 } 306 }
307} 307}
308 308
309void AudioWidget::skipFor() { 309void 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
315void AudioWidget::skipBack() { 315void 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
323void AudioWidget::stopSkip() { 323void AudioWidget::stopSkip() {
324 killTimers(); 324 killTimers();
325} 325}
326 326
327 327
328void AudioWidget::timerEvent( QTimerEvent * ) { 328void 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
337void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
338 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
339 Button &button = *it;
340 Command command = button.command;
341
342 if ( event->state() == QMouseEvent::LeftButton ) {
343 // The test to see if the mouse click is inside the button or not
344 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command );
345
346 if ( isOnButton && !button.isHeld ) {
347 button.isHeld = TRUE;
348 toggleButton( button );
349 switch ( command ) {
350 case VolumeUp:
351 emit moreClicked();
352 return;
353 case VolumeDown:
354 emit lessClicked();
355 return;
356 case Forward:
357 emit forwardClicked();
358 return;
359 case Back:
360 emit backClicked();
361 return;
362 default: break;
363 }
364 } else if ( !isOnButton && button.isHeld ) {
365 button.isHeld = FALSE;
366 toggleButton( button );
367 }
368 } else {
369 if ( button.isHeld ) {
370 button.isHeld = FALSE;
371 if ( button.type != ToggleButton ) {
372 setToggleButton( button, FALSE );
373 }
374 handleCommand( command, button.isDown );
375 }
376 }
377 }
378}
379
380
381void AudioWidget::mousePressEvent( QMouseEvent *event ) { 336void AudioWidget::mousePressEvent( QMouseEvent *event ) {
382 mouseMoveEvent( event ); 337 mouseMoveEvent( event );
383} 338}
384 339
385 340
386void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { 341void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) {
387 mouseMoveEvent( event ); 342 mouseMoveEvent( event );
388} 343}
389 344
390 345
391void AudioWidget::showEvent( QShowEvent* ) { 346void AudioWidget::showEvent( QShowEvent* ) {
392 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); 347 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
393 mouseMoveEvent( &event ); 348 mouseMoveEvent( &event );
394} 349}
395 350
396void AudioWidget::keyReleaseEvent( QKeyEvent *e) { 351void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
397 switch ( e->key() ) { 352 switch ( e->key() ) {
398 ////////////////////////////// Zaurus keys 353 ////////////////////////////// Zaurus keys
399 case Key_Home: 354 case Key_Home:
400 break; 355 break;
401 case Key_F9: //activity 356 case Key_F9: //activity
402 hide(); 357 hide();
403 // qDebug("Audio F9"); 358 // qDebug("Audio F9");
404 break; 359 break;
405 case Key_F10: //contacts 360 case Key_F10: //contacts
406 break; 361 break;
407 case Key_F11: //menu 362 case Key_F11: //menu
408 mediaPlayerState.toggleBlank(); 363 mediaPlayerState.toggleBlank();
409 break; 364 break;
410 case Key_F12: //home 365 case Key_F12: //home
411 break; 366 break;
412 case Key_F13: //mail 367 case Key_F13: //mail
413 mediaPlayerState.toggleBlank(); 368 mediaPlayerState.toggleBlank();
414 break; 369 break;
415 case Key_Space: { 370 case Key_Space: {
416 mediaPlayerState.togglePaused(); 371 mediaPlayerState.togglePaused();
417 } 372 }
418 break; 373 break;
419 case Key_Down: 374 case Key_Down:
420 // toggleButton(6); 375 // toggleButton(6);
421 emit lessClicked(); 376 emit lessClicked();
422 emit lessReleased(); 377 emit lessReleased();
423 // toggleButton(6); 378 // toggleButton(6);
424 break; 379 break;
425 case Key_Up: 380 case Key_Up:
426 // toggleButton(5); 381 // toggleButton(5);
427 emit moreClicked(); 382 emit moreClicked();
428 emit moreReleased(); 383 emit moreReleased();
429 // toggleButton(5); 384 // toggleButton(5);
430 break; 385 break;
431 case Key_Right: 386 case Key_Right:
432 // toggleButton(3); 387 // toggleButton(3);
433 mediaPlayerState.setNext(); 388 mediaPlayerState.setNext();
434 // toggleButton(3); 389 // toggleButton(3);
435 break; 390 break;
436 case Key_Left: 391 case Key_Left:
437 // toggleButton(4); 392 // toggleButton(4);
438 mediaPlayerState.setPrev(); 393 mediaPlayerState.setPrev();
439 // toggleButton(4); 394 // toggleButton(4);
440 break; 395 break;
441 case Key_Escape: { 396 case Key_Escape: {
442 } 397 }
443 break; 398 break;
444 399
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 9b276b5..690d1b3 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -8,100 +8,95 @@
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can 10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public 12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
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#ifndef AUDIO_WIDGET_H 34#ifndef AUDIO_WIDGET_H
35#define AUDIO_WIDGET_H 35#define AUDIO_WIDGET_H
36 36
37#include <qpainter.h> 37#include <qpainter.h>
38#include <qdrawutil.h> 38#include <qdrawutil.h>
39#include <qpixmap.h> 39#include <qpixmap.h>
40#include <qstring.h> 40#include <qstring.h>
41#include <qslider.h> 41#include <qslider.h>
42#include <qframe.h> 42#include <qframe.h>
43#include <qlineedit.h> 43#include <qlineedit.h>
44#include <qimage.h> 44#include <qimage.h>
45 45
46#include <opie/oticker.h> 46#include <opie/oticker.h>
47 47
48#include "mediawidget.h" 48#include "mediawidget.h"
49 49
50class QPixmap; 50class QPixmap;
51 51
52class AudioWidget : public MediaWidget { 52class AudioWidget : public MediaWidget {
53 Q_OBJECT 53 Q_OBJECT
54public: 54public:
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 ); }
58public slots: 58public 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
66public: 66public:
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
71signals: 71signals:
72 void moreClicked();
73 void lessClicked();
74 void forwardClicked();
75 void backClicked();
76 void sliderMoved(long); 72 void sliderMoved(long);
77 73
78protected: 74protected:
79 void doBlank(); 75 void doBlank();
80 void doUnblank(); 76 void doUnblank();
81 void showEvent( QShowEvent *se ); 77 void showEvent( QShowEvent *se );
82 void resizeEvent( QResizeEvent *re ); 78 void resizeEvent( QResizeEvent *re );
83 void mouseMoveEvent( QMouseEvent *event );
84 void mousePressEvent( QMouseEvent *event ); 79 void mousePressEvent( QMouseEvent *event );
85 void mouseReleaseEvent( QMouseEvent *event ); 80 void mouseReleaseEvent( QMouseEvent *event );
86 void timerEvent( QTimerEvent *event ); 81 void timerEvent( QTimerEvent *event );
87 void keyReleaseEvent( QKeyEvent *e); 82 void keyReleaseEvent( QKeyEvent *e);
88private slots: 83private slots:
89 void skipFor(); 84 void skipFor();
90 void skipBack(); 85 void skipBack();
91 void stopSkip(); 86 void stopSkip();
92private: 87private:
93 int skipDirection; 88 int skipDirection;
94 QString skin; 89 QString skin;
95 QImage imgUp; 90 QImage imgUp;
96 QImage imgDn; 91 QImage imgDn;
97 92
98 OTicker songInfo; 93 OTicker songInfo;
99 QSlider slider; 94 QSlider slider;
100 QLineEdit time; 95 QLineEdit time;
101 bool isStreaming : 1; 96 bool isStreaming : 1;
102 bool audioSliderBeingMoved : 1; 97 bool audioSliderBeingMoved : 1;
103}; 98};
104 99
105 100
106#endif // AUDIO_WIDGET_H 101#endif // AUDIO_WIDGET_H
107 102
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index 7eb75e6..3533d74 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -8,128 +8,172 @@
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
11 11
12 This library is distributed in the hope that it will be useful, 12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23 23
24#include "mediawidget.h" 24#include "mediawidget.h"
25#include "playlistwidget.h" 25#include "playlistwidget.h"
26 26
27MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) 27MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name )
28 : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) 28 : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList )
29{ 29{
30 connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ), 30 connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ),
31 this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) ); 31 this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) );
32 connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ), 32 connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ),
33 this, SLOT( setLength( long ) ) ); 33 this, SLOT( setLength( long ) ) );
34 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), 34 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ),
35 this, SLOT( setPlaying( bool ) ) ); 35 this, SLOT( setPlaying( bool ) ) );
36} 36}
37 37
38MediaWidget::~MediaWidget() 38MediaWidget::~MediaWidget()
39{ 39{
40} 40}
41 41
42void MediaWidget::closeEvent( QCloseEvent * ) 42void MediaWidget::closeEvent( QCloseEvent * )
43{ 43{
44 mediaPlayerState.setList(); 44 mediaPlayerState.setList();
45} 45}
46 46
47void MediaWidget::paintEvent( QPaintEvent *pe ) 47void MediaWidget::paintEvent( QPaintEvent *pe )
48{ 48{
49 QPainter p( this ); 49 QPainter p( this );
50 50
51 if ( mediaPlayerState.isFullscreen() ) { 51 if ( mediaPlayerState.isFullscreen() ) {
52 // Clear the background 52 // Clear the background
53 p.setBrush( QBrush( Qt::black ) ); 53 p.setBrush( QBrush( Qt::black ) );
54 return; 54 return;
55 } 55 }
56 56
57 if ( !pe->erased() ) { 57 if ( !pe->erased() ) {
58 // Combine with background and double buffer 58 // Combine with background and double buffer
59 QPixmap pix( pe->rect().size() ); 59 QPixmap pix( pe->rect().size() );
60 QPainter p( &pix ); 60 QPainter p( &pix );
61 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 61 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
62 p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() ); 62 p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
63 paintAllButtons( p ); 63 paintAllButtons( p );
64 QPainter p2( this ); 64 QPainter p2( this );
65 p2.drawPixmap( pe->rect().topLeft(), pix ); 65 p2.drawPixmap( pe->rect().topLeft(), pix );
66 } else { 66 } else {
67 QPainter p( this ); 67 QPainter p( this );
68 paintAllButtons( p ); 68 paintAllButtons( p );
69 } 69 }
70} 70}
71 71
72void MediaWidget::mouseMoveEvent( QMouseEvent *event )
73{
74 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
75 Button &button = *it;
76 Command command = button.command;
77
78 if ( event->state() == QMouseEvent::LeftButton ) {
79 // The test to see if the mouse click is inside the button or not
80 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command );
81
82 if ( isOnButton && !button.isHeld ) {
83 button.isHeld = TRUE;
84 toggleButton( button );
85 switch ( command ) {
86 case VolumeUp:
87 emit moreClicked();
88 return;
89 case VolumeDown:
90 emit lessClicked();
91 return;
92 case Forward:
93 emit forwardClicked();
94 return;
95 case Back:
96 emit backClicked();
97 return;
98 default: break;
99 }
100 } else if ( !isOnButton && button.isHeld ) {
101 button.isHeld = FALSE;
102 toggleButton( button );
103 }
104 } else {
105 if ( button.isHeld ) {
106 button.isHeld = FALSE;
107 if ( button.type != ToggleButton ) {
108 setToggleButton( button, FALSE );
109 }
110 handleCommand( command, button.isDown );
111 }
112 }
113 }
114}
115
72void MediaWidget::makeVisible() 116void MediaWidget::makeVisible()
73{ 117{
74} 118}
75 119
76void MediaWidget::handleCommand( Command command, bool buttonDown ) 120void MediaWidget::handleCommand( Command command, bool buttonDown )
77{ 121{
78 switch ( command ) { 122 switch ( command ) {
79 case Play: mediaPlayerState.togglePaused(); 123 case Play: mediaPlayerState.togglePaused();
80 case Stop: mediaPlayerState.setPlaying(FALSE); return; 124 case Stop: mediaPlayerState.setPlaying(FALSE); return;
81 case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; 125 case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return;
82 case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; 126 case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return;
83 case Loop: mediaPlayerState.setLooping( buttonDown ); return; 127 case Loop: mediaPlayerState.setLooping( buttonDown ); return;
84 case VolumeUp: emit moreReleased(); return; 128 case VolumeUp: emit moreReleased(); return;
85 case VolumeDown: emit lessReleased(); return; 129 case VolumeDown: emit lessReleased(); return;
86 case PlayList: mediaPlayerState.setList(); return; 130 case PlayList: mediaPlayerState.setList(); return;
87 case Forward: emit forwardReleased(); return; 131 case Forward: emit forwardReleased(); return;
88 case Back: emit backReleased(); return; 132 case Back: emit backReleased(); return;
89 case FullScreen: mediaPlayerState.setFullscreen( true ); makeVisible(); return; 133 case FullScreen: mediaPlayerState.setFullscreen( true ); makeVisible(); return;
90 default: assert( false ); 134 default: assert( false );
91 } 135 }
92} 136}
93 137
94bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const 138bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const
95{ 139{
96 return ( position.x() > 0 && position.y() > 0 && 140 return ( position.x() > 0 && position.y() > 0 &&
97 position.x() < buttonMask.width() && 141 position.x() < buttonMask.width() &&
98 position.y() < buttonMask.height() && 142 position.y() < buttonMask.height() &&
99 buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); 143 buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 );
100} 144}
101 145
102void MediaWidget::paintAllButtons( QPainter &p ) 146void MediaWidget::paintAllButtons( QPainter &p )
103{ 147{
104 for ( ButtonVector::const_iterator it = buttons.begin(); 148 for ( ButtonVector::const_iterator it = buttons.begin();
105 it != buttons.end(); ++it ) 149 it != buttons.end(); ++it )
106 paintButton( p, *it ); 150 paintButton( p, *it );
107} 151}
108 152
109void MediaWidget::paintButton( const Button &button ) 153void MediaWidget::paintButton( const Button &button )
110{ 154{
111 QPainter p( this ); 155 QPainter p( this );
112 paintButton( p, button ); 156 paintButton( p, button );
113} 157}
114 158
115void MediaWidget::paintButton( QPainter &p, const Button &button ) 159void MediaWidget::paintButton( QPainter &p, const Button &button )
116{ 160{
117 if ( button.isDown ) 161 if ( button.isDown )
118 p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); 162 p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
119 else 163 else
120 p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); 164 p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
121} 165}
122 166
123void MediaWidget::setToggleButton( Command command, bool down ) 167void MediaWidget::setToggleButton( Command command, bool down )
124{ 168{
125 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) 169 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it )
126 if ( it->command == command ) { 170 if ( it->command == command ) {
127 setToggleButton( *it, down ); 171 setToggleButton( *it, down );
128 return; 172 return;
129 } 173 }
130} 174}
131 175
132void MediaWidget::setToggleButton( Button &button, bool down ) 176void MediaWidget::setToggleButton( Button &button, bool down )
133{ 177{
134 if ( down != button.isDown ) 178 if ( down != button.isDown )
135 toggleButton( button ); 179 toggleButton( button );
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 3f4c45d..c19fdbb 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -16,99 +16,105 @@
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#ifndef MEDIAWIDGET_H 23#ifndef MEDIAWIDGET_H
24#define MEDIAWIDGET_H 24#define MEDIAWIDGET_H
25 25
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qmap.h> 27#include <qmap.h>
28 28
29#include "mediaplayerstate.h" 29#include "mediaplayerstate.h"
30#include "playlistwidget.h" 30#include "playlistwidget.h"
31 31
32#include <vector> 32#include <vector>
33 33
34class MediaWidget : public QWidget 34class MediaWidget : public QWidget
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37public: 37public:
38 enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined }; 38 enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined };
39 enum ButtonType { NormalButton, ToggleButton }; 39 enum ButtonType { NormalButton, ToggleButton };
40 40
41 struct Button 41 struct Button
42 { 42 {
43 Button() : command( Undefined ), type( NormalButton ), isHeld( false ), isDown( false ) {} 43 Button() : command( Undefined ), type( NormalButton ), isHeld( false ), isDown( false ) {}
44 44
45 Command command; 45 Command command;
46 46
47 ButtonType type : 1; 47 ButtonType type : 1;
48 bool isHeld : 1; 48 bool isHeld : 1;
49 bool isDown : 1; 49 bool isDown : 1;
50 50
51 QBitmap mask; 51 QBitmap mask;
52 QPixmap pixUp; 52 QPixmap pixUp;
53 QPixmap pixDown; 53 QPixmap pixDown;
54 }; 54 };
55 typedef std::vector<Button> ButtonVector; 55 typedef std::vector<Button> ButtonVector;
56 56
57 struct SkinButtonInfo 57 struct SkinButtonInfo
58 { 58 {
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
70public slots: 70public 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
75signals: 75signals:
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();
81 void backClicked();
82 void moreClicked();
83 void lessClicked();
80 84
81protected: 85protected:
82 virtual void closeEvent( QCloseEvent * ); 86 virtual void closeEvent( QCloseEvent * );
83 87
84 virtual void paintEvent( QPaintEvent *pe ); 88 virtual void paintEvent( QPaintEvent *pe );
85 89
90 virtual void mouseMoveEvent( QMouseEvent *event );
91
86 virtual void makeVisible(); 92 virtual void makeVisible();
87 93
88 void handleCommand( Command command, bool buttonDown ); 94 void handleCommand( Command command, bool buttonDown );
89 95
90 bool isOverButton( const QPoint &position, int buttonId ) const; 96 bool isOverButton( const QPoint &position, int buttonId ) const;
91 97
92 void paintAllButtons( QPainter &p ); 98 void paintAllButtons( QPainter &p );
93 void paintButton( const Button &button ); 99 void paintButton( const Button &button );
94 void paintButton( QPainter &p, const Button &button ); 100 void paintButton( QPainter &p, const Button &button );
95 101
96 void setToggleButton( Button &button, bool down ); 102 void setToggleButton( Button &button, bool down );
97 void setToggleButton( Command command, bool down ); 103 void setToggleButton( Command command, bool down );
98 void toggleButton( Button &button ); 104 void toggleButton( Button &button );
99 105
100 MediaPlayerState &mediaPlayerState; 106 MediaPlayerState &mediaPlayerState;
101 PlayListWidget &playList; 107 PlayListWidget &playList;
102 108
103 ButtonVector buttons; 109 ButtonVector buttons;
104 110
105 QImage buttonMask; 111 QImage buttonMask;
106 112
107 QPoint upperLeftOfButtonMask; 113 QPoint upperLeftOfButtonMask;
108 114
109 QPixmap backgroundPixmap; 115 QPixmap backgroundPixmap;
110}; 116};
111 117
112#endif // MEDIAWIDGET_H 118#endif // MEDIAWIDGET_H
113/* vim: et sw=4 ts=4 119/* vim: et sw=4 ts=4
114 */ 120 */
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index cc586cc..41844e1 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -182,168 +182,128 @@ void VideoWidget::resizeEvent( QResizeEvent * ) {
182 if ( !button.mask.isNull() ) { 182 if ( !button.mask.isNull() ) {
183 button.pixUp = maskVPixToMask( *pixUp, button.mask ); 183 button.pixUp = maskVPixToMask( *pixUp, button.mask );
184 button.pixDown = maskVPixToMask( *pixDn, button.mask ); 184 button.pixDown = maskVPixToMask( *pixDn, button.mask );
185 } 185 }
186 } 186 }
187 187
188 delete pixUp; 188 delete pixUp;
189 delete pixDn; 189 delete pixDn;
190} 190}
191 191
192static bool videoSliderBeingMoved = FALSE; 192static bool videoSliderBeingMoved = FALSE;
193 193
194void VideoWidget::sliderPressed() { 194void VideoWidget::sliderPressed() {
195 videoSliderBeingMoved = TRUE; 195 videoSliderBeingMoved = TRUE;
196} 196}
197 197
198void VideoWidget::sliderReleased() { 198void VideoWidget::sliderReleased() {
199 videoSliderBeingMoved = FALSE; 199 videoSliderBeingMoved = FALSE;
200 if ( slider->width() == 0 ) { 200 if ( slider->width() == 0 ) {
201 return; 201 return;
202 } 202 }
203 long val = long((double)slider->value() * mediaPlayerState.length() / slider->width()); 203 long val = long((double)slider->value() * mediaPlayerState.length() / slider->width());
204 mediaPlayerState.setPosition( val ); 204 mediaPlayerState.setPosition( val );
205} 205}
206 206
207void VideoWidget::setPosition( long i ) { 207void VideoWidget::setPosition( long i ) {
208 updateSlider( i, mediaPlayerState.length() ); 208 updateSlider( i, mediaPlayerState.length() );
209} 209}
210 210
211 211
212void VideoWidget::setLength( long max ) { 212void VideoWidget::setLength( long max ) {
213 updateSlider( mediaPlayerState.position(), max ); 213 updateSlider( mediaPlayerState.position(), max );
214} 214}
215 215
216void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) 216void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType )
217{ 217{
218 if ( displayType == MediaPlayerState::Video ) { 218 if ( displayType == MediaPlayerState::Video ) {
219 makeVisible(); 219 makeVisible();
220 return; 220 return;
221 } 221 }
222 222
223 // Effectively blank the view next time we show it so it looks nicer 223 // Effectively blank the view next time we show it so it looks nicer
224 scaledWidth = 0; 224 scaledWidth = 0;
225 scaledHeight = 0; 225 scaledHeight = 0;
226 hide(); 226 hide();
227} 227}
228 228
229void VideoWidget::updateSlider( long i, long max ) { 229void VideoWidget::updateSlider( long i, long max ) {
230 // Will flicker too much if we don't do this 230 // Will flicker too much if we don't do this
231 if ( max == 0 ) { 231 if ( max == 0 ) {
232 return; 232 return;
233 } 233 }
234 int width = slider->width(); 234 int width = slider->width();
235 int val = int((double)i * width / max); 235 int val = int((double)i * width / max);
236 if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { 236 if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) {
237 if ( slider->value() != val ) { 237 if ( slider->value() != val ) {
238 slider->setValue( val ); 238 slider->setValue( val );
239 } 239 }
240 if ( slider->maxValue() != width ) { 240 if ( slider->maxValue() != width ) {
241 slider->setMaxValue( width ); 241 slider->setMaxValue( width );
242 } 242 }
243 } 243 }
244} 244}
245 245
246void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
247 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
248 Button &button = *it;
249 Command command = button.command;
250
251 if ( event->state() == QMouseEvent::LeftButton ) {
252 // The test to see if the mouse click is inside the button or not
253 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command );
254
255 if ( isOnButton && !button.isHeld ) {
256 button.isHeld = TRUE;
257 toggleButton( button );
258
259 switch ( command ) {
260 case VolumeUp:
261 emit moreClicked();
262 return;
263 case VolumeDown:
264 emit lessClicked();
265 return;
266 default: break;
267 }
268 } else if ( !isOnButton && button.isHeld ) {
269 button.isHeld = FALSE;
270 toggleButton( button );
271 }
272 } else {
273
274 if ( button.isHeld ) {
275 button.isHeld = FALSE;
276 if ( button.type != ToggleButton ) {
277 setToggleButton( button, FALSE );
278 }
279
280 handleCommand( command, button.isDown );
281 }
282 }
283 }
284}
285
286void VideoWidget::mousePressEvent( QMouseEvent *event ) { 246void VideoWidget::mousePressEvent( QMouseEvent *event ) {
287 mouseMoveEvent( event ); 247 mouseMoveEvent( event );
288} 248}
289 249
290void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { 250void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) {
291 if ( mediaPlayerState.isFullscreen() ) { 251 if ( mediaPlayerState.isFullscreen() ) {
292 mediaPlayerState.setFullscreen( FALSE ); 252 mediaPlayerState.setFullscreen( FALSE );
293 makeVisible(); 253 makeVisible();
294 } 254 }
295 mouseMoveEvent( event ); 255 mouseMoveEvent( event );
296} 256}
297 257
298void VideoWidget::showEvent( QShowEvent* ) { 258void VideoWidget::showEvent( QShowEvent* ) {
299 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); 259 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
300 mouseMoveEvent( &event ); 260 mouseMoveEvent( &event );
301} 261}
302 262
303 263
304 void VideoWidget::backToNormal() { 264 void VideoWidget::backToNormal() {
305 mediaPlayerState.setFullscreen( FALSE ); 265 mediaPlayerState.setFullscreen( FALSE );
306 makeVisible(); 266 makeVisible();
307 } 267 }
308 268
309void VideoWidget::makeVisible() { 269void VideoWidget::makeVisible() {
310 if ( mediaPlayerState.isFullscreen() ) { 270 if ( mediaPlayerState.isFullscreen() ) {
311 setBackgroundMode( QWidget::NoBackground ); 271 setBackgroundMode( QWidget::NoBackground );
312 showFullScreen(); 272 showFullScreen();
313 resize( qApp->desktop()->size() ); 273 resize( qApp->desktop()->size() );
314 videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); 274 videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
315 275
316 slider->hide(); 276 slider->hide();
317 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 277 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
318 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 278 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
319 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 279 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
320 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 280 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
321 281
322 } else { 282 } else {
323 showNormal(); 283 showNormal();
324 showMaximized(); 284 showMaximized();
325 setBackgroundPixmap( backgroundPixmap ); 285 setBackgroundPixmap( backgroundPixmap );
326 QWidget *d = QApplication::desktop(); 286 QWidget *d = QApplication::desktop();
327 int w = d->width(); 287 int w = d->width();
328 int h = d->height(); 288 int h = d->height();
329 289
330 if(w>h) { 290 if(w>h) {
331 int newW=(w/2)-(246/2); //this will only work with 320x240 291 int newW=(w/2)-(246/2); //this will only work with 320x240
332 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); 292 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
333 } else { 293 } else {
334 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); 294 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
335 } 295 }
336 296
337 if ( !mediaPlayerState.isSeekable() ) { 297 if ( !mediaPlayerState.isSeekable() ) {
338 if( !slider->isHidden()) { 298 if( !slider->isHidden()) {
339 slider->hide(); 299 slider->hide();
340 } 300 }
341 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 301 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
342 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 302 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
343 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 303 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
344 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 304 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
345 } else { 305 } else {
346 slider->show(); 306 slider->show();
347 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 307 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
348 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 308 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
349 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 309 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index ef88186..7d50ea0 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -15,89 +15,88 @@
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
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#ifndef VIDEO_WIDGET_H 34#ifndef VIDEO_WIDGET_H
35#define VIDEO_WIDGET_H 35#define VIDEO_WIDGET_H
36 36
37#include <qwidget.h> 37#include <qwidget.h>
38#include <qimage.h> 38#include <qimage.h>
39#include <qpixmap.h> 39#include <qpixmap.h>
40#include "xinevideowidget.h" 40#include "xinevideowidget.h"
41 41
42#include "mediawidget.h" 42#include "mediawidget.h"
43 43
44class QPixmap; 44class QPixmap;
45class QSlider; 45class QSlider;
46 46
47class VideoWidget : public MediaWidget { 47class VideoWidget : public MediaWidget {
48 Q_OBJECT 48 Q_OBJECT
49public: 49public:
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();
55public slots: 55public 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
64public: 64public:
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
69signals: 69signals:
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
75protected: 75protected:
76 76
77 void resizeEvent( QResizeEvent * ); 77 void resizeEvent( QResizeEvent * );
78 void showEvent( QShowEvent *se ); 78 void showEvent( QShowEvent *se );
79 void mouseMoveEvent( QMouseEvent *event );
80 void mousePressEvent( QMouseEvent *event ); 79 void mousePressEvent( QMouseEvent *event );
81 void mouseReleaseEvent( QMouseEvent *event ); 80 void mouseReleaseEvent( QMouseEvent *event );
82 void keyReleaseEvent( QKeyEvent *e); 81 void keyReleaseEvent( QKeyEvent *e);
83 82
84private: 83private:
85// Ticker songInfo; 84// Ticker songInfo;
86 QImage imgUp; 85 QImage imgUp;
87 QImage imgDn; 86 QImage imgDn;
88 QString skin; 87 QString skin;
89 88
90 89
91 90
92 QString backgroundPix; 91 QString backgroundPix;
93 QSlider *slider; 92 QSlider *slider;
94 QImage *currentFrame; 93 QImage *currentFrame;
95 int scaledWidth; 94 int scaledWidth;
96 int scaledHeight; 95 int scaledHeight;
97 XineVideoWidget* videoFrame; 96 XineVideoWidget* videoFrame;
98}; 97};
99 98
100#endif // VIDEO_WIDGET_H 99#endif // VIDEO_WIDGET_H
101 100
102 101
103 102