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
@@ -42,6 +42,5 @@
-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 ) {
@@ -50,8 +49,8 @@ XineControl::XineControl( QObject *parent, const char *name )
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() ) );
@@ -82,6 +81,6 @@ void XineControl::play( const QString& fileName ) {
// toggle stop so the the play button is reset
- mediaPlayerState->setPlaying( false );
+ mediaPlayerState.setPlaying( false );
return;
}
- mediaPlayerState->setPlaying( true );
+ mediaPlayerState.setPlaying( true );
@@ -101,6 +100,6 @@ 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 );
@@ -120,3 +119,3 @@ void XineControl::play( const QString& fileName ) {
void XineControl::nextMedia() {
- mediaPlayerState->setNext();
+ mediaPlayerState.setNext();
}
@@ -169,3 +168,3 @@ void XineControl::length() {
m_length = libXine->length();
- mediaPlayerState->setLength( m_length );
+ mediaPlayerState.setLength( m_length );
}
@@ -179,6 +178,6 @@ 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