本文整理汇总了C++中CAAFBuiltinDefs::cdHTMLClip方法的典型用法代码示例。如果您正苦于以下问题:C++ CAAFBuiltinDefs::cdHTMLClip方法的具体用法?C++ CAAFBuiltinDefs::cdHTMLClip怎么用?C++ CAAFBuiltinDefs::cdHTMLClip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAAFBuiltinDefs
的用法示例。
在下文中一共展示了CAAFBuiltinDefs::cdHTMLClip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateHTMLClip
void HTMLClipTest::CreateHTMLClip()
{
assert(_pHeader && _pDictionary);
HRESULT hr = S_OK;
IAAFMasterMob *pMasterMob = NULL;
IAAFMob *pReferencedMob = NULL;
IAAFHTMLClip *pHTMLClip = NULL;
IAAFSourceReference *pSourceReference = NULL;
IAAFCompositionMob *pCompositionMob = NULL;
IAAFMob *pReferencingMob = NULL;
IAAFSegment *pSegment = NULL;
IAAFTimelineMobSlot *pMobSlot = NULL;
IAAFComponent *pComponent = NULL;
CAAFBuiltinDefs defs (_pDictionary);
try
{
//Make the MOB to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMasterMob,
(IUnknown **)&pMasterMob));
checkResult(pMasterMob->QueryInterface(IID_IAAFMob, (void **)&pReferencedMob));
checkResult(pReferencedMob->GetMobID(&_referencedMobID));
checkResult(pReferencedMob->SetName(L"HTMLClipTest::ReferencedMob"));
// Save the master mob.
checkResult(_pHeader->AddMob(pReferencedMob));
// Use EssenceAccess to write some html essence
// Create a file mob for the html essence.
// Create the corresponding html essence.
// Write some html essence.
// Create a HTMLClip
checkResult(defs.cdHTMLClip()->
CreateInstance(IID_IAAFHTMLClip,
(IUnknown **)&pHTMLClip));
checkResult(pHTMLClip->SetBeginAnchor(const_cast<wchar_t *>(_beginAnchor)));
checkResult(pHTMLClip->SetEndAnchor(const_cast<wchar_t *>(_endAnchor)));
checkResult(pHTMLClip->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
pComponent->Release();
pComponent = NULL;
// Initialize the source reference data.
checkResult(pHTMLClip->QueryInterface(IID_IAAFSourceReference, (void **)&pSourceReference));
checkResult(pSourceReference->SetSourceID(_referencedMobID));
checkResult(pSourceReference->SetSourceMobSlotID(0));
// Create a composition mob to hold the html clip.
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFCompositionMob,
(IUnknown **)&pCompositionMob));
checkResult(pCompositionMob->QueryInterface(IID_IAAFMob, (void **)&pReferencingMob));
checkResult(pReferencingMob->SetName(L"CompositionMob_HTMLClipTest"));
checkResult(pHTMLClip->QueryInterface(IID_IAAFSegment, (void **)&pSegment));
IAAFMobSlot *pSlot = NULL;
aafRational_t editRate = { 0, 1};
checkResult(pReferencingMob->AppendNewTimelineSlot(editRate,
pSegment,
1,
L"HTMLClipTest",
0,
&pMobSlot));
// Save the referencing mob.
checkResult(_pHeader->AddMob(pReferencingMob));
}
catch (HRESULT& rHR)
{
hr = rHR;
// fall through and handle cleanup
}
// Cleanup local references
if (pMobSlot)
{
pMobSlot->Release();
pMobSlot = NULL;
}
if (pComponent)
{
pComponent->Release();
pComponent = NULL;
}
if (pSegment)
{
pSegment->Release();
pSegment = NULL;
}
//.........这里部分代码省略.........