author | simon <simon> | 2002-12-02 18:37:23 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 18:37:23 (UTC) |
commit | 54665278a9b7d703deb73ede0d74d3948c265b39 (patch) (side-by-side diff) | |
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 ) { slider->setMinValue( 0 ); slider->setMaxValue( 1 ); slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); //slider->setFocusPolicy( QWidget::NoFocus ); resizeEvent( NULL ); connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); - connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); + connect( mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); setLength( mediaPlayerState->length() ); setPosition( mediaPlayerState->position() ); setFullscreen( mediaPlayerState->isFullscreen() ); setPlaying( mediaPlayerState->isPlaying() ); } @@ -234,26 +234,27 @@ void VideoWidget::setPosition( long i ) { updateSlider( i, mediaPlayerState->length() ); } void VideoWidget::setLength( long max ) { updateSlider( mediaPlayerState->position(), max ); } -void VideoWidget::setView( char view ) { - - if ( view == 'v' ) { +void VideoWidget::setDisplayType( MediaPlayerState::DisplayType displayType ) +{ + if ( displayType == MediaPlayerState::Video ) { makeVisible(); - } else { - // Effectively blank the view next time we show it so it looks nicer - scaledWidth = 0; - scaledHeight = 0; - hide(); + return; } + + // Effectively blank the view next time we show it so it looks nicer + scaledWidth = 0; + scaledHeight = 0; + hide(); } void VideoWidget::updateSlider( long i, long max ) { // Will flicker too much if we don't do this if ( max == 0 ) { return; } 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 @@ */ #ifndef VIDEO_WIDGET_H #define VIDEO_WIDGET_H #include <qwidget.h> #include "xinevideowidget.h" +#include "mediaplayerstate.h" + class QPixmap; class QSlider; enum VideoButtons { VideoStop = 0, VideoPlay, // VideoPause, VideoPrevious, @@ -64,17 +66,17 @@ public slots: void sliderPressed( ); void sliderReleased( ); void setPlaying( bool b); void setFullscreen( bool b ); void makeVisible(); void backToNormal(); void setPosition( long ); void setLength( long ); - void setView( char ); + void setDisplayType( MediaPlayerState::DisplayType displayType ); signals: void moreClicked(); void lessClicked(); void moreReleased(); void lessReleased(); void sliderMoved( long ); void videoResized ( const QSize &s ); |