Commit 9888ba9d authored by Kevin Whitaker's avatar Kevin Whitaker

Add TcpServer and have it broadcast itself over DNSSD.

parent b86bbd94
......@@ -13,7 +13,7 @@ include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Multimedia)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Multimedia Network)
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons
......
......@@ -2,6 +2,7 @@ set( simplecastengine_SRCS
simplecastengine.cpp
minimediaplayer.cpp
simplecastservice.cpp
simplecasttcpservice.cpp
)
add_library(plasma_engine_simplecast ${simplecastengine_SRCS})
......@@ -12,6 +13,7 @@ kcoreaddons_desktop_to_json(plasma_engine_simplecast plasma-dataengine-simplecas
target_link_libraries( plasma_engine_simplecast
Qt5::Core
Qt5::Multimedia
Qt5::Network
KF5::Plasma
KF5::Service
KF5::I18n
......
......@@ -22,7 +22,7 @@
#include "simplecastservice.h"
SimpleCastEngine::SimpleCastEngine(QObject *parent, const QVariantList &args)
: Plasma::DataEngine(parent,args), player(new MiniMediaPlayer(this))
: Plasma::DataEngine(parent,args), player(new MiniMediaPlayer(this)), tcpService(player,this)
{
Q_UNUSED(args)
setMinimumPollingInterval(333);
......@@ -30,6 +30,7 @@ SimpleCastEngine::SimpleCastEngine(QObject *parent, const QVariantList &args)
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();
}
void SimpleCastEngine::durationChanged(qint64 length)
......
......@@ -25,6 +25,7 @@
#include <Plasma/DataEngine>
#include <qt5/QtCore/QString>
#include "minimediaplayer.h"
#include "simplecasttcpservice.h"
/**
* Simple Cast Engine is a Plasma DataEngine that conveys that status on the media player casting to to other code like Plasmoids.
......@@ -46,7 +47,7 @@ protected:
bool sourceRequestEvent(const QString &source) override;
bool updateSourceEvent(const QString &source) override;
MiniMediaPlayer *player;
SimpleCastTcpService tcpService;
};
#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