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
@@ -82,12 +82,17 @@ 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
+{
+ return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video;
+}
+
// slots
void MediaPlayerState::setIsStreaming( bool b ) {
streaming = b;
}
void MediaPlayerState::setIsSeekable( bool b ) {
@@ -200,12 +205,13 @@ void MediaPlayerState::setLength( long l ) {
void MediaPlayerState::setView( char v ) {
if ( curView == v ) {
return;
}
curView = v;
emit viewChanged(v);
+ emit mediaTypeChanged( mediaType() );
}
void MediaPlayerState::setPrev(){
emit prev();
}
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
@@ -44,12 +44,14 @@ class MediaPlayerDecoder;
class Config;
class MediaPlayerState : public QObject {
Q_OBJECT
public:
+ enum MediaType { Audio, Video };
+
MediaPlayerState( QObject *parent, const char *name );
~MediaPlayerState();
bool isStreaming() const { return streaming; }
bool isSeekable() const { return seekable; }
bool isFullscreen() const { return fullscreen; }
@@ -59,12 +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;
public slots:
void setIsStreaming( bool b );
void setIsSeekable( bool b );
void setFullscreen( bool b );
void setScaled( bool b );
@@ -105,12 +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( MediaType type );
void isSeekableToggled( bool );
void blankToggled( bool );
void videoGammaChanged( int );
void prev();
void next();