Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// Purpose: Creates and insterts a new keyframe into the sequence
// Input  : newPos - 
//			newAngles - 
// Output : CPathKeyFrame
//-----------------------------------------------------------------------------
CPathKeyFrame *CPathKeyFrame::InsertNewKey( Vector newPos, QAngle newAngles )
{
	CPathKeyFrame *newKey = CREATE_ENTITY( CPathKeyFrame, "keyframe_track" ); 

	// copy data across
	newKey->SetKeyAngles( newAngles );
	newKey->m_Origin = newPos;
	newKey->m_flSpeed = m_flSpeed;
	newKey->SetEFlags( GetEFlags() );
	if ( m_iParent != NULL_STRING )
	{
		newKey->SetParent( m_iParent, NULL );
	}

	// link forward
	newKey->m_pNextKey = m_pNextKey;
	m_pNextKey->m_pPrevKey = newKey;

	// link back
	m_pNextKey = newKey;
	newKey->m_pPrevKey = this;

	// calculate new times
	CalculateFrameDuration();
	newKey->CalculateFrameDuration();

	return newKey;
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
// Purpose: Adds the keyframe into the path after all the other keys have spawned
//-----------------------------------------------------------------------------
void CPathKeyFrame::Activate( void )
{
	BaseClass::Activate();
	
	Link();

	CalculateFrameDuration();
}
// ---------------------------------------------------------------------------
// This method is for setting the sender up. 
// ---------------------------------------------------------------------------
//
void CBTAudioStreamSender::StartL(TUint aOutboundMTUSize, const TUint aFrameLength, const TUint aTargetBitrate)
    {
    BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender::StartL() ->")));
    if(iCurrentSendPacket) 
        {
        __ASSERT_DEBUG(!iCurrentSendPacket->IsOpen(),User::Invariant());
        }
    TInt requiredPacketLength = CalculatePacketLength(aOutboundMTUSize, aFrameLength); 

    if(requiredPacketLength > 0) 
        {
		__ASSERT_DEBUG(iCurrentSendPacket, User::Invariant());
        *iCurrentSendPacket = iSendSrc.NewSendPacketL(requiredPacketLength); 
        iTargetBitrate = aTargetBitrate; 
        InitSender(*iCurrentSendPacket, iPayloadDesC, iTargetBitrate); 
        iStreamerState = EBuffering; 
        BT_AUDIO_STREAMER_TRACE_OPT( KPRINTSTATE, FLOG(_L("[BTAudioStreamer]\t State changed to: EBuffering")));
      }
    else 
        {
        BT_AUDIO_STREAMER_TRACE_OPT( KPRINTSTATE, FLOG(_L("[BTAudioStreamer]\t Error! Packet length must be greater than zero!")));
        User::Leave(KErrArgument); 
        }

    // Streaming started, optimise the ACL link if optimiser service is available. 
    if(iLinkOptimiserAvailable)
        {
        // The below code is to get the connected device's BT Address.
        TBTSockAddr addr; 
        iRtpSession.RtpSocket()->RemoteName(addr); 
        TUint accessLatency = MaxFramesPerPacket() * CalculateFrameDuration(aFrameLength, aTargetBitrate); 
        // Not checking the return code, because it doesn't matter if it fails. 
        iA2DPOptimiser.OptimiseAclForAudioStreaming(addr.BTAddr(), aTargetBitrate, accessLatency);
        }
    BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender::StartL() <-")));
    }