summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/videowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 7c20c6d..efd756c 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -59,6 +59,7 @@ namespace
59const int xo = 2; // movable x offset 59const int xo = 2; // movable x offset
60const int yo = 0; // movable y offset 60const int yo = 0; // movable y offset
61 61
62/*
62MediaWidget::Button videoButtons[] = { 63MediaWidget::Button videoButtons[] = {
63 { FALSE, FALSE, FALSE }, // stop 64 { FALSE, FALSE, FALSE }, // stop
64 { TRUE, FALSE, FALSE }, // play 65 { TRUE, FALSE, FALSE }, // play
@@ -68,12 +69,13 @@ MediaWidget::Button videoButtons[] = {
68 { FALSE, FALSE, FALSE }, // volDown 69 { FALSE, FALSE, FALSE }, // volDown
69 { TRUE, FALSE, FALSE } // fullscreen 70 { TRUE, FALSE, FALSE } // fullscreen
70}; 71};
72*/
71 73
72const char * const skinV_mask_file_names[7] = { 74const char * const skinV_mask_file_names[7] = {
73"stop","play","back","fwd","up","down","full" 75"stop","play","back","fwd","up","down","full"
74}; 76};
75 77
76const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button)); 78//const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button));
77 79
78} 80}
79 81
@@ -82,6 +84,21 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
82{ 84{
83 setCaption( tr("OpiePlayer - Video") ); 85 setCaption( tr("OpiePlayer - Video") );
84 86
87 Button defaultButton;
88 defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false;
89 Button toggleButton;
90 toggleButton.isToggle = true;
91 toggleButton.isHeld = toggleButton.isDown = false;
92
93 videoButtons.reserve( 7 );
94 videoButtons.push_back( defaultButton ); // stop
95 videoButtons.push_back( toggleButton ); // play
96 videoButtons.push_back( defaultButton ); // previous
97 videoButtons.push_back( defaultButton ); // next
98 videoButtons.push_back( defaultButton ); // volUp
99 videoButtons.push_back( defaultButton ); // volDown
100 videoButtons.push_back( toggleButton ); //fullscreen
101
85 videoFrame = new XineVideoWidget ( this, "Video frame" ); 102 videoFrame = new XineVideoWidget ( this, "Video frame" );
86 103
87 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); 104 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
@@ -276,7 +293,7 @@ void VideoWidget::paintButton( QPainter *p, int i ) {
276} 293}
277 294
278void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { 295void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
279 for ( int i = 0; i < numVButtons; i++ ) { 296 for ( unsigned int i = 0; i < videoButtons.size(); i++ ) {
280 if ( event->state() == QMouseEvent::LeftButton ) { 297 if ( event->state() == QMouseEvent::LeftButton ) {
281 // The test to see if the mouse click is inside the button or not 298 // The test to see if the mouse click is inside the button or not
282 int x = event->pos().x() - xoff; 299 int x = event->pos().x() - xoff;
@@ -423,14 +440,14 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
423 QPainter p( &pix ); 440 QPainter p( &pix );
424 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 441 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
425 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); 442 p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
426 for ( int i = 0; i < numVButtons; i++ ) { 443 for ( unsigned int i = 0; i < videoButtons.size(); i++ ) {
427 paintButton( &p, i ); 444 paintButton( &p, i );
428 } 445 }
429 QPainter p2( this ); 446 QPainter p2( this );
430 p2.drawPixmap( pe->rect().topLeft(), pix ); 447 p2.drawPixmap( pe->rect().topLeft(), pix );
431 } else { 448 } else {
432 QPainter p( this ); 449 QPainter p( this );
433 for ( int i = 0; i < numVButtons; i++ ) 450 for ( unsigned int i = 0; i < videoButtons.size(); i++ )
434 paintButton( &p, i ); 451 paintButton( &p, i );
435 } 452 }
436 //slider->repaint( TRUE ); 453 //slider->repaint( TRUE );