本文整理汇总了C++中CChoreoEvent::GetCloseCaptionType方法的典型用法代码示例。如果您正苦于以下问题:C++ CChoreoEvent::GetCloseCaptionType方法的具体用法?C++ CChoreoEvent::GetCloseCaptionType怎么用?C++ CChoreoEvent::GetCloseCaptionType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChoreoEvent
的用法示例。
在下文中一共展示了CChoreoEvent::GetCloseCaptionType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSortedCombinedEventList
bool CChoreoChannel::GetSortedCombinedEventList( char const *cctoken, CUtlRBTree< CChoreoEvent * >& events )
{
events.RemoveAll();
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;
if ( e->GetCloseCaptionType() == CChoreoEvent::CC_DISABLED )
continue;
// A master with no slaves is not a combined event
if ( e->GetCloseCaptionType() == CChoreoEvent::CC_MASTER &&
e->GetNumSlaves() == 0 )
continue;
char const *token = e->GetCloseCaptionToken();
if ( Q_stricmp( token, cctoken ) )
continue;
events.Insert( e );
}
return ( events.Count() > 0 ) ? true : false;
}
示例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() );
//.........这里部分代码省略.........