1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* When a track starts playing, check if we need to update the sidebar's speaker-icon.

This commit is contained in:
Christian Muehlhaeuser 2013-06-13 10:25:59 +02:00
parent 8f91f7d18f
commit b25cc538f7
2 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "SourceTreeItem.h"
#include "audio/AudioEngine.h"
#include "utils/Logger.h"
using namespace Tomahawk;
@ -30,6 +31,8 @@ SourceTreeItem::SourceTreeItem( SourcesModel* model, SourceTreeItem* parent, Sou
, m_model( model )
, m_peerSortValue( peerSortValue )
{
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( checkPlayingStatus() ) );
connect( this, SIGNAL( beginChildRowsAdded( int, int ) ), m_model, SLOT( onItemRowsAddedBegin( int, int ) ) );
connect( this, SIGNAL( beginChildRowsRemoved( int, int ) ), m_model, SLOT( onItemRowsRemovedBegin( int, int ) ) );
connect( this, SIGNAL( childRowsAdded() ), m_model, SLOT( onItemRowsAddedDone() ) );
@ -56,6 +59,14 @@ SourceTreeItem::~SourceTreeItem()
}
void
SourceTreeItem::checkPlayingStatus()
{
if ( isBeingPlayed() )
emit updated();
}
SourcesModel::RowType
SourceTreeItem::type() const
{

View File

@ -98,6 +98,9 @@ protected:
void setRowType( SourcesModel::RowType t );
void setParentItem( SourceTreeItem* item );
private slots:
void checkPlayingStatus();
private:
SourcesModel::RowType m_type;