summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -27,2 +27,4 @@
+#include <vector>
+
class MediaWidget : public QWidget
@@ -35,3 +37,5 @@ public:
{
-// 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 ) {}
@@ -41,2 +45,3 @@ public:
};
+ typedef std::vector<Button> ButtonVector;
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
+/*
MediaWidget::Button videoButtons[] = {
@@ -70,2 +71,3 @@ MediaWidget::Button videoButtons[] = {
};
+*/
@@ -75,3 +77,3 @@ const char * const skinV_mask_file_names[7] = {
-const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button));
+//const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button));
@@ -84,2 +86,17 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
+ 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" );
@@ -278,3 +295,3 @@ 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 ) {
@@ -425,3 +442,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
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 );
@@ -432,3 +449,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
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
@@ -122,2 +122,4 @@ private:
XineVideoWidget* videoFrame;
+
+ ButtonVector videoButtons;
};