From 03ac4af4d6014bbd46b12d5fe89ee2cc73941080 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 11 Dec 2002 11:40:20 +0000 Subject: - slight simplification of XineControl constructor - fixed a race between the video resizing and the xine initialization --- (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 14e71d9..e791c3b 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -38,16 +38,16 @@ #include #include "xinecontrol.h" #include "mediaplayerstate.h" +#include "xinevideowidget.h" -XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget, +XineControl::XineControl( XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) - : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) + : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { libXine = new XINE::Lib( xineWidget ); - connect ( videoContainerWidget, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) ); connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); @@ -55,7 +55,7 @@ XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWi connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); - connect( libXine, SIGNAL( initialized() ), this, SIGNAL( initialized() ) ); + connect( libXine, SIGNAL( initialized() ), this, SLOT( xineInitialized() ) ); disabledSuspendScreenSaver = FALSE; } @@ -126,6 +126,14 @@ void XineControl::setGamma( int value ) { libXine->setGamma( value ); } +void XineControl::xineInitialized() +{ + connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); + libXine->resize( xineVideoWidget->videoSize() ); + + emit initialized(); +} + void XineControl::stop( bool isSet ) { if ( !isSet ) { libXine->stop(); -- cgit v0.9.0.2