diff --git a/src/minimediaplayer.cpp b/src/minimediaplayer.cpp index b4ed1209072b06390721b10bef80f86e8f07dc0a..59a79a786fd27284754e0fd750dc843f8afab5bb 100644 --- a/src/minimediaplayer.cpp +++ b/src/minimediaplayer.cpp @@ -29,6 +29,7 @@ MiniMediaPlayer::MiniMediaPlayer(QObject *parent) : QObject(parent) connect(m_player,SIGNAL(positionChanged(qint64)),this,SLOT(positionChanged(qint64))); } + bool MiniMediaPlayer::isPlaying() { return m_player->state() == QMediaPlayer::State::PlayingState; diff --git a/src/simplecastengine.cpp b/src/simplecastengine.cpp index 040e801d6dc36a9dd168ba2fa4d3e306e0e0b7e9..6d5b5cf95415e302a153db7adb616a8af33675cc 100644 --- a/src/simplecastengine.cpp +++ b/src/simplecastengine.cpp @@ -22,15 +22,16 @@ #include "simplecastservice.h" SimpleCastEngine::SimpleCastEngine(QObject *parent, const QVariantList &args) - : Plasma::DataEngine(parent,args), player(new MiniMediaPlayer(this)), tcpService(player,this) + : Plasma::DataEngine(parent,args), player(new MiniMediaPlayer(this)) { Q_UNUSED(args) + tcpService = new SimpleCastTcpService(player,this); setMinimumPollingInterval(333); connect(player,SIGNAL(playStateChanged(bool)),this,SLOT(playStateChanged(bool))); connect(player,SIGNAL(trackDurationChanged(qint64)),this,SLOT(durationChanged(qint64))); connect(player,SIGNAL(trackPositionChanged(qint64)),this,SLOT(positionChanged(qint64))); connect(player,SIGNAL(playlistChanged(QStringList)),this,SLOT(playlistChanged(QStringList))); - tcpService.listen(QHostAddress::Any,54634); + tcpService->listen(QHostAddress::Any,54634); } void SimpleCastEngine::durationChanged(qint64 length) @@ -55,7 +56,7 @@ bool SimpleCastEngine::sourceRequestEvent(const QString& source) void SimpleCastEngine::playlistChanged(QStringList playlist) { - setData("Playlist",playlist); + setData("Playlist","trackNames",playlist); } bool SimpleCastEngine::updateSourceEvent(const QString& source) diff --git a/src/simplecastengine.h b/src/simplecastengine.h index a7ed0cda87fee36bf9955e9cc321faa23889c93a..e0fdaab1a3b319ba3342676366cb954228d58773 100644 --- a/src/simplecastengine.h +++ b/src/simplecastengine.h @@ -46,8 +46,8 @@ private slots: protected: bool sourceRequestEvent(const QString &source) override; bool updateSourceEvent(const QString &source) override; - MiniMediaPlayer *player; - SimpleCastTcpService tcpService; + SimpleCastTcpService *tcpService; + MiniMediaPlayer *player; }; #endif // SIMPLECASTENGINE_H