本文整理汇总了C++中IAAFMob::GetComments方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFMob::GetComments方法的具体用法?C++ IAAFMob::GetComments怎么用?C++ IAAFMob::GetComments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFMob
的用法示例。
在下文中一共展示了IAAFMob::GetComments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
//.........这里部分代码省略.........
(IUnknown **)&pKLVData));
checkResult(pKLVData->Initialize(TEST_KLV, sizeof(KLVfrowney),
(unsigned char *)KLVfrowney));
checkResult(pMob->AppendKLVData(pKLVData));
checkExpression(pMob->AppendKLVData(pKLVData) == AAFRESULT_OBJECT_ALREADY_ATTACHED,
AAFRESULT_TEST_FAILED);
// RemoveKLVData - remove object #2
checkExpression(pMob->RemoveKLVData(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkResult(pMob->CountKLVData(&numFound));
checkExpression(numFound == 2, AAFRESULT_TEST_FAILED);
checkResult(pMob->RemoveKLVData(pKLVData));
checkResult(pMob->CountKLVData(&numFound));
checkExpression(numFound == 1, AAFRESULT_TEST_FAILED);
pKLVData->Release();
pKLVData = NULL;
// Try removing an object that is not attached
checkResult(defs.cdKLVData()->
CreateInstance(IID_IAAFKLVData,
(IUnknown **)&pKLVData));
checkResult(pKLVData->Initialize(TEST_KLV, sizeof(KLVsmiley),
(unsigned char *)KLVsmiley));
checkExpression(pMob->RemoveKLVData(pKLVData) == AAFRESULT_OBJECT_NOT_ATTACHED,
AAFRESULT_TEST_FAILED);
// Attach it to replace the one removed
checkResult(pMob->AppendKLVData(pKLVData));
pKLVData->Release();
pKLVData = NULL;
// Comments
checkExpression(pMob->GetComments(&enumTaggedVal) == AAFRESULT_PROP_NOT_PRESENT,
AAFRESULT_TEST_FAILED);
// Check CountComments()
checkExpression(pMob->CountComments(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
numComments = 1;
checkResult(pMob->CountComments(&numComments));
checkExpression(numComments == 0, AAFRESULT_TEST_FAILED);
// Check AppendComments()
checkExpression(pMob->AppendComment(NULL, pComment[0]) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkExpression(pMob->AppendComment(const_cast<aafWChar*>(pCategory[0]), NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
for (i = 0; i < 5; ++i)
{
checkResult(pMob->AppendComment(const_cast<aafWChar*>(pCategory[i]), pComment[i]));
}
checkResult(pMob->CountComments(&numComments));
checkExpression(numComments == 5, AAFRESULT_TEST_FAILED);
// Check GetComments()
checkExpression(pMob->GetComments(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkResult(pMob->GetComments(&enumTaggedVal));
for (i = 0; i < 5; ++i)
{
checkResult(enumTaggedVal->NextOne(&taggedVal));
checkResult(taggedVal->GetNameBufLen(&bufLen));
checkResult(taggedVal->GetName(name, bufLen));
checkExpression(wcscmp(name, pCategory[i]) == 0, AAFRESULT_TEST_FAILED);
示例2: ReadAAFFile
//.........这里部分代码省略.........
checkResult(aMob->CountKLVData(&numFound));
checkExpression(numFound == 2, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetKLVData(&klvEnum));
checkResult(klvEnum->NextOne(&pKLVData));
checkResult(pKLVData->GetValueBufLen(&bufLen));
checkExpression(sizeof(KLVfrowney) == bufLen, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetValue( sizeof(value), (unsigned char *)value, &bytesRead));
checkExpression(memcmp(value, KLVfrowney, sizeof(KLVfrowney)) == 0, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetKey(&testKey));
checkExpression(memcmp(&testKey, &TEST_KLV, sizeof(aafUID_t)) == 0, AAFRESULT_TEST_FAILED);
pKLVData->Release();
pKLVData = NULL;
checkResult(klvEnum->NextOne(&pKLVData));
checkResult(pKLVData->GetValueBufLen(&bufLen));
checkExpression(sizeof(KLVsmiley) == bufLen, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetValue( sizeof(value), (unsigned char *)value, &bytesRead));
checkExpression(memcmp(value, KLVsmiley, sizeof(KLVsmiley)) == 0, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetKey(&testKey));
checkExpression(memcmp(&testKey, &TEST_KLV, sizeof(aafUID_t)) == 0, AAFRESULT_TEST_FAILED);
pKLVData->Release();
pKLVData = NULL;
klvEnum->Release();
klvEnum = NULL;
checkExpression(aMob->GetKLVData(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
// Check the comments
checkResult(aMob->GetComments(&enumTaggedVal));
for (i = 0; i < 5; ++i)
{
if (i==2)
continue;
checkResult(enumTaggedVal->NextOne(&taggedVal));
checkResult(taggedVal->GetNameBufLen(&bufLen));
checkResult(taggedVal->GetName(name, bufLen));
checkExpression(wcscmp(name, pCategory[i]) == 0, AAFRESULT_TEST_FAILED);
checkResult(taggedVal->GetValueBufLen(&bufLen));
checkResult(taggedVal->GetValue(bufLen, (aafDataBuffer_t)value, &bytesRead));
checkExpression(wcscmp(value, pComment[i]) == 0, AAFRESULT_TEST_FAILED);
taggedVal->Release();
taggedVal = NULL;
}
// Check attributes and usage code.
// Need IAAFMob2 for that;
IAAFMob2* aMobInterface2 = 0;
checkResult( aMob->QueryInterface( IID_IAAFMob2, reinterpret_cast<void**>(&aMobInterface2) ) );
IEnumAAFTaggedValues* pAttributesEnum = 0;
checkResult( aMobInterface2->GetAttributes( &pAttributesEnum ) );
int attributeCount = 0;
HRESULT atthr = AAFRESULT_SUCCESS;
IAAFTaggedValue* pAttribute = 0;
示例3: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IEnumAAFMobs *mobIter = NULL;
IAAFMob *aMob = NULL;
IEnumAAFMobSlots *slotIter = NULL;
IEnumAAFTaggedValues* pCommentIterator = NULL;
IAAFTaggedValue* pComment = NULL;
IAAFMobSlot *slot = NULL;
aafNumSlots_t numMobs, n, slt;
aafUInt32 numComments, bytesRead, com;
HRESULT hr = S_OK;
aafWChar tag[64];
aafWChar Value[64];
aafSearchCrit_t criteria;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFCompMob;
checkResult(pHeader->CountMobs(kAAFCompMob, &numMobs));
checkExpression(1 == numMobs, AAFRESULT_TEST_FAILED);
checkResult(pHeader->GetMobs (&criteria, &mobIter));
for(n = 0; n < numMobs; n++)
{
aafWChar name[500], slotName[500];
aafNumSlots_t numSlots;
aafMobID_t mobID;
aafSlotID_t trackID;
checkResult(mobIter->NextOne (&aMob));
checkResult(aMob->GetName (name, sizeof(name)));
checkResult(aMob->GetMobID (&mobID));
// Check for comments
checkResult(aMob->CountComments(&numComments));
checkExpression(1 == numComments, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetComments(&pCommentIterator));
for(com = 0; com < numComments; com++)
{
checkResult(pCommentIterator->NextOne(&pComment));
checkResult(pComment->GetName(tag, sizeof(tag)));
checkResult(pComment->GetValue( sizeof(Value), (unsigned char *)Value, &bytesRead));
checkExpression(wcscmp(tag, TagNames)== 0, AAFRESULT_TEST_FAILED);
checkExpression(wcscmp(Value, AltComment)== 0, AAFRESULT_TEST_FAILED);
pComment->Release();
}
pCommentIterator->Release();
checkResult(aMob->CountSlots (&numSlots));
checkExpression(5 == numSlots, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetSlots(&slotIter));
for(slt = 0; slt < numSlots; slt++)
{
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetName (slotName, sizeof(slotName)));
checkResult(slot->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[slt]) == 0, AAFRESULT_TEST_FAILED);
slot->Release();
slot = NULL;
}
aMob->Release();
aMob = NULL;
}
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup object references
if (slot)
slot->Release();
if (slotIter)
slotIter->Release();
if (aMob)
aMob->Release();
if (mobIter)
//.........这里部分代码省略.........