mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Following is working now :-D
This commit is contained in:
@@ -285,6 +285,8 @@ Source::onPlaybackStarted( const Tomahawk::query_ptr& query )
|
|||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << query->toString();
|
qDebug() << Q_FUNC_INFO << query->toString();
|
||||||
m_currentTrack = query;
|
m_currentTrack = query;
|
||||||
|
if ( m_playlistInterface.isNull() )
|
||||||
|
getPlaylistInterface();
|
||||||
emit playbackStarted( query );
|
emit playbackStarted( query );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,6 @@ SourcePlaylistInterface::siblingItem( int itemsAway )
|
|||||||
{
|
{
|
||||||
Q_UNUSED( itemsAway );
|
Q_UNUSED( itemsAway );
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
Pipeline::instance()->resolve( m_source->currentTrack(), true );
|
|
||||||
if ( m_source->currentTrack()->results().empty() )
|
if ( m_source->currentTrack()->results().empty() )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << " Results were empty for current track";
|
qDebug() << Q_FUNC_INFO << " Results were empty for current track";
|
||||||
@@ -53,7 +52,6 @@ Tomahawk::result_ptr
|
|||||||
SourcePlaylistInterface::nextItem()
|
SourcePlaylistInterface::nextItem()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
Pipeline::instance()->resolve( m_source->currentTrack(), true );
|
|
||||||
if ( m_source->currentTrack()->results().empty() )
|
if ( m_source->currentTrack()->results().empty() )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << " Results were empty for current track";
|
qDebug() << Q_FUNC_INFO << " Results were empty for current track";
|
||||||
@@ -75,5 +73,24 @@ void
|
|||||||
SourcePlaylistInterface::onSourcePlaybackStarted( const Tomahawk::query_ptr& query ) const
|
SourcePlaylistInterface::onSourcePlaybackStarted( const Tomahawk::query_ptr& query ) const
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
connect( query.data(), SIGNAL( resultsAdded( const QList<Tomahawk::result_ptr>& ) ), SLOT( resolveResultsAdded( const QList<Tomahawk::result_ptr>& ) ) );
|
||||||
|
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), SLOT( resolvingFinished( bool ) ) );
|
||||||
Pipeline::instance()->resolve( query, true );
|
Pipeline::instance()->resolve( query, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SourcePlaylistInterface::resolveResultsAdded( const QList<Tomahawk::result_ptr>& results ) const
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
foreach ( Tomahawk::result_ptr ptr, results )
|
||||||
|
{
|
||||||
|
qDebug() << "Found result: " << ptr->track();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SourcePlaylistInterface::resolvingFinished( bool hasResults ) const
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << " and has results? : " << (hasResults ? "true" : "false");
|
||||||
|
}
|
@@ -64,6 +64,8 @@ signals:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onSourcePlaybackStarted( const Tomahawk::query_ptr& query ) const;
|
void onSourcePlaybackStarted( const Tomahawk::query_ptr& query ) const;
|
||||||
|
void resolveResultsAdded( const QList<Tomahawk::result_ptr>& results ) const;
|
||||||
|
void resolvingFinished( bool hasResults ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Tomahawk::source_ptr m_source;
|
Tomahawk::source_ptr m_source;
|
||||||
|
Reference in New Issue
Block a user