author | simon <simon> | 2002-12-11 11:40:20 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 11:40:20 (UTC) |
commit | 03ac4af4d6014bbd46b12d5fe89ee2cc73941080 (patch) (unidiff) | |
tree | f88296c20f73e7e46d03daff3000ef34acd31bb0 | |
parent | 9431b69a1efab055c28c77e780df012b0a476a57 (diff) | |
download | opie-03ac4af4d6014bbd46b12d5fe89ee2cc73941080.zip opie-03ac4af4d6014bbd46b12d5fe89ee2cc73941080.tar.gz opie-03ac4af4d6014bbd46b12d5fe89ee2cc73941080.tar.bz2 |
- slight simplification of XineControl constructor
- fixed a race between the video resizing and the xine initialization
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 27 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.h | 4 |
5 files changed, 37 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 0d9a5b8..c230d6f 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -366,3 +366,3 @@ void MediaPlayer::recreateAudioAndVideoWidgets() | |||
366 | 366 | ||
367 | xineControl = new XineControl( videoUI, videoUI->vidWidget(), mediaPlayerState ); | 367 | xineControl = new XineControl( videoUI->vidWidget(), mediaPlayerState ); |
368 | connect( xineControl, SIGNAL( initialized() ), | 368 | connect( xineControl, SIGNAL( initialized() ), |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 14e71d9..e791c3b 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -40,7 +40,8 @@ | |||
40 | #include "mediaplayerstate.h" | 40 | #include "mediaplayerstate.h" |
41 | #include "xinevideowidget.h" | ||
41 | 42 | ||
42 | XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget, | 43 | XineControl::XineControl( XineVideoWidget *xineWidget, |
43 | MediaPlayerState &_mediaPlayerState, | 44 | MediaPlayerState &_mediaPlayerState, |
44 | QObject *parent, const char *name ) | 45 | QObject *parent, const char *name ) |
45 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) | 46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
46 | { | 47 | { |
@@ -49,3 +50,2 @@ XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWi | |||
49 | 50 | ||
50 | connect ( videoContainerWidget, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) ); | ||
51 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); | 51 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); |
@@ -57,3 +57,3 @@ XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWi | |||
57 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 57 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
58 | connect( libXine, SIGNAL( initialized() ), this, SIGNAL( initialized() ) ); | 58 | connect( libXine, SIGNAL( initialized() ), this, SLOT( xineInitialized() ) ); |
59 | 59 | ||
@@ -128,2 +128,10 @@ void XineControl::setGamma( int value ) { | |||
128 | 128 | ||
129 | void XineControl::xineInitialized() | ||
130 | { | ||
131 | connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); | ||
132 | libXine->resize( xineVideoWidget->videoSize() ); | ||
133 | |||
134 | emit initialized(); | ||
135 | } | ||
136 | |||
129 | void XineControl::stop( bool isSet ) { | 137 | void XineControl::stop( bool isSet ) { |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 000529c..085de3f 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -44,3 +44,3 @@ class XineControl : public QObject { | |||
44 | public: | 44 | public: |
45 | XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget, | 45 | XineControl( XineVideoWidget *xineWidget, |
46 | MediaPlayerState &_mediaPlayerState, | 46 | MediaPlayerState &_mediaPlayerState, |
@@ -103,2 +103,5 @@ public slots: | |||
103 | 103 | ||
104 | private slots: | ||
105 | void xineInitialized(); | ||
106 | |||
104 | private: | 107 | private: |
@@ -113,2 +116,3 @@ private: | |||
113 | MediaPlayerState &mediaPlayerState; | 116 | MediaPlayerState &mediaPlayerState; |
117 | XineVideoWidget *xineVideoWidget; | ||
114 | 118 | ||
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 1d88cea..791818e 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -110,2 +110,17 @@ void XineVideoWidget::clear ( ) | |||
110 | 110 | ||
111 | QSize XineVideoWidget::videoSize() const | ||
112 | { | ||
113 | QSize s = size(); | ||
114 | bool fs = ( s == qApp->desktop()->size() ); | ||
115 | |||
116 | // if we are in fullscreen mode, do not rotate the video | ||
117 | // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!) | ||
118 | m_rotation = fs ? - qt_screen->transformOrientation() : 0; | ||
119 | |||
120 | if ( fs && qt_screen->isTransformed() ) | ||
121 | s = qt_screen->mapToDevice( s ); | ||
122 | |||
123 | return s; | ||
124 | } | ||
125 | |||
111 | void XineVideoWidget::paintEvent ( QPaintEvent * ) | 126 | void XineVideoWidget::paintEvent ( QPaintEvent * ) |
@@ -253,13 +268,3 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * ) | |||
253 | { | 268 | { |
254 | QSize s = size ( ); | 269 | emit videoResized( videoSize() ); |
255 | bool fs = ( s == qApp-> desktop ( )-> size ( )); | ||
256 | |||
257 | // if we are in fullscreen mode, do not rotate the video | ||
258 | // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!) | ||
259 | m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0; | ||
260 | |||
261 | if ( fs && qt_screen-> isTransformed ( )) | ||
262 | s = qt_screen-> mapToDevice ( s ); | ||
263 | |||
264 | emit videoResized ( s ); | ||
265 | } | 270 | } |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h index 33f1470..8b3a3ea 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.h +++ b/noncore/multimedia/opieplayer2/xinevideowidget.h | |||
@@ -52,2 +52,4 @@ public: | |||
52 | 52 | ||
53 | QSize videoSize() const; | ||
54 | |||
53 | protected: | 55 | protected: |
@@ -71,3 +73,3 @@ private: | |||
71 | QImage *m_logo; | 73 | QImage *m_logo; |
72 | int m_rotation; | 74 | mutable int m_rotation; |
73 | }; | 75 | }; |