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


C++ ISound::GetTimeLeft方法代码示例

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


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

示例1: Handle

void MusicPlayer::Handle(ProcessEventArg arg) {
    if (!playlist.empty() && !stalled) {

        ISound* currentSound = playlist.at(current);

//         logger.info << "time left: " << 
//             currentSound->GetTimeLeft().ToString() << logger.end;

        if(currentSound->GetTimeLeft() <= tran->GetInTime()) {
            if (switchToNextNumber == false) Next();
            switchToNextNumber = true;
        }

        if (switchToNextNumber) {
            tran->InitFade(currentSound,
                           playlist.at(nextTrackNumber));
            tran->Start();
            current = nextTrackNumber;
            switchToNextNumber = false;
        }

        if (!tran->IsDone()) {
            tran->Process();
        }

        /*
        Vector<3, float> pos = cam->GetPosition();

        //set the position of the current
        if (monoreftype && (typeid(*currentsound).name() ==  
                            typeid(*monoreftype).name())) {
        IMonoSound* cursound = (IMonoSound*) currentsound;
		cursound->SetPosition(pos);
        }
        else {
            IStereoSound* cursound = (IStereoSound*) currentsound;
            IMonoSound* left = cursound->GetLeft();
            IMonoSound* right = cursound->GetRight();
            pos[0] = pos[0] - 1;
            left->SetPosition(pos);
            pos[0] = pos[0] + 1;
            right->SetPosition(pos);
        }
        //set the position of the old if initialize
        if (monoreftype && (typeid(*previoussound).name() ==
                            typeid(*monoreftype).name())) {
            IMonoSound* presound = (IMonoSound*) previoussound;
            presound->SetPosition(pos);
        } 
        else {
            IStereoSound* presound = (IStereoSound*) previoussound;
            IMonoSound* left = presound->GetLeft();
            IMonoSound* right = presound->GetRight();
            pos[0] = pos[0] - 1;
            left->SetPosition(pos);
            pos[0] = pos[0] + 1;
            right->SetPosition(pos);
        }
        */
    }
}
开发者ID:OpenEngineDK,项目名称:extensions-MusicPlayer,代码行数:61,代码来源:MusicPlayer.cpp


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