Commit 9610a7a8 authored by Kevin Whitaker's avatar Kevin Whitaker

Move TCP service to after rest inits. Give playlist a key for stringlist.

parent dd475d24
......@@ -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;
......
......@@ -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)
......
......@@ -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
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