mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Let AudioEngine wait for a query to finish resolving and start playback asap.
This commit is contained in:
@@ -105,6 +105,8 @@ private:
|
||||
QString m_filter;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE( Tomahawk::playlistinterface_ptr )
|
||||
|
||||
#endif // PLAYLISTINTERFACE_H
|
||||
|
@@ -579,9 +579,17 @@ AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk:
|
||||
void
|
||||
AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::query_ptr& query )
|
||||
{
|
||||
if ( !query.isNull() && query->numResults() )
|
||||
if ( query->resolvingFinished() )
|
||||
{
|
||||
if ( query->numResults() )
|
||||
playItem( playlist, query->results().first() );
|
||||
}
|
||||
else
|
||||
{
|
||||
_detail::Closure* closure = NewClosure( query.data(), SIGNAL( resolvingFinished( bool ) ),
|
||||
const_cast<AudioEngine*>(this), SLOT( playItem( Tomahawk::playlistinterface_ptr, Tomahawk::query_ptr ) ), playlist, query );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@@ -604,18 +612,10 @@ AudioEngine::playItem( const Tomahawk::album_ptr& album )
|
||||
{
|
||||
playlistinterface_ptr pli = album->playlistInterface( Mixed );
|
||||
if ( pli->trackCount() )
|
||||
{
|
||||
if ( pli->tracks().first()->resolvingFinished() )
|
||||
{
|
||||
playItem( pli, pli->tracks().first() );
|
||||
}
|
||||
else
|
||||
{
|
||||
_detail::Closure* closure = NewClosure( pli->tracks().first().data(), SIGNAL( resolvingFinished( bool ) ),
|
||||
const_cast<AudioEngine*>(this), SLOT( playItem( Tomahawk::album_ptr ) ), album );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_detail::Closure* closure = NewClosure( album.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ),
|
||||
const_cast<AudioEngine*>(this), SLOT( playItem( Tomahawk::album_ptr ) ), album );
|
||||
|
Reference in New Issue
Block a user