mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-20 12:52:30 +02:00
If paused for a minute, clear Adium status.
This commit is contained in:
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "infosystem/infosystemworker.h"
|
#include "infosystem/infosystemworker.h"
|
||||||
#include "artist.h"
|
#include "artist.h"
|
||||||
#include "result.h"
|
#include "result.h"
|
||||||
@@ -65,6 +67,10 @@ AdiumPlugin::AdiumPlugin()
|
|||||||
|
|
||||||
connect( TomahawkSettings::instance(), SIGNAL( changed() ),
|
connect( TomahawkSettings::instance(), SIGNAL( changed() ),
|
||||||
SLOT( settingsChanged() ), Qt::QueuedConnection );
|
SLOT( settingsChanged() ), Qt::QueuedConnection );
|
||||||
|
|
||||||
|
m_pauseTimer = new QTimer( this );
|
||||||
|
connect( m_pauseTimer, SIGNAL( timeout() ),
|
||||||
|
this, SLOT( clearStatus() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
AdiumPlugin::~AdiumPlugin()
|
AdiumPlugin::~AdiumPlugin()
|
||||||
@@ -73,6 +79,13 @@ AdiumPlugin::~AdiumPlugin()
|
|||||||
setStatus( "" );
|
setStatus( "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AdiumPlugin::clearStatus()
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
setStatus( "" );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AdiumPlugin::settingsChanged()
|
AdiumPlugin::settingsChanged()
|
||||||
{
|
{
|
||||||
@@ -107,9 +120,9 @@ AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp
|
|||||||
case InfoNowPlaying:
|
case InfoNowPlaying:
|
||||||
audioStarted( input );
|
audioStarted( input );
|
||||||
break;
|
break;
|
||||||
// case InfoNowPaused:
|
case InfoNowPaused:
|
||||||
// audioPaused();
|
audioPaused();
|
||||||
// break;
|
return;
|
||||||
case InfoNowResumed:
|
case InfoNowResumed:
|
||||||
audioResumed( input );
|
audioResumed( input );
|
||||||
break;
|
break;
|
||||||
@@ -120,6 +133,9 @@ AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop the pause timer always, unless pausing of course
|
||||||
|
m_pauseTimer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Audio state slots */
|
/** Audio state slots */
|
||||||
@@ -177,14 +193,12 @@ void
|
|||||||
AdiumPlugin::audioPaused()
|
AdiumPlugin::audioPaused()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
m_pauseTimer->start( 60 * 1000 );
|
||||||
//setStatus( "Paused" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AdiumPlugin::audioResumed( const QVariant &input )
|
AdiumPlugin::audioResumed( const QVariant &input )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
// TODO: audio resumed, so push update status to Adium with playing track
|
|
||||||
audioStarted( input );
|
audioStarted( input );
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
class QTimer;
|
||||||
|
|
||||||
namespace Tomahawk {
|
namespace Tomahawk {
|
||||||
|
|
||||||
namespace InfoSystem {
|
namespace InfoSystem {
|
||||||
@@ -44,6 +46,9 @@ public slots:
|
|||||||
void namChangedSlot( QNetworkAccessManager *nam ) {} // unused
|
void namChangedSlot( QNetworkAccessManager *nam ) {} // unused
|
||||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) {} // unused
|
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) {} // unused
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void clearStatus();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
@@ -59,6 +64,8 @@ private:
|
|||||||
QString m_beforeStatus;
|
QString m_beforeStatus;
|
||||||
QString m_afterStatus;
|
QString m_afterStatus;
|
||||||
|
|
||||||
|
QTimer* m_pauseTimer;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user