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


C++ TimeRange::getInternalStartTime方法代码示例

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


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

示例1: switch

void
PlayerSceneCreate::configureNode(SceneNodePtr node, const PlayerItemPtr item, const TimeRange &time_range)
{
    // Set screen rectangle for node
    const ScreenRect &rect = item->getScreenRect();
    if (rect.isFullScreen())
        node->setFullScreenRect();
    else {
        float x1,y1,x2,y2;
        rect.getExtents(x1, y1, x2, y2);
        node->setScreenRect(x1, y1, x2, y2);
    }

    // Pivot point is center of rotation and scaling
    float pivotX = 0, pivotY = 0, pivotZ = 0;
    compute_pivot(item, pivotX, pivotY, pivotZ);
    node->setPivot(pivotX, pivotY, pivotZ);

    // Static Transformation
    float sx = 1, sy = 1, sz = 1;
    item->getScale(sx, sy, sz);
    node->setScale(sx, sy, sz);
    float posx = 0, posy = 0, posz = 0;
    item->getPosition(posx, posy, posz);
    node->setPosition(posx, posy, posz);

    // Switching to euler angles for 3d rotation
    //node->setRotationInDegrees(item->getRotationInDegrees());
    float rx = 0, ry = 0, rz = 0;
    item->getEulerAnglesInDegrees(rx, ry, rz);
    node->setEulerAnglesInDegrees(rx, ry, rz);

    // Set rule for how to fit image into aspect ratio of screen
    ContentMode contentMode = item->getContentMode();
    set_node_resize_fit(node.get(), contentMode);

    // And set the gravity enumeration
    Gravity gravity = item->getGravity();
    set_node_gravity(node.get(), gravity);

    // Cropping region, default of "no crop" is (0,0,1,1)
    float cx = 0, cy = 0, cw = 1, ch = 1;
    item->getCroppingRegion(cx, cy, cw, ch);
    node->setCroppingRegion(cx, cy, cw, ch);

    // Focus of subregion when aspect fitting subregions
    float fx = 0.5f, fy = 0.3333f;
    item->getFocusCenter(fx, fy);
    node->setFocusCenter(fx, fy);

    // Frame preserves size when image resizes
    const FrameInfo &framing = item->getFraming();
    if (framing.hasFraming()) {
        BorderWidths frame_size, frame_uvs;
        framing.getFrameSize(frame_size.left, frame_size.right, frame_size.top, frame_size.bottom);
        framing.getFrameUVs(frame_uvs.left, frame_uvs.right, frame_uvs.top, frame_uvs.bottom);
        node->setFrameBorder(frame_size, frame_uvs);
    }

    // Blend mode enumeration
    BlendMode blendMode = item->getBlendMode();
    set_node_blend_mode(node.get(), blendMode);

    // Set zorder, when static
    node->setZOrder(item->getZOrder());

    // Set static opacity
    node->setOpacity(item->getOpacity());

    // This controls when videos start playing.
    // NOTE: if the transition expands the visible time, should the
    // video be playing during this time? Right now, it is set
    // so that the video holds the first or last frame during the
    // extra transition time.
    //
    mf::Time playbackStartOffset = time_range.getItemStartTime()+Time::Seconds(item->getPlaybackStart());
    node->setLocalTimeOffset(playbackStartOffset);

    //NOTE This isn't the way I want to keep track of local time. I want it to
    // be handled by the Preloader later.
    if (node->getAsset() != NULL)
        node->getAsset()->setLocalTimeOffset(playbackStartOffset);

    // Create keys for the animation for this item, if it exists
    const AnimationPtr animation = item->getAnimation();
    if (animation) {
        Time anim_begin, anim_end;
        switch(animation->getTiming()) {
        default:
        case Animation::INNER_TIME_RANGE:
            // Internal time range is the time when the item is visible and
            // is not running part of the transition animation.
            anim_begin = time_range.getInternalStartTime();
            anim_end = time_range.getInternalEndTime();
            break;
        case Animation::ITEM_TIMING:
            anim_begin = time_range.getItemStartTime();
            anim_end = time_range.getItemEndTime();
            break;
        case Animation::OUTER_TIME_RANGE:
//.........这里部分代码省略.........
开发者ID:CaringLabs,项目名称:MediaFramework,代码行数:101,代码来源:PlayerSceneCreate.cpp


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