当前位置: 首页>>代码示例>>C++>>正文


C++ dynplaylist_ptr::data方法代码示例

本文整理汇总了C++中tomahawk::dynplaylist_ptr::data方法的典型用法代码示例。如果您正苦于以下问题:C++ dynplaylist_ptr::data方法的具体用法?C++ dynplaylist_ptr::data怎么用?C++ dynplaylist_ptr::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tomahawk::dynplaylist_ptr的用法示例。


在下文中一共展示了dynplaylist_ptr::data方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QString

void
ViewManager::createDynamicPlaylist( const Tomahawk::source_ptr& src, const QVariant& contents )
{
    Tomahawk::dynplaylist_ptr p = Tomahawk::dynplaylist_ptr( new Tomahawk::DynamicPlaylist( src, contents.toMap().value( "type", QString() ).toString()  ) );
    QJson::QObjectHelper::qvariant2qobject( contents.toMap(), p.data() );
    p->reportCreated( p );
}
开发者ID:nowrep,项目名称:tomahawk,代码行数:7,代码来源:ViewManager.cpp

示例2: deleted

void
DynamicPlaylist::reportDeleted( const Tomahawk::dynplaylist_ptr& self )
{
//    qDebug() << Q_FUNC_INFO;
    Q_ASSERT( self.data() == this );
    // will emit Collection::playlistDeleted(...)
    if( self->mode() == Static )
        author()->collection()->deleteAutoPlaylist( self );
    else
        author()->collection()->deleteStation( self );

    emit deleted( self );
}
开发者ID:euroelessar,项目名称:tomahawk,代码行数:13,代码来源:DynamicPlaylist.cpp

示例3: author

void
DynamicPlaylist::reportCreated( const Tomahawk::dynplaylist_ptr& self )
{
//    qDebug() << Q_FUNC_INFO;
    Q_ASSERT( self.data() == this );
    Q_ASSERT( !author().isNull() );
    Q_ASSERT( !author()->collection().isNull() );
    // will emit Collection::playlistCreated(...)
    //    qDebug() << "Creating dynplaylist belonging to:" << author().data() << author().isNull();
    //    qDebug() << "REPORTING DYNAMIC PLAYLIST CREATED:" << this << author()->friendlyName();
    if( self->mode() == Static )
        author()->collection()->addAutoPlaylist( self );
    else
        author()->collection()->addStation( self );
}
开发者ID:euroelessar,项目名称:tomahawk,代码行数:15,代码来源:DynamicPlaylist.cpp

示例4: QModelIndex

QModelIndex
SourcesModel::dynamicPlaylistToIndex( const Tomahawk::dynplaylist_ptr& playlist )
{
    for ( int i = 0; i < rowCount(); i++ )
    {
        QModelIndex pidx = index( i, 0 );
        
        for ( int j = 0; j < rowCount( pidx ); j++ )
        {
            QModelIndex idx = index( j, 0, pidx );
            SourcesModel::SourceType type = SourcesModel::indexType( idx );
            
            if ( type == SourcesModel::DynamicPlaylistSource )
            {
                playlist_ptr p = SourcesModel::indexToDynamicPlaylist( idx );
                if ( playlist.data() == p.data() )
                    return idx;
            }
        }
    }
    
    return QModelIndex();
}
开发者ID:tiegz,项目名称:tomahawk,代码行数:23,代码来源:sourcesmodel.cpp

示例5: qAbs

void
DynamicWidget::loadDynamicPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
{
    // special case: if we have launched multiple setRevision calls, and the number of controls is different, it means that we're getting an intermediate setRevision
    //  called after the user has already created more revisions. ignore in that case.
    if( m_playlist.data() == playlist.data() && m_seqRevLaunched > 0
        && m_controls->controls().size() != playlist->generator()->controls().size() // different number of controls
        && qAbs( m_playlist->generator()->controls().size() - playlist->generator()->controls().size() ) < m_seqRevLaunched ) { // difference in controls has to be less than how many revisions we launched
        return;
    }
    m_seqRevLaunched = 0;

    // if we're being told to load the same dynamic playlist over again, only do it if the controls have a different number
    if( !m_playlist.isNull() && ( m_playlist.data() == playlist.data() ) // same playlist pointer
        && m_playlist->generator()->controls().size() == playlist->generator()->controls().size() ) {
        // we can skip our work. just let the dynamiccontrollist show the difference
        m_controls->setControls( m_playlist, m_playlist->author()->isLocal() );

        m_playlist = playlist;

        if( !m_runningOnDemand ) {
            m_model->loadPlaylist( m_playlist );
        } else if( !m_controlsChanged ) { // if the controls changed, we already dealt with that and don't want to change station yet
            m_model->changeStation();
        }
        m_controlsChanged = false;

        return;
    }

    if( !m_playlist.isNull() ) {
        disconnect( m_playlist->generator().data(), SIGNAL( generated( QList<Tomahawk::query_ptr> ) ), this, SLOT( tracksGenerated( QList<Tomahawk::query_ptr> ) ) );
        disconnect( m_playlist.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision) ), this, SLOT(onRevisionLoaded( Tomahawk::DynamicPlaylistRevision) ) );
        disconnect( m_playlist->generator().data(), SIGNAL( error( QString, QString ) ), this, SLOT( generatorError( QString, QString ) ) );
        disconnect( m_playlist.data(), SIGNAL( deleted( Tomahawk::dynplaylist_ptr ) ), this, SLOT( onDeleted() ) );
        disconnect( m_playlist.data(), SIGNAL( changed() ), this, SLOT( onChanged() ) );
    }


    m_playlist = playlist;
    m_view->setOnDemand( m_playlist->mode() == OnDemand );
    m_view->setReadOnly( !m_playlist->author()->isLocal() );
    m_model->loadPlaylist( m_playlist );
    m_controlsChanged = false;
    m_setup->setPlaylist( m_playlist );


    if( !m_playlist->author()->isLocal() ) { // hide controls, as we show the description in the summary
            m_layout->removeWidget( m_controls );
    } else if( m_layout->indexOf( m_controls ) == -1 ) {
        m_layout->insertWidget( 0, m_controls );
    }

    if( m_playlist->mode() == OnDemand && !m_playlist->generator()->controls().isEmpty() )
        showPreview();

    if( !m_playlist.isNull() )
        m_controls->setControls( m_playlist, m_playlist->author()->isLocal() );

    connect( m_playlist->generator().data(), SIGNAL( generated( QList<Tomahawk::query_ptr> ) ), this, SLOT( tracksGenerated( QList<Tomahawk::query_ptr> ) ) );
    connect( m_playlist.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( onRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ) );
    connect( m_playlist->generator().data(), SIGNAL( error( QString, QString ) ), this, SLOT( generatorError( QString, QString ) ) );
    connect( m_playlist.data(), SIGNAL( deleted( Tomahawk::dynplaylist_ptr ) ), this, SLOT( onDeleted() ) );
    connect( m_playlist.data(), SIGNAL( changed() ), this, SLOT( onChanged() ) );
}
开发者ID:tehzed,项目名称:tomahawk,代码行数:65,代码来源:DynamicWidget.cpp


注:本文中的tomahawk::dynplaylist_ptr::data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。