author | simon <simon> | 2002-12-13 22:12:49 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-13 22:12:49 (UTC) |
commit | 43ebe08628369c245da597555909025942f4ac0c (patch) (unidiff) | |
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 | |||
@@ -43,16 +43,29 @@ | |||
43 | XineControl::XineControl( XineVideoWidget *xineWidget, | 43 | XineControl::XineControl( XineVideoWidget *xineWidget, |
44 | MediaPlayerState &_mediaPlayerState, | 44 | MediaPlayerState &_mediaPlayerState, |
45 | QObject *parent, const char *name ) | 45 | QObject *parent, const char *name ) |
46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
47 | { | 47 | { |
48 | 48 | ||
49 | libXine = new XINE::Lib( xineWidget ); | 49 | libXine = new XINE::Lib( xineWidget ); |
50 | 50 | ||
51 | init(); | ||
52 | } | ||
53 | |||
54 | XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, | ||
55 | MediaPlayerState &_mediaPlayerState, | ||
56 | QObject *parent, const char *name ) | ||
57 | : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | ||
58 | { | ||
59 | init(); | ||
60 | } | ||
61 | |||
62 | void XineControl::init() | ||
63 | { | ||
51 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); | 64 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); |
52 | connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); | 65 | connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); |
53 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 66 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
54 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 67 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
55 | connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 68 | connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
56 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); | 69 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); |
57 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 70 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
58 | connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); | 71 | connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); |
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 | |||
@@ -40,16 +40,21 @@ | |||
40 | #include "mediaplayerstate.h" | 40 | #include "mediaplayerstate.h" |
41 | 41 | ||
42 | class XineControl : public QObject { | 42 | class XineControl : public QObject { |
43 | Q_OBJECT | 43 | Q_OBJECT |
44 | public: | 44 | public: |
45 | XineControl( XineVideoWidget *xineWidget, | 45 | XineControl( XineVideoWidget *xineWidget, |
46 | MediaPlayerState &_mediaPlayerState, | 46 | MediaPlayerState &_mediaPlayerState, |
47 | QObject *parent = 0, const char *name =0 ); | 47 | QObject *parent = 0, const char *name =0 ); |
48 | // note that this constructor takes over ownership of the passed | ||
49 | // XINE::Lib object. | ||
50 | XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, | ||
51 | MediaPlayerState &_mediaPlayerState, | ||
52 | QObject *parent = 0, const char *name =0 ); | ||
48 | ~XineControl(); | 53 | ~XineControl(); |
49 | 54 | ||
50 | bool hasVideo() const { return hasVideoChannel; } | 55 | bool hasVideo() const { return hasVideoChannel; } |
51 | bool hasAudio() const { return hasAudioChannel; } | 56 | bool hasAudio() const { return hasAudioChannel; } |
52 | 57 | ||
53 | public slots: | 58 | public slots: |
54 | void play( const QString& fileName ); | 59 | void play( const QString& fileName ); |
55 | void stop( bool ); | 60 | void stop( bool ); |
@@ -96,16 +101,18 @@ public slots: | |||
96 | 101 | ||
97 | /** | 102 | /** |
98 | * Set the gamma value of the video output | 103 | * Set the gamma value of the video output |
99 | * @param int value between -100 and 100, 0 is original | 104 | * @param int value between -100 and 100, 0 is original |
100 | */ | 105 | */ |
101 | void setGamma( int ); | 106 | void setGamma( int ); |
102 | 107 | ||
103 | private: | 108 | private: |
109 | void init(); | ||
110 | |||
104 | XINE::Lib *libXine; | 111 | XINE::Lib *libXine; |
105 | long m_currentTime; | 112 | long m_currentTime; |
106 | long m_position; | 113 | long m_position; |
107 | int m_length; | 114 | int m_length; |
108 | QString m_fileName; | 115 | QString m_fileName; |
109 | bool disabledSuspendScreenSaver : 1; | 116 | bool disabledSuspendScreenSaver : 1; |
110 | bool hasVideoChannel : 1; | 117 | bool hasVideoChannel : 1; |
111 | bool hasAudioChannel : 1; | 118 | bool hasAudioChannel : 1; |