本文整理汇总了C++中CAAFBuiltinDefs::cdDescriptiveClip方法的典型用法代码示例。如果您正苦于以下问题:C++ CAAFBuiltinDefs::cdDescriptiveClip方法的具体用法?C++ CAAFBuiltinDefs::cdDescriptiveClip怎么用?C++ CAAFBuiltinDefs::cdDescriptiveClip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAAFBuiltinDefs
的用法示例。
在下文中一共展示了CAAFBuiltinDefs::cdDescriptiveClip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
// IAAFSession* pSession = NULL;
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFMob* pReferencedMob = NULL;
IAAFTimelineMobSlot* newSlot = NULL;
IAAFSegment* seg = NULL;
IAAFComponent* pComponent = NULL;
IAAFDescriptiveClip* pDescClip = NULL;
bool bFileOpen = false;
HRESULT hr = AAFRESULT_SUCCESS;
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 MOB to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pReferencedMob));
checkResult(pReferencedMob->SetMobID(TEST_referencedMobID));
checkResult(pReferencedMob->SetName(L"AAFDescriptiveClipTest::ReferencedMob"));
// Create a Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"AAFDescriptiveClipTest"));
// Create a DescriptiveClip
checkResult(defs.cdDescriptiveClip()->
CreateInstance(IID_IAAFDescriptiveClip,
(IUnknown **)&pDescClip));
checkResult(pDescClip->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFSound()));
pComponent->Release();
pComponent = NULL;
// Set the properties for the SourceClip
//checkResult(pDescClip->SetFade( fadeInLen, fadeInType, fadeOutLen, fadeOutType));
sourceRef.sourceID = TEST_referencedMobID;
sourceRef.sourceSlotID = 0;
sourceRef.startTime = 0;
checkResult(pDescClip->Initialize(defs.ddkAAFSound(), 1000, sourceRef));
// Get described slots - should not be present.
aafUInt32 size = 0;
AAFRESULT hr = pDescClip->CountDescribedSlotIDs( &size );
checkExpression( AAFRESULT_PROP_NOT_PRESENT == hr, AAFRESULT_TEST_FAILED );
// Set/Get single described slot id
aafUInt32 setSingleDescribedSlotID = 0xdeadbeef;
checkResult( pDescClip->AddDescribedSlotID( setSingleDescribedSlotID ) );
aafUInt32 getSingleDescribedSlotID = 0;
checkResult( pDescClip->GetDescribedSlotIDs( 1, &getSingleDescribedSlotID ) );
checkExpression( setSingleDescribedSlotID == getSingleDescribedSlotID, AAFRESULT_TEST_FAILED );
// Clear the ID set for the next test
checkResult( pDescClip->RemoveDescribedSlotID( setSingleDescribedSlotID ) );
// Set the persistent described slots.
for( aafUInt32 i_tid = 0; i_tid < TestDescribedSlotIDsVectorSize; ++i_tid )
{
checkResult( pDescClip->AddDescribedSlotID( TestDescribedSlotIDsVector[i_tid] ) );
}
aafUInt32 getDescribedSlotIDsVector[TestDescribedSlotIDsVectorSize];
checkResult( pDescClip->GetDescribedSlotIDs( TestDescribedSlotIDsVectorSize, getDescribedSlotIDsVector ) );
checkExpression( 0 == memcmp( getDescribedSlotIDsVector, TestDescribedSlotIDsVector, sizeof(TestDescribedSlotIDsVector) ),
AAFRESULT_TEST_FAILED );
checkResult(pDescClip->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
1,
slotName,
//.........这里部分代码省略.........