author | sandman <sandman> | 2002-08-03 23:58:20 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-08-03 23:58:20 (UTC) |
commit | 0cecd08dba036f39e414e34a2b7c070008ee3884 (patch) (side-by-side diff) | |
tree | c187c9308f0553b1d5d9cd59093bcc3c11740665 /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | 8fb605fdfbbcbc654f567efcb59f02ec0d26228a (diff) | |
download | opie-0cecd08dba036f39e414e34a2b7c070008ee3884.zip opie-0cecd08dba036f39e414e34a2b7c070008ee3884.tar.gz opie-0cecd08dba036f39e414e34a2b7c070008ee3884.tar.bz2 |
Added support for fullscreen playback
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 48caf00..af06079 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -107,12 +107,16 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : slider->setMinValue( 0 ); slider->setMaxValue( 1 ); slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); slider->setFocusPolicy( QWidget::NoFocus ); slider->setGeometry( QRect( 7, 250, 220, 20 ) ); + videoFrame = new XineVideoWidget ( this, "Video frame" ); + + connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); + connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); @@ -124,14 +128,12 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : setLength( mediaPlayerState->length() ); setPosition( mediaPlayerState->position() ); setFullscreen( mediaPlayerState->fullscreen() ); setPaused( mediaPlayerState->paused() ); setPlaying( mediaPlayerState->playing() ); - videoFrame = new XineVideoWidget( 240, 155 ,this, "Video frame" ); - } VideoWidget::~VideoWidget() { for ( int i = 0; i < 3; i++ ) { delete pixmaps[i]; @@ -276,32 +278,34 @@ void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { void VideoWidget::makeVisible() { if ( mediaPlayerState->fullscreen() ) { setBackgroundMode( QWidget::NoBackground ); showFullScreen(); resize( qApp->desktop()->size() ); slider->hide(); + videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); } else { setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); showNormal(); showMaximized(); slider->show(); + videoFrame->setGeometry( QRect( 10, 20, 220, 160 ) ); } } void VideoWidget::paintEvent( QPaintEvent * ) { QPainter p( this ); if ( mediaPlayerState->fullscreen() ) { // Clear the background p.setBrush( QBrush( Qt::black ) ); - videoFrame->setGeometry( QRect( 0, 0 , 240 ,340 ) ); +// videoFrame->setGeometry( QRect( 0, 0 , 240 ,320 ) ); } else { - videoFrame->setGeometry( QRect( 0, 15 , 240 ,170 ) ); + // videoFrame->setGeometry( QRect( 0, 15 , 240 ,170 ) ); // draw the buttons for ( int i = 0; i < numButtons; i++ ) { paintButton( &p, i ); } // draw the slider @@ -379,6 +383,12 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e) }; } XineVideoWidget* VideoWidget::vidWidget() { return videoFrame; } + + +void VideoWidget::setFullscreen ( bool b ) +{ + setToggleButton( VideoFullscreen, b ); +}
\ No newline at end of file |