/**
 *
 * TestPlayData
 * @result TVerdict
 *
 */
TVerdict CTestStepSDevSoundPlayDataCap::TestPlayData()
{
    ResetCallbacks();

    iAL->InitialiseActiveListener();

    iMMFDevSound->PlayData();
    // Start the active scheduler and catch the callback
    CActiveScheduler::Start();

    if (iCallbackArray[EBuffToFill] != 1)
    {
        if (iCallbackArray[EBuffToFill] == 0 && iCallbackArray[EPlayError] == 1)
        {
            INFO_PRINTF1(_L("DevSound PlayError was called 1 time.  Must be EOF."));
        }
        else
        {
            ERR_PRINTF2 (_L("DevSound BufferToBeFilled was called %d times, expected 1"), iCallbackArray[EBuffToFill]);
            return EFail;
        }
    }

    TInt tot = GetCallbackTotal();
    if (tot > 2)
    {
        ERR_PRINTF2 (_L("DevSound called %d callbacks, expected 1"), tot);
        return EFail;
    }
    return EPass;
}
/**
 *
 * TestPlayInit
 * @result TVerdict
 *
 */
TVerdict CTestStepSDevSoundPlayDataCap::TestPlayInit()
{
    ResetCallbacks();

    iAL->InitialiseActiveListener();

    //get buffer from devsound
    TRAPD(err, iMMFDevSound->PlayInitL());
    // Start the active scheduler and catch the callback
    CActiveScheduler::Start();
    if (err)
    {
        WARN_PRINTF2 (_L("DevSound PlayInitL left with error = %d"), err);
        return EFail;
    }
    else
    {
        if (iCallbackArray[EBuffToFill] != 1)
        {
            ERR_PRINTF2 (_L("DevSound BufferToBeFilled was called %d times, expected 1"), iCallbackArray[EBuffToFill]);
            return EFail;
        }
        TInt tot = GetCallbackTotal();
        if (tot > 1)
        {
            ERR_PRINTF2 (_L("DevSound called %d callbacks, expected 1"), tot);
            return EFail;
        }
    }
    return EPass;
}
/**
 *
 * TestInitialize
 * @param aDataType
 * @param aMode
 * @result TVerdict
 *
 */
TVerdict CTestStepSDevSoundPlayDataCap::TestInitialize(TMMFState aMode)
{
    TFourCC pcm16(KMMFFourCCCodePCM16); //default to pcm16 data type

    iCallbackError = KErrNone;
    iExpectedValue = KErrNone;

    ResetCallbacks();
    iAL->InitialiseActiveListener();

    INFO_PRINTF1(_L("Initializing DevSound"));
    // Initialize
    TRAPD(err, iMMFDevSound->InitializeL(*this, pcm16, aMode));
    if (err)
    {
        WARN_PRINTF2 (_L("DevSound InitializeL left with error = %d"), err);
        return EInconclusive;
    }
    else
    {
        CActiveScheduler::Start();
        if (iCallbackError != iExpectedValue)
        {
            ERR_PRINTF3 (_L("DevSound InitializeComplete returned %d, expected %d"), iCallbackError, iExpectedValue);
            return EFail;
        }
        if (iCallbackArray[EInitComplete] != 1)
        {
            ERR_PRINTF2 (_L("DevSound InitializeComplete was called %d times, expected 1"), iCallbackArray[EInitComplete]);
            return EFail;
        }
    }
    return EPass;
}
Example #4
0
void CActor::attach_Vehicle(CHolderCustom* vehicle)
{
	if(!vehicle) return;

	if(m_holder) return;
	PickupModeOff		();
	m_holder=vehicle;

	CKinematicsAnimated* V		= smart_cast<CKinematicsAnimated*>(Visual()); R_ASSERT(V);
	
	if(!m_holder->attach_Actor(this)){
		m_holder=NULL;
		return;
	}
	// temp play animation
	CCar*	car						= smart_cast<CCar*>(m_holder);
	u16 anim_type					= car->DriverAnimationType();
	SVehicleAnimCollection& anims	= m_vehicle_anims->m_vehicles_type_collections[anim_type];
	V->PlayCycle					(anims.idles[0],FALSE);

	ResetCallbacks					();
	u16 head_bone					= V->LL_BoneID("bip01_head");
	V->LL_GetBoneInstance			(u16(head_bone)).set_callback		(bctPhysics, VehicleHeadCallback,this);

	character_physics_support		()->movement()->DestroyCharacter();
	mstate_wishful					= 0;
	m_holderID=car->ID				();

	SetWeaponHideState				(INV_STATE_CAR, true);

	CStepManager::on_animation_start(MotionID(), 0);
}
/**
 *
 * TestPlayTone
 * @param aFreq
 * @param aDur
 * @result TVerdict
 *
 */
TVerdict CSecDevSndTS0036::TestPlayTone(TInt aFreq, TTimeIntervalMicroSeconds aDur)
	{
	iCallbackError = KErrNone;

	ResetCallbacks();

	TRAPD(err, iMMFDevSound->PlayToneL(aFreq, aDur));
	if (err)
		{
		iCallbackError = err;
		return EFail;
		}
	else
		{
		// Start the active scheduler and catch the callback
 		CActiveScheduler::Start();
		if (iCallbackError != iExpectedValue)
			{
			return EFail;
			}
		if (iCallbackArray[EToneFinished] != 1)
			{
			return EFail;
			}
		TInt tot = GetCallbackTotal();
		if (tot > 1)
			{
			return EFail;
			}
		}
	return EPass;
	}
TInt CTestStepSDevSoundClientThreadNoCap::TestPlayTone(TInt aFreq, TTimeIntervalMicroSeconds aDur)
{
    iCallbackError = KErrNone;
    ResetCallbacks();

    INFO_PRINTF1(_L("Playing Simple Tone"));
    TRAPD(err, iMMFDevSound->PlayToneL(aFreq, aDur));
    if (err)
    {
        WARN_PRINTF2 (_L("DevSound PlayToneL left with error = %d"), err);
        iCallbackError = err;
    }
    return err;
}