summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h7
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp25
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h2
3 files changed, 29 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 0b9d826..9cb75ae 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -26,4 +26,6 @@
26#include "playlistwidget.h" 26#include "playlistwidget.h"
27 27
28#include <vector>
29
28class MediaWidget : public QWidget 30class MediaWidget : public QWidget
29{ 31{
@@ -34,5 +36,7 @@ public:
34 struct Button 36 struct Button
35 { 37 {
36// Button() : isToggle( false ), isHeld( false ), isDown( false ) {} 38 //Button() : isToggle( false ), isHeld( false ), isDown( false ) {}
39// Button( bool toggle, bool held, bool down )
40// : isToggle( toggle ), isHeld( held ), isDown( down ) {}
37 41
38 bool isToggle : 1; 42 bool isToggle : 1;
@@ -40,4 +44,5 @@ public:
40 bool isDown : 1; 44 bool isDown : 1;
41 }; 45 };
46 typedef std::vector<Button> ButtonVector;
42 47
43 MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); 48 MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 );
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
@@ -60,4 +60,5 @@ const 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
@@ -69,4 +70,5 @@ MediaWidget::Button videoButtons[] = {
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] = {
@@ -74,5 +76,5 @@ const char * const skinV_mask_file_names[7] = {
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}
@@ -83,4 +85,19 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
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
@@ -277,5 +294,5 @@ void VideoWidget::paintButton( QPainter *p, int i ) {
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
@@ -424,5 +441,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
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 }
@@ -431,5 +448,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
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 }
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index f996803..34558f8 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -121,4 +121,6 @@ private:
121 int scaledHeight; 121 int scaledHeight;
122 XineVideoWidget* videoFrame; 122 XineVideoWidget* videoFrame;
123
124 ButtonVector videoButtons;
123}; 125};
124 126