本文整理汇总了C++中CAtlMap::Lookup方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlMap::Lookup方法的具体用法?C++ CAtlMap::Lookup怎么用?C++ CAtlMap::Lookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAtlMap
的用法示例。
在下文中一共展示了CAtlMap::Lookup方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
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);
}
}
}
示例2: Commit
void IFileContainer::Commit(const CPath& path)
{
CAtlMap<CString, size_t> namepair;
POSITION pos = m_container.GetStartPosition();
while (NULL != pos)
{
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(path / defdir);
smart_ptr<OOX::IFileBuilder> fileBuilder = pPair->m_value.smart_dynamic_cast<OOX::IFileBuilder>();
if (fileBuilder.is_init())
fileBuilder->Commit(path / defdir / name);
}
}
}
示例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;
}
}
示例4: 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]);
}
}
}
}
}
}
}
示例5: 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;
}
示例6: 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;
}
示例7: GetLength
//.........这里部分代码省略.........
__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;
if (Read(len, &p, false) && p.rtStart != Packet::INVALID_TIME && p.bSyncPoint) {
BYTE id = (BYTE)p.TrackNumber, tmp;
if (ids.Lookup(id, tmp)) {
ids.RemoveKey((BYTE)p.TrackNumber);
ret = min(ret, (__int64)syncpos);
}
}
}
Seek(pos + len);
}
maxpos = minpos;
}
return ret;
}
示例8: 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");
//.........这里部分代码省略.........
示例9: 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;
}
示例10: 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");
//.........这里部分代码省略.........
示例11: 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;
}
示例12: _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
//.........这里部分代码省略.........