Commit 0aea5f33 authored by Scott Wheeler's avatar Scott Wheeler

Make 'playingString()' work in the DCOP interface.

svn path=/trunk/kdemultimedia/juk/; revision=304700
parent a785b993
......@@ -33,7 +33,7 @@ k_dcop:
virtual void seek(int time) = 0;
// virtual void startPlayingPlaylist() = 0;
// virtual QString playingString() const = 0;
virtual QString playingString() const = 0;
virtual int currentTime() const = 0;
virtual int totalTime() const = 0;
};
......
......@@ -28,6 +28,7 @@
#include "slideraction.h"
#include "statuslabel.h"
#include "actioncollection.h"
#include "tag.h"
#include "config.h"
......@@ -146,6 +147,14 @@ int PlayerManager::position() const
return player()->position();
}
QString PlayerManager::playingString() const
{
if(!playing())
return QString::null;
return m_file.tag()->artist() + " - " + m_file.tag()->title();
}
void PlayerManager::setPlaylistInterface(PlaylistInterface *interface)
{
m_playlistInterface = interface;
......@@ -187,15 +196,16 @@ void PlayerManager::play(const FileHandle &file)
player()->seekPosition(0);
}
else {
FileHandle currentFile = m_playlistInterface->currentFile();
m_file = m_playlistInterface->currentFile();
if(!currentFile.isNull()) {
player()->play(currentFile);
m_statusLabel->setPlayingItemInfo(currentFile, m_playlistInterface);
if(!m_file.isNull()) {
player()->play(m_file);
m_statusLabel->setPlayingItemInfo(m_file, m_playlistInterface);
}
}
}
else {
m_file = file;
player()->play(file);
m_statusLabel->setPlayingItemInfo(file, m_playlistInterface);
}
......@@ -261,6 +271,8 @@ void PlayerManager::stop()
player()->stop();
m_file = FileHandle::null();
emit signalStop();
}
......
......@@ -51,6 +51,8 @@ public:
int currentTime() const;
int position() const;
QString playingString() const;
void setPlaylistInterface(PlaylistInterface *interface);
void setStatusLabel(StatusLabel *label);
......@@ -92,6 +94,7 @@ private slots:
private:
static PlayerManager *m_instance;
FileHandle m_file;
SliderAction *m_sliderAction;
PlaylistInterface *m_playlistInterface;
StatusLabel *m_statusLabel;
......
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