本文整理汇总了C++中CAAFBuiltinDefs::cdStaticMobSlot方法的典型用法代码示例。如果您正苦于以下问题:C++ CAAFBuiltinDefs::cdStaticMobSlot方法的具体用法?C++ CAAFBuiltinDefs::cdStaticMobSlot怎么用?C++ CAAFBuiltinDefs::cdStaticMobSlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAAFBuiltinDefs
的用法示例。
在下文中一共展示了CAAFBuiltinDefs::cdStaticMobSlot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
HRESULT hr = AAFRESULT_SUCCESS;
IAAFFile* pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary * pDict = NULL;
try
{
//Do the usual ...
RemoveTestFile (pFileName);
checkResult (CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
assert (pFile);
checkResult (pFile->GetHeader (&pHeader));
assert (pHeader);
checkResult (pHeader->GetDictionary (&pDict));
assert (pDict);
CAAFBuiltinDefs defs (pDict);
///////////////////////
//checkResult(createCHARType (pDict));
checkResult(addCHARTypeToComponent (pDict));
///////////
//Create a concrete subclass of mob
IAAFMobSP spMob;
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&spMob));
checkResult(spMob->SetMobID(TEST_MobID));
checkResult(spMob->SetName(L"Some Mob"));
//Add a slot - make it our Filler
/// first, create Filler
IAAFFillerSP spFill;
checkResult(defs.cdFiller()->CreateInstance(IID_IAAFFiller, (IUnknown**)&spFill));
checkResult(spFill->Initialize(defs.ddkAAFSound(), 10));
checkResult(createCHARFiller(pDict, spFill));
//seg
//QI the filler for its segment
IAAFSegmentSP spSeg;
checkResult(spFill->QueryInterface (IID_IAAFSegment, (void **)&spSeg));
//Create a concrete subclass of mob slot
IAAFMobSlotSP spMobSlot;
checkResult(defs.cdStaticMobSlot()->
CreateInstance(IID_IAAFMobSlot,
(IUnknown **)&spMobSlot));
//Add the segment to the mobslot
checkResult(spMobSlot->SetSegment(spSeg));
checkResult(spMobSlot->SetSlotID(TEST_SLOT_ID));
checkResult(spMobSlot->SetName(TEST_SLOT_NAME));
//Append the slot to the Mob ....
checkResult(spMob->AppendSlot (spMobSlot));
//FINALLY .... Add mob to header
checkResult (pHeader->AddMob (spMob));
//////////////////// done /!!!!!!!!!!!!!!!!!!!!!!
//Verify results right away (during this creation process) ....
checkResult(verifyContents (pHeader, pDict, kAAFTrue)); //True => minimal testing
}
catch (HRESULT & rResult)
{
hr = rResult;
}
if (pDict) pDict->Release();
if (pHeader) pHeader->Release();
if (pFile)
{
stopGap(pFile->Save());
stopGap(pFile->Close());
pFile->Release();
}
return hr;
}//CreateAAFFile()
示例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;
IAAFMobSlot *newSlot = NULL;
IAAFSegment *seg = NULL;
IAAFSourceClip *sclp = NULL;
IAAFComponent *pComp = 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 concrete subclass of Mob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"MOBTest"));
// Add some slots
for(test = 0; test < 5; test++)
{
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&sclp));
checkResult(sclp->QueryInterface (IID_IAAFComponent, (void **)&pComp));
checkResult(pComp->SetDataDef (defs.ddkAAFPicture()));
pComp->Release();
pComp = NULL;
checkResult(sclp->QueryInterface (IID_IAAFSegment, (void **)&seg));
// Create a concrete subclass of MobSlot
checkResult(defs.cdStaticMobSlot()->
CreateInstance(IID_IAAFMobSlot,
(IUnknown **)&newSlot));
checkResult(newSlot->SetSegment(seg));
checkResult(newSlot->SetSlotID(test+1));
checkResult(newSlot->SetPhysicalNum(test+2));
checkResult(newSlot->SetName(slotNames[test]));
checkResult(pMob->AppendSlot (newSlot));
newSlot->Release();
newSlot = NULL;
seg->Release();
seg = NULL;
sclp->Release();
sclp = NULL;
}
// Add the mob to the file.
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (newSlot)
newSlot->Release();
if (seg)
seg->Release();
if (sclp)
sclp->Release();
if (pComp)
pComp->Release();
//.........这里部分代码省略.........
示例3: CreateAAFFile
//.........这里部分代码省略.........
slotNames[test],
0,
NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
pMob->RemoveSlotAt(4);
checkExpression(pMob->RemoveSlotAt(test+1) == AAFRESULT_BADINDEX,
AAFRESULT_TEST_FAILED);
}
newSlot->Release();
newSlot = NULL;
if(newStaticSlot)
newStaticSlot->Release();
newStaticSlot = NULL;
seg->Release();
seg = NULL;
sclp->Release();
sclp = NULL;
pComponent->Release();
pComponent = NULL;
pSourceRef->Release();
pSourceRef = NULL;
}
// PrependSlot
checkResult(defs.cdStaticMobSlot()->
CreateInstance(IID_IAAFMobSlot,
(IUnknown **)&mSlot));
checkResult(defs.cdFiller()->
CreateInstance(IID_IAAFFiller,
(IUnknown **)&filler));
checkResult(filler->Initialize(defs.ddkAAFSound(), 10));
checkResult(filler->QueryInterface (IID_IAAFSegment, (void **)&seg));
checkResult(mSlot->SetName(slotNames[0]));
checkResult(mSlot->SetPhysicalNum(1));
checkResult(mSlot->SetSlotID(1));
checkResult(mSlot->SetSegment(seg));
checkResult(pMob->PrependSlot(mSlot));
checkExpression(pMob->PrependSlot(mSlot) == AAFRESULT_OBJECT_ALREADY_ATTACHED,
AAFRESULT_TEST_FAILED);
checkExpression(pMob->PrependSlot(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
mSlot->Release();
mSlot = NULL;
seg->Release();
seg = NULL;
filler->Release();
filler = NULL;
// AppendSlot
checkResult(defs.cdStaticMobSlot()->
CreateInstance(IID_IAAFMobSlot,
(IUnknown **)&mSlot));