author | simon <simon> | 2002-12-08 22:31:49 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 22:31:49 (UTC) |
commit | 3023dd47eefe179c245a186dd0870c2b4a76a4ae (patch) (unidiff) | |
tree | 97dd05fd90a776e8fd72a630b3fb6e58b9b08f1b | |
parent | 3b5f97272ded8a40da3853476371b4edc41d1a34 (diff) | |
download | opie-3023dd47eefe179c245a186dd0870c2b4a76a4ae.zip opie-3023dd47eefe179c245a186dd0870c2b4a76a4ae.tar.gz opie-3023dd47eefe179c245a186dd0870c2b4a76a4ae.tar.bz2 |
- made XineControl independent from VideoWidget
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 9 |
3 files changed, 11 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 06b1a04..ed7e37f 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -354,15 +354,15 @@ void MediaPlayer::recreateAudioAndVideoWidgets() | |||
354 | videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); | 354 | videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); |
355 | 355 | ||
356 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 356 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
357 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 357 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
358 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 358 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
359 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 359 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
360 | 360 | ||
361 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 361 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
362 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 362 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
363 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 363 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
364 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 364 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
365 | 365 | ||
366 | xineControl = new XineControl( videoUI, mediaPlayerState ); | 366 | xineControl = new XineControl( videoUI, videoUI->vidWidget(), mediaPlayerState ); |
367 | } | 367 | } |
368 | 368 | ||
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index b4ae783..6f1cd9c 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -29,32 +29,34 @@ | |||
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | 34 | ||
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | #include "xinecontrol.h" | 39 | #include "xinecontrol.h" |
40 | #include "mediaplayerstate.h" | 40 | #include "mediaplayerstate.h" |
41 | #include "videowidget.h" | ||
42 | 41 | ||
43 | XineControl::XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) | 42 | XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget, |
44 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), videoUI( videoWidget ) { | 43 | MediaPlayerState &_mediaPlayerState, |
44 | QObject *parent, const char *name ) | ||
45 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) | ||
46 | { | ||
45 | 47 | ||
46 | libXine = new XINE::Lib( videoUI->vidWidget() ); | 48 | libXine = new XINE::Lib( xineWidget ); |
47 | 49 | ||
48 | connect ( videoUI, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) ); | 50 | connect ( videoContainerWidget, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) ); |
49 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); | 51 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); |
50 | connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); | 52 | connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); |
51 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 53 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
52 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 54 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
53 | connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 55 | connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
54 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); | 56 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); |
55 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 57 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
56 | 58 | ||
57 | disabledSuspendScreenSaver = FALSE; | 59 | disabledSuspendScreenSaver = FALSE; |
58 | } | 60 | } |
59 | 61 | ||
60 | XineControl::~XineControl() { | 62 | XineControl::~XineControl() { |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 24e966b..69a594f 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -30,30 +30,30 @@ | |||
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef XINECONTROL_H | 34 | #ifndef XINECONTROL_H |
35 | #define XINECONTROL_H | 35 | #define XINECONTROL_H |
36 | 36 | ||
37 | #include "lib.h" | 37 | #include "lib.h" |
38 | #include <qobject.h> | 38 | #include <qobject.h> |
39 | 39 | ||
40 | #include "mediaplayerstate.h" | 40 | #include "mediaplayerstate.h" |
41 | 41 | ||
42 | class VideoWidget; | ||
43 | |||
44 | class XineControl : public QObject { | 42 | class XineControl : public QObject { |
45 | Q_OBJECT | 43 | Q_OBJECT |
46 | public: | 44 | public: |
47 | XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 ); | 45 | XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget, |
46 | MediaPlayerState &_mediaPlayerState, | ||
47 | QObject *parent = 0, const char *name =0 ); | ||
48 | ~XineControl(); | 48 | ~XineControl(); |
49 | 49 | ||
50 | bool hasVideo() const { return hasVideoChannel; } | 50 | bool hasVideo() const { return hasVideoChannel; } |
51 | bool hasAudio() const { return hasAudioChannel; } | 51 | bool hasAudio() const { return hasAudioChannel; } |
52 | 52 | ||
53 | public slots: | 53 | public slots: |
54 | void play( const QString& fileName ); | 54 | void play( const QString& fileName ); |
55 | void stop( bool ); | 55 | void stop( bool ); |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Pause the media stream | 58 | * Pause the media stream |
59 | * @param if pause or not | 59 | * @param if pause or not |
@@ -105,19 +105,16 @@ private: | |||
105 | XINE::Lib *libXine; | 105 | XINE::Lib *libXine; |
106 | long m_currentTime; | 106 | long m_currentTime; |
107 | long m_position; | 107 | long m_position; |
108 | int m_length; | 108 | int m_length; |
109 | QString m_fileName; | 109 | QString m_fileName; |
110 | bool disabledSuspendScreenSaver : 1; | 110 | bool disabledSuspendScreenSaver : 1; |
111 | bool hasVideoChannel : 1; | 111 | bool hasVideoChannel : 1; |
112 | bool hasAudioChannel : 1; | 112 | bool hasAudioChannel : 1; |
113 | MediaPlayerState &mediaPlayerState; | 113 | MediaPlayerState &mediaPlayerState; |
114 | 114 | ||
115 | signals: | 115 | signals: |
116 | void positionChanged( long ); | 116 | void positionChanged( long ); |
117 | |||
118 | private: | ||
119 | VideoWidget *videoUI; | ||
120 | }; | 117 | }; |
121 | 118 | ||
122 | 119 | ||
123 | #endif | 120 | #endif |