本文整理汇总了C++中tomahawk::artist_ptr类的典型用法代码示例。如果您正苦于以下问题:C++ artist_ptr类的具体用法?C++ artist_ptr怎么用?C++ artist_ptr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了artist_ptr类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QObject
TreeModelItem::TreeModelItem( const Tomahawk::artist_ptr& artist, TreeModelItem* parent, int row )
: QObject( parent )
, m_artist( artist )
{
this->parent = parent;
fetchingMore = false;
m_isPlaying = false;
if ( parent )
{
if ( row < 0 )
{
parent->children.append( this );
row = parent->children.count() - 1;
}
else
{
parent->children.insert( row, this );
}
this->model = parent->model;
}
toberemoved = false;
connect( artist.data(), SIGNAL( updated() ), SIGNAL( dataChanged() ) );
}
示例2: QObject
PlayableItem::PlayableItem( const Tomahawk::artist_ptr& artist, PlayableItem* parent, int row )
: QObject( parent )
, m_artist( artist )
{
init( parent, row );
connect( artist.data(), SIGNAL( updated() ), SIGNAL( dataChanged() ) );
}
示例3: album_ptr
album_ptr
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
{
int albid = Database::instance()->impl()->albumId( artist->id(), name, autoCreate );
if ( albid < 1 && autoCreate )
return album_ptr();
return Album::get( albid, name, artist );
}
示例4: connect
void
PlaylistModel::append( const Tomahawk::artist_ptr& artist )
{
if ( artist.isNull() )
return;
connect( artist.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr> ) ),
SLOT( append( QList<Tomahawk::query_ptr> ) ) );
if ( rowCount( QModelIndex() ) == 0 )
{
setTitle( artist->name() );
setDescription( tr( "All tracks by %1" ).arg( artist->name() ) );
m_isTemporary = true;
}
append( artist->playlistInterface()->tracks() );
}
示例5: QObject
Album::Album( const QString& name, const Tomahawk::artist_ptr& artist )
: QObject()
, m_waitingForId( true )
, m_name( name )
, m_artist( artist )
, m_coverLoaded( false )
, m_coverLoading( false )
#ifndef ENABLE_HEADLESS
, m_cover( 0 )
#endif
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Creating album:" << name << artist->name();
m_sortname = DatabaseImpl::sortname( name );
}
示例6: ErrorStatusMessage
void
AudioEngine::playItem( const Tomahawk::artist_ptr& artist )
{
playlistinterface_ptr pli = artist->playlistInterface( Mixed );
if ( pli->isFinished() )
{
if ( !pli->tracks().count() )
{
JobStatusView::instance()->model()->addJob(
new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the artist '%1'" ).arg( artist->name() ), 15 ) );
if ( isStopped() )
emit stopped(); // we do this so the original caller knows we couldn't find this track
}
else
playItem( pli, pli->tracks().first() );
}
else
{
NewClosure( artist.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ),
const_cast<AudioEngine*>(this), SLOT( playItem( Tomahawk::artist_ptr ) ), artist );
pli->tracks();
}
}
示例7: QString
inline QString
albumCacheKey( const Tomahawk::artist_ptr& artist, const QString& albumName )
{
return QString( "%1\t\t%2" ).arg( artist->name().toLower() ).arg( albumName.toLower() );
}
示例8: QWidget
ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent )
: QWidget( parent )
, ui( new Ui::ArtistInfoWidget )
, m_artist( artist )
{
QWidget* widget = new QWidget;
ui->setupUi( widget );
artist->loadStats();
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
ui->lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
ui->lineBelow2->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
m_playStatsGauge = new StatsGauge( ui->statsWidget );
m_playStatsGauge->setText( tr( "YOUR ARTIST RANK" ) );
m_playStatsGauge->setInvertedAppearance( true );
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
l->addWidget( m_playStatsGauge );
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
ui->statsWidget->setLayout( l );
TomahawkUtils::unmarginLayout( l );
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Original, QSize( 48, 48 ) );
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, ui->cover->size() ) );
ui->cover->setShowText( false );
{
m_relatedModel = new PlayableModel( ui->relatedArtists );
ui->relatedArtists->setPlayableModel( m_relatedModel );
ui->relatedArtists->proxyModel()->sort( -1 );
ui->relatedArtists->setEmptyTip( tr( "Sorry, we could not find any related artists!" ) );
ui->relatedArtists->setAutoFitItems( true );
/* ui->relatedArtists->setWrapping( false );
ui->relatedArtists->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->relatedArtists->delegate()->setItemSize( QSize( 170, 170 ) );
TomahawkStyle::stylePageFrame( ui->relatedArtists );
TomahawkStyle::stylePageFrame( ui->artistFrame );
TomahawkStyle::styleScrollBar( ui->relatedArtists->verticalScrollBar() );
}
{
ui->albums->setAutoResize( true );
ui->albums->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
/* ui->albums->setWrapping( false );
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->albums->delegate()->setItemSize( QSize( 170, 170 ) );
ui->albums->proxyModel()->setHideDupeItems( true );
m_albumsModel = new PlayableModel( ui->albums );
ui->albums->setPlayableModel( m_albumsModel );
ui->albums->proxyModel()->sort( -1 );
ui->albums->setEmptyTip( tr( "Sorry, we could not find any albums for this artist!" ) );
ui->albums->setStyleSheet( QString( "QListView { background-color: %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
TomahawkStyle::stylePageFrame( ui->albumFrame );
TomahawkStyle::styleScrollBar( ui->albums->verticalScrollBar() );
}
{
m_topHitsModel = new PlaylistModel( ui->topHits );
AlbumItemDelegate* del = new AlbumItemDelegate( ui->topHits, ui->topHits->proxyModel() );
ui->topHits->setPlaylistItemDelegate( del );
ui->topHits->proxyModel()->setStyle( PlayableProxyModel::Short );
ui->topHits->setPlayableModel( m_topHitsModel );
ui->topHits->setSortingEnabled( false );
ui->topHits->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
ui->topHits->setAutoResize( true );
ui->topHits->setAlternatingRowColors( false );
QPalette p = ui->topHits->palette();
p.setColor( QPalette::Text, TomahawkStyle::PAGE_TRACKLIST_TRACK_SOLVED );
p.setColor( QPalette::BrightText, TomahawkStyle::PAGE_TRACKLIST_TRACK_UNRESOLVED );
p.setColor( QPalette::Foreground, TomahawkStyle::PAGE_TRACKLIST_NUMBER );
p.setColor( QPalette::Highlight, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT );
p.setColor( QPalette::HighlightedText, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT_TEXT );
ui->topHits->setPalette( p );
TomahawkStyle::stylePageFrame( ui->topHits );
TomahawkStyle::stylePageFrame( ui->trackFrame );
}
{
QFont f = ui->biography->font();
f.setFamily( "Titillium Web" );
QPalette p = ui->biography->palette();
p.setColor( QPalette::Text, TomahawkStyle::HEADER_TEXT );
ui->biography->setFont( f );
ui->biography->setPalette( p );
ui->biography->setOpenLinks( false );
ui->biography->setOpenExternalLinks( true );
//.........这里部分代码省略.........