本文整理汇总了C++中CAAFBuiltinDefs::cdMasterMob方法的典型用法代码示例。如果您正苦于以下问题:C++ CAAFBuiltinDefs::cdMasterMob方法的具体用法?C++ CAAFBuiltinDefs::cdMasterMob怎么用?C++ CAAFBuiltinDefs::cdMasterMob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAAFBuiltinDefs
的用法示例。
在下文中一共展示了CAAFBuiltinDefs::cdMasterMob方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
// IAAFSession * pSession = NULL;
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFSourceMob *pSourceMob = NULL;
IAAFMob *pMob = NULL;
IAAFEssenceDescriptor *edesc = 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
// Create a FileMob
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
checkResult(pSourceMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_File_MobID));
checkResult(pMob->SetName(L"File Mob"));
// Check the Mob2 usage code implementations.
// Need IAAFMob2 for to do that.
{
IAAFSmartPointer<IAAFMob2> pMobInterface2;
checkResult( pMob->QueryInterface( IID_IAAFMob2, reinterpret_cast<void**>(&pMobInterface2) ) );
checkResult( pMobInterface2->SetUsageCode( kAAFUsage_Template ) );
}
// Create a concrete subclass of FileDescriptor
checkResult(defs.cdAIFCDescriptor()->
CreateInstance(IID_IAAFEssenceDescriptor,
(IUnknown **)&edesc));
IAAFAIFCDescriptor* pAIFCDesc = NULL;
checkResult(edesc->QueryInterface (IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
checkResult(pAIFCDesc->SetSummary (5, (unsigned char*)"TEST"));
pAIFCDesc->Release();
pAIFCDesc = NULL;
checkResult(pSourceMob->SetEssenceDescriptor (edesc));
checkResult(pHeader->AddMob(pMob));
// Reusing local variable so we need to release the inteface.
pMob->Release();
pMob = NULL;
// Create a MasterMob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_Master_MobID));
checkResult(pMob->SetName(L"Master Mob"));
// Check the Mob2 usage code implementations.
// Need IAAFMob2 for to do that.
{
IAAFSmartPointer<IAAFMob2> pMobInterface2;
checkResult( pMob->QueryInterface( IID_IAAFMob2, reinterpret_cast<void**>(&pMobInterface2) ) );
checkResult( pMobInterface2->SetUsageCode( kAAFUsage_Template ) );
}
checkResult(pHeader->AddMob(pMob));
// Reusing local variable so we need to release the inteface.
pMob->Release();
pMob = NULL;
// Create a CompositionMob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
//.........这里部分代码省略.........
示例2: 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;
bool bFileOpen = false;
HRESULT hr = AAFRESULT_SUCCESS;
IAAFComponent* pComponent = NULL;
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"AAFSourceClipTest::ReferencedMob"));
// Create a Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"AAFSourceClipTest"));
// Create a SourceClip
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSegment,
(IUnknown **)&seg));
checkResult(seg->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
pComponent->Release();
pComponent = NULL;
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
1,
slotName,
0,
&newSlot));
checkResult(pHeader->AddMob(pMob));
checkResult(pHeader->AddMob(pReferencedMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (newSlot)
newSlot->Release();
if (pComponent)
pComponent->Release();
if (seg)
seg->Release();
if (pMob)
pMob->Release();
if (pReferencedMob)
pReferencedMob->Release();
if (pDictionary)
pDictionary->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{
if (bFileOpen)
{
pFile->Save();
//.........这里部分代码省略.........
示例3: 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;
}
//.........这里部分代码省略.........
示例4: 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;
IAAFMasterMob* pMasterMob = NULL;
IAAFSourceMob* pSrcMob = NULL;
IAAFSourceMob* pTapeMob = NULL;
IAAFEssenceDescriptor* pDesc = NULL;
IAAFMob* pTempMob = NULL;
HRESULT hr = S_OK;
long test;
aafSourceRef_t ref;
IAAFEssenceDescriptor* pEssDesc = NULL;
IAAFTapeDescriptor* pTapeDesc = NULL;
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the AAF file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
// Create a Master Mob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
// Set the IAAFMob properties
checkResult(pMob->SetMobID(TEST_Master_MobID));
checkResult(pMob->SetName(MobName));
checkResult(pMob->QueryInterface(IID_IAAFMasterMob, (void **) &pMasterMob));
// Create source mob to associate with our MasterMob.
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pTapeMob));
hr = defs.cdTapeDescriptor()->
CreateInstance(IID_IAAFTapeDescriptor,
(IUnknown **)&pTapeDesc);
if (AAFRESULT_SUCCESS == hr)
{
hr = pTapeDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pEssDesc);
if (AAFRESULT_SUCCESS == hr)
{
hr = pTapeMob->SetEssenceDescriptor(pEssDesc);
if (AAFRESULT_SUCCESS == hr)
{
hr = pTapeDesc->SetTapeManufacturer( Manufacturer );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetTapeModel( Model );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetTapeFormFactor( FormFactor );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetSignalType( VideoSignalType );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetTapeFormat( TapeFormat );
if (AAFRESULT_SUCCESS == hr )
hr = pTapeDesc->SetTapeLength( TapeLength );
}
}
}
}
}
pEssDesc->Release();
pEssDesc = NULL;
}
pTapeDesc->Release();
pTapeDesc = NULL;
}
for (test = 0; test < NumMobSlots; test++)
{
IAAFDataDefSP pDataDef;
checkResult (pDictionary->LookupDataDef (*slotDDefs[test], &pDataDef));
checkResult(pTapeMob->AddNilReference (test, TAPE_MOB_LENGTH_ARR[test], pDataDef, slotRates[test]));
}
checkResult(pTapeMob->QueryInterface(IID_IAAFMob, (void **) &pTempMob));
//.........这里部分代码省略.........
示例5: 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();
//.........这里部分代码省略.........
示例6: 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()
示例7: 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 *pMob2 = NULL;
IAAFMob2 *pMobInterface2 = NULL;
IAAFTimelineMobSlot *newSlot = NULL;
IAAFStaticMobSlot *newStaticSlot=NULL;
IAAFEventMobSlot *newEventSlot=NULL;
IAAFSegment *seg = NULL;
IAAFSourceClip *sclp = NULL;
IAAFEvent *event=NULL;
IAAFComponent* pComponent = NULL;
IAAFClassDef *pcdEventMeta=NULL;
IAAFClassDef *pcdEvent=NULL;
IAAFClassDef *pcdEventConcrete=NULL;
HRESULT hr = S_OK;
aafNumSlots_t numMobs;
aafUInt32 bufLen = 0;
aafUInt32 bytesRead = 0;
aafUInt32 numComments = 0;
aafUInt32 numFound = 0;
aafWChar name[500];
aafWChar value[500];
IEnumAAFTaggedValues *enumTaggedVal = NULL;
IAAFTaggedValue *taggedVal = NULL;
IAAFMobSlot *mSlot = NULL;
IAAFFiller *filler = NULL;
IAAFKLVData *pKLVData = NULL;
IAAFTypeDef* pBaseType = NULL;
IAAFSourceReference *pSourceRef = NULL;
IAAFTimecode *pTimecode = NULL;
aafTimecode_t timecode;
int i;
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->QueryInterface(IID_IAAFMob2,(void**)&pMobInterface2));
checkResult(pMob->SetMobID(MOBTestID));
checkExpression(pMob->GetNameBufLen(&bufLen) == AAFRESULT_PROP_NOT_PRESENT, AAFRESULT_TEST_FAILED);
checkExpression(pMob->GetName(name, 0) == AAFRESULT_PROP_NOT_PRESENT, AAFRESULT_TEST_FAILED);
checkExpression(pMob->SetName(NULL) == AAFRESULT_NULL_PARAM, AAFRESULT_TEST_FAILED);
checkResult(pMob->SetName(mobName));
checkResult(pMob->SetCreateTime(creationTimeStamp));
checkResult(pMob->SetModTime(modificationTimeStamp));
// Add some slots
for(test = 1; test < 6; test++)
{
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&sclp));
checkResult(sclp->QueryInterface(IID_IAAFSourceReference, (void **)&pSourceRef));
checkResult(pSourceRef->SetSourceID(MOBTestID3));
checkResult(sclp->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
checkResult(sclp->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
test+1,
slotNames[test],
0,
&newSlot));
//.........这里部分代码省略.........
示例8: 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)
//.........这里部分代码省略.........
示例9: 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,
//.........这里部分代码省略.........