author | simon <simon> | 2002-12-08 21:13:27 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 21:13:27 (UTC) |
commit | b3ae76e6afdfd734789a85c5e80e8e846b15d6cf (patch) (unidiff) | |
tree | 5ac754c7945fc89f3cfc70e361fe109ba1c90233 /noncore/multimedia/opieplayer2 | |
parent | 009f786417b304168f2e23ddd1d8626653ba1c63 (diff) | |
download | opie-b3ae76e6afdfd734789a85c5e80e8e846b15d6cf.zip opie-b3ae76e6afdfd734789a85c5e80e8e846b15d6cf.tar.gz opie-b3ae76e6afdfd734789a85c5e80e8e846b15d6cf.tar.bz2 |
- made videoButtons a member variable instead of a global one
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 25 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
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 | |||
@@ -27,2 +27,4 @@ | |||
27 | 27 | ||
28 | #include <vector> | ||
29 | |||
28 | class MediaWidget : public QWidget | 30 | class MediaWidget : public QWidget |
@@ -35,3 +37,5 @@ public: | |||
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 | ||
@@ -41,2 +45,3 @@ public: | |||
41 | }; | 45 | }; |
46 | typedef std::vector<Button> ButtonVector; | ||
42 | 47 | ||
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 | |||
@@ -61,2 +61,3 @@ const int yo = 0; // movable y offset | |||
61 | 61 | ||
62 | /* | ||
62 | MediaWidget::Button videoButtons[] = { | 63 | MediaWidget::Button videoButtons[] = { |
@@ -70,2 +71,3 @@ MediaWidget::Button videoButtons[] = { | |||
70 | }; | 71 | }; |
72 | */ | ||
71 | 73 | ||
@@ -75,3 +77,3 @@ const char * const skinV_mask_file_names[7] = { | |||
75 | 77 | ||
76 | const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button)); | 78 | //const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button)); |
77 | 79 | ||
@@ -84,2 +86,17 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
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" ); |
@@ -278,3 +295,3 @@ void VideoWidget::paintButton( QPainter *p, int i ) { | |||
278 | void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | 295 | void 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 ) { |
@@ -425,3 +442,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { | |||
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 ); |
@@ -432,3 +449,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { | |||
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 ); |
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 | |||
@@ -122,2 +122,4 @@ private: | |||
122 | XineVideoWidget* videoFrame; | 122 | XineVideoWidget* videoFrame; |
123 | |||
124 | ButtonVector videoButtons; | ||
123 | }; | 125 | }; |