mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-19 23:41:51 +02:00
Add the Seeked signal in MPRIS.
This commit is contained in:
parent
6b1d919518
commit
1d222064fb
@ -245,6 +245,7 @@ AudioEngine::seek( qint64 ms )
|
||||
{
|
||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << ms;
|
||||
m_mediaObject->seek( ms );
|
||||
emit seeked( ms );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,8 @@ signals:
|
||||
void paused();
|
||||
void resumed();
|
||||
|
||||
void seeked( qint64 ms );
|
||||
|
||||
void stateChanged( AudioState newState, AudioState oldState );
|
||||
void volumeChanged( int volume /* in percent */ );
|
||||
|
||||
|
@ -44,16 +44,20 @@ MprisPlugin::MprisPlugin()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
// init
|
||||
m_playbackStatus = "Stopped";
|
||||
|
||||
// Types of pushInfo we care about
|
||||
m_supportedPushTypes << InfoNowPlaying << InfoNowPaused << InfoNowResumed << InfoNowStopped;
|
||||
|
||||
// DBus connection
|
||||
new MprisPluginRootAdaptor( this );
|
||||
new MprisPluginPlayerAdaptor( this );
|
||||
QDBusConnection dbus = QDBusConnection::sessionBus();
|
||||
dbus.registerObject("/org/mpris/MediaPlayer2", this);
|
||||
dbus.registerService("org.mpris.MediaPlayer2.tomahawk");
|
||||
|
||||
// Listen to volume changes
|
||||
connect( AudioEngine::instance(), SIGNAL( volumeChanged( int ) ),
|
||||
SLOT( onVolumeChanged( int ) ) );
|
||||
|
||||
@ -548,6 +552,18 @@ MprisPlugin::onTrackCountChanged( unsigned int tracks )
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
MprisPlugin::onSeeked( qint64 ms )
|
||||
{
|
||||
QDBusMessage signal = QDBusMessage::createSignal(
|
||||
"/org/mpris/MediaPlayer2",
|
||||
"org.mpris.MediaPlayer2.Player",
|
||||
"Seeked");
|
||||
qlonglong us = ms*1000;
|
||||
signal << us;
|
||||
QDBusConnection::sessionBus().send(signal);
|
||||
}
|
||||
|
||||
void
|
||||
MprisPlugin::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
|
||||
{
|
||||
|
@ -149,6 +149,7 @@ private slots:
|
||||
void onVolumeChanged( int volume );
|
||||
void onPlaylistChanged( Tomahawk::PlaylistInterface* playlist);
|
||||
void onTrackCountChanged( unsigned int tracks );
|
||||
void onSeeked( qint64 ms );
|
||||
|
||||
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
||||
void infoSystemFinished( QString target );
|
||||
|
Loading…
x
Reference in New Issue
Block a user