Add service and class to handle media playing.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "simplecastengine.h"
|
||||
#include "simplecastservice.h"
|
||||
|
||||
SimpleCastEngine::SimpleCastEngine(QObject *parent, const QVariantList &args)
|
||||
: Plasma::DataEngine(parent,args)
|
||||
@@ -29,16 +30,35 @@ SimpleCastEngine::SimpleCastEngine(QObject *parent, const QVariantList &args)
|
||||
|
||||
bool SimpleCastEngine::sourceRequestEvent(const QString& source)
|
||||
{
|
||||
return updateSourceEvent(source);//TODO
|
||||
setData(source, "you found me");
|
||||
return true;
|
||||
//return updateSourceEvent(source);//TODO
|
||||
}
|
||||
|
||||
bool SimpleCastEngine::updateSourceEvent(const QString& source)
|
||||
{
|
||||
//Source for current playlist(contains title and url)
|
||||
//Source for current track time and length, and playing state
|
||||
setData(source, "you found me again");
|
||||
return true;//TODO
|
||||
}
|
||||
|
||||
QStringList SimpleCastEngine::sources() const
|
||||
{
|
||||
return QStringList() << "Playlist" << "CurrentState";
|
||||
}
|
||||
|
||||
Plasma::Service * SimpleCastEngine::serviceForSource(const QString& source)
|
||||
{
|
||||
if(source == "CurrentState")
|
||||
{
|
||||
return new SimpleCastService(source, this);
|
||||
}
|
||||
return Plasma::DataEngine::serviceForSource(source);
|
||||
}
|
||||
|
||||
|
||||
|
||||
K_EXPORT_PLASMA_DATAENGINE(simplecast, SimpleCastEngine)
|
||||
K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(org.eyecreate.simplecast, SimpleCastEngine,"plasma-dataengine-simplecast.json")
|
||||
|
||||
#include "simplecastengine.moc"
|
||||
|
||||
Reference in New Issue
Block a user