当前位置: 首页>>代码示例>>C++>>正文


C++ CAAFBuiltinDefs::cdOperationDef方法代码示例

本文整理汇总了C++中CAAFBuiltinDefs::cdOperationDef方法的典型用法代码示例。如果您正苦于以下问题:C++ CAAFBuiltinDefs::cdOperationDef方法的具体用法?C++ CAAFBuiltinDefs::cdOperationDef怎么用?C++ CAAFBuiltinDefs::cdOperationDef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAAFBuiltinDefs的用法示例。


在下文中一共展示了CAAFBuiltinDefs::cdOperationDef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
	IAAFCompositionMob*			pCompMob=NULL;
	IAAFMob*					pMob = NULL;
	IAAFTimelineMobSlot*		pNewSlot = NULL;
	IAAFSourceClip*				pSourceClip = NULL;
	IAAFSourceReference*		pSourceRef = NULL;
	IAAFTransition*				pTransition = NULL;
	IAAFOperationGroup*			pOperationGroup = NULL;
	IAAFSegment*				pSegment = NULL;
	IAAFSegment*				pEffectFiller = NULL;
	IAAFComponent*				pComponent = NULL;
	IAAFFiller*					pFiller = NULL;
	IAAFSequence*				pSequence = NULL;
	IAAFOperationDef*				pOperationDef = NULL;
	IAAFParameter				*pParm = NULL;
	IAAFParameterDef*			pParamDef = NULL;
	IAAFConstantValue*			pConstantValue = NULL;
	
	HRESULT						hr = S_OK;
	aafLength_t					transitionLength;
	aafPosition_t				cutPoint = 0;
	aafLength_t					effectLen = TEST_EFFECT_LEN;
	aafUID_t					effectID = kTestEffectID;
	aafUID_t					parmID = kTestParmID;

	transitionLength = 100;

	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);
 		
		// Create the effect and parameter definitions
		checkResult(defs.cdOperationDef()->
					CreateInstance(IID_IAAFOperationDef, 
								   (IUnknown **)&pOperationDef));
    
		checkResult(defs.cdParameterDef()->
					CreateInstance(IID_IAAFParameterDef, 
								   (IUnknown **)&pParamDef));

		checkResult(pOperationDef->Initialize (effectID, TEST_EFFECT_NAME, TEST_EFFECT_DESC));
		checkResult(pDictionary->RegisterOperationDef(pOperationDef));
		checkResult(pParamDef->Initialize (parmID, TEST_PARAM_NAME, TEST_PARAM_DESC, defs.tdRational ()));
		checkResult(pParamDef->SetDisplayUnits(TEST_PARAM_UNITS));
		checkResult(pDictionary->RegisterParameterDef(pParamDef));


		checkResult(pOperationDef->SetDataDef (defs.ddkAAFPicture()));
		checkResult(pOperationDef->SetIsTimeWarp (kAAFFalse));
		checkResult(pOperationDef->SetNumberInputs (TEST_NUM_INPUTS));
		checkResult(pOperationDef->SetCategory (TEST_CATEGORY));
		checkResult(pOperationDef->AddParameterDef (pParamDef));
		checkResult(pOperationDef->SetBypass (TEST_BYPASS));


		// ------------------------------------------------------------
		//	To test a Transition we need to create a Sequence which will 
		//	a Filler, a transition and another Filler. I know this is not 
		//  very interesting, but it will let us test the Transition 
		//  interface with the least amount of other stuff.
		// ------------------------------------------------------------
		//
		// Create a CompositionMob
		checkResult(defs.cdCompositionMob()->
					CreateInstance(IID_IAAFCompositionMob, 
								   (IUnknown **)&pCompMob));

		checkResult(pCompMob->Initialize(L"Transition Test"));
		// Get a MOB interface
		checkResult(pCompMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
		checkResult(pMob->SetMobID(TEST_MobID));

		// Create a Sequence
		checkResult(defs.cdSequence()->
					CreateInstance(IID_IAAFSequence,
								   (IUnknown **) &pSequence));

		// Get a Segment interface
//.........这里部分代码省略.........
开发者ID:UIKit0,项目名称:aaf,代码行数:101,代码来源:CAAFTransitionTest.cpp

示例2: CreateAAFFile

static HRESULT CreateAAFFile(
    aafWChar * pFileName,
    aafUID_constref fileKind,
    testRawStorageType_t rawStorageType,
    aafProductIdentification_constref productID)
{
	IAAFFile*			pFile = NULL;
	IAAFHeader *        pHeader = NULL;
	IAAFDictionary*		pDictionary = NULL;
	IAAFOperationDef*		pOperationDef = NULL;
	IAAFParameterDef*	pParamDef = NULL;
	IAAFDefObject*		pDefObject = NULL;
	IAAFOperationGroup			*pOperationGroup = NULL;
	IAAFMob				*pMob = NULL;
	IAAFSegment			*pSeg = NULL;
	IAAFTimelineMobSlot	*pSlot = NULL;
	IAAFParameter		*pParm = NULL;
	IAAFVaryingValue		*pVaryingValue = NULL;
	IAAFSegment			*pFiller = NULL;
	IAAFComponent		*pComponent = NULL;
	IAAFSourceClip		 *pSourceClip = NULL;
	IAAFControlPoint	 *pControlPoint = NULL;
	IAAFSourceReference *pSourceRef = NULL;
	IAAFInterpolationDef *pInterpDef = NULL;
	IAAFPluginManager	*pMgr = NULL;
	IAAFTypeDef			*pTypeDef = NULL;
	bool				bFileOpen = false;
	HRESULT				hr = S_OK;
//	aafUID_t			testInterpDef = kAAFTypeID_Rational;
	aafLength_t			effectLen = TEST_EFFECT_LEN;
	aafUID_t			effectID = kTestEffectID;
	aafUID_t			parmID = kTestParmID;
	aafRational_t		testLevel1 = kTestLevel1;
	aafRational_t		testLevel2 = kTestLevel2;
	aafRational_t		testTime1 = kTestTime1;
	aafRational_t		testTime2 = kTestTime2;
/*	long				test;
*/

	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);

		checkResult(defs.cdOperationDef()->
					CreateInstance(IID_IAAFOperationDef, 
								   (IUnknown **)&pOperationDef));
    
		checkResult(defs.cdParameterDef()->
					CreateInstance(IID_IAAFParameterDef, 
								   (IUnknown **)&pParamDef));

 		checkResult(pDictionary->LookupTypeDef (kAAFTypeID_Rational, &pTypeDef));
    checkResult(pParamDef->Initialize (parmID, TEST_PARAM_NAME, TEST_PARAM_DESC, pTypeDef));

		checkResult(AAFGetPluginManager(&pMgr));
		checkResult(pMgr->CreatePluginDefinition(LinearInterpolator, pDictionary, &pDefObject));
		checkResult(pDefObject->QueryInterface(IID_IAAFInterpolationDef, (void **) &pInterpDef));
		pDefObject->Release();
		pDefObject = NULL;

		checkResult(pOperationDef->Initialize (effectID, TEST_EFFECT_NAME, TEST_EFFECT_DESC));
		checkResult(pDictionary->RegisterOperationDef (pOperationDef));
		checkResult(pDictionary->RegisterParameterDef (pParamDef));
		checkResult(pDictionary->RegisterInterpolationDef (pInterpDef));


		checkResult(pOperationDef->SetDataDef (defs.ddkAAFPicture()));
		checkResult(pOperationDef->SetIsTimeWarp (kAAFFalse));
		checkResult(pOperationDef->SetNumberInputs (TEST_NUM_INPUTS));
		checkResult(pOperationDef->SetCategory (TEST_CATEGORY));
		checkResult(pOperationDef->AddParameterDef (pParamDef));
		checkResult(pOperationDef->SetBypass (TEST_BYPASS));

		checkResult(pParamDef->SetDisplayUnits(TEST_PARAM_UNITS));

		//Make the first mob
		long	test;
		aafRational_t	videoRate = { 2997, 100 };
		// Create a Mob
		checkResult(defs.cdCompositionMob()->
					CreateInstance(IID_IAAFMob, 
								   (IUnknown **)&pMob));

		checkResult(pMob->SetName(L"AAFOperationGroupTest"));
	  
		// Add some slots
//.........这里部分代码省略.........
开发者ID:mcanthony,项目名称:aaf,代码行数:101,代码来源:CAAFControlPointTest.cpp

示例3: CreateAAFFile

static HRESULT CreateAAFFile(
    aafWChar * pFileName,
    aafUID_constref fileKind,
    testRawStorageType_t rawStorageType,
    aafProductIdentification_constref productID)
{
	IAAFFile*			pFile = NULL;
	IAAFHeader *        pHeader = NULL;
	IAAFDictionary*		pDictionary = NULL;
	IAAFParameterDef*	pParamDef = NULL;
	bool				bFileOpen = false;
	HRESULT				hr = S_OK;
	aafUID_t			testParmID = kParmID;
	aafInt32			index;
	IAAFOperationDef	*pOperationDef = NULL, *defResults[3] = { NULL, NULL, NULL };

/*	long				test;
*/

	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);
    
 		checkResult(defs.cdParameterDef()->
					CreateInstance(IID_IAAFParameterDef, 
								   (IUnknown **)&pParamDef));
		checkResult(pParamDef->Initialize (testParmID, TEST_PARAM_NAME, TEST_PARAM_DESC, defs.tdRational()));
		checkResult(pDictionary->RegisterParameterDef(pParamDef));

		for(index = 0; index < 3; index++)
		{
			checkResult(defs.cdOperationDef()->
						CreateInstance(IID_IAAFOperationDef, 
									   (IUnknown **)&pOperationDef));
			checkResult(pOperationDef->Initialize (effectID[index], effectNames[index], effectDesc[index]));
			checkResult(pDictionary->RegisterOperationDef(pOperationDef));
			
			
			checkResult(pOperationDef->SetDataDef (defs.ddkAAFPicture()));
			checkResult(pOperationDef->SetIsTimeWarp (kAAFFalse));
			checkResult(pOperationDef->SetNumberInputs (TEST_NUM_INPUTS));
			checkResult(pOperationDef->SetCategory (TEST_CATEGORY));
			checkResult(pOperationDef->AddParameterDef (pParamDef));
			checkResult(pOperationDef->SetBypass (TEST_BYPASS));
			
			defResults[index] = pOperationDef;
			pOperationDef = NULL;
		}

		checkResult(defResults[1]->AppendDegradeToOperation (defResults[1]));
		checkResult(defResults[2]->AppendDegradeToOperation (defResults[2]));
		checkResult(defResults[0]->AppendDegradeToOperation (defResults[1]));
		checkResult(defResults[0]->PrependDegradeToOperation (defResults[2]));
		// Add an extra one to delete for the test
//!!!		checkResult(defResults[0]->CountDegradeToOperations(&numDegrade));
//		checkExpression(2 == numDegrade, AAFRESULT_TEST_FAILED);
//		checkResult(defResults[0]->AppendDegradeToOperation (defResults[1]));
//		checkResult(defResults[0]->CountDegradeToOperations(&numDegrade));
//		checkExpression(3 == numDegrade, AAFRESULT_TEST_FAILED);
//		checkResult(defResults[0]->RemoveDegradeToOperationAt (2));
//		checkResult(defResults[0]->CountDegradeToOperations(&numDegrade));
//		checkExpression(2 == numDegrade, AAFRESULT_TEST_FAILED);

		for(index = 0; index < 3; index++)
		{
			defResults[index]->Release();
			defResults[index] = NULL;
		}
	}
	catch (HRESULT& rResult)
	{
		hr = rResult;
	}


	// Cleanup and return
	if (pOperationDef)
		pOperationDef->Release();

	if (pParamDef)
		pParamDef->Release();

	if (pDictionary)
		pDictionary->Release();

	if (pHeader)
		pHeader->Release();
      
//.........这里部分代码省略.........
开发者ID:UIKit0,项目名称:aaf,代码行数:101,代码来源:CAAFOperationDefTest.cpp

示例4: RegisterDefs

static HRESULT RegisterDefs (IAAFDictionary * pDict)
{
  assert (pDict);

  CAAFBuiltinDefs defs (pDict);

  
//  IAAFTypeDefSP pTypeUInt8;
//  checkResult(pDict->LookupTypeDef(kAAFTypeID_UInt8, &pTypeUInt8));
  { // Create an opaque type and register it in the dictionary.
    IAAFTypeDefSP pOpaqueType;
    IAAFTypeDefRenameSP pOpaqueTestType;
	  checkResult(pDict->CreateMetaInstance(AUID_AAFTypeDefRename, IID_IAAFTypeDefRename, (IUnknown **)&pOpaqueTestType));
    checkResult(pOpaqueTestType->Initialize(kTestTypeID, defs.tdUInt8(), L"TestUInt8"));
    checkResult(pOpaqueTestType->QueryInterface(IID_IAAFTypeDef, (void **)&pOpaqueType));
    checkResult(pDict->RegisterOpaqueTypeDef(pOpaqueType));
  }

  RegisterOneMetaDef (/* dictionary*/      pDict,
				  /* def object's class id */      AUID_AAFTypeDefRename,
				  /* IID of def to pass to Init */ IID_IAAFTypeDefRename,
				  /* SP of def to use with Init */ IAAFTypeDefRenameSP,
				  /* Init() invocation */
				  Initialize (kTestTypeID, defs.tdUInt8(), L"TestUInt8"),
				  /* IID of type to QI */          IID_IAAFMetaDefinition,
				  /* SP for type to QI */          IAAFMetaDefinitionSP,
				  /* IID of def to register */     IID_IAAFTypeDef,
				  /* SP for def to register */     IAAFTypeDefSP,
				  /* reg method on pDict */        RegisterTypeDef);

  { // Make sure that "TestUInt8" is no longer opaque.
    IAAFTypeDefSP pOpaqueTestType;
    checkExpression(FAILED(pDict->LookupOpaqueTypeDef(kTestTypeID, &pOpaqueTestType)),
                    AAFRESULT_TEST_FAILED);
  }

    
  RegisterOneDef (/* dictionary*/                  pDict,
				  /* def object's class */         defs.cdDataDef(),
				  /* IID of def to pass to Init */ IID_IAAFDataDef,
				  /* SP of def to use with Init */ IAAFDataDefSP,
				  /* Init() invocation */
				  Initialize (kTestDataDefID, L"TestDataDef", L"Desc"),
				  /* IID of type to QI */          IID_IAAFDefObject,
				  /* SP for type to QI */          IAAFDefObjectSP,
				  /* IID of def to register */     IID_IAAFDataDef,
				  /* SP for def to register */     IAAFDataDefSP,
				  /* reg method on pDict */        RegisterDataDef);
  
  RegisterOneDef (/* dictionary*/                  pDict,
				  /* def object's class */         defs.cdOperationDef(),
				  /* IID of def to pass to Init */ IID_IAAFOperationDef,
				  /* SP of def to use with Init */ IAAFOperationDefSP,
				  /* Init() invocation */
				  Initialize (kTestOperationDefID, L"TestOperationDef", L"Desc"),
				  /* IID of type to QI */          IID_IAAFDefObject,
				  /* SP for type to QI */          IAAFDefObjectSP,
				  /* IID of def to register */     IID_IAAFOperationDef,
				  /* SP for def to register */     IAAFOperationDefSP,
				  /* reg method on pDict */        RegisterOperationDef);

  // Hack!
  {
	IAAFOperationDefSP od;
	checkResult (pDict->LookupOperationDef (kTestOperationDefID,
										    &od));
	checkResult (od->SetDataDef (defs.ddkAAFMatte()));
  }  
  
  RegisterOneDef (/* dictionary*/                  pDict,
				  /* def object's class */         defs.cdParameterDef(),
				  /* IID of def to pass to Init */ IID_IAAFParameterDef,
				  /* SP of def to use with Init */ IAAFParameterDefSP,
				  /* Init() invocation */
				  Initialize (kTestParameterDefID, L"TestParameterDef", L"Desc", defs.tdRational()),
				  /* IID of type to QI */          IID_IAAFDefObject,
				  /* SP for type to QI */          IAAFDefObjectSP,
				  /* IID of def to register */     IID_IAAFParameterDef,
				  /* SP for def to register */     IAAFParameterDefSP,
				  /* reg method on pDict */        RegisterParameterDef);

				  RegisterOneDef (/* dictionary*/                  pDict,
				  /* def object's class */         defs.cdCodecDef(),
				  /* IID of def to pass to Init */ IID_IAAFCodecDef,
				  /* SP of def to use with Init */ IAAFCodecDefSP,
				  /* Init() invocation */
				  Initialize (kTestCodecDefID, L"TestCodecDef", L"Desc"),
				  /* IID of type to QI */          IID_IAAFDefObject,
				  /* SP for type to QI */          IAAFDefObjectSP,
				  /* IID of def to register */     IID_IAAFCodecDef,
				  /* SP for def to register */     IAAFCodecDefSP,
				  /* reg method on pDict */        RegisterCodecDef);

  // Hack! Codec defs must have at least one data def appended in
  // order to be saved correctly...
  {
	IAAFCodecDefSP cd;
	IAAFClassDefSP pClassDef;
	checkResult (pDict->LookupCodecDef (kTestCodecDefID,
										&cd));
//.........这里部分代码省略.........
开发者ID:mcanthony,项目名称:aaf,代码行数:101,代码来源:CAAFDictionaryTest.cpp


注:本文中的CAAFBuiltinDefs::cdOperationDef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。