當前位置: 首頁>>代碼示例>>C++>>正文


C++ CAtlList::GetHeadPosition方法代碼示例

本文整理匯總了C++中CAtlList::GetHeadPosition方法的典型用法代碼示例。如果您正苦於以下問題:C++ CAtlList::GetHeadPosition方法的具體用法?C++ CAtlList::GetHeadPosition怎麽用?C++ CAtlList::GetHeadPosition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CAtlList的用法示例。


在下文中一共展示了CAtlList::GetHeadPosition方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: AddItem

void CPlayerPlaylistBar::AddItem(CAtlList<CString>& fns, CAtlList<CString>* subs)
{
    CPlaylistItem pli;

    POSITION pos = fns.GetHeadPosition();
    while (pos) {
        CString fn = fns.GetNext(pos);
        if (!fn.Trim().IsEmpty()) {
            pli.m_fns.AddTail(fn);
        }
    }

    if (subs) {
        POSITION posSub = subs->GetHeadPosition();
        while (posSub) {
            CString fn = subs->GetNext(posSub);
            if (!fn.Trim().IsEmpty()) {
                pli.m_subs.AddTail(fn);
            }
        }
    }

    pli.AutoLoadFiles();

    m_pl.AddTail(pli);
}
開發者ID:Azpidatziak,項目名稱:mpc-hc,代碼行數:26,代碼來源:PlayerPlaylistBar.cpp

示例2: Lookup

	bool SubtitleFile::Lookup(float at, CAutoPtrList<Subtitle>& subs)
	{
		if(!subs.IsEmpty()) {ASSERT(0); return false;}

		CAtlList<SegmentItem> sis;
		m_segments.Lookup(at, sis);

		POSITION pos = sis.GetHeadPosition();
		while(pos)
		{
			SegmentItem& si = sis.GetNext(pos);

			CAutoPtr<Subtitle> s(DNew Subtitle(this));

			if(s->Parse(si.pDef, si.start, si.stop, at))
			{
				for(POSITION pos = subs.GetHeadPosition(); pos; subs.GetNext(pos))
				{
					if(s->m_layer < subs.GetAt(pos)->m_layer)
					{
						subs.InsertBefore(pos, s);
						break;
					}
				}

				if(s)
				{
					subs.AddTail(s);
				}
			}
		}

		return !subs.IsEmpty();
	}
開發者ID:Fluffiest,項目名稱:mpc-hc,代碼行數:34,代碼來源:SubtitleFile.cpp

示例3: SetNoRecentDocs

void CFileAssoc::SetNoRecentDocs(bool bNoRecentDocs, bool bUpdateAssocs /*= false*/)
{
    if (bNoRecentDocs == m_bNoRecentDocs) {
        bUpdateAssocs = false;
    } else {
        m_bNoRecentDocs = bNoRecentDocs;
    }

    CAtlList<CString> exts;
    if (bUpdateAssocs && GetAssociatedExtensionsFromRegistry(exts)) {
        CRegKey key;
        POSITION pos = exts.GetHeadPosition();
        while (pos) {
            const CString& ext = exts.GetNext(pos);

            if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, PROGID + ext)) {
                if (m_bNoRecentDocs) {
                    key.SetStringValue(_T("NoRecentDocs"), _T(""));
                } else {
                    key.DeleteValue(_T("NoRecentDocs"));
                }
            }
        }
    }
}
開發者ID:EchoLiao,項目名稱:mpc-hc,代碼行數:25,代碼來源:FileAssoc.cpp

示例4: OnInitDialog

BOOL CShaderCombineDlg::OnInitDialog()
{
	__super::OnInitDialog();

	AddAnchor(IDC_LIST1, TOP_LEFT, BOTTOM_RIGHT);
	AddAnchor(IDC_COMBO1, BOTTOM_LEFT, BOTTOM_RIGHT);
	AddAnchor(IDC_STATIC1, BOTTOM_LEFT, BOTTOM_RIGHT);
	AddAnchor(IDC_BUTTON2, BOTTOM_RIGHT);
	AddAnchor(IDC_BUTTON3, BOTTOM_RIGHT);
	AddAnchor(IDC_BUTTON1, TOP_RIGHT);
	AddAnchor(IDC_BUTTON4, TOP_RIGHT);
	AddAnchor(IDOK, TOP_RIGHT);
	AddAnchor(IDCANCEL, TOP_RIGHT);

	AppSettings& s = AfxGetCurrentSettings();

	CString str = s.m_shadercombine.Trim();

	CAtlList<CString> sl;
	if(!str.IsEmpty()) Explode(str, sl, '|');

	POSITION pos = sl.GetHeadPosition();
	while(pos) m_list.AddString(sl.GetNext(pos));

	pos = s.m_shaders.GetHeadPosition();
	while(pos) m_combo.AddString(s.m_shaders.GetNext(pos).label);
	if(m_combo.GetCount()) m_combo.SetCurSel(0);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
開發者ID:Strongc,項目名稱:playasa,代碼行數:31,代碼來源:ShaderCombineDlg.cpp

示例5: OnDropFiles

void CPPageExternalFilters::OnDropFiles(CAtlList<CString>& slFiles, DROPEFFECT)
{
    SetActiveWindow();

    POSITION pos = slFiles.GetHeadPosition();

    while (pos) {
        CString fn = slFiles.GetNext(pos);

        CFilterMapper2 fm2(false);
        fm2.Register(fn);

        while (!fm2.m_filters.IsEmpty()) {
            if (FilterOverride* f = fm2.m_filters.RemoveHead()) {
                CAutoPtr<FilterOverride> p(f);
                int i = m_filters.InsertItem(m_filters.GetItemCount(), f->name);
                m_filters.SetItemData(i, reinterpret_cast<DWORD_PTR>(m_pFilters.AddTail(p)));
                m_filters.SetCheck(i, 1);

                if (fm2.m_filters.IsEmpty()) {
                    m_filters.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
                    m_filters.SetSelectionMark(i);
                    OnFilterSelectionChange();
                }

                m_filters.SetColumnWidth(0, LVSCW_AUTOSIZE);

                SetModified();
            }
        }
    }
}
開發者ID:hiplayer,項目名稱:mpc_hc,代碼行數:32,代碼來源:PPageExternalFilters.cpp

示例6: OnDropFiles

void CPPageExternalFilters::OnDropFiles(CAtlList<CString>& slFiles, DROPEFFECT)
{
    SetActiveWindow();

    POSITION pos = slFiles.GetHeadPosition();

    while (pos) {
        CString fn = slFiles.GetNext(pos);

        CFilterMapper2 fm2(false);
        fm2.Register(fn);

        while (!fm2.m_filters.IsEmpty()) {
            if (FilterOverride* f = fm2.m_filters.RemoveHead()) {
                CAutoPtr<FilterOverride> p(f);
                int i = m_filters.AddString(f->name);
                m_filters.SetItemDataPtr(i, m_pFilters.AddTail(p));
                m_filters.SetCheck(i, 1);

                if (fm2.m_filters.IsEmpty()) {
                    m_filters.SetCurSel(i);
                    OnFilterSelectionChange();
                }

                SetModified();
            }
        }
    }
}
開發者ID:JanChou,項目名稱:mpc-hc,代碼行數:29,代碼來源:PPageExternalFilters.cpp

示例7: ReplaceCodecsPath

HRESULT CDSFilters::ReplaceCodecsPath(CAtlList<DSFilterInfo*>& InfoList, CString& strNewPath)
{
	DSFilterInfo* pInfo = NULL;
	POSITION pos = InfoList.GetHeadPosition();
	while (pos)
	{
		pInfo = InfoList.GetNext(pos);
		if (pInfo != NULL)
		{
			pInfo->path.Replace(m_strCodecsPath, strNewPath);

			POSITION pos2 = pInfo->depends.GetHeadPosition();
			while (pos2)
			{
				CString& depend = pInfo->depends.GetNext(pos2);
				depend.Replace(m_strCodecsPath, strNewPath);
			}

			pos2 = pInfo->preloads.GetHeadPosition();
			while (pos2)
			{
				CString& preload = pInfo->preloads.GetNext(pos2);
				preload.Replace(m_strCodecsPath, strNewPath);
			}
		}
	}
	
	return S_OK;
}
開發者ID:liudeyan,項目名稱:CodesAndNotes,代碼行數:29,代碼來源:DSFilters.cpp

示例8: Parse

	void SubtitleFile::Parse(InputStream& s)
	{
		m_segments.RemoveAll();

		__super::Parse(s, s_predef);

		// TODO: check file.format == "ssf" and file.version == 1

		CAtlList<Definition*> defs;
		GetRootRef()->GetChildDefs(defs, L"subtitle");
		
		StringMapW<float> offset;

		POSITION pos = defs.GetHeadPosition();
		while(pos)
		{
			Definition* pDef = defs.GetNext(pos);

			try
			{
				Definition::Time time;

				if(pDef->GetAsTime(time, offset) && (*pDef)[L"@"].IsValue())
				{
					m_segments.Insert(time.start.value, time.stop.value, pDef);
				}
			}
			catch(Exception&)
			{
			}
		}
	}
開發者ID:Fluffiest,項目名稱:mpc-hc,代碼行數:32,代碼來源:SubtitleFile.cpp

示例9: SortInfoByExtension

void CDSFilters::SortInfoByExtension(CAtlList<DSFilterInfo*>& InfoList, const TCHAR* pcszExtension)
{
	DSFilterInfo* pInfo = NULL;
	POSITION pos = InfoList.GetHeadPosition();
	while (pos)
	{
		BOOL bMatched = FALSE;
		pInfo = InfoList.GetAt(pos);
		if (pInfo != NULL)
		{
			POSITION pos2 = pInfo->extensions.GetHeadPosition();
			while (pos2)
			{
				CString& extension = pInfo->extensions.GetNext(pos2);
				if (extension.CompareNoCase(pcszExtension+1))
				{
					bMatched = TRUE;
					break;
				}
			}
			if (bMatched)
			{
				InfoList.MoveToHead(pos);
			}
		}
		InfoList.GetNext(pos);
	}
}
開發者ID:liudeyan,項目名稱:CodesAndNotes,代碼行數:28,代碼來源:DSFilters.cpp

示例10: OpenFiles

BOOL CMultiFiles::OpenFiles(CAtlList<CHdmvClipInfo::PlaylistItem>& files, UINT nOpenFlags)
{
	POSITION		pos = files.GetHeadPosition();
	LARGE_INTEGER	llSize;
	int				nPos  = 0;
	REFERENCE_TIME	rtDur = 0;

	Reset();
	while(pos)
	{
		CHdmvClipInfo::PlaylistItem& s = files.GetNext(pos);
		m_strFiles.Add(s.m_strFileName);
		if (!OpenPart(nPos)) return false;

		llSize.QuadPart = 0;
		GetFileSizeEx (m_hFile, &llSize);
		m_llTotalLength += llSize.QuadPart;
		m_FilesSize.Add (llSize.QuadPart);
		m_rtPtsOffsets.Add (rtDur);
		rtDur += s.Duration();
		nPos++;
	}

	if (files.GetCount() > 1) ClosePart();
	
	return TRUE;
}
開發者ID:Fluffiest,項目名稱:mpc-hc,代碼行數:27,代碼來源:MultiFiles.cpp

示例11: AreRegisteredFileContextMenuEntries

CFileAssoc::reg_state_t CFileAssoc::AreRegisteredFileContextMenuEntries(const CMediaFormatCategory& mfc)
{
    CAtlList<CString> exts;
    ExplodeMin(mfc.GetExtsWithPeriod(), exts, ' ');

    size_t cnt = 0;

    POSITION pos = exts.GetHeadPosition();
    while (pos) {
        if (CFileAssoc::AreRegisteredFileContextMenuEntries(exts.GetNext(pos))) {
            cnt++;
        }
    }

    reg_state_t res;
    if (cnt == 0) {
        res = NOT_REGISTERED;
    } else if (cnt == exts.GetCount()) {
        res = ALL_REGISTERED;
    } else {
        res = SOME_REGISTERED;
    }

    return res;
}
開發者ID:Azpidatziak,項目名稱:mpc-hc,代碼行數:25,代碼來源:FileAssoc.cpp

示例12: ParsePlayList

void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString>* subs)
{
    if (fns.IsEmpty()) {
        return;
    }

    const CAppSettings& s = AfxGetAppSettings();

    ResolveLinkFiles(fns);

    CAtlList<CString> sl;
    if (SearchFiles(fns.GetHead(), sl)) {
        if (sl.GetCount() > 1) {
            subs = NULL;
        }
        POSITION pos = sl.GetHeadPosition();
        while (pos) {
            ParsePlayList(sl.GetNext(pos), subs);
        }
        return;
    }

    CAtlList<CString> redir;
    CStringA ct = GetContentType(fns.GetHead(), &redir);
    if (!redir.IsEmpty()) {
        POSITION pos = redir.GetHeadPosition();
        while (pos) {
            ParsePlayList(sl.GetNext(pos), subs);
        }
        return;
    }

    if (ct == "application/x-mpc-playlist") {
        ParseMPCPlayList(fns.GetHead());
        return;
    } else {
#if INTERNAL_SOURCEFILTER_MPEG
        if (ct == "application/x-bdmv-playlist" && s.SrcFilters[SRC_MPEG]) {
            ParseBDMVPlayList(fns.GetHead());
            return;
        }
#endif
    }

    AddItem(fns, subs);
}
開發者ID:Azpidatziak,項目名稱:mpc-hc,代碼行數:46,代碼來源:PlayerPlaylistBar.cpp

示例13: FindFileInList

bool FindFileInList(const CAtlList<CString>& sl, CString fn)
{
    bool fFound = false;
    POSITION pos = sl.GetHeadPosition();
    while (pos && !fFound) {
        if (!sl.GetNext(pos).CompareNoCase(fn)) {
            fFound = true;
        }
    }
    return fFound;
}
開發者ID:1ldk,項目名稱:mpc-hc,代碼行數:11,代碼來源:Playlist.cpp

示例14: Append

void CPlayerPlaylistBar::Append(CAtlList<CString>& fns, bool fMulti, CAtlList<CString>* subs)
{
    if (fMulti) {
        ASSERT(subs == NULL || subs->GetCount() == 0);
        POSITION pos = fns.GetHeadPosition();
        while (pos) {
            ParsePlayList(fns.GetNext(pos), NULL);
        }
    } else {
        ParsePlayList(fns, subs);
    }

    Refresh();
    SavePlaylist();
}
開發者ID:Azpidatziak,項目名稱:mpc-hc,代碼行數:15,代碼來源:PlayerPlaylistBar.cpp

示例15: Register

bool CFileAssoc::Register(CMediaFormatCategory& mfc, bool bRegister, bool bRegisterContextMenuEntries, bool bAssociatedWithIcon)
{
    CAtlList<CString> exts;
    ExplodeMin(mfc.GetExtsWithPeriod(), exts, ' ');

    CString strLabel = mfc.GetDescription();
    bool res = true;

    POSITION pos = exts.GetHeadPosition();
    while (pos) {
        res &= Register(exts.GetNext(pos), strLabel, bRegister, bRegisterContextMenuEntries, bAssociatedWithIcon);
    }

    return res;
}
開發者ID:Azpidatziak,項目名稱:mpc-hc,代碼行數:15,代碼來源:FileAssoc.cpp


注:本文中的CAtlList::GetHeadPosition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。