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


C++ CChoreoEvent::GetEndTime方法代码示例

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


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

示例1: EventCollidesWithRows

static bool EventCollidesWithRows( CUtlLinkedList< CChoreoEvent*, int >& list, CChoreoEvent *event, char *trackName, size_t trackNameLength )
{
    float st = event->GetStartTime();
    float ed = event->GetEndTime();

    for ( int i = list.Head(); i != list.InvalidIndex(); i = list.Next( i ) )
    {
        CChoreoEvent *test = list[ i ];

        float teststart = test->GetStartTime();
        float testend = test->GetEndTime();

        // See if spans overlap
        if ( teststart >= ed )
            continue;
        if ( testend <= st )
            continue;

        // Now see if they deal with the same flex controller
        int tc = event->GetNumFlexAnimationTracks();
        for ( int track = 0; track < tc; ++track )
        {
            CFlexAnimationTrack *t = event->GetFlexAnimationTrack( track );
            if ( !t->IsTrackActive() )
            {
                continue;
            }

            int sampleCountNormal = t->GetNumSamples( 0 );
            int sampleCountBalance = 0;
            if ( t->IsComboType() )
            {
                sampleCountBalance = t->GetNumSamples( 1 );
            }

            if ( !sampleCountNormal && !sampleCountBalance )
                continue;

            // Otherwise, see if the test track has this as an active track
            if ( IsFlexTrackBeingUsed( test, t->GetFlexControllerName() ) )
            {
                Q_strncpy( trackName, t->GetFlexControllerName(), trackNameLength );
                return true;
            }
        }
        return false;
    }

    return false;
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:50,代码来源:vcd_sound_check.cpp

示例2: ReconcileCloseCaption

// Compute master/slave, count, endtime info for close captioning data
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CChoreoChannel::ReconcileCloseCaption()
{
	// Create a dictionary based on the combined token name
	CUtlDict< EventGroup, int > validSpeakEventsGroupedByName;

	int i;
	// Sort items
	int c = GetNumEvents();
	for ( i = 0; i < c; i++ )
	{
		CChoreoEvent *e = GetEvent( i );
		Assert( e );
		if ( e->GetType() != CChoreoEvent::SPEAK )
			continue;

		CChoreoEvent::CLOSECAPTION type;

		type = e->GetCloseCaptionType();
		if ( type == CChoreoEvent::CC_DISABLED )
		{
			e->SetUsingCombinedFile( false );
			e->SetRequiredCombinedChecksum( 0 );
			e->SetNumSlaves( 0 );
			e->SetLastSlaveEndTime( 0.0f );
			continue;
		}

		char const *name = e->GetCloseCaptionToken();
		if ( !name || !name[0] )
		{
			// Fixup invalid slave tag
			if ( type == CChoreoEvent::CC_SLAVE )
			{
				e->SetCloseCaptionType( CChoreoEvent::CC_MASTER );
				e->SetUsingCombinedFile( false );
				e->SetRequiredCombinedChecksum( 0 );
				e->SetNumSlaves( 0 );
				e->SetLastSlaveEndTime( 0.0f );
			}
			continue;
		}
	
		int idx = validSpeakEventsGroupedByName.Find( name );
		if ( idx == validSpeakEventsGroupedByName.InvalidIndex() )
		{
			EventGroup eg;
			eg.timeSortedEvents.Insert( e );
			validSpeakEventsGroupedByName.Insert( name, eg );
		}
		else
		{
			EventGroup & eg = validSpeakEventsGroupedByName[ idx ];
			eg.timeSortedEvents.Insert( e );
		}
	}

	c = validSpeakEventsGroupedByName.Count();
	// Now walk list of events by group
	if ( !c )
	{
		return;
	}

	for ( i = 0; i < c; ++i )
	{
		EventGroup & eg = validSpeakEventsGroupedByName[ i ];
		int sortedEventInGroup = eg.timeSortedEvents.Count();
		// If there's only one, just mark it valid
		if ( sortedEventInGroup <= 1 )
		{
			CChoreoEvent *e = eg.timeSortedEvents[ 0 ];
			Assert( e );
			// Make sure it's the master
			e->SetCloseCaptionType( CChoreoEvent::CC_MASTER );
			// Since it's by itself, can't be using "combined" file
			e->SetUsingCombinedFile( false );
			e->SetRequiredCombinedChecksum( 0 );
			e->SetNumSlaves( 0 );
			e->SetLastSlaveEndTime( 0.0f );
			continue;
		}

		// Okay, read them back in of start time
		int j = eg.timeSortedEvents.FirstInorder();
		CChoreoEvent *master = NULL;
		while ( j != eg.timeSortedEvents.InvalidIndex() )
		{
			CChoreoEvent *e = eg.timeSortedEvents[ j ];
			if ( !master )
			{
				master = e;
				e->SetCloseCaptionType( CChoreoEvent::CC_MASTER );
				//e->SetUsingCombinedFile( true );
				e->SetRequiredCombinedChecksum( 0 );
				e->SetNumSlaves( sortedEventInGroup - 1 );
				e->SetLastSlaveEndTime( e->GetEndTime() );
//.........这里部分代码省略.........
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:101,代码来源:choreochannel.cpp


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