本文整理汇总了C++中PlayableItem::setPlaybackLog方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayableItem::setPlaybackLog方法的具体用法?C++ PlayableItem::setPlaybackLog怎么用?C++ PlayableItem::setPlaybackLog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayableItem
的用法示例。
在下文中一共展示了PlayableItem::setPlaybackLog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: itemCountChanged
void
PlaylistModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int row, const QModelIndex& parent, const QList< Tomahawk::PlaybackLog >& logs )
{
Q_D( PlaylistModel );
if ( !entries.count() )
{
emit itemCountChanged( rowCount( QModelIndex() ) );
finishLoading();
return;
}
int c = row;
QPair< int, int > crows;
crows.first = c;
crows.second = c + entries.count() - 1;
if ( !d->isLoading )
{
d->savedInsertPos = row;
d->savedInsertTracks = entries;
}
emit beginInsertRows( parent, crows.first, crows.second );
QList< Tomahawk::query_ptr > queries;
int i = 0;
PlayableItem* plitem;
foreach( const plentry_ptr& entry, entries )
{
PlayableItem* pItem = itemFromIndex( parent );
plitem = new PlayableItem( entry, pItem, row + i );
plitem->index = createIndex( row + i, 0, plitem );
if ( logs.count() > i )
plitem->setPlaybackLog( logs.at( i ) );
i++;
if ( entry->query()->id() == currentItemUuid() )
setCurrentIndex( plitem->index );
if ( !entry->query()->resolvingFinished() && !entry->query()->playable() )
{
queries << entry->query();
d->waitingForResolved.append( entry->query().data() );
connect( entry->query().data(), SIGNAL( playableStateChanged( bool ) ),
SLOT( onQueryBecamePlayable( bool ) ),
Qt::UniqueConnection );
connect( entry->query().data(), SIGNAL( resolvingFinished( bool ) ),
SLOT( trackResolved( bool ) ) );
}