DuiLib::CDuiString CDuiFrameWnd::GetNextPath( bool bNext )
{
    int iNodeStart = -1; // 第一个文件的tree下标
    int iFileCount = 0;
    int iIndexPlay = m_iPlaylistIndex;  // 新增的GetCurSelActivate也可以获取双击的下标,不过如果双击了非文件的列,就会变成那一列,这里用Tree只是给大家一个Demo参考,建议嵌入ListBox来保存文件路径。

    GetPlaylistInfo(iNodeStart, iFileCount);
    if (iFileCount <= 0)
    {
        return _T("");
    }

    if (-1 == iIndexPlay)
    {
        iIndexPlay = iNodeStart;
    }

    if (EM_PLAY_MODE_RANDOM == m_emPlayMode)
    {
        if (! m_queRand.size())
        {
            Rand(m_queRand, iFileCount);
        }

        iIndexPlay = iNodeStart + m_queRand.front();
        m_queRand.pop_front();
    } 
    else if (EM_PLAY_MODE_SEQUENCE == m_emPlayMode)
    {
        if (bNext)
        {
            iIndexPlay++;

            if (iIndexPlay >= iNodeStart + iFileCount)
            {
                iIndexPlay = iNodeStart;
            } 
        } 
        else
        {
            iIndexPlay--;

            if (iIndexPlay < iNodeStart)
            {
                iIndexPlay = iNodeStart + iFileCount - 1;
            } 
        }
    }

    CTreeViewUI *pTree = static_cast<CTreeViewUI*>(m_PaintManager.FindControl(_T("treePlaylist")));
    if(pTree)
    {
        pTree->SelectItem(iIndexPlay, true);
    }
    m_iPlaylistIndex = iIndexPlay;
    //return static_cast<CTreeNodeUI*>(pTree->GetItemAt(iIndexPlay))->GetItemText();  // 文件名
    return m_cPlayList.GetPlaylist(iIndexPlay - iNodeStart).szFileName;                  // 完整路径
}
int CDuiFrameWnd::GetPlaylistIndex( int iIndexTree )
{
    int iNodeStart = -1; // 第一个文件的tree下标
    int iFileCount = 0;

    GetPlaylistInfo(iNodeStart, iFileCount); 

    if (iFileCount <= 0)
    {
        return -1;
    }

    return iIndexTree - iNodeStart;
}
Exemple #3
0
bool BDRingBuffer::SwitchPlaylist(uint32_t index)
{
    if (!bdnav)
        return false;

    VERBOSE(VB_PLAYBACK, LOC + "SwitchPlaylist - start");

    m_infoLock.lock();
    m_currentTitleInfo = GetPlaylistInfo(index);
    m_infoLock.unlock();
    bool result = UpdateTitleInfo();

    VERBOSE(VB_PLAYBACK, LOC + "SwitchPlaylist - end");
    return result;
}