Move TCP service to after rest inits. Give playlist a key for stringlist.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user