-rw-r--r-- | noncore/multimedia/opieplayer2/main.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 33 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 5 |
4 files changed, 21 insertions, 21 deletions
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp index fd47ea5..7d11ca0 100644 --- a/noncore/multimedia/opieplayer2/main.cpp +++ b/noncore/multimedia/opieplayer2/main.cpp @@ -8,3 +8,2 @@ -MediaPlayerState *mediaPlayerState; PlayListWidget *playList; @@ -17,3 +16,2 @@ int main(int argc, char **argv) { MediaPlayerState st( 0, "mediaPlayerState" ); - mediaPlayerState = &st; PlayListWidget pl( st, 0, "playList" ); diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 424259b..eccb5d9 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -62,3 +62,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, volControl = new VolumeControl; - xineControl = new XineControl(); + xineControl = new XineControl( mediaPlayerState ); Config cfg( "OpiePlayer" ); 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 diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index b1300a8..00486f2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h @@ -39,2 +39,4 @@ +#include "mediaplayerstate.h" + class XineControl : public QObject { @@ -42,3 +44,3 @@ class XineControl : public QObject { public: - XineControl( QObject *parent = 0, const char *name =0 ); + XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 ); ~XineControl(); @@ -108,2 +110,3 @@ private: bool hasAudioChannel : 1; + MediaPlayerState &mediaPlayerState; |