1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
4
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
6
* Tomahawk is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* Tomahawk is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
23
#include "audio/AudioEngine.h"
24
#include "infosystem/InfoSystem.h"
25
#include "infoplugins/InfoPluginDllMacro.h"
29
#include <QtDBus/QtDBus>
37
class INFOPLUGINDLLEXPORT MprisPlugin : public InfoPlugin
40
Q_INTERFACES( Tomahawk::InfoSystem::InfoPlugin )
44
virtual ~MprisPlugin();
48
// org.mpris.MediaPlayer2
50
Q_PROPERTY( bool CanQuit READ canQuit )
53
Q_PROPERTY( bool CanRaise READ canRaise )
54
bool canRaise() const;
56
Q_PROPERTY( QString DesktopEntry READ desktopEntry )
57
QString desktopEntry() const;
59
Q_PROPERTY( bool HasTrackList READ hasTrackList )
60
bool hasTrackList() const;
62
Q_PROPERTY( QString Identity READ identity )
63
QString identity() const;
65
Q_PROPERTY( QStringList SupportedMimeTypes READ supportedMimeTypes )
66
QStringList supportedMimeTypes() const;
68
Q_PROPERTY( QStringList SupportedUriSchemes READ supportedUriSchemes )
69
QStringList supportedUriSchemes() const;
71
// org.mpris.MediaPlayer2.Player
73
Q_PROPERTY( bool CanControl READ canControl )
74
bool canControl() const;
76
Q_PROPERTY( bool CanGoNext READ canGoNext )
77
bool canGoNext() const;
79
Q_PROPERTY( bool CanGoPrevious READ canGoPrevious )
80
bool canGoPrevious() const;
82
Q_PROPERTY( bool CanPause READ canPause )
83
bool canPause() const;
85
Q_PROPERTY( bool CanPlay READ canPlay )
88
Q_PROPERTY( bool CanSeek READ canSeek )
91
Q_PROPERTY( QString LoopStatus READ loopStatus WRITE setLoopStatus )
92
QString loopStatus() const;
93
void setLoopStatus( const QString& value );
95
Q_PROPERTY( double MaximumRate READ maximumRate )
96
double maximumRate() const;
98
Q_PROPERTY( QVariantMap Metadata READ metadata )
99
QVariantMap metadata() const;
101
Q_PROPERTY( double MinimumRate READ minimumRate )
102
double minimumRate() const;
104
Q_PROPERTY( QString PlaybackStatus READ playbackStatus )
105
QString playbackStatus() const;
107
Q_PROPERTY( qlonglong Position READ position )
108
qlonglong position() const;
110
Q_PROPERTY( double Rate READ rate WRITE setRate )
112
void setRate( double value );
114
Q_PROPERTY( bool Shuffle READ shuffle WRITE setShuffle )
115
bool shuffle() const;
116
void setShuffle( bool value );
118
Q_PROPERTY( double Volume READ volume WRITE setVolume )
119
double volume() const;
120
void setVolume( double value );
123
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
125
Q_UNUSED( criteria );
126
Q_UNUSED( requestData );
129
// org.mpris.MediaPlayer2
133
// org.mpris.MediaPlayer2.Player
135
void OpenUri( const QString& Uri );
140
void Seek( qlonglong Offset );
141
void SetPosition( const QDBusObjectPath& TrackId, qlonglong Position );
147
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
149
Q_UNUSED( requestData );
151
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
154
void stateChanged( AudioState newState, AudioState oldState );
155
void onVolumeChanged( int volume );
156
void onPlaylistChanged( Tomahawk::playlistinterface_ptr );
157
void onTrackCountChanged( unsigned int tracks );
158
void onSeeked( qint64 ms );
161
void Seeked( qlonglong Position );
167
void audioStarted( const QVariant& input );
168
void audioFinished( const QVariant& input );
171
void audioResumed( const QVariant& input );
174
void notifyPropertyChanged( const QString& interface, const QString& propertyName );
175
QString m_playbackStatus;
176
QString m_coverTempFile;
183
#endif // MPRISPLUGIN_H