author | simon <simon> | 2002-12-13 22:12:49 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-13 22:12:49 (UTC) |
commit | 43ebe08628369c245da597555909025942f4ac0c (patch) (side-by-side diff) | |
tree | 4b5a25d48afc481de153a2b0103964b03142e43b | |
parent | de449c83cf37a64a9d2df586f6d1acecf3bc0c6e (diff) | |
download | opie-43ebe08628369c245da597555909025942f4ac0c.zip opie-43ebe08628369c245da597555909025942f4ac0c.tar.gz opie-43ebe08628369c245da597555909025942f4ac0c.tar.bz2 |
- added a second constructor that takes a XINE::Lib object (and takes
ownership of it)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 13 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index ee2cd83..efa9934 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -39,24 +39,37 @@ #include "xinecontrol.h" #include "mediaplayerstate.h" #include "xinevideowidget.h" XineControl::XineControl( XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { libXine = new XINE::Lib( xineWidget ); + init(); +} + +XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, + MediaPlayerState &_mediaPlayerState, + QObject *parent, const char *name ) + : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) +{ + init(); +} + +void XineControl::init() +{ 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() ) ); connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); disabledSuspendScreenSaver = FALSE; } diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index fdc5d2b..0e985d6 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h @@ -36,24 +36,29 @@ #include "lib.h" #include <qobject.h> #include "mediaplayerstate.h" class XineControl : public QObject { Q_OBJECT public: XineControl( XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 ); + // note that this constructor takes over ownership of the passed + // XINE::Lib object. + XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, + MediaPlayerState &_mediaPlayerState, + QObject *parent = 0, const char *name =0 ); ~XineControl(); bool hasVideo() const { return hasVideoChannel; } bool hasAudio() const { return hasAudioChannel; } public slots: void play( const QString& fileName ); void stop( bool ); /** * Pause the media stream * @param if pause or not @@ -92,24 +97,26 @@ public slots: QString getErrorCode(); void videoResized ( const QSize &s ); /** * Set the gamma value of the video output * @param int value between -100 and 100, 0 is original */ void setGamma( int ); private: + void init(); + XINE::Lib *libXine; long m_currentTime; long m_position; int m_length; QString m_fileName; bool disabledSuspendScreenSaver : 1; bool hasVideoChannel : 1; bool hasAudioChannel : 1; MediaPlayerState &mediaPlayerState; XineVideoWidget *xineVideoWidget; signals: |