summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h6
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
@@ -162,3 +162,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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) ) );
@@ -266,6 +266,6 @@ void AudioWidget::setLength( long 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;
@@ -273,4 +273,4 @@ void AudioWidget::setMediaType( MediaPlayerState::MediaType mediaType ) {
- // startTimer( 150 );
- showMaximized();
+ killTimers();
+ hide();
}
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
@@ -83,3 +83,3 @@ public slots:
void setSeekable( bool );
- void setMediaType( MediaPlayerState::MediaType mediaType );
+ void setDisplayType( MediaPlayerState::DisplayType displayType );
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
@@ -43,3 +43,3 @@
-
+#include <assert.h>
@@ -87,5 +87,13 @@ void MediaPlayerState::writeConfig( Config& cfg ) const {
-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;
}
@@ -210,3 +218,3 @@ void MediaPlayerState::setView( char v ) {
emit viewChanged(v);
- emit mediaTypeChanged( mediaType() );
+ emit displayTypeChanged( displayType() );
}
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
@@ -49,3 +49,3 @@ Q_OBJECT
public:
- enum MediaType { Audio, Video };
+ enum DisplayType { Audio, Video, MediaSelection };
@@ -66,3 +66,3 @@ public:
char view() const { return curView; }
- MediaType mediaType() const;
+ DisplayType displayType() const;
@@ -113,3 +113,3 @@ signals:
void viewChanged( char );
- void mediaTypeChanged( MediaPlayerState::MediaType type );
+ void displayTypeChanged( MediaPlayerState::DisplayType type );
void isSeekableToggled( bool );