summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 586870c..22451b7 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -85,6 +85,11 @@ void MediaPlayerState::writeConfig( Config& cfg ) const {
cfg.writeEntry( "VideoGamma", videoGamma );
}
+MediaPlayerState::MediaType MediaPlayerState::mediaType() const
+{
+ return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video;
+}
+
// slots
void MediaPlayerState::setIsStreaming( bool b ) {
streaming = b;
@@ -203,6 +208,7 @@ void MediaPlayerState::setView( char v ) {
}
curView = v;
emit viewChanged(v);
+ emit mediaTypeChanged( mediaType() );
}
void MediaPlayerState::setPrev(){
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index fc4e6cb..9474882 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -47,6 +47,8 @@ class Config;
class MediaPlayerState : public QObject {
Q_OBJECT
public:
+ enum MediaType { Audio, Video };
+
MediaPlayerState( QObject *parent, const char *name );
~MediaPlayerState();
@@ -62,6 +64,7 @@ public:
long position() const { return curPosition; }
long length() const { return curLength; }
char view() const { return curView; }
+ MediaType mediaType() const;
public slots:
void setIsStreaming( bool b );
@@ -108,6 +111,7 @@ signals:
void positionUpdated( long ); // When the media file progresses
void lengthChanged( long );
void viewChanged( char );
+ void mediaTypeChanged( MediaType type );
void isSeekableToggled( bool );
void blankToggled( bool );
void videoGammaChanged( int );