-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 6 |
4 files changed, 23 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 74bc390..1600320 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -157,13 +157,13 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : // time.setFrame(FALSE); // changeTextColor( &time ); resizeEvent( NULL ); connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); - connect( mediaPlayerState, SIGNAL( mediaTypeChanged(MediaPlayerState::MediaType) ), this, SLOT( setMediaType(MediaPlayerState::MediaType) ) ); + connect( mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); @@ -261,21 +261,21 @@ void AudioWidget::setPosition( long i ) { void AudioWidget::setLength( long max ) { updateSlider( mediaPlayerState->position(), max ); } -void AudioWidget::setMediaType( MediaPlayerState::MediaType mediaType ) { - if ( mediaType == MediaPlayerState::Video ) { - killTimers(); - hide(); +void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) { + if ( mediaType == MediaPlayerState::Audio ) { + // startTimer( 150 ); + showMaximized(); return; } - // startTimer( 150 ); - showMaximized(); + killTimers(); + hide(); } void AudioWidget::setSeekable( bool isSeekable ) { if ( !isSeekable ) { diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 3f0c059..91fcbc5 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -78,13 +78,13 @@ public slots: void sliderReleased( ); void setLooping( bool b) { setToggleButton( AudioLoop, b ); } void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } void setPosition( long ); void setLength( long ); void setSeekable( bool ); - void setMediaType( MediaPlayerState::MediaType mediaType ); + void setDisplayType( MediaPlayerState::DisplayType displayType ); signals: void moreClicked(); void lessClicked(); void moreReleased(); void lessReleased(); diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 22451b7..6806adc 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -38,13 +38,13 @@ #include <qpe/config.h> #include <qvaluelist.h> #include <qobject.h> #include <qdir.h> #include "mediaplayerstate.h" - +#include <assert.h> //#define MediaPlayerDebug(x) qDebug x #define MediaPlayerDebug(x) MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) @@ -82,15 +82,23 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.writeEntry( "Scaling", scaled ); cfg.writeEntry( "Looping", looping ); cfg.writeEntry( "Shuffle", shuffled ); cfg.writeEntry( "VideoGamma", videoGamma ); } -MediaPlayerState::MediaType MediaPlayerState::mediaType() const +MediaPlayerState::DisplayType MediaPlayerState::displayType() const { - return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video; + char v = view(); + switch ( v ) { + case 'a': return MediaPlayerState::Audio; + case 'v': return MediaPlayerState::Video; + case 'l': return MediaPlayerState::MediaSelection; + default: assert( false ); + } + // never reached + return MediaPlayerState::MediaSelection; } // slots void MediaPlayerState::setIsStreaming( bool b ) { streaming = b; } @@ -205,13 +213,13 @@ void MediaPlayerState::setLength( long l ) { void MediaPlayerState::setView( char v ) { if ( curView == v ) { return; } curView = v; emit viewChanged(v); - emit mediaTypeChanged( mediaType() ); + emit displayTypeChanged( displayType() ); } void MediaPlayerState::setPrev(){ emit prev(); } diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 05264cf..ca531c5 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -44,13 +44,13 @@ class MediaPlayerDecoder; class Config; class MediaPlayerState : public QObject { Q_OBJECT public: - enum MediaType { Audio, Video }; + enum DisplayType { Audio, Video, MediaSelection }; MediaPlayerState( QObject *parent, const char *name ); ~MediaPlayerState(); bool isStreaming() const { return streaming; } bool isSeekable() const { return seekable; } @@ -61,13 +61,13 @@ public: bool isPaused() const { return paused; } bool isPlaying() const { return playing; } bool isStopped() const { return stopped; } long position() const { return curPosition; } long length() const { return curLength; } char view() const { return curView; } - MediaType mediaType() const; + DisplayType displayType() const; public slots: void setIsStreaming( bool b ); void setIsSeekable( bool b ); void setFullscreen( bool b ); void setScaled( bool b ); @@ -108,13 +108,13 @@ signals: void playingToggled( bool ); void stopToggled( bool ); void positionChanged( long ); // When the slider is moved void positionUpdated( long ); // When the media file progresses void lengthChanged( long ); void viewChanged( char ); - void mediaTypeChanged( MediaPlayerState::MediaType type ); + void displayTypeChanged( MediaPlayerState::DisplayType type ); void isSeekableToggled( bool ); void blankToggled( bool ); void videoGammaChanged( int ); void prev(); void next(); |