diff --git a/src/libtomahawk/audio/audioengine.cpp b/src/libtomahawk/audio/audioengine.cpp index 6e4def041..ee51230ae 100644 --- a/src/libtomahawk/audio/audioengine.cpp +++ b/src/libtomahawk/audio/audioengine.cpp @@ -91,6 +91,13 @@ AudioEngine::play() { m_mediaObject->play(); emit resumed(); + Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + + trackInfo["title"] = m_currentTrack->track(); + trackInfo["artist"] = m_currentTrack->artist()->name(); + Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( + s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowResumed, + QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); } else loadNextTrack(); @@ -104,6 +111,8 @@ AudioEngine::pause() m_mediaObject->pause(); emit paused(); + Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( + s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowPaused, QVariant() ); } @@ -117,6 +126,8 @@ AudioEngine::stop() setCurrentTrack( Tomahawk::result_ptr() ); emit stopped(); + Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( + s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowStopped, QVariant() ); } diff --git a/src/libtomahawk/infosystem/infoplugins/adiumplugin.cpp b/src/libtomahawk/infosystem/infoplugins/adiumplugin.cpp index 59a97c0a4..4a9da79ef 100644 --- a/src/libtomahawk/infosystem/infoplugins/adiumplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/adiumplugin.cpp @@ -42,7 +42,7 @@ AdiumPlugin::AdiumPlugin() : InfoPlugin() { qDebug() << Q_FUNC_INFO; - m_supportedPushTypes << InfoNowPlaying; + m_supportedPushTypes << InfoNowPlaying << InfoNowPaused << InfoNowResumed << InfoNowStopped; } AdiumPlugin::~AdiumPlugin() @@ -68,15 +68,24 @@ void AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input ) { qDebug() << Q_FUNC_INFO; - + switch ( type ) { case InfoNowPlaying: - audioStarted( input ); - break; + audioStarted( input ); + break; + case InfoNowPaused: + audioPaused(); + break; + case InfoNowResumed: + audioResumed( input ); + break; + case InfoNowStopped: + audioStopped(); + break; default: - return; + return; } } diff --git a/src/libtomahawk/infosystem/infosystem.h b/src/libtomahawk/infosystem/infosystem.h index 86de07e6e..a484307b8 100644 --- a/src/libtomahawk/infosystem/infosystem.h +++ b/src/libtomahawk/infosystem/infosystem.h @@ -95,8 +95,11 @@ enum InfoType { // as items are saved in cache, mark them here to not change the InfoSubmitScrobble = 47, InfoNowPlaying = 48, + InfoNowPaused = 49, + InfoNowResumed = 50, + InfoNowStopped = 51, - InfoNoInfo = 49 + InfoNoInfo = 52 }; typedef QMap< InfoType, QVariant > InfoMap;