Commit aaaf404d authored by Michael Pyne's avatar Michael Pyne

Consolidate the various playing status DCOP calls into a simple status() call

to make it easier for poor mETz's Media Control applet work. :-)

svn path=/trunk/kdemultimedia/juk/; revision=319195
parent a1317514
...@@ -39,6 +39,7 @@ k_dcop: ...@@ -39,6 +39,7 @@ k_dcop:
virtual bool playing() const = 0; virtual bool playing() const = 0;
virtual bool paused() const = 0; virtual bool paused() const = 0;
virtual float volume() const = 0; virtual float volume() const = 0;
virtual int status() const = 0;
virtual QStringList trackProperties() = 0; virtual QStringList trackProperties() = 0;
virtual QString trackProperty(const QString &property) const = 0; virtual QString trackProperty(const QString &property) const = 0;
......
...@@ -120,6 +120,24 @@ float PlayerManager::volume() const ...@@ -120,6 +120,24 @@ float PlayerManager::volume() const
return player()->volume(); return player()->volume();
} }
int PlayerManager::status() const
{
// DCOP call to interface better with the Media Control applet
// Constant values provided by mETz.
// mETz: You can thank me later. :-)
if(!player())
return -1;
if(player()->paused())
return 1;
if(player()->playing())
return 2;
return 0;
}
int PlayerManager::totalTime() const int PlayerManager::totalTime() const
{ {
if(!player()) if(!player())
......
...@@ -44,6 +44,7 @@ public: ...@@ -44,6 +44,7 @@ public:
bool playing() const; bool playing() const;
bool paused() const; bool paused() const;
float volume() const; float volume() const;
int status() const;
int totalTime() const; int totalTime() const;
int currentTime() const; int currentTime() const;
int position() const; int position() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment