summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-08 21:13:27 (UTC)
committer simon <simon>2002-12-08 21:13:27 (UTC)
commitb3ae76e6afdfd734789a85c5e80e8e846b15d6cf (patch) (side-by-side diff)
tree5ac754c7945fc89f3cfc70e361fe109ba1c90233
parent009f786417b304168f2e23ddd1d8626653ba1c63 (diff)
downloadopie-b3ae76e6afdfd734789a85c5e80e8e846b15d6cf.zip
opie-b3ae76e6afdfd734789a85c5e80e8e846b15d6cf.tar.gz
opie-b3ae76e6afdfd734789a85c5e80e8e846b15d6cf.tar.bz2
- made videoButtons a member variable instead of a global one
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 @@
#include "playlistwidget.h"
+#include <vector>
+
class MediaWidget : public QWidget
{
@@ -34,5 +36,7 @@ public:
struct Button
{
-// Button() : isToggle( false ), isHeld( false ), isDown( false ) {}
+ //Button() : isToggle( false ), isHeld( false ), isDown( false ) {}
+// Button( bool toggle, bool held, bool down )
+// : isToggle( toggle ), isHeld( held ), isDown( down ) {}
bool isToggle : 1;
@@ -40,4 +44,5 @@ public:
bool isDown : 1;
};
+ typedef std::vector<Button> ButtonVector;
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
const int yo = 0; // movable y offset
+/*
MediaWidget::Button videoButtons[] = {
{ FALSE, FALSE, FALSE }, // stop
@@ -69,4 +70,5 @@ MediaWidget::Button videoButtons[] = {
{ TRUE, FALSE, FALSE } // fullscreen
};
+*/
const char * const skinV_mask_file_names[7] = {
@@ -74,5 +76,5 @@ const char * const skinV_mask_file_names[7] = {
};
-const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button));
+//const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button));
}
@@ -83,4 +85,19 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
setCaption( tr("OpiePlayer - Video") );
+ Button defaultButton;
+ defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false;
+ Button toggleButton;
+ toggleButton.isToggle = true;
+ toggleButton.isHeld = toggleButton.isDown = false;
+
+ videoButtons.reserve( 7 );
+ videoButtons.push_back( defaultButton ); // stop
+ videoButtons.push_back( toggleButton ); // play
+ videoButtons.push_back( defaultButton ); // previous
+ videoButtons.push_back( defaultButton ); // next
+ videoButtons.push_back( defaultButton ); // volUp
+ videoButtons.push_back( defaultButton ); // volDown
+ videoButtons.push_back( toggleButton ); //fullscreen
+
videoFrame = new XineVideoWidget ( this, "Video frame" );
@@ -277,5 +294,5 @@ void VideoWidget::paintButton( QPainter *p, int i ) {
void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
- for ( int i = 0; i < numVButtons; i++ ) {
+ for ( unsigned int i = 0; i < videoButtons.size(); i++ ) {
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
@@ -424,5 +441,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
- for ( int i = 0; i < numVButtons; i++ ) {
+ for ( unsigned int i = 0; i < videoButtons.size(); i++ ) {
paintButton( &p, i );
}
@@ -431,5 +448,5 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
} else {
QPainter p( this );
- for ( int i = 0; i < numVButtons; i++ )
+ for ( unsigned int i = 0; i < videoButtons.size(); i++ )
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
@@ -121,4 +121,6 @@ private:
int scaledHeight;
XineVideoWidget* videoFrame;
+
+ ButtonVector videoButtons;
};