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


C++ CAtlMap类代码示例

本文整理汇总了C++中CAtlMap的典型用法代码示例。如果您正苦于以下问题:C++ CAtlMap类的具体用法?C++ CAtlMap怎么用?C++ CAtlMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: while

	void IFileContainer::write(Rels::File& rels, const CPath& curdir, const CPath& directory, ContentTypes::File& content) const
	{
		CAtlMap<CString, size_t> namepair;

		POSITION pos = m_container.GetStartPosition();
		while (NULL != pos)
		{
			const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
			
			smart_ptr<OOX::File> pFile		= pPair->m_value;
			smart_ptr<OOX::External> pExt	= pFile.smart_dynamic_cast<OOX::External>();

			if (!pExt.IsInit())
			{
				OOX::CPath defdir	= pFile->DefaultDirectory();
				OOX::CPath name		= pFile->DefaultFileName();

				CAtlMap<CString, size_t>::CPair* pNamePair = namepair.Lookup(name.m_strFilename);
				if (NULL == pNamePair)
					namepair.SetAt(name.m_strFilename, 1);
				else
					name = name + pNamePair->m_key;

				OOX::CSystemUtility::CreateDirectories(curdir / defdir);
				pFile->write(curdir / defdir / name, directory / defdir, content);
				rels.registration(pPair->m_key, pFile->type(), defdir / name);
			}
			else
			{
				
				
				rels.registration(pPair->m_key, pExt);
			}
		}
	}
开发者ID:Alsan,项目名称:ONLYOFFICE-OnlineEditors,代码行数:35,代码来源:IFileContainer.cpp

示例2: log_NOTICE

void AsyncUpdateHandler::OnDataChange(COPCGroup & group, CAtlMap<COPCItem *, OPCItemData *> & changes)
{
	log_NOTICE("OnDataChange called, group [", group.getName(),"] change count [", pantheios::integer(changes.GetCount()),"] have callback [",(callbackFn != NULL?"Y":"N"),"]");
	
	for(POSITION pos = changes.GetStartPosition(); pos != NULL; )
	{
		CAtlMap<COPCItem *, OPCItemData *>::CPair* pPair = changes.GetNext(pos);

		ItemValueStruct itemValueStruct(pPair->m_value);		
		const ItemValue& itemValue = itemValueStruct.getItemValue();
		
		log_NOTICE("\t item [",pPair->m_key->getName(),"] value [", itemValueStruct.getItemValue().value,"]");

		if(callbackFn != NULL)
		{
			log_NOTICE("\t OnDataChange calling callback fn");			
			//Update* update = createUpdate(pPair->m_key->getName().GetString(), itemValue.value, itemValue.quality, itemValue.dataType, itemValue.timestamp);
			callbackFn(pPair->m_key->getName().GetString(), itemValue.value, itemValue.quality, itemValue.dataType, itemValue.timestamp);

			log_DEBUG("\t OnDataChange called callback fn");
/*			
			callbackFn(update);
			log_DEBUG("\t OnDataChange called callback fn");

			destroyUpdate(update);
			log_DEBUG("\t OnDataChange destroyed object");
*/
		}
	}
}
开发者ID:Strongc,项目名称:Automated-OPC-Tester,代码行数:30,代码来源:AsyncUpdateHandler.cpp

示例3: TryInsertPeerIDMessageID

bool CPeerInfo::TryInsertPeerIDMessageID(unsigned int PeerID, unsigned MessageID)
{
	CAtlMap<unsigned int, void*> *MessageIDMap;
	if(PeerIDMessageIDMap.Lookup(PeerID, MessageIDMap) == false)
	{
		MessageIDMap = new CAtlMap<unsigned int, void*>();
		PeerIDMessageIDMap.SetAt(PeerID, MessageIDMap);
	}

	void *Temp;
	if(MessageIDMap->Lookup(MessageID, Temp) == true) return false;
	else
	{
		MessageIDMap->SetAt(MessageID, NULL);
		return true;
	}
}
开发者ID:wonsch,项目名称:ds,代码行数:17,代码来源:PeerInfo.cpp

示例4: CreateObject

IDTManager* CMainDlg::GetDTMgrForPhone()
{
	if(m_pPhoneDTMgr == NULL && CreateObject != NULL)
	{
		CreateObject(__uuidof(IDTManager), (void**)&m_pPhoneDTMgr);

		if(m_pPhoneDTMgr != NULL)
		{
			CAtlMap<DtStateChangeNotifyCallBack,void*> *pCallback = new CAtlMap<DtStateChangeNotifyCallBack,void*>;
			pCallback->SetAt(PhoneSoftDownCallback, this);

			m_pPhoneDTMgr->Init(pCallback);
		}
	}

	return m_pPhoneDTMgr;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:17,代码来源:MainDlg.cpp

示例5: FillSpecFunctionArray

void CFunctionManager::FillSpecFunctionArray()
{
	m_SelectedFunctions.RemoveAll();
	for (size_t i = 0;i < m_pClass->Parents.GetCount(); i++)
	{
		SpecFunctionParent SpecParent;
		if (m_sSpecFunctions.Lookup(m_pClass->Parents[i]->Name, SpecParent))
		{
			CAtlMap<int, bool> ConditionResult;
			bool bDefault = true;
			for (size_t i = 0; i < SpecParent.Conditions.GetCount(); i++)
			{
				bool bRes = CheckSpecialCondition(SpecParent.Conditions[i]);
				bDefault &= !bRes;
				ConditionResult.SetAt(SpecParent.Conditions[i], bRes);
			}
			if (SpecParent.Conditions.GetCount())
			{
				ConditionResult.SetAt(0, bDefault);
			}
			CSmartAtlArray<SpecFunctionStruct>& SpecFunctions = SpecParent.SpecFunctions;
			for (size_t i = 0; i < SpecFunctions.GetCount(); i++)
			{
				if (SpecFunctions[i].Condition == -1)
				{
					m_SelectedFunctions.Add(SpecFunctions[i]);
				}
				else
				{
					bool bRes;
					if (ConditionResult.Lookup(SpecFunctions[i].Condition, bRes))
					{
						if (bRes)
						{
							m_SelectedFunctions.Add(SpecFunctions[i]);
						}
					}
				}
			}
		}
	}
}
开发者ID:axxapp,项目名称:winxgui,代码行数:42,代码来源:FunctionManager.cpp

示例6: GetVideoCodecName

CString CMediaTypeEx::GetVideoCodecName(const GUID& subtype, DWORD biCompression)
{
    CString str;

    static CAtlMap<DWORD, CString> names;

    if (names.IsEmpty()) {
        names['WMV1'] = _T("Windows Media Video 7");
        names['WMV2'] = _T("Windows Media Video 8");
        names['WMV3'] = _T("Windows Media Video 9");
        names['DIV3'] = _T("DivX 3");
        names['DX50'] = _T("DivX 5");
        names['MP4V'] = _T("MPEG4 Video");
        names['AVC1'] = _T("MPEG4 Video (H264)");
        names['H264'] = _T("MPEG4 Video (H264)");
        names['RV10'] = _T("RealVideo 1");
        names['RV20'] = _T("RealVideo 2");
        names['RV30'] = _T("RealVideo 3");
        names['RV40'] = _T("RealVideo 4");
        names['FLV1'] = _T("Flash Video 1");
        // names[''] = _T("");
    }

    if (biCompression) {
        BYTE* b = (BYTE*)&biCompression;

        for (int i = 0; i < 4; i++)
            if (b[i] >= 'a' && b[i] <= 'z') {
                b[i] = toupper(b[i]);
            }

        if (!names.Lookup(MAKEFOURCC(b[3], b[2], b[1], b[0]), str)) {
            if (subtype == MEDIASUBTYPE_DiracVideo) { str = _T("Dirac Video"); }
            // else if(subtype == ) str = _T("");
            else if (biCompression < 256) { str.Format(_T("%d"), biCompression); }
            else { str.Format(_T("%4.4hs"), &biCompression); }
        }
    }

    return str;
}
开发者ID:kenygia,项目名称:xy-vsfilter,代码行数:41,代码来源:MediaTypeEx.cpp

示例7: DoEnumCurrnetSubKey

BOOL CRegOpt::DoEnumCurrnetSubKey(HKEY hRootKey,LPCTSTR lpcKey,CAtlMap<CString,char>& vec_Key)
{
	HKEY hKey;
	LONG lResult;
	
	//打开键
	lResult = RegOpenKeyEx(hRootKey,
		lpcKey,
		NULL,
		KEY_READ,
		&hKey
		);

	if(lResult != ERROR_SUCCESS)
	{	
		m_iErrCode = lResult;
		return FALSE;
	}

	//枚举键名
	BOOL  bRet = TRUE;
	DWORD dwIndex=0;
	do 
	{	
		TCHAR szKey[MAX_PATH]={0};
		DWORD dwKey = sizeof(szKey);
		lResult =RegEnumKey(hKey,dwIndex,szKey,dwKey);

		if (lResult != ERROR_SUCCESS)
		{
			if (lResult == ERROR_NO_MORE_ITEMS)
			{	
				bRet = TRUE;
				break;
			}
			else
			{	
				bRet = FALSE;
				m_iErrCode = lResult;
				break;
			}
		}
		
		
		vec_Key.SetAt(szKey,'1');
		dwIndex++;

	} while (1);

	RegCloseKey(hKey);

	return bRet;
}
开发者ID:dreamsxin,项目名称:PcManager,代码行数:53,代码来源:regopt.cpp

示例8: GetSubtitleCodecName

CString CMediaTypeEx::GetSubtitleCodecName(const GUID& subtype)
{
	CString str;

	static CAtlMap<GUID, CString> names;

	if (names.IsEmpty()) {
		names[MEDIASUBTYPE_UTF8] = _T("UTF-8");
		names[MEDIASUBTYPE_SSA] = _T("SubStation Alpha");
		names[MEDIASUBTYPE_ASS] = _T("Advanced SubStation Alpha");
		names[MEDIASUBTYPE_ASS2] = _T("Advanced SubStation Alpha");
		names[MEDIASUBTYPE_USF] = _T("Universal Subtitle Format");
		names[MEDIASUBTYPE_VOBSUB] = _T("VobSub");
		// names[''] = _T("");
	}

	if (names.Lookup(subtype, str)) {

	}

	return str;
}
开发者ID:Samangan,项目名称:mpc-hc,代码行数:22,代码来源:MediaTypeEx.cpp

示例9: range_bsearch

__int64 CDSMSplitterFile::FindSyncPoint(REFERENCE_TIME rt)
{
	if (/*!m_sps.IsEmpty()*/ m_sps.GetCount() > 1) {
		int i = range_bsearch(m_sps, m_rtFirst + rt);
		return i >= 0 ? m_sps[i].fp : 0;
	}

	if (m_rtDuration <= 0 || rt <= m_rtFirst) {
		return 0;
	}

	// ok, do the hard way then

	dsmp_t type;
	UINT64 syncpos, len;

	// 1. find some boundaries close to rt's position (minpos, maxpos)

	__int64 minpos = 0, maxpos = GetLength();

	for (int i = 0; i < 10 && (maxpos - minpos) >= 1024*1024; i++) {
		Seek((minpos + maxpos) / 2);

		while (GetPos() < maxpos) {
			if (!Sync(syncpos, type, len)) {
				continue;
			}

			__int64 pos = GetPos();

			if (type == DSMP_SAMPLE) {
				Packet p;
				if (Read(len, &p, false) && p.rtStart != Packet::INVALID_TIME) {
					REFERENCE_TIME dt = (p.rtStart -= m_rtFirst) - rt;
					if (dt >= 0) {
						maxpos = max((__int64)syncpos - 65536, minpos);
					} else {
						minpos = syncpos;
					}
					break;
				}
			}

			Seek(pos + len);
		}
	}

	// 2. find the first packet just after rt (maxpos)

	Seek(minpos);

	while (GetRemaining()) {
		if (!Sync(syncpos, type, len)) {
			continue;
		}

		__int64 pos = GetPos();

		if (type == DSMP_SAMPLE) {
			Packet p;
			if (Read(len, &p, false) && p.rtStart != Packet::INVALID_TIME) {
				REFERENCE_TIME dt = (p.rtStart -= m_rtFirst) - rt;
				if (dt >= 0) {
					maxpos = (__int64)syncpos;
					break;
				}
			}
		}

		Seek(pos + len);
	}

	// 3. iterate backwards from maxpos and find at least one syncpoint for every stream, except for subtitle streams

	CAtlMap<BYTE,BYTE> ids;

	{
		POSITION pos = m_mts.GetStartPosition();
		while (pos) {
			BYTE id;
			CMediaType mt;
			m_mts.GetNextAssoc(pos, id, mt);
			if (mt.majortype != MEDIATYPE_Text && mt.majortype != MEDIATYPE_Subtitle) {
				ids[id] = 0;
			}
		}
	}

	__int64 ret = maxpos;

	while (maxpos > 0 && !ids.IsEmpty()) {
		minpos = max(0, maxpos - 65536);

		Seek(minpos);

		while (Sync(syncpos, type, len) && GetPos() < maxpos) {
			UINT64 pos = GetPos();

			if (type == DSMP_SAMPLE) {
				Packet p;
//.........这里部分代码省略.........
开发者ID:Samangan,项目名称:mpc-hc,代码行数:101,代码来源:DSMSplitterFile.cpp

示例10: ParseMPCPlayList

bool CPlayerPlaylistBar::ParseMPCPlayList(CString fn)
{
    CString str;
    CAtlMap<int, CPlaylistItem> pli;
    CAtlArray<int> idx;

    CWebTextFile f;
    if (!f.Open(fn) || !f.ReadString(str) || str != _T("MPCPLAYLIST")) {
        return false;
    }

    if (f.GetEncoding() == CTextFile::ASCII) {
        f.SetEncoding(CTextFile::ANSI);
    }

    CPath base(fn);
    base.RemoveFileSpec();

    while (f.ReadString(str)) {
        CAtlList<CString> sl;
        Explode(str, sl, ',', 3);
        if (sl.GetCount() != 3) {
            continue;
        }

        if (int i = _ttoi(sl.RemoveHead())) {
            CString key = sl.RemoveHead();
            CString value = sl.RemoveHead();

            if (key == _T("type")) {
                pli[i].m_type = (CPlaylistItem::type_t)_ttol(value);
                idx.Add(i);
            } else if (key == _T("label")) {
                pli[i].m_label = value;
            } else if (key == _T("filename")) {
                value = CombinePath(base, value);
                pli[i].m_fns.AddTail(value);
            } else if (key == _T("subtitle")) {
                value = CombinePath(base, value);
                pli[i].m_subs.AddTail(value);
            } else if (key == _T("video")) {
                while (pli[i].m_fns.GetCount() < 2) {
                    pli[i].m_fns.AddTail(_T(""));
                }
                pli[i].m_fns.GetHead() = value;
            } else if (key == _T("audio")) {
                while (pli[i].m_fns.GetCount() < 2) {
                    pli[i].m_fns.AddTail(_T(""));
                }
                pli[i].m_fns.GetTail() = value;
            } else if (key == _T("vinput")) {
                pli[i].m_vinput = _ttol(value);
            } else if (key == _T("vchannel")) {
                pli[i].m_vchannel = _ttol(value);
            } else if (key == _T("ainput")) {
                pli[i].m_ainput = _ttol(value);
            } else if (key == _T("country")) {
                pli[i].m_country = _ttol(value);
            }
        }
    }

    qsort(idx.GetData(), idx.GetCount(), sizeof(int), s_int_comp);
    for (size_t i = 0; i < idx.GetCount(); i++) {
        m_pl.AddTail(pli[idx[i]]);
    }

    return pli.GetCount() > 0;
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:69,代码来源:PlayerPlaylistBar.cpp

示例11: GetAudioCodecName

CString CMediaTypeEx::GetAudioCodecName(const GUID& subtype, WORD wFormatTag)
{
	CString str;

	static CAtlMap<WORD, CString> names;

	if (names.IsEmpty()) {
		names[WAVE_FORMAT_PCM] = _T("PCM");
		names[WAVE_FORMAT_EXTENSIBLE] = _T("WAVE_FORMAT_EXTENSIBLE");
		names[WAVE_FORMAT_IEEE_FLOAT] = _T("IEEE Float");
		names[WAVE_FORMAT_ADPCM] = _T("MS ADPCM");
		names[WAVE_FORMAT_ALAW] = _T("aLaw");
		names[WAVE_FORMAT_MULAW] = _T("muLaw");
		names[WAVE_FORMAT_DRM] = _T("DRM");
		names[WAVE_FORMAT_OKI_ADPCM] = _T("OKI ADPCM");
		names[WAVE_FORMAT_DVI_ADPCM] = _T("DVI ADPCM");
		names[WAVE_FORMAT_IMA_ADPCM] = _T("IMA ADPCM");
		names[WAVE_FORMAT_MEDIASPACE_ADPCM] = _T("Mediaspace ADPCM");
		names[WAVE_FORMAT_SIERRA_ADPCM] = _T("Sierra ADPCM");
		names[WAVE_FORMAT_G723_ADPCM] = _T("G723 ADPCM");
		names[WAVE_FORMAT_DIALOGIC_OKI_ADPCM] = _T("Dialogic OKI ADPCM");
		names[WAVE_FORMAT_MEDIAVISION_ADPCM] = _T("Media Vision ADPCM");
		names[WAVE_FORMAT_YAMAHA_ADPCM] = _T("Yamaha ADPCM");
		names[WAVE_FORMAT_DSPGROUP_TRUESPEECH] = _T("DSP Group Truespeech");
		names[WAVE_FORMAT_DOLBY_AC2] = _T("Dolby AC2");
		names[WAVE_FORMAT_GSM610] = _T("GSM610");
		names[WAVE_FORMAT_MSNAUDIO] = _T("MSN Audio");
		names[WAVE_FORMAT_ANTEX_ADPCME] = _T("Antex ADPCME");
		names[WAVE_FORMAT_CS_IMAADPCM] = _T("Crystal Semiconductor IMA ADPCM");
		names[WAVE_FORMAT_ROCKWELL_ADPCM] = _T("Rockwell ADPCM");
		names[WAVE_FORMAT_ROCKWELL_DIGITALK] = _T("Rockwell Digitalk");
		names[WAVE_FORMAT_G721_ADPCM] = _T("G721");
		names[WAVE_FORMAT_G728_CELP] = _T("G728");
		names[WAVE_FORMAT_MSG723] = _T("MSG723");
		names[WAVE_FORMAT_MPEG] = _T("MPEG Audio");
		names[WAVE_FORMAT_MPEGLAYER3] = _T("MPEG Audio Layer 3");
		names[WAVE_FORMAT_LUCENT_G723] = _T("Lucent G723");
		names[WAVE_FORMAT_VOXWARE] = _T("Voxware");
		names[WAVE_FORMAT_G726_ADPCM] = _T("G726");
		names[WAVE_FORMAT_G722_ADPCM] = _T("G722");
		names[WAVE_FORMAT_G729A] = _T("G729A");
		names[WAVE_FORMAT_MEDIASONIC_G723] = _T("MediaSonic G723");
		names[WAVE_FORMAT_ZYXEL_ADPCM] = _T("ZyXEL ADPCM");
		names[WAVE_FORMAT_RHETOREX_ADPCM] = _T("Rhetorex ADPCM");
		names[WAVE_FORMAT_VIVO_G723] = _T("Vivo G723");
		names[WAVE_FORMAT_VIVO_SIREN] = _T("Vivo Siren");
		names[WAVE_FORMAT_DIGITAL_G723] = _T("Digital G723");
		names[WAVE_FORMAT_SANYO_LD_ADPCM] = _T("Sanyo LD ADPCM");
		names[WAVE_FORMAT_CREATIVE_ADPCM] = _T("Creative ADPCM");
		names[WAVE_FORMAT_CREATIVE_FASTSPEECH8] = _T("Creative Fastspeech 8");
		names[WAVE_FORMAT_CREATIVE_FASTSPEECH10] = _T("Creative Fastspeech 10");
		names[WAVE_FORMAT_UHER_ADPCM] = _T("UHER ADPCM");
		names[WAVE_FORMAT_DOLBY_AC3] = _T("Dolby AC3");
		names[WAVE_FORMAT_DVD_DTS] = _T("DTS");
		names[WAVE_FORMAT_AAC] = _T("AAC");
		names[WAVE_FORMAT_LATM_AAC] = _T("AAC(LATM)");
		names[WAVE_FORMAT_FLAC] = _T("FLAC");
		names[WAVE_FORMAT_TTA1] = _T("TTA");
		names[WAVE_FORMAT_14_4] = _T("RealAudio 14.4");
		names[WAVE_FORMAT_28_8] = _T("RealAudio 28.8");
		names[WAVE_FORMAT_ATRC] = _T("RealAudio ATRC");
		names[WAVE_FORMAT_COOK] = _T("RealAudio COOK");
		names[WAVE_FORMAT_DNET] = _T("RealAudio DNET");
		names[WAVE_FORMAT_RAAC] = _T("RealAudio RAAC");
		names[WAVE_FORMAT_RACP] = _T("RealAudio RACP");
		names[WAVE_FORMAT_SIPR] = _T("RealAudio SIPR");
		names[WAVE_FORMAT_PS2_PCM] = _T("PS2 PCM");
		names[WAVE_FORMAT_PS2_ADPCM] = _T("PS2 ADPCM");
		names[0x0160] = _T("Windows Media Audio");
		names[0x0161] = _T("Windows Media Audio");
		names[0x0162] = _T("Windows Media Audio");
		names[0x0163] = _T("Windows Media Audio");
		names[0x6173] = _T("AMR");
		// names[] = _T("");
	}

	if (!names.Lookup(wFormatTag, str)) {
		if (subtype == MEDIASUBTYPE_Vorbis) {
			str = _T("Vorbis (deprecated)");
		} else if (subtype == MEDIASUBTYPE_Vorbis2) {
			str = _T("Vorbis");
		} else if (subtype == MEDIASUBTYPE_MP4A) {
			str = _T("MPEG4 Audio");
		} else if (subtype == MEDIASUBTYPE_FLAC_FRAMED) {
			str = _T("FLAC (framed)");
		} else if (subtype == MEDIASUBTYPE_DOLBY_AC3) {
			str += _T("Dolby AC3");
		} else if (subtype == MEDIASUBTYPE_DTS) {
			str += _T("DTS");
		} else if (subtype == MEDIASUBTYPE_PCM_NONE || subtype == MEDIASUBTYPE_PCM_RAW ||
				   subtype == MEDIASUBTYPE_PCM_TWOS || subtype == MEDIASUBTYPE_PCM_SOWT ||
				   subtype == MEDIASUBTYPE_PCM_IN24 || subtype == MEDIASUBTYPE_PCM_IN32 ||
				   subtype == MEDIASUBTYPE_PCM_IN24_le || subtype == MEDIASUBTYPE_PCM_IN32_le ||
				   subtype == MEDIASUBTYPE_PCM_FL32 || subtype == MEDIASUBTYPE_PCM_FL32_le ||
				   subtype == MEDIASUBTYPE_PCM_FL64 || subtype == MEDIASUBTYPE_PCM_FL64_le) {
			str += _T("PCM");
		} else if (subtype == MEDIASUBTYPE_ADPCM_SWF || subtype == MEDIASUBTYPE_IMA4) {
			str += _T("ADPCM");
		} else if (subtype == MEDIASUBTYPE_ALAC) {
			str += _T("Alac");
//.........这里部分代码省略.........
开发者ID:Samangan,项目名称:mpc-hc,代码行数:101,代码来源:MediaTypeEx.cpp

示例12: GetGUIDString

CString GetGUIDString(const GUID& guid)
{
	static CAtlMap<GUID, CString> DXVA_names;
	{
		DXVA_ModeNone;

		ADDENTRY(DXVA_ModeNone);
		ADDENTRY(DXVA_ModeH261_A);
		ADDENTRY(DXVA_ModeH261_B);

		ADDENTRY(DXVA_ModeH263_A);
		ADDENTRY(DXVA_ModeH263_B);
		ADDENTRY(DXVA_ModeH263_C);
		ADDENTRY(DXVA_ModeH263_D);
		ADDENTRY(DXVA_ModeH263_E);
		ADDENTRY(DXVA_ModeH263_F);

		ADDENTRY(DXVA_ModeMPEG1_A);

		ADDENTRY(DXVA_ModeMPEG2_A);
		ADDENTRY(DXVA_ModeMPEG2_B);
		ADDENTRY(DXVA_ModeMPEG2_C);
		ADDENTRY(DXVA_ModeMPEG2_D);
		ADDENTRY(DXVA2_ModeMPEG2_MoComp);
		ADDENTRY(DXVA2_ModeMPEG2_IDCT);
		ADDENTRY(DXVA2_ModeMPEG2_VLD);
		ADDENTRY(DXVA_ModeMPEG2and1_VLD);

		ADDENTRY(DXVA_ModeH264_A);
		ADDENTRY(DXVA_ModeH264_B);
		ADDENTRY(DXVA_ModeH264_C);
		ADDENTRY(DXVA_ModeH264_D);
		ADDENTRY(DXVA_ModeH264_E);
		ADDENTRY(DXVA_ModeH264_F);

		ADDENTRY(DXVA_ModeWMV8_A);
		ADDENTRY(DXVA_ModeWMV8_B);

		ADDENTRY(DXVA_ModeWMV9_A);
		ADDENTRY(DXVA_ModeWMV9_B);
		ADDENTRY(DXVA_ModeWMV9_C);

		ADDENTRY(DXVA_ModeVC1_A);
		ADDENTRY(DXVA_ModeVC1_B);
		ADDENTRY(DXVA_ModeVC1_C);
		ADDENTRY(DXVA_ModeVC1_D);
		ADDENTRY(DXVA2_ModeVC1_D2010);

		ADDENTRY(DXVA_Intel_H264_ClearVideo);
		ADDENTRY(DXVA_Intel_VC1_ClearVideo);
		ADDENTRY(DXVA_Intel_VC1_ClearVideo_2);
		ADDENTRY(DXVA_MPEG4_ASP);

		ADDENTRY(DXVA_ModeHEVC_VLD_Main);
		ADDENTRY(DXVA_ModeHEVC_VLD_Main10);

		ADDENTRY(DXVA_NoEncrypt);
	}

	// to prevent print TIME_FORMAT_NONE for GUID_NULL
	if (guid == GUID_NULL) {
		return _T("GUID_NULL");
	}

	CString guidStr = CString(GuidNames[guid]);
	if (guidStr == _T("Unknown GUID Name")) {
		guidStr = CString(m_GuidNames[guid]);
	}
	if (guidStr == _T("Unknown GUID Name")) {
		CString str;
		if (DXVA_names.Lookup(guid, str)) {
			guidStr = str;
		}
	}

	return guidStr;
}
开发者ID:Tphive,项目名称:mpc-be,代码行数:77,代码来源:MediaTypeEx.cpp

示例13: GetAudioCodecName

CString CMediaTypeEx::GetAudioCodecName(const GUID& subtype, WORD wFormatTag)
{
	CString str;

	static CAtlMap<WORD, CString> names;
	if (names.IsEmpty()) {
		// MMReg.h
		names[WAVE_FORMAT_ADPCM]                 = _T("MS ADPCM");
		names[WAVE_FORMAT_IEEE_FLOAT]            = _T("IEEE Float");
		names[WAVE_FORMAT_ALAW]                  = _T("aLaw");
		names[WAVE_FORMAT_MULAW]                 = _T("muLaw");
		names[WAVE_FORMAT_DTS]                   = _T("DTS");
		names[WAVE_FORMAT_DRM]                   = _T("DRM");
		names[WAVE_FORMAT_WMAVOICE9]             = _T("WMA Voice");
		names[WAVE_FORMAT_WMAVOICE10]            = _T("WMA Voice");
		names[WAVE_FORMAT_OKI_ADPCM]             = _T("OKI ADPCM");
		names[WAVE_FORMAT_IMA_ADPCM]             = _T("IMA ADPCM");
		names[WAVE_FORMAT_MEDIASPACE_ADPCM]      = _T("Mediaspace ADPCM");
		names[WAVE_FORMAT_SIERRA_ADPCM]          = _T("Sierra ADPCM");
		names[WAVE_FORMAT_G723_ADPCM]            = _T("G723 ADPCM");
		names[WAVE_FORMAT_DIALOGIC_OKI_ADPCM]    = _T("Dialogic OKI ADPCM");
		names[WAVE_FORMAT_MEDIAVISION_ADPCM]     = _T("Media Vision ADPCM");
		names[WAVE_FORMAT_YAMAHA_ADPCM]          = _T("Yamaha ADPCM");
		names[WAVE_FORMAT_DSPGROUP_TRUESPEECH]   = _T("DSP Group Truespeech");
		names[WAVE_FORMAT_DOLBY_AC2]             = _T("Dolby AC2");
		names[WAVE_FORMAT_GSM610]                = _T("GSM610");
		names[WAVE_FORMAT_MSNAUDIO]              = _T("MSN Audio");
		names[WAVE_FORMAT_ANTEX_ADPCME]          = _T("Antex ADPCME");
		names[WAVE_FORMAT_CS_IMAADPCM]           = _T("Crystal Semiconductor IMA ADPCM");
		names[WAVE_FORMAT_ROCKWELL_ADPCM]        = _T("Rockwell ADPCM");
		names[WAVE_FORMAT_ROCKWELL_DIGITALK]     = _T("Rockwell Digitalk");
		names[WAVE_FORMAT_G721_ADPCM]            = _T("G721");
		names[WAVE_FORMAT_G728_CELP]             = _T("G728");
		names[WAVE_FORMAT_MSG723]                = _T("MSG723");
		names[WAVE_FORMAT_MPEG]                  = _T("MPEG Audio");
		names[WAVE_FORMAT_MPEGLAYER3]            = _T("MP3");
		names[WAVE_FORMAT_LUCENT_G723]           = _T("Lucent G723");
		names[WAVE_FORMAT_VOXWARE]               = _T("Voxware");
		names[WAVE_FORMAT_G726_ADPCM]            = _T("G726");
		names[WAVE_FORMAT_G722_ADPCM]            = _T("G722");
		names[WAVE_FORMAT_G729A]                 = _T("G729A");
		names[WAVE_FORMAT_MEDIASONIC_G723]       = _T("MediaSonic G723");
		names[WAVE_FORMAT_ZYXEL_ADPCM]           = _T("ZyXEL ADPCM");
		names[WAVE_FORMAT_RAW_AAC1]              = _T("AAC");
		names[WAVE_FORMAT_RHETOREX_ADPCM]        = _T("Rhetorex ADPCM");
		names[WAVE_FORMAT_VIVO_G723]             = _T("Vivo G723");
		names[WAVE_FORMAT_VIVO_SIREN]            = _T("Vivo Siren");
		names[WAVE_FORMAT_DIGITAL_G723]          = _T("Digital G723");
		names[WAVE_FORMAT_SANYO_LD_ADPCM]        = _T("Sanyo LD ADPCM");
		names[WAVE_FORMAT_MSAUDIO1]              = _T("WMA 1");
		names[WAVE_FORMAT_WMAUDIO2]              = _T("WMA 2");
		names[WAVE_FORMAT_WMAUDIO3]              = _T("WMA Pro");
		names[WAVE_FORMAT_WMAUDIO_LOSSLESS]      = _T("WMA Lossless");
		names[WAVE_FORMAT_CREATIVE_ADPCM]        = _T("Creative ADPCM");
		names[WAVE_FORMAT_CREATIVE_FASTSPEECH8]  = _T("Creative Fastspeech 8");
		names[WAVE_FORMAT_CREATIVE_FASTSPEECH10] = _T("Creative Fastspeech 10");
		names[WAVE_FORMAT_UHER_ADPCM]            = _T("UHER ADPCM");
		names[WAVE_FORMAT_DTS2]                  = _T("DTS");
		// other
		names[WAVE_FORMAT_DOLBY_AC3]             = _T("Dolby AC3");
		names[WAVE_FORMAT_LATM_AAC]              = _T("AAC(LATM)");
		names[WAVE_FORMAT_FLAC]                  = _T("FLAC");
		names[WAVE_FORMAT_TTA1]                  = _T("TTA");
		names[WAVE_FORMAT_WAVPACK4]              = _T("WavPack");
		names[WAVE_FORMAT_14_4]                  = _T("RealAudio 14.4");
		names[WAVE_FORMAT_28_8]                  = _T("RealAudio 28.8");
		names[WAVE_FORMAT_ATRC]                  = _T("RealAudio ATRC");
		names[WAVE_FORMAT_COOK]                  = _T("RealAudio COOK");
		names[WAVE_FORMAT_DNET]                  = _T("RealAudio DNET");
		names[WAVE_FORMAT_RAAC]                  = _T("RealAudio RAAC");
		names[WAVE_FORMAT_RACP]                  = _T("RealAudio RACP");
		names[WAVE_FORMAT_SIPR]                  = _T("RealAudio SIPR");
		names[WAVE_FORMAT_PS2_PCM]               = _T("PS2 PCM");
		names[WAVE_FORMAT_PS2_ADPCM]             = _T("PS2 ADPCM");
		names[WAVE_FORMAT_SPEEX]                 = _T("Speex");
		names[WAVE_FORMAT_ADX_ADPCM]             = _T("ADX ADPCM");
	}

	if (!names.Lookup(wFormatTag, str)) {
		// for wFormatTag equal to WAVE_FORMAT_UNKNOWN, WAVE_FORMAT_PCM, WAVE_FORMAT_EXTENSIBLE and other.
		if (subtype == MEDIASUBTYPE_PCM) {
			str = _T("PCM");
		} else if (subtype == MEDIASUBTYPE_IEEE_FLOAT) {
			str = _T("IEEE Float");
		} else if (subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO || subtype == MEDIASUBTYPE_HDMV_LPCM_AUDIO) {
			str = _T("LPCM");
		} else if (subtype == MEDIASUBTYPE_Vorbis) {
			str = _T("Vorbis (deprecated)");
		} else if (subtype == MEDIASUBTYPE_Vorbis2) {
			str = _T("Vorbis");
		} else if (subtype == MEDIASUBTYPE_MP4A) {
			str = _T("MPEG4 Audio");
		} else if (subtype == MEDIASUBTYPE_FLAC_FRAMED) {
			str = _T("FLAC (framed)");
		} else if (subtype == MEDIASUBTYPE_DOLBY_AC3) {
			str = _T("Dolby AC3");
		} else if (subtype == MEDIASUBTYPE_DOLBY_DDPLUS) {
			str = _T("DD+");
		} else if (subtype == MEDIASUBTYPE_DOLBY_TRUEHD) {
			str = _T("TrueHD");
//.........这里部分代码省略.........
开发者ID:Tphive,项目名称:mpc-be,代码行数:101,代码来源:MediaTypeEx.cpp

示例14: GetVideoCodecName

CString CMediaTypeEx::GetVideoCodecName(const GUID& subtype, DWORD biCompression)
{
	CString str;

	static CAtlMap<DWORD, CString> names;
	if (names.IsEmpty()) {
		names['WMV1'] = _T("Windows Media Video 7");
		names['WMV2'] = _T("Windows Media Video 8");
		names['WMV3'] = _T("Windows Media Video 9");
		names['DIV3'] = _T("DivX 3");
		names['MP43'] = _T("MSMPEG4v3");
		names['MP42'] = _T("MSMPEG4v2");
		names['MP41'] = _T("MSMPEG4v1");
		names['DX30'] = _T("DivX 3");
		names['DX50'] = _T("DivX 5");
		names['DIVX'] = _T("DivX 6");
		names['XVID'] = _T("Xvid");
		names['MP4V'] = _T("MPEG4 Video");
		names['AVC1'] = _T("MPEG4 Video (H264)");
		names['H264'] = _T("MPEG4 Video (H264)");
		names['RV10'] = _T("RealVideo 1");
		names['RV20'] = _T("RealVideo 2");
		names['RV30'] = _T("RealVideo 3");
		names['RV40'] = _T("RealVideo 4");
		names['FLV1'] = _T("Flash Video 1");
		names['FLV4'] = _T("Flash Video 4");
		names['VP50'] = _T("On2 VP5");
		names['VP60'] = _T("On2 VP6");
		names['SVQ3'] = _T("SVQ3");
		names['SVQ1'] = _T("SVQ1");
		names['H263'] = _T("H263");
		names['DRAC'] = _T("Dirac");
		names['WVC1'] = _T("VC-1");
		names['THEO'] = _T("Theora");
		names['HVC1'] = _T("HEVC");
		names['HM91'] = _T("HEVC(HM9.1)");
		names['HM10'] = _T("HEVC(HM10)");
		names['HM12'] = _T("HEVC(HM12)");
	}

	if (biCompression) {
		BYTE* b = (BYTE*)&biCompression;

		for (ptrdiff_t i = 0; i < 4; i++)
			if (b[i] >= 'a' && b[i] <= 'z') {
				b[i] = toupper(b[i]);
			}

		if (!names.Lookup(MAKEFOURCC(b[3], b[2], b[1], b[0]), str)) {
			if (subtype == MEDIASUBTYPE_DiracVideo) {
				str = _T("Dirac Video");
			} else if (subtype == MEDIASUBTYPE_apch ||
					   subtype == MEDIASUBTYPE_apcn ||
					   subtype == MEDIASUBTYPE_apcs ||
					   subtype == MEDIASUBTYPE_apco ||
					   subtype == MEDIASUBTYPE_ap4h) {
				str.Format(_T("ProRes Video (%4.4hs)"), &biCompression);
			} else if (biCompression < 256) {
				str.Format(_T("%u"), biCompression);
			} else {
				str.Format(_T("%4.4hs"), &biCompression);
			}
		}
	} else {
		if (subtype == MEDIASUBTYPE_RGB32)
			str = _T("RGB32");
		else if (subtype == MEDIASUBTYPE_RGB24)
			str = _T("RGB24");
		else if (subtype == MEDIASUBTYPE_RGB555)
			str = _T("RGB555");
		else if (subtype == MEDIASUBTYPE_RGB565)
			str = _T("RGB565");
        else if (subtype == MEDIASUBTYPE_ARGB32)
            str = _T("ARGB32");
	}

	return str;
}
开发者ID:Tphive,项目名称:mpc-be,代码行数:78,代码来源:MediaTypeEx.cpp

示例15: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
	FT_Library pLibrary = NULL;
					
	//CString strFolder = _T("\\\\mediaserver\\Exchange\\Korshul\\Fonts");
	CString strFolder = _T("X:\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\DesktopEditor\\freetype_names\\FontsDictionaryFiles");
	CWinFontList* m_pList = NULL;

	if (!FT_Init_FreeType( &pLibrary ))
	{
		if (_T("") == strFolder)
			m_pList = new CWinFontList(pLibrary);
		else
			m_pList = new CWinFontList(pLibrary, strFolder);

		FT_Done_FreeType( pLibrary );
	}

	CString strFontDictionaryPath = _T("X:\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\DesktopEditor\\freetype_names\\FontMaps\\FontDictionary.h");

	int nCount = m_pList->GetFonts()->GetLength();

	// теперь строим массив всех шрифтов по имени
	CAtlMap<CString, CFontInfoJS> mapFonts;
	CAtlMap<CString, CFontInfoJS> mapFontsUnicodes;
	CAtlArray<CString> arrFonts;
	CAtlArray<CString> arrFontsUnicodes;

	int nError = 0;

	CAtlMap<CString, BOOL> mapMainAscii;
	for (int i = 0; i < nCount; ++i)
	{
		CWinFontInfo* pInfo = (CWinFontInfo*)m_pList->GetByIndex(i);
		CString strPath = (CString)pInfo->m_wsFontPath;
		CString strName = (CString)pInfo->m_wsFontName;

		LONG lFontIndex = 0;
		LONG lFaceIndex = 0;

		//CAtlMap<CString, LONG>::CPair* pPairFontFiles = mapFontFiles.Lookup(strPath);
		//lFontIndex = pPairFontFiles->m_value;
		lFontIndex = (LONG)i;

		if (pInfo->m_lIndex >= 0)
			lFaceIndex = pInfo->m_lIndex;

		mapMainAscii.SetAt(pInfo->m_wsFontName, TRUE);

		CAtlMap<CString, CFontInfoJS>::CPair* pPair = mapFonts.Lookup(pInfo->m_wsFontName);
		if (NULL != pPair)
		{
			pPair->m_value.m_sName = pInfo->m_wsFontName;

			if (pInfo->m_bBold && pInfo->m_bItalic)
			{
				if (-1 != pPair->m_value.m_lIndexBI)
					nError++;

				pPair->m_value.m_lIndexBI = lFontIndex;
				pPair->m_value.m_lFaceIndexBI = lFaceIndex;

				pPair->m_value.namesBI.RemoveAll();
				pPair->m_value.namesBI.Copy(pInfo->names);
			}
			else if (pInfo->m_bBold)
			{
				if (-1 != pPair->m_value.m_lIndexB)
					nError++;

				pPair->m_value.m_lIndexB = lFontIndex;
				pPair->m_value.m_lFaceIndexB = lFaceIndex;

				pPair->m_value.namesB.RemoveAll();
				pPair->m_value.namesB.Copy(pInfo->names);
			}
			else if (pInfo->m_bItalic)
			{
				if (-1 != pPair->m_value.m_lIndexI)
					nError++;

				pPair->m_value.m_lIndexI = lFontIndex;
				pPair->m_value.m_lFaceIndexI = lFaceIndex;

				pPair->m_value.namesI.RemoveAll();
				pPair->m_value.namesI.Copy(pInfo->names);
			}
			else
			{
				if (-1 != pPair->m_value.m_lIndexR)
					nError++;

				pPair->m_value.m_lIndexR = lFontIndex;
				pPair->m_value.m_lFaceIndexR = lFaceIndex;

				pPair->m_value.namesR.RemoveAll();
				pPair->m_value.namesR.Copy(pInfo->names);
			}
		}
		else
//.........这里部分代码省略.........
开发者ID:tralivali1234,项目名称:core-1,代码行数:101,代码来源:FontMaps.cpp


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