mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
* When a track starts playing, check if we need to update the sidebar's speaker-icon.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "SourceTreeItem.h"
|
#include "SourceTreeItem.h"
|
||||||
|
|
||||||
|
#include "audio/AudioEngine.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
@@ -30,6 +31,8 @@ SourceTreeItem::SourceTreeItem( SourcesModel* model, SourceTreeItem* parent, Sou
|
|||||||
, m_model( model )
|
, m_model( model )
|
||||||
, m_peerSortValue( peerSortValue )
|
, 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( beginChildRowsAdded( int, int ) ), m_model, SLOT( onItemRowsAddedBegin( int, int ) ) );
|
||||||
connect( this, SIGNAL( beginChildRowsRemoved( int, int ) ), m_model, SLOT( onItemRowsRemovedBegin( int, int ) ) );
|
connect( this, SIGNAL( beginChildRowsRemoved( int, int ) ), m_model, SLOT( onItemRowsRemovedBegin( int, int ) ) );
|
||||||
connect( this, SIGNAL( childRowsAdded() ), m_model, SLOT( onItemRowsAddedDone() ) );
|
connect( this, SIGNAL( childRowsAdded() ), m_model, SLOT( onItemRowsAddedDone() ) );
|
||||||
@@ -56,6 +59,14 @@ SourceTreeItem::~SourceTreeItem()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourceTreeItem::checkPlayingStatus()
|
||||||
|
{
|
||||||
|
if ( isBeingPlayed() )
|
||||||
|
emit updated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SourcesModel::RowType
|
SourcesModel::RowType
|
||||||
SourceTreeItem::type() const
|
SourceTreeItem::type() const
|
||||||
{
|
{
|
||||||
|
@@ -98,6 +98,9 @@ protected:
|
|||||||
void setRowType( SourcesModel::RowType t );
|
void setRowType( SourcesModel::RowType t );
|
||||||
void setParentItem( SourceTreeItem* item );
|
void setParentItem( SourceTreeItem* item );
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void checkPlayingStatus();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SourcesModel::RowType m_type;
|
SourcesModel::RowType m_type;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user