本文整理汇总了C++中IAAFMob::AppendComment方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFMob::AppendComment方法的具体用法?C++ IAAFMob::AppendComment怎么用?C++ IAAFMob::AppendComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFMob
的用法示例。
在下文中一共展示了IAAFMob::AppendComment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
//.........这里部分代码省略.........
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);
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;
}
示例2: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob *pMob = NULL;
IAAFMob* pRMob = NULL;
IAAFMasterMob* pReferencedMob = NULL;
IAAFCompositionMob* pCompMob = NULL;
IAAFTimelineMobSlot *newSlot = NULL;
IAAFSegment *seg = NULL;
IAAFSourceClip *sclp = NULL;
HRESULT hr = S_OK;
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the file.
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
//Make the first mob
long test;
// Create a Composition Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFCompositionMob,
(IUnknown **)&pCompMob));
checkResult(pCompMob->QueryInterface(IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"AAFTaggedValuesTest"));
// append a comment to this mob !!
checkResult(pMob->AppendComment(const_cast<aafWChar*>(TagNames), Comments));
checkResult(pMob->AppendComment(const_cast<aafWChar*>(TagNames), AltComment));
// Create a master mob to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMasterMob,
(IUnknown **)&pReferencedMob));
checkResult(pReferencedMob->QueryInterface(IID_IAAFMob, (void **)&pRMob));
checkResult(pRMob->SetMobID(TEST_referencedMobID));
checkResult(pRMob->SetName(L"AAFTaggedValueTest::ReferencedMob"));
// Add some slots
for(test = 0; test < 5; test++)
{
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&sclp));
// Set the properties for the SourceClip
sourceRef.sourceID = TEST_referencedMobID;
sourceRef.sourceSlotID = 0;
sourceRef.startTime = 0;
IAAFDataDefSP pDataDef;
checkResult(pDictionary->LookupDataDef(*slotDDefs[test], &pDataDef));
checkResult(sclp->Initialize(pDataDef, slotsLength[test], sourceRef));
checkResult(sclp->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
test+1,
slotNames[test],
0,
&newSlot));
newSlot->Release();
newSlot = NULL;
seg->Release();
seg = NULL;
sclp->Release();
sclp = NULL;
}
// Add the mob to the file.
checkResult(pHeader->AddMob(pMob));
checkResult(pHeader->AddMob(pRMob));
}
catch (HRESULT& rResult)
//.........这里部分代码省略.........