示例#1
0
void
IdThreadWorker::getAlbumId( const album_ptr& album, bool autoCreate )
{
    QueueItem* item = internalGet( artist_ptr(), album, trackdata_ptr(), autoCreate, AlbumType );
    album->setIdFuture( item->promise.future() );

#if ID_THREAD_DEBUG
    tDebug() << "QUEUEING ALUBM:" << album->artist()->name() << album->name();
#endif
    s_mutex.lock();
    s_workQueue.enqueue( item );
    s_mutex.unlock();
    s_waitCond.wakeOne();
#if ID_THREAD_DEBUG
    tDebug() << "DONE WOKE UP THREAD:" << album->artist()->name() << album->name();
#endif
}
示例#2
0
void
AlbumInfoWidget::load( const album_ptr& album )
{
    if ( !m_album.isNull() )
        disconnect( m_album.data(), SIGNAL( updated() ), this, SLOT( onAlbumCoverUpdated() ) );

    m_album = album;
    m_title = album->name();
    m_description = album->artist()->name();

    ui->albumsLabel->setText( tr( "Other Albums by %1" ).arg( album->artist()->name() ) );

    m_tracksModel->addTracks( album, QModelIndex(), true );
    loadAlbums( true );

    connect( m_album.data(), SIGNAL( updated() ), SLOT( onAlbumCoverUpdated() ) );
    onAlbumCoverUpdated();
}
示例#3
0
void
AlbumInfoWidget::load( const album_ptr& album )
{
    m_album = album;
    m_title = album->name();
    m_description = album->artist()->name();
    ui->albumsLabel->setText( tr( "Other Albums by %1" ).arg( album->artist()->name() ) );

    m_tracksModel->addTracks( album, QModelIndex() );

    DatabaseCommand_AllAlbums* cmd = new DatabaseCommand_AllAlbums();
    cmd->setArtist( album->artist() );

    connect( cmd, SIGNAL( albums( QList<Tomahawk::album_ptr>, QVariant ) ),
                    SLOT( gotAlbums( QList<Tomahawk::album_ptr> ) ) );

    Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );

    Tomahawk::InfoSystem::InfoCriteriaHash trackInfo;
    trackInfo["artist"] = album->artist()->name();
    trackInfo["album"] = album->name();

    Tomahawk::InfoSystem::InfoRequestData requestData;
    requestData.caller = s_aiInfoIdentifier;
    requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt;
    requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo );
    requestData.customData = QVariantMap();

    Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
}
示例#4
0
void
AlbumInfoWidget::load( const album_ptr& album )
{
    if ( !m_album.isNull() )
    {
        disconnect( m_album.data(), SIGNAL( updated() ), this, SLOT( onAlbumImageUpdated() ) );
    }

    m_album = album;
    m_title = album->name();

    connect( m_album.data(), SIGNAL( updated() ), SLOT( onAlbumImageUpdated() ) );

    ui->label_2->setText( tr( "Other Albums by %1" ).arg( album->artist()->name() ) );
    ui->cover->setAlbum( album );

    m_tracksModel->startLoading();
    m_tracksModel->addTracks( album, QModelIndex(), true );
    loadAlbums( true );

    onAlbumImageUpdated();
}
示例#5
0
QUrl
GlobalActionManager::copyOpenLink( const album_ptr& album ) const
{
    const QUrl link = QUrl::fromUserInput( QString( "%1/album/%2/%3" ).arg( hostname() ).arg( album->artist().isNull() ? QString() : album->artist()->name() ).arg( album->name() ) );

    QClipboard* cb = QApplication::clipboard();
    QByteArray data = percentEncode( link );

    cb->setText( data );

    return link;
}