author | simon <simon> | 2002-12-02 18:37:23 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 18:37:23 (UTC) |
commit | 54665278a9b7d703deb73ede0d74d3948c265b39 (patch) (unidiff) | |
tree | 82a047d0c948f8a1f917a8fb430a69dbf2968e25 | |
parent | cf6d2e032faac6fbaeb9c5730767fc25021045fe (diff) | |
download | opie-54665278a9b7d703deb73ede0d74d3948c265b39.zip opie-54665278a9b7d703deb73ede0d74d3948c265b39.tar.gz opie-54665278a9b7d703deb73ede0d74d3948c265b39.tar.bz2 |
- converted to MediaPlayerState::DisplayType
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 19 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 4 |
2 files changed, 13 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index ff3f5f7..9ce2b57 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -134,17 +134,17 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
134 | slider->setMinValue( 0 ); | 134 | slider->setMinValue( 0 ); |
135 | slider->setMaxValue( 1 ); | 135 | slider->setMaxValue( 1 ); |
136 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 136 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
137 | //slider->setFocusPolicy( QWidget::NoFocus ); | 137 | //slider->setFocusPolicy( QWidget::NoFocus ); |
138 | 138 | ||
139 | resizeEvent( NULL ); | 139 | resizeEvent( NULL ); |
140 | 140 | ||
141 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 141 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
142 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 142 | connect( mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); |
143 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 143 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
144 | 144 | ||
145 | setLength( mediaPlayerState->length() ); | 145 | setLength( mediaPlayerState->length() ); |
146 | setPosition( mediaPlayerState->position() ); | 146 | setPosition( mediaPlayerState->position() ); |
147 | setFullscreen( mediaPlayerState->isFullscreen() ); | 147 | setFullscreen( mediaPlayerState->isFullscreen() ); |
148 | setPlaying( mediaPlayerState->isPlaying() ); | 148 | setPlaying( mediaPlayerState->isPlaying() ); |
149 | } | 149 | } |
150 | 150 | ||
@@ -234,26 +234,27 @@ void VideoWidget::setPosition( long i ) { | |||
234 | updateSlider( i, mediaPlayerState->length() ); | 234 | updateSlider( i, mediaPlayerState->length() ); |
235 | } | 235 | } |
236 | 236 | ||
237 | 237 | ||
238 | void VideoWidget::setLength( long max ) { | 238 | void VideoWidget::setLength( long max ) { |
239 | updateSlider( mediaPlayerState->position(), max ); | 239 | updateSlider( mediaPlayerState->position(), max ); |
240 | } | 240 | } |
241 | 241 | ||
242 | void VideoWidget::setView( char view ) { | 242 | void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) |
243 | 243 | { | |
244 | if ( view == 'v' ) { | 244 | if ( displayType == MediaPlayerState::Video ) { |
245 | makeVisible(); | 245 | makeVisible(); |
246 | } else { | 246 | return; |
247 | // Effectively blank the view next time we show it so it looks nicer | ||
248 | scaledWidth = 0; | ||
249 | scaledHeight = 0; | ||
250 | hide(); | ||
251 | } | 247 | } |
248 | |||
249 | // Effectively blank the view next time we show it so it looks nicer | ||
250 | scaledWidth = 0; | ||
251 | scaledHeight = 0; | ||
252 | hide(); | ||
252 | } | 253 | } |
253 | 254 | ||
254 | void VideoWidget::updateSlider( long i, long max ) { | 255 | void VideoWidget::updateSlider( long i, long max ) { |
255 | // Will flicker too much if we don't do this | 256 | // Will flicker too much if we don't do this |
256 | if ( max == 0 ) { | 257 | if ( max == 0 ) { |
257 | return; | 258 | return; |
258 | } | 259 | } |
259 | int width = slider->width(); | 260 | int width = slider->width(); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 990fa5f..89af646 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -32,16 +32,18 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef VIDEO_WIDGET_H | 34 | #ifndef VIDEO_WIDGET_H |
35 | #define VIDEO_WIDGET_H | 35 | #define VIDEO_WIDGET_H |
36 | 36 | ||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include "xinevideowidget.h" | 38 | #include "xinevideowidget.h" |
39 | 39 | ||
40 | #include "mediaplayerstate.h" | ||
41 | |||
40 | class QPixmap; | 42 | class QPixmap; |
41 | class QSlider; | 43 | class QSlider; |
42 | 44 | ||
43 | enum VideoButtons { | 45 | enum VideoButtons { |
44 | VideoStop = 0, | 46 | VideoStop = 0, |
45 | VideoPlay, | 47 | VideoPlay, |
46 | // VideoPause, | 48 | // VideoPause, |
47 | VideoPrevious, | 49 | VideoPrevious, |
@@ -64,17 +66,17 @@ public slots: | |||
64 | void sliderPressed( ); | 66 | void sliderPressed( ); |
65 | void sliderReleased( ); | 67 | void sliderReleased( ); |
66 | void setPlaying( bool b); | 68 | void setPlaying( bool b); |
67 | void setFullscreen( bool b ); | 69 | void setFullscreen( bool b ); |
68 | void makeVisible(); | 70 | void makeVisible(); |
69 | void backToNormal(); | 71 | void backToNormal(); |
70 | void setPosition( long ); | 72 | void setPosition( long ); |
71 | void setLength( long ); | 73 | void setLength( long ); |
72 | void setView( char ); | 74 | void setDisplayType( MediaPlayerState::DisplayType displayType ); |
73 | 75 | ||
74 | signals: | 76 | signals: |
75 | void moreClicked(); | 77 | void moreClicked(); |
76 | void lessClicked(); | 78 | void lessClicked(); |
77 | void moreReleased(); | 79 | void moreReleased(); |
78 | void lessReleased(); | 80 | void lessReleased(); |
79 | void sliderMoved( long ); | 81 | void sliderMoved( long ); |
80 | void videoResized ( const QSize &s ); | 82 | void videoResized ( const QSize &s ); |