/* * Cantata * * Copyright (c) 2011-2016 Craig Drummond * * ---- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 this program; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef MPRIS2_H #define MPRIS2_H #include #include #include #include #include #include class QDBusObjectPath; class Mpris : public QObject { Q_OBJECT // org.mpris.MediaPlayer2.Player Q_PROPERTY( double Rate READ Rate WRITE SetRate ) Q_PROPERTY( qlonglong Position READ Position ) Q_PROPERTY( double MinimumRate READ MinimumRate ) Q_PROPERTY( double MaximumRate READ MaximumRate ) Q_PROPERTY( bool CanControl READ CanControl ) Q_PROPERTY( bool CanPlay READ CanPlay ) Q_PROPERTY( bool CanPause READ CanPause ) Q_PROPERTY( bool CanSeek READ CanSeek ) Q_PROPERTY( bool CanGoNext READ CanGoNext ) Q_PROPERTY( bool CanGoPrevious READ CanGoPrevious ) Q_PROPERTY( QString PlaybackStatus READ PlaybackStatus ) Q_PROPERTY( QString LoopStatus READ LoopStatus WRITE SetLoopStatus ) Q_PROPERTY( bool Shuffle READ Shuffle WRITE SetShuffle ) Q_PROPERTY( QVariantMap Metadata READ Metadata ) Q_PROPERTY( double Volume READ Volume WRITE SetVolume ) // org.mpris.MediaPlayer2 Q_PROPERTY( bool CanQuit READ CanQuit ) Q_PROPERTY( bool CanRaise READ CanRaise ) Q_PROPERTY( QString DesktopEntry READ DesktopEntry ) Q_PROPERTY( bool HasTrackList READ HasTrackList ) Q_PROPERTY( QString Identity READ Identity ) Q_PROPERTY( QStringList SupportedMimeTypes READ SupportedMimeTypes ) Q_PROPERTY( QStringList SupportedUriSchemes READ SupportedUriSchemes ) public: Mpris(QObject *p); virtual ~Mpris(); // org.mpris.MediaPlayer2.Player void Next() { qDebug()<<"next"; } void Previous() { qDebug()<<"previous"; } void Pause(); void PlayPause() { qDebug()<<"pause"; } void Stop() { qDebug()<<"stop"; } void StopAfterCurrent() { qDebug()<<"stop after current"; } void Play(); void Seek(qlonglong pos) { qDebug()<