summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index e7d5a7b..071ef7c 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -41,18 +41,17 @@
#include "videowidget.h"
-extern MediaPlayerState *mediaPlayerState;
extern VideoWidget *videoUI;
-XineControl::XineControl( QObject *parent, const char *name )
- : QObject( parent, name ) {
+XineControl::XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
+ : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) {
libXine = new XINE::Lib( videoUI->vidWidget() );
connect ( videoUI, 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 ) ) );
- connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
- connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
- connect( mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
+ 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 ) ) );
+ connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
+ 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() ) );
@@ -81,8 +80,8 @@ void XineControl::play( const QString& fileName ) {
QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
// toggle stop so the the play button is reset
- mediaPlayerState->setPlaying( false );
+ mediaPlayerState.setPlaying( false );
return;
}
- mediaPlayerState->setPlaying( true );
+ mediaPlayerState.setPlaying( true );
MediaPlayerState::DisplayType displayType;
@@ -100,8 +99,8 @@ void XineControl::play( const QString& fileName ) {
}
// determine if slider is shown
- mediaPlayerState->setIsSeekable( libXine->isSeekable() );
+ mediaPlayerState.setIsSeekable( libXine->isSeekable() );
// which gui (video / audio)
- mediaPlayerState->setDisplayType( displayType );
+ mediaPlayerState.setDisplayType( displayType );
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
@@ -119,5 +118,5 @@ void XineControl::play( const QString& fileName ) {
void XineControl::nextMedia() {
- mediaPlayerState->setNext();
+ mediaPlayerState.setNext();
}
@@ -168,5 +167,5 @@ long XineControl::currentTime() {
void XineControl::length() {
m_length = libXine->length();
- mediaPlayerState->setLength( m_length );
+ mediaPlayerState.setLength( m_length );
}
@@ -178,8 +177,8 @@ void XineControl::length() {
long XineControl::position() {
m_position = ( currentTime() );
- mediaPlayerState->updatePosition( m_position );
+ mediaPlayerState.updatePosition( m_position );
long emitPos = (long)m_position;
emit positionChanged( emitPos );
- if( mediaPlayerState->isPlaying() ) {
+ if( mediaPlayerState.isPlaying() ) {
// needs to be stopped the media is stopped
QTimer::singleShot( 1000, this, SLOT( position() ) );