mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 05:07:27 +02:00
* Expose track stats in Track(-Data).
This commit is contained in:
@@ -320,6 +320,20 @@ Track::playbackCount( const source_ptr& source )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
Track::chartPosition() const
|
||||||
|
{
|
||||||
|
return m_trackData->chartPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
Track::chartCount() const
|
||||||
|
{
|
||||||
|
return m_trackData->chartCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Track::loadAttributes()
|
Track::loadAttributes()
|
||||||
{
|
{
|
||||||
|
@@ -99,6 +99,9 @@ public:
|
|||||||
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
||||||
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
||||||
|
|
||||||
|
unsigned int chartPosition() const;
|
||||||
|
unsigned int chartCount() const;
|
||||||
|
|
||||||
void loadSocialActions();
|
void loadSocialActions();
|
||||||
QList< Tomahawk::SocialAction > allSocialActions() const;
|
QList< Tomahawk::SocialAction > allSocialActions() const;
|
||||||
QString socialActionDescription( const QString& action, DescriptionMode mode ) const;
|
QString socialActionDescription( const QString& action, DescriptionMode mode ) const;
|
||||||
|
@@ -105,6 +105,8 @@ TrackData::TrackData( unsigned int id, const QString& artist, const QString& tra
|
|||||||
, m_attributesLoaded( false )
|
, m_attributesLoaded( false )
|
||||||
, m_socialActionsLoaded( false )
|
, m_socialActionsLoaded( false )
|
||||||
, m_playbackHistoryLoaded( false )
|
, m_playbackHistoryLoaded( false )
|
||||||
|
, m_chartPosition( 0 )
|
||||||
|
, m_chartCount( 0 )
|
||||||
, m_simTracksLoaded( false )
|
, m_simTracksLoaded( false )
|
||||||
, m_lyricsLoaded( false )
|
, m_lyricsLoaded( false )
|
||||||
, m_infoJobs( 0 )
|
, m_infoJobs( 0 )
|
||||||
@@ -339,6 +341,7 @@ TrackData::loadStats()
|
|||||||
m_playbackHistoryLoaded = true;
|
m_playbackHistoryLoaded = true;
|
||||||
|
|
||||||
DatabaseCommand_TrackStats* cmd = new DatabaseCommand_TrackStats( m_ownRef.toStrongRef() );
|
DatabaseCommand_TrackStats* cmd = new DatabaseCommand_TrackStats( m_ownRef.toStrongRef() );
|
||||||
|
connect( cmd, SIGNAL( trackStats( unsigned int, unsigned int ) ), SLOT( onTrackStatsLoaded( unsigned int, unsigned int ) ) );
|
||||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,6 +391,30 @@ TrackData::playbackCount( const source_ptr& source )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TrackData::onTrackStatsLoaded( unsigned int chartPos, unsigned int chartCount )
|
||||||
|
{
|
||||||
|
m_chartPosition = chartPos;
|
||||||
|
m_chartCount = chartCount;
|
||||||
|
|
||||||
|
emit statsLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
TrackData::chartPosition() const
|
||||||
|
{
|
||||||
|
return m_chartPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
TrackData::chartCount() const
|
||||||
|
{
|
||||||
|
return m_chartCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<Tomahawk::query_ptr>
|
QList<Tomahawk::query_ptr>
|
||||||
TrackData::similarTracks() const
|
TrackData::similarTracks() const
|
||||||
{
|
{
|
||||||
|
@@ -100,6 +100,9 @@ public:
|
|||||||
void setPlaybackHistory( const QList< Tomahawk::PlaybackLog >& playbackData );
|
void setPlaybackHistory( const QList< Tomahawk::PlaybackLog >& playbackData );
|
||||||
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
||||||
|
|
||||||
|
unsigned int chartPosition() const;
|
||||||
|
unsigned int chartCount() const;
|
||||||
|
|
||||||
QList<Tomahawk::query_ptr> similarTracks() const;
|
QList<Tomahawk::query_ptr> similarTracks() const;
|
||||||
QStringList lyrics() const;
|
QStringList lyrics() const;
|
||||||
|
|
||||||
@@ -114,6 +117,8 @@ signals:
|
|||||||
void lyricsLoaded();
|
void lyricsLoaded();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void onTrackStatsLoaded( unsigned int chartPos, unsigned int chartCount );
|
||||||
|
|
||||||
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
||||||
void infoSystemFinished( QString target );
|
void infoSystemFinished( QString target );
|
||||||
|
|
||||||
@@ -142,6 +147,8 @@ private:
|
|||||||
|
|
||||||
bool m_playbackHistoryLoaded;
|
bool m_playbackHistoryLoaded;
|
||||||
QList< PlaybackLog > m_playbackHistory;
|
QList< PlaybackLog > m_playbackHistory;
|
||||||
|
unsigned int m_chartPosition;
|
||||||
|
unsigned int m_chartCount;
|
||||||
|
|
||||||
bool m_simTracksLoaded;
|
bool m_simTracksLoaded;
|
||||||
QList<Tomahawk::query_ptr> m_similarTracks;
|
QList<Tomahawk::query_ptr> m_similarTracks;
|
||||||
|
Reference in New Issue
Block a user