mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
Add MprisPluginPlayerAdaptor skeleton.
This commit is contained in:
@@ -412,12 +412,14 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/.
|
|||||||
IF( UNIX AND NOT APPLE )
|
IF( UNIX AND NOT APPLE )
|
||||||
SET( libSources ${libSources}
|
SET( libSources ${libSources}
|
||||||
infosystem/infoplugins/unix/mprispluginrootadaptor.cpp
|
infosystem/infoplugins/unix/mprispluginrootadaptor.cpp
|
||||||
|
infosystem/infoplugins/unix/mprispluginplayeradaptor.cpp
|
||||||
infosystem/infoplugins/unix/mprisplugin.cpp
|
infosystem/infoplugins/unix/mprisplugin.cpp
|
||||||
infosystem/infoplugins/unix/fdonotifyplugin.cpp
|
infosystem/infoplugins/unix/fdonotifyplugin.cpp
|
||||||
infosystem/infoplugins/unix/imageconverter.cpp )
|
infosystem/infoplugins/unix/imageconverter.cpp )
|
||||||
|
|
||||||
SET( libHeaders ${libHeaders}
|
SET( libHeaders ${libHeaders}
|
||||||
infosystem/infoplugins/unix/mprispluginrootadaptor.h
|
infosystem/infoplugins/unix/mprispluginrootadaptor.h
|
||||||
|
infosystem/infoplugins/unix/mprispluginplayeradaptor.h
|
||||||
infosystem/infoplugins/unix/mprisplugin.h
|
infosystem/infoplugins/unix/mprisplugin.h
|
||||||
infosystem/infoplugins/unix/fdonotifyplugin.h )
|
infosystem/infoplugins/unix/fdonotifyplugin.h )
|
||||||
ENDIF( UNIX AND NOT APPLE )
|
ENDIF( UNIX AND NOT APPLE )
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "mprisplugin.h"
|
#include "mprisplugin.h"
|
||||||
#include "mprispluginrootadaptor.h"
|
#include "mprispluginrootadaptor.h"
|
||||||
|
#include "mprispluginplayeradaptor.h"
|
||||||
|
|
||||||
using namespace Tomahawk::InfoSystem;
|
using namespace Tomahawk::InfoSystem;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ MprisPlugin::MprisPlugin()
|
|||||||
m_supportedPushTypes << InfoNowPlaying << InfoNowPaused << InfoNowResumed << InfoNowStopped;
|
m_supportedPushTypes << InfoNowPlaying << InfoNowPaused << InfoNowResumed << InfoNowStopped;
|
||||||
|
|
||||||
new MprisPluginRootAdaptor( this );
|
new MprisPluginRootAdaptor( this );
|
||||||
|
new MprisPluginPlayerAdaptor( this );
|
||||||
QDBusConnection dbus = QDBusConnection::sessionBus();
|
QDBusConnection dbus = QDBusConnection::sessionBus();
|
||||||
dbus.registerObject("/org/mpris/MediaPlayer2", this);
|
dbus.registerObject("/org/mpris/MediaPlayer2", this);
|
||||||
dbus.registerService("org.mpris.MediaPlayer2.tomahawk");
|
dbus.registerService("org.mpris.MediaPlayer2.tomahawk");
|
||||||
@@ -53,54 +55,211 @@ MprisPlugin::~MprisPlugin()
|
|||||||
// org.mpris.MediaPlayer2
|
// org.mpris.MediaPlayer2
|
||||||
|
|
||||||
bool
|
bool
|
||||||
MprisPlugin::canQuit()
|
MprisPlugin::canQuit() const
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
MprisPlugin::canRaise()
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
MprisPlugin::hasTrackList()
|
MprisPlugin::canRaise() const
|
||||||
{
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QString
|
|
||||||
MprisPlugin::identity()
|
bool
|
||||||
|
MprisPlugin::hasTrackList() const
|
||||||
{
|
{
|
||||||
return QString("Tomahawk Music Player");
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
MprisPlugin::desktopEntry()
|
MprisPlugin::identity() const
|
||||||
|
{
|
||||||
|
return QString("Tomahawk");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MprisPlugin::desktopEntry() const
|
||||||
{
|
{
|
||||||
return QString("tomahawk");
|
return QString("tomahawk");
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
MprisPlugin::supportedUriSchemes()
|
MprisPlugin::supportedUriSchemes() const
|
||||||
{
|
{
|
||||||
return QStringList();
|
QStringList uriSchemes;
|
||||||
|
uriSchemes << "tomahawk" << "spotify";
|
||||||
|
return uriSchemes;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
MprisPlugin::supportedMimeTypes()
|
MprisPlugin::supportedMimeTypes() const
|
||||||
{
|
{
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MprisPlugin::raise()
|
MprisPlugin::Raise()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MprisPlugin::quit()
|
MprisPlugin::Quit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// org.mpris.MediaPlayer2.Player
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::canControl() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::canGoNext() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::canGoPrevious() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::canPause() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::canPlay() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::canSeek() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MprisPlugin::loopStatus() const
|
||||||
|
{
|
||||||
|
return QString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::setLoopStatus(const QString &value)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
MprisPlugin::maximumRate() const
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap
|
||||||
|
MprisPlugin::metadata() const
|
||||||
|
{
|
||||||
|
return QVariantMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
MprisPlugin::minimumRate() const
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MprisPlugin::playbackStatus() const
|
||||||
|
{
|
||||||
|
return QString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
qlonglong
|
||||||
|
MprisPlugin::position() const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
MprisPlugin::rate() const
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::setRate( double value )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MprisPlugin::shuffle() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::setShuffle( bool value )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
MprisPlugin::volume() const
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::Next()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::OpenUri(const QString &Uri)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::Pause()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::Play()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::PlayPause()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::Previous()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::Seek( qlonglong Offset )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::SetPosition( const QDBusObjectPath &TrackId, qlonglong Position )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MprisPlugin::Stop()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <QtDBus/QtDBus>
|
||||||
|
|
||||||
namespace Tomahawk {
|
namespace Tomahawk {
|
||||||
|
|
||||||
@@ -36,28 +37,82 @@ public:
|
|||||||
MprisPlugin();
|
MprisPlugin();
|
||||||
virtual ~MprisPlugin();
|
virtual ~MprisPlugin();
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData );
|
|
||||||
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input );
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
// MPRIS DBus Methods
|
// MPRIS DBus Methods
|
||||||
|
|
||||||
// org.mpris.MediaPlayer2
|
// org.mpris.MediaPlayer2
|
||||||
bool canQuit();
|
|
||||||
bool canRaise();
|
|
||||||
bool hasTrackList();
|
|
||||||
QString identity();
|
|
||||||
QString desktopEntry();
|
|
||||||
QStringList supportedUriSchemes();
|
|
||||||
QStringList supportedMimeTypes();
|
|
||||||
|
|
||||||
void raise();
|
Q_PROPERTY(bool CanQuit READ canQuit)
|
||||||
void quit();
|
bool canQuit() const;
|
||||||
|
|
||||||
// org.mpris.MediaPlayer2.player
|
Q_PROPERTY(bool CanRaise READ canRaise)
|
||||||
// TODO: player methods/properties
|
bool canRaise() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString DesktopEntry READ desktopEntry)
|
||||||
|
QString desktopEntry() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool HasTrackList READ hasTrackList)
|
||||||
|
bool hasTrackList() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString Identity READ identity)
|
||||||
|
QString identity() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QStringList SupportedMimeTypes READ supportedMimeTypes)
|
||||||
|
QStringList supportedMimeTypes() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QStringList SupportedUriSchemes READ supportedUriSchemes)
|
||||||
|
QStringList supportedUriSchemes() const;
|
||||||
|
|
||||||
|
// org.mpris.MediaPlayer2.Player
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanControl READ canControl)
|
||||||
|
bool canControl() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanGoNext READ canGoNext)
|
||||||
|
bool canGoNext() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanGoPrevious READ canGoPrevious)
|
||||||
|
bool canGoPrevious() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanPause READ canPause)
|
||||||
|
bool canPause() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanPlay READ canPlay)
|
||||||
|
bool canPlay() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanSeek READ canSeek)
|
||||||
|
bool canSeek() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString LoopStatus READ loopStatus WRITE setLoopStatus)
|
||||||
|
QString loopStatus() const;
|
||||||
|
void setLoopStatus(const QString &value);
|
||||||
|
|
||||||
|
Q_PROPERTY(double MaximumRate READ maximumRate)
|
||||||
|
double maximumRate() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QVariantMap Metadata READ metadata)
|
||||||
|
QVariantMap metadata() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(double MinimumRate READ minimumRate)
|
||||||
|
double minimumRate() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString PlaybackStatus READ playbackStatus)
|
||||||
|
QString playbackStatus() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(qlonglong Position READ position)
|
||||||
|
qlonglong position() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(double Rate READ rate WRITE setRate)
|
||||||
|
double rate() const;
|
||||||
|
void setRate(double value);
|
||||||
|
|
||||||
|
Q_PROPERTY(bool Shuffle READ shuffle WRITE setShuffle)
|
||||||
|
bool shuffle() const;
|
||||||
|
void setShuffle(bool value);
|
||||||
|
|
||||||
|
Q_PROPERTY(double Volume READ volume)
|
||||||
|
double volume() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
void namChangedSlot( QNetworkAccessManager* /*nam*/ ) {} // unused
|
void namChangedSlot( QNetworkAccessManager* /*nam*/ ) {} // unused
|
||||||
|
|
||||||
virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
|
virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||||
@@ -67,6 +122,26 @@ public slots:
|
|||||||
Q_UNUSED( requestData );
|
Q_UNUSED( requestData );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// org.mpris.MediaPlayer2
|
||||||
|
void Raise();
|
||||||
|
void Quit();
|
||||||
|
|
||||||
|
// org.mpris.MediaPlayer2.Player
|
||||||
|
void Next();
|
||||||
|
void OpenUri(const QString &Uri);
|
||||||
|
void Pause();
|
||||||
|
void Play();
|
||||||
|
void PlayPause();
|
||||||
|
void Previous();
|
||||||
|
void Seek(qlonglong Offset);
|
||||||
|
void SetPosition(const QDBusObjectPath &TrackId, qlonglong Position);
|
||||||
|
void Stop();
|
||||||
|
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData );
|
||||||
|
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Get Info
|
// Get Info
|
||||||
|
|
||||||
|
@@ -0,0 +1,197 @@
|
|||||||
|
/*
|
||||||
|
* This file was generated by qdbusxml2cpp version 0.7
|
||||||
|
* Command line was: qdbusxml2cpp -a mprispluginplayeradaptor -c MprisPluginPlayerAdaptor mprispluginplayeradaptor.xml
|
||||||
|
*
|
||||||
|
* qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
*
|
||||||
|
* This is an auto-generated file.
|
||||||
|
* Do not edit! All changes made to it will be lost.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mprispluginplayeradaptor.h"
|
||||||
|
#include <QtCore/QMetaObject>
|
||||||
|
#include <QtCore/QByteArray>
|
||||||
|
#include <QtCore/QList>
|
||||||
|
#include <QtCore/QMap>
|
||||||
|
#include <QtCore/QString>
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
#include <QtCore/QVariant>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Implementation of adaptor class MprisPluginPlayerAdaptor
|
||||||
|
*/
|
||||||
|
|
||||||
|
MprisPluginPlayerAdaptor::MprisPluginPlayerAdaptor(QObject *parent)
|
||||||
|
: QDBusAbstractAdaptor(parent)
|
||||||
|
{
|
||||||
|
// constructor
|
||||||
|
setAutoRelaySignals(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
MprisPluginPlayerAdaptor::~MprisPluginPlayerAdaptor()
|
||||||
|
{
|
||||||
|
// destructor
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::canControl() const
|
||||||
|
{
|
||||||
|
// get the value of property CanControl
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanControl"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::canGoNext() const
|
||||||
|
{
|
||||||
|
// get the value of property CanGoNext
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanGoNext"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::canGoPrevious() const
|
||||||
|
{
|
||||||
|
// get the value of property CanGoPrevious
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanGoPrevious"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::canPause() const
|
||||||
|
{
|
||||||
|
// get the value of property CanPause
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanPause"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::canPlay() const
|
||||||
|
{
|
||||||
|
// get the value of property CanPlay
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanPlay"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::canSeek() const
|
||||||
|
{
|
||||||
|
// get the value of property CanSeek
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanSeek"));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MprisPluginPlayerAdaptor::loopStatus() const
|
||||||
|
{
|
||||||
|
// get the value of property LoopStatus
|
||||||
|
return qvariant_cast< QString >(parent()->property("LoopStatus"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::setLoopStatus(const QString &value)
|
||||||
|
{
|
||||||
|
// set the value of property LoopStatus
|
||||||
|
parent()->setProperty("LoopStatus", qVariantFromValue(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
double MprisPluginPlayerAdaptor::maximumRate() const
|
||||||
|
{
|
||||||
|
// get the value of property MaximumRate
|
||||||
|
return qvariant_cast< double >(parent()->property("MaximumRate"));
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap MprisPluginPlayerAdaptor::metadata() const
|
||||||
|
{
|
||||||
|
// get the value of property Metadata
|
||||||
|
return qvariant_cast< QVariantMap >(parent()->property("Metadata"));
|
||||||
|
}
|
||||||
|
|
||||||
|
double MprisPluginPlayerAdaptor::minimumRate() const
|
||||||
|
{
|
||||||
|
// get the value of property MinimumRate
|
||||||
|
return qvariant_cast< double >(parent()->property("MinimumRate"));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MprisPluginPlayerAdaptor::playbackStatus() const
|
||||||
|
{
|
||||||
|
// get the value of property PlaybackStatus
|
||||||
|
return qvariant_cast< QString >(parent()->property("PlaybackStatus"));
|
||||||
|
}
|
||||||
|
|
||||||
|
qlonglong MprisPluginPlayerAdaptor::position() const
|
||||||
|
{
|
||||||
|
// get the value of property Position
|
||||||
|
return qvariant_cast< qlonglong >(parent()->property("Position"));
|
||||||
|
}
|
||||||
|
|
||||||
|
double MprisPluginPlayerAdaptor::rate() const
|
||||||
|
{
|
||||||
|
// get the value of property Rate
|
||||||
|
return qvariant_cast< double >(parent()->property("Rate"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::setRate(double value)
|
||||||
|
{
|
||||||
|
// set the value of property Rate
|
||||||
|
parent()->setProperty("Rate", qVariantFromValue(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MprisPluginPlayerAdaptor::shuffle() const
|
||||||
|
{
|
||||||
|
// get the value of property Shuffle
|
||||||
|
return qvariant_cast< bool >(parent()->property("Shuffle"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::setShuffle(bool value)
|
||||||
|
{
|
||||||
|
// set the value of property Shuffle
|
||||||
|
parent()->setProperty("Shuffle", qVariantFromValue(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
double MprisPluginPlayerAdaptor::volume() const
|
||||||
|
{
|
||||||
|
// get the value of property Volume
|
||||||
|
return qvariant_cast< double >(parent()->property("Volume"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::Next()
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.Next
|
||||||
|
QMetaObject::invokeMethod(parent(), "Next");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::OpenUri(const QString &Uri)
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.OpenUri
|
||||||
|
QMetaObject::invokeMethod(parent(), "OpenUri", Q_ARG(QString, Uri));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::Pause()
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.Pause
|
||||||
|
QMetaObject::invokeMethod(parent(), "Pause");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::Play()
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.Play
|
||||||
|
QMetaObject::invokeMethod(parent(), "Play");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::PlayPause()
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.PlayPause
|
||||||
|
QMetaObject::invokeMethod(parent(), "PlayPause");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::Previous()
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.Previous
|
||||||
|
QMetaObject::invokeMethod(parent(), "Previous");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::Seek(qlonglong Offset)
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.Seek
|
||||||
|
QMetaObject::invokeMethod(parent(), "Seek", Q_ARG(qlonglong, Offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::SetPosition(const QDBusObjectPath &TrackId, qlonglong Position)
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.SetPosition
|
||||||
|
QMetaObject::invokeMethod(parent(), "SetPosition", Q_ARG(QDBusObjectPath, TrackId), Q_ARG(qlonglong, Position));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MprisPluginPlayerAdaptor::Stop()
|
||||||
|
{
|
||||||
|
// handle method call org.mpris.MediaPlayer2.Player.Stop
|
||||||
|
QMetaObject::invokeMethod(parent(), "Stop");
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* This file was generated by qdbusxml2cpp version 0.7
|
||||||
|
* Command line was: qdbusxml2cpp -a mprispluginplayeradaptor -c MprisPluginPlayerAdaptor mprispluginplayeradaptor.xml
|
||||||
|
*
|
||||||
|
* qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
*
|
||||||
|
* This is an auto-generated file.
|
||||||
|
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||||
|
* before re-generating it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MPRISPLUGINPLAYERADAPTOR_H_1312900500
|
||||||
|
#define MPRISPLUGINPLAYERADAPTOR_H_1312900500
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
#include <QtDBus/QtDBus>
|
||||||
|
class QByteArray;
|
||||||
|
template<class T> class QList;
|
||||||
|
template<class Key, class Value> class QMap;
|
||||||
|
class QString;
|
||||||
|
class QStringList;
|
||||||
|
class QVariant;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Adaptor class for interface org.mpris.MediaPlayer2.Player
|
||||||
|
*/
|
||||||
|
class MprisPluginPlayerAdaptor: public QDBusAbstractAdaptor
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_CLASSINFO("D-Bus Interface", "org.mpris.MediaPlayer2.Player")
|
||||||
|
Q_CLASSINFO("D-Bus Introspection", ""
|
||||||
|
" <interface name=\"org.mpris.MediaPlayer2.Player\">\n"
|
||||||
|
" <method name=\"Next\"/>\n"
|
||||||
|
" <method name=\"Previous\"/>\n"
|
||||||
|
" <method name=\"Pause\"/>\n"
|
||||||
|
" <method name=\"PlayPause\"/>\n"
|
||||||
|
" <method name=\"Stop\"/>\n"
|
||||||
|
" <method name=\"Play\"/>\n"
|
||||||
|
" <method name=\"Seek\">\n"
|
||||||
|
" <arg type=\"x\" name=\"Offset\"/>\n"
|
||||||
|
" </method>\n"
|
||||||
|
" <method name=\"SetPosition\">\n"
|
||||||
|
" <arg type=\"o\" name=\"TrackId\"/>\n"
|
||||||
|
" <arg type=\"x\" name=\"Position\"/>\n"
|
||||||
|
" </method>\n"
|
||||||
|
" <method name=\"OpenUri\">\n"
|
||||||
|
" <arg type=\"s\" name=\"Uri\"/>\n"
|
||||||
|
" </method>\n"
|
||||||
|
" <signal name=\"Seeked\">\n"
|
||||||
|
" <arg type=\"x\" name=\"Position\"/>\n"
|
||||||
|
" </signal>\n"
|
||||||
|
" <property access=\"read\" type=\"s\" name=\"PlaybackStatus\"/>\n"
|
||||||
|
" <property access=\"readwrite\" type=\"s\" name=\"LoopStatus\"/>\n"
|
||||||
|
" <property access=\"readwrite\" type=\"d\" name=\"Rate\"/>\n"
|
||||||
|
" <property access=\"readwrite\" type=\"b\" name=\"Shuffle\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"a{sv}\" name=\"Metadata\">\n"
|
||||||
|
" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName\"/>\n"
|
||||||
|
" </property>\n"
|
||||||
|
" <property access=\"read\" type=\"d\" name=\"Volume\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"x\" name=\"Position\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"d\" name=\"MinimumRate\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"d\" name=\"MaximumRate\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"b\" name=\"CanGoNext\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"b\" name=\"CanGoPrevious\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"b\" name=\"CanPlay\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"b\" name=\"CanPause\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"b\" name=\"CanSeek\"/>\n"
|
||||||
|
" <property access=\"read\" type=\"b\" name=\"CanControl\"/>\n"
|
||||||
|
" </interface>\n"
|
||||||
|
"")
|
||||||
|
public:
|
||||||
|
MprisPluginPlayerAdaptor(QObject *parent);
|
||||||
|
virtual ~MprisPluginPlayerAdaptor();
|
||||||
|
|
||||||
|
public: // PROPERTIES
|
||||||
|
Q_PROPERTY(bool CanControl READ canControl)
|
||||||
|
bool canControl() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanGoNext READ canGoNext)
|
||||||
|
bool canGoNext() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanGoPrevious READ canGoPrevious)
|
||||||
|
bool canGoPrevious() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanPause READ canPause)
|
||||||
|
bool canPause() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanPlay READ canPlay)
|
||||||
|
bool canPlay() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanSeek READ canSeek)
|
||||||
|
bool canSeek() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString LoopStatus READ loopStatus WRITE setLoopStatus)
|
||||||
|
QString loopStatus() const;
|
||||||
|
void setLoopStatus(const QString &value);
|
||||||
|
|
||||||
|
Q_PROPERTY(double MaximumRate READ maximumRate)
|
||||||
|
double maximumRate() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QVariantMap Metadata READ metadata)
|
||||||
|
QVariantMap metadata() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(double MinimumRate READ minimumRate)
|
||||||
|
double minimumRate() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString PlaybackStatus READ playbackStatus)
|
||||||
|
QString playbackStatus() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(qlonglong Position READ position)
|
||||||
|
qlonglong position() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(double Rate READ rate WRITE setRate)
|
||||||
|
double rate() const;
|
||||||
|
void setRate(double value);
|
||||||
|
|
||||||
|
Q_PROPERTY(bool Shuffle READ shuffle WRITE setShuffle)
|
||||||
|
bool shuffle() const;
|
||||||
|
void setShuffle(bool value);
|
||||||
|
|
||||||
|
Q_PROPERTY(double Volume READ volume)
|
||||||
|
double volume() const;
|
||||||
|
|
||||||
|
public Q_SLOTS: // METHODS
|
||||||
|
void Next();
|
||||||
|
void OpenUri(const QString &Uri);
|
||||||
|
void Pause();
|
||||||
|
void Play();
|
||||||
|
void PlayPause();
|
||||||
|
void Previous();
|
||||||
|
void Seek(qlonglong Offset);
|
||||||
|
void SetPosition(const QDBusObjectPath &TrackId, qlonglong Position);
|
||||||
|
void Stop();
|
||||||
|
Q_SIGNALS: // SIGNALS
|
||||||
|
void Seeked(qlonglong Position);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@@ -0,0 +1,41 @@
|
|||||||
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
|
<node>
|
||||||
|
<interface name="org.mpris.MediaPlayer2.Player">
|
||||||
|
<method name="Next"/>
|
||||||
|
<method name="Previous"/>
|
||||||
|
<method name="Pause"/>
|
||||||
|
<method name="PlayPause"/>
|
||||||
|
<method name="Stop"/>
|
||||||
|
<method name="Play"/>
|
||||||
|
<method name="Seek">
|
||||||
|
<arg name="Offset" type="x"/>
|
||||||
|
</method>
|
||||||
|
<method name="SetPosition">
|
||||||
|
<arg name="TrackId" type="o"/>
|
||||||
|
<arg name="Position" type="x"/>
|
||||||
|
</method>
|
||||||
|
<method name="OpenUri">
|
||||||
|
<arg name="Uri" type="s"/>
|
||||||
|
</method>
|
||||||
|
<signal name="Seeked">
|
||||||
|
<arg name="Position" type="x"/>
|
||||||
|
</signal>
|
||||||
|
<property name="PlaybackStatus" type="s" access="read"/>
|
||||||
|
<property name="LoopStatus" type="s" access="readwrite"/>
|
||||||
|
<property name="Rate" type="d" access="readwrite"/>
|
||||||
|
<property name="Shuffle" type="b" access="readwrite"/>
|
||||||
|
<property name="Metadata" type="a{sv}" access="read">
|
||||||
|
<annotation name="com.trolltech.QtDBus.QtTypeName" value="QVariantMap"/>
|
||||||
|
</property>
|
||||||
|
<property name="Volume" type="d" access="read"/>
|
||||||
|
<property name="Position" type="x" access="read"/>
|
||||||
|
<property name="MinimumRate" type="d" access="read"/>
|
||||||
|
<property name="MaximumRate" type="d" access="read"/>
|
||||||
|
<property name="CanGoNext" type="b" access="read"/>
|
||||||
|
<property name="CanGoPrevious" type="b" access="read"/>
|
||||||
|
<property name="CanPlay" type="b" access="read"/>
|
||||||
|
<property name="CanPause" type="b" access="read"/>
|
||||||
|
<property name="CanSeek" type="b" access="read"/>
|
||||||
|
<property name="CanControl" type="b" access="read"/>
|
||||||
|
</interface>
|
||||||
|
</node>
|
@@ -1,130 +1,92 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/*
|
||||||
|
* This file was generated by qdbusxml2cpp version 0.7
|
||||||
|
* Command line was: qdbusxml2cpp -a mprispluginrootadaptor -c MprisPluginRootAdaptor mprispluginrootadaptor.xml
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* This is an auto-generated file.
|
||||||
* it under the terms of the GNU General Public License as published by
|
* Do not edit! All changes made to it will be lost.
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Tomahawk is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mprispluginrootadaptor.h"
|
#include "mprispluginrootadaptor.h"
|
||||||
|
#include <QtCore/QMetaObject>
|
||||||
|
#include <QtCore/QByteArray>
|
||||||
|
#include <QtCore/QList>
|
||||||
|
#include <QtCore/QMap>
|
||||||
|
#include <QtCore/QString>
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
#include <QtCore/QVariant>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Implementation of adaptor class MprisPluginRootAdaptor
|
||||||
|
*/
|
||||||
|
|
||||||
MprisPluginRootAdaptor::MprisPluginRootAdaptor(QObject *parent)
|
MprisPluginRootAdaptor::MprisPluginRootAdaptor(QObject *parent)
|
||||||
: QDBusAbstractAdaptor(parent)
|
: QDBusAbstractAdaptor(parent)
|
||||||
{
|
{
|
||||||
|
// constructor
|
||||||
|
setAutoRelaySignals(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
MprisPluginRootAdaptor::~MprisPluginRootAdaptor()
|
MprisPluginRootAdaptor::~MprisPluginRootAdaptor()
|
||||||
{
|
{
|
||||||
|
// destructor
|
||||||
}
|
}
|
||||||
|
|
||||||
// Properties
|
bool MprisPluginRootAdaptor::canQuit() const
|
||||||
|
{
|
||||||
|
// get the value of property CanQuit
|
||||||
|
return qvariant_cast< bool >(parent()->property("CanQuit"));
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool MprisPluginRootAdaptor::canRaise() const
|
||||||
MprisPluginRootAdaptor::canQuit()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
bool retVal;
|
// get the value of property CanRaise
|
||||||
QMetaObject::invokeMethod(parent()
|
bool ret = qvariant_cast< bool >(parent()->property("CanRaise"));
|
||||||
, "canQuit"
|
qDebug() << "ret: " << ret;
|
||||||
, Qt::DirectConnection
|
return ret;
|
||||||
, Q_RETURN_ARG( bool, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
QString MprisPluginRootAdaptor::desktopEntry() const
|
||||||
MprisPluginRootAdaptor::canRaise()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// get the value of property DesktopEntry
|
||||||
bool retVal;
|
return qvariant_cast< QString >(parent()->property("DesktopEntry"));
|
||||||
QMetaObject::invokeMethod(parent()
|
|
||||||
, "canRaise"
|
|
||||||
, Qt::DirectConnection
|
|
||||||
, Q_RETURN_ARG( bool, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool MprisPluginRootAdaptor::hasTrackList() const
|
||||||
MprisPluginRootAdaptor::hasTrackList()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// get the value of property HasTrackList
|
||||||
bool retVal;
|
return qvariant_cast< bool >(parent()->property("HasTrackList"));
|
||||||
QMetaObject::invokeMethod(parent()
|
|
||||||
, "hasTrackList"
|
|
||||||
, Qt::DirectConnection
|
|
||||||
, Q_RETURN_ARG( bool, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString MprisPluginRootAdaptor::identity() const
|
||||||
MprisPluginRootAdaptor::identity()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// get the value of property Identity
|
||||||
QString retVal;
|
return qvariant_cast< QString >(parent()->property("Identity"));
|
||||||
QMetaObject::invokeMethod(parent()
|
|
||||||
, "identity"
|
|
||||||
, Qt::DirectConnection
|
|
||||||
, Q_RETURN_ARG( QString, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QStringList MprisPluginRootAdaptor::supportedMimeTypes() const
|
||||||
MprisPluginRootAdaptor::desktopEntry()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// get the value of property SupportedMimeTypes
|
||||||
QString retVal;
|
return qvariant_cast< QStringList >(parent()->property("SupportedMimeTypes"));
|
||||||
QMetaObject::invokeMethod(parent()
|
|
||||||
, "desktopEntry"
|
|
||||||
, Qt::DirectConnection
|
|
||||||
, Q_RETURN_ARG( QString, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList
|
QStringList MprisPluginRootAdaptor::supportedUriSchemes() const
|
||||||
MprisPluginRootAdaptor::supportedUriSchemes()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// get the value of property SupportedUriSchemes
|
||||||
QStringList retVal;
|
return qvariant_cast< QStringList >(parent()->property("SupportedUriSchemes"));
|
||||||
QMetaObject::invokeMethod(parent()
|
|
||||||
, "supportedUriSchemes"
|
|
||||||
, Qt::DirectConnection
|
|
||||||
, Q_RETURN_ARG( QStringList, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList
|
void MprisPluginRootAdaptor::Quit()
|
||||||
MprisPluginRootAdaptor::supportedMimeTypes()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// handle method call org.mpris.MediaPlayer2.Quit
|
||||||
QStringList retVal;
|
QMetaObject::invokeMethod(parent(), "Quit");
|
||||||
QMetaObject::invokeMethod(parent()
|
|
||||||
, "supportedMimeTypes"
|
|
||||||
, Qt::DirectConnection
|
|
||||||
, Q_RETURN_ARG( QStringList, retVal ) );
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods
|
void MprisPluginRootAdaptor::Raise()
|
||||||
|
|
||||||
void
|
|
||||||
MprisPluginRootAdaptor::Raise()
|
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// handle method call org.mpris.MediaPlayer2.Raise
|
||||||
QMetaObject::invokeMethod(parent(), "raise");
|
QMetaObject::invokeMethod(parent(), "Raise");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
MprisPluginRootAdaptor::Quit()
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO;
|
|
||||||
QMetaObject::invokeMethod(parent(), "quit");
|
|
||||||
}
|
|
||||||
|
@@ -1,29 +1,29 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/*
|
||||||
|
* This file was generated by qdbusxml2cpp version 0.7
|
||||||
|
* Command line was: qdbusxml2cpp -a mprispluginrootadaptor -c MprisPluginRootAdaptor mprispluginrootadaptor.xml
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* This is an auto-generated file.
|
||||||
* it under the terms of the GNU General Public License as published by
|
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* before re-generating it.
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Tomahawk is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MPRIS_PLUGIN_ROOT_ADAPTOR
|
#ifndef MPRISPLUGINROOTADAPTOR_H_1312900930
|
||||||
#define MPRIS_PLUGIN_ROOT_ADAPTOR
|
#define MPRISPLUGINROOTADAPTOR_H_1312900930
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtDBus/QtDBus>
|
#include <QtDBus/QtDBus>
|
||||||
|
class QByteArray;
|
||||||
|
template<class T> class QList;
|
||||||
|
template<class Key, class Value> class QMap;
|
||||||
|
class QString;
|
||||||
|
class QStringList;
|
||||||
|
class QVariant;
|
||||||
|
|
||||||
#include <QStringList>
|
/*
|
||||||
|
* Adaptor class for interface org.mpris.MediaPlayer2
|
||||||
|
*/
|
||||||
class MprisPluginRootAdaptor: public QDBusAbstractAdaptor
|
class MprisPluginRootAdaptor: public QDBusAbstractAdaptor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -32,42 +32,45 @@ class MprisPluginRootAdaptor: public QDBusAbstractAdaptor
|
|||||||
" <interface name=\"org.mpris.MediaPlayer2\">\n"
|
" <interface name=\"org.mpris.MediaPlayer2\">\n"
|
||||||
" <method name=\"Raise\"/>\n"
|
" <method name=\"Raise\"/>\n"
|
||||||
" <method name=\"Quit\"/>\n"
|
" <method name=\"Quit\"/>\n"
|
||||||
" <property name=\"CanQuit\" type=\"b\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"b\" name=\"CanQuit\"/>\n"
|
||||||
" <property name=\"CanRaise\" type=\"b\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"b\" name=\"CanRaise\"/>\n"
|
||||||
" <property name=\"HasTrackList\" type=\"b\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"b\" name=\"HasTrackList\"/>\n"
|
||||||
" <property name=\"Identity\" type=\"s\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"s\" name=\"Identity\"/>\n"
|
||||||
" <property name=\"DesktopEntry\" type=\"s\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"s\" name=\"DesktopEntry\"/>\n"
|
||||||
" <property name=\"SupportedUriSchemes\" type=\"as\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"as\" name=\"SupportedUriSchemes\"/>\n"
|
||||||
" <property name=\"SupportedMimeTypes\" type=\"as\" access=\"read\"/>\n"
|
" <property access=\"read\" type=\"as\" name=\"SupportedMimeTypes\"/>\n"
|
||||||
" </interface>\n"
|
" </interface>\n"
|
||||||
"")
|
"")
|
||||||
Q_PROPERTY( bool CanQuit READ canQuit )
|
|
||||||
Q_PROPERTY( bool CanRaise READ canRaise )
|
|
||||||
Q_PROPERTY( bool HasTrackList READ hasTrackList )
|
|
||||||
Q_PROPERTY( QString Identity READ identity )
|
|
||||||
Q_PROPERTY( QString DesktopEntry READ desktopEntry )
|
|
||||||
Q_PROPERTY( QStringList SupportedUriSchemes READ supportedUriSchemes )
|
|
||||||
Q_PROPERTY( QStringList SupportedMimeTypes READ supportedMimeTypes )
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MprisPluginRootAdaptor(QObject *parent);
|
MprisPluginRootAdaptor(QObject *parent);
|
||||||
virtual ~MprisPluginRootAdaptor();
|
virtual ~MprisPluginRootAdaptor();
|
||||||
|
|
||||||
bool canQuit();
|
public: // PROPERTIES
|
||||||
bool canRaise();
|
Q_PROPERTY(bool CanQuit READ canQuit)
|
||||||
bool hasTrackList();
|
bool canQuit() const;
|
||||||
QString identity();
|
|
||||||
QString desktopEntry();
|
|
||||||
QStringList supportedUriSchemes();
|
|
||||||
QStringList supportedMimeTypes();
|
|
||||||
|
|
||||||
|
Q_PROPERTY(bool CanRaise READ canRaise)
|
||||||
|
bool canRaise() const;
|
||||||
|
|
||||||
public slots:
|
Q_PROPERTY(QString DesktopEntry READ desktopEntry)
|
||||||
Q_NOREPLY void Raise();
|
QString desktopEntry() const;
|
||||||
Q_NOREPLY void Quit();
|
|
||||||
|
|
||||||
|
Q_PROPERTY(bool HasTrackList READ hasTrackList)
|
||||||
|
bool hasTrackList() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QString Identity READ identity)
|
||||||
|
QString identity() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QStringList SupportedMimeTypes READ supportedMimeTypes)
|
||||||
|
QStringList supportedMimeTypes() const;
|
||||||
|
|
||||||
|
Q_PROPERTY(QStringList SupportedUriSchemes READ supportedUriSchemes)
|
||||||
|
QStringList supportedUriSchemes() const;
|
||||||
|
|
||||||
|
public Q_SLOTS: // METHODS
|
||||||
|
void Quit();
|
||||||
|
void Raise();
|
||||||
|
Q_SIGNALS: // SIGNALS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
|
<node>
|
||||||
|
<interface name="org.mpris.MediaPlayer2">
|
||||||
|
<method name="Raise"/>
|
||||||
|
<method name="Quit"/>
|
||||||
|
<property name="CanQuit" type="b" access="read"/>
|
||||||
|
<property name="CanRaise" type="b" access="read"/>
|
||||||
|
<property name="HasTrackList" type="b" access="read"/>
|
||||||
|
<property name="Identity" type="s" access="read"/>
|
||||||
|
<property name="DesktopEntry" type="s" access="read"/>
|
||||||
|
<property name="SupportedUriSchemes" type="as" access="read"/>
|
||||||
|
<property name="SupportedMimeTypes" type="as" access="read"/>
|
||||||
|
</interface>
|
||||||
|
</node>
|
Reference in New Issue
Block a user