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


C++ VideoStream::setAnimation方法代码示例

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


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

示例1: execute

bool VideoImporter::execute(PlugInArgList *pInArgList, PlugInArgList *pOutArgList)
{
   if(pInArgList == NULL)
   {
      return false;
   }
   // Create a message log step
   mProgress = ProgressTracker(pInArgList->getPlugInArgValue<Progress>(ProgressArg()),
      "Execute video importer", "coan", "{6385aa93-ff7f-4ee7-9308-b3476aca544b}");

   DataElement* pElmnt = pInArgList->getPlugInArgValue<DataElement>(ImportElementArg());
   mpRasterElement = dynamic_cast<RasterElement*>(pElmnt);
   mpStreamElement = dynamic_cast<Any*>(pElmnt);
   if (mpRasterElement == NULL && mpStreamElement == NULL)
   {
      mProgress.report("The data element input value is invalid.", 0, ERRORS, true);
      return false;
   }

   if (mpRasterElement != NULL)
   {
      mProgress.report("Initialize display.", 1, NORMAL);
      if (!mpRasterElement->createDefaultPager())
      {
         //return checkAbortOrError("Could not allocate resources for new RasterElement", pStep.get());
         return false;
      }
      // schedule load of first frame
      Any* pParent = dynamic_cast<Any*>(mpRasterElement->getParent());
      VERIFY(pParent != NULL);
      VideoStream* pStream = dynamic_cast<VideoStream*>(pParent->getData());
      VERIFY(pStream != NULL);
      if (!pStream->setDisplay(mpRasterElement))
      {
         mProgress.report("Unable to display the stream.", 0, ERRORS, true);
         return false;
      }

      // Create the view
      if(!isBatch() && !Service<SessionManager>()->isSessionLoading())
      {
         SpatialDataView *pView = createView();
         if(pView == NULL)
         {
            mProgress.report("The view could not be created.", 0, ERRORS, true);
            return false;
         }

         // Add the view to the output arg list
         if(pOutArgList != NULL)
         {
            pOutArgList->setPlugInArgValue("View", pView);
         }
      }
      mProgress.report("Display initialization complete.", 100, NORMAL);
   }
   else if (mpStreamElement != NULL)
   {
      mProgress.report("Initialize video stream.", 1, NORMAL);
      // initialize the stream data
      VideoStream* pStream = NULL;
      std::vector<PlugIn*> instances = Service<PlugInManagerServices>()->getPlugInInstances("Video Stream Manager");
      StreamManager* pStreamManager = instances.empty() ? NULL : dynamic_cast<StreamManager*>(instances.front());
      if (pStreamManager != NULL)
      {
         if (pStreamManager->initializeStream(mpStreamElement))
         {
            pStream = dynamic_cast<VideoStream*>(mpStreamElement->getData());
         }
      }
      if (pStream == NULL)
      {
         mProgress.report("Unable to initialize the video stream.", 0, ERRORS, true);
         return false;
      }
      
      // create animation
      AnimationController* pController = Service<AnimationServices>()->getAnimationController(mpStreamElement->getName());
      if (pController == NULL)
      {
         pController = Service<AnimationServices>()->createAnimationController(mpStreamElement->getName(), FRAME_TIME);
      }
      if (pController == NULL)
      {
         mProgress.report("Unable to create animation.", 0, ERRORS, true);
         return false;
      }
      if (!isBatch())
      {
         AnimationToolBar* pToolBar = static_cast<AnimationToolBar*>(Service<DesktopServices>()->getWindow("Animation", TOOLBAR));
         VERIFY(pToolBar);
         pToolBar->setAnimationController(pController);
      }
      Animation* pAnim = pController->createAnimation(mpStreamElement->getName());
      VERIFY(pAnim != NULL);
      if (!pStream->setAnimation(pAnim, pController))
      {
         mProgress.report("Unable to create animation.", 0, ERRORS, true);
         return false;
      }
//.........这里部分代码省略.........
开发者ID:Siddharthk,项目名称:coan,代码行数:101,代码来源:VideoImporter.cpp


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