2608 if (err != KErrNone) |
2608 if (err != KErrNone) |
2609 { |
2609 { |
2610 ERR_PRINTF2(_L("Could not Open the File: Error = %d"), err); |
2610 ERR_PRINTF2(_L("Could not Open the File: Error = %d"), err); |
2611 StopTest(err); |
2611 StopTest(err); |
2612 } |
2612 } |
2613 iPlayState = EStatePlayStart; |
2613 iPlayState = EStatePlayInitializing; |
2614 Fsm(EEventPlayStart, KErrNone); |
2614 Fsm(EEventInitCompletePlay, KErrNone); |
2615 } |
2615 } |
2616 else |
2616 else |
2617 { |
2617 { |
2618 INFO_PRINTF2(_L("Finished playing %d number of times."), iRepeatCounter); |
2618 INFO_PRINTF2(_L("Finished playing %d number of times."), iRepeatCounter); |
2619 StopTest(KErrNone); |
2619 StopTest(KErrNone); |
2623 { |
2623 { |
2624 StopTest(aError, EFail); |
2624 StopTest(aError, EFail); |
2625 } |
2625 } |
2626 |
2626 |
2627 } |
2627 } |
2628 |
|
2629 /* |
|
2630 * |
|
2631 * InitializeComplete |
|
2632 * |
|
2633 */ |
|
2634 void RStepA3FDevSoundPlayEOFPlayMultipleTimes::InitializeComplete(TInt aError) |
|
2635 { |
|
2636 INFO_PRINTF2(_L("Initialize returned with = %d"), aError); |
|
2637 if (aError == KErrNone) |
|
2638 { |
|
2639 TTimeIntervalMicroSeconds time; |
|
2640 TInt err = iMMFDevSound->GetTimePlayed(time); |
|
2641 if (err != KErrNone) |
|
2642 { |
|
2643 INFO_PRINTF2(_L("CMMFDevSound::GetTimePlayed unexpectedly returned %d - abort test"), err); |
|
2644 StopTest(err, EFail); |
|
2645 return; |
|
2646 } |
|
2647 |
|
2648 // checking low 32bits should be enough - sample played should never exceed 4000-ish seconds |
|
2649 INFO_PRINTF2(_L("Time played is %d after Play-Initialisation"), I64LOW(time.Int64())); |
|
2650 if (I64LOW(time.Int64()) != 0) |
|
2651 { |
|
2652 INFO_PRINTF1(_L("Time played is not 0 after Play-Initialisation - abort test")); |
|
2653 StopTest(KErrNone, EFail); |
|
2654 return; |
|
2655 } |
|
2656 |
|
2657 TInt samples = iMMFDevSound->SamplesPlayed(); |
|
2658 INFO_PRINTF2(_L("Sample played is %d after Play-Initialisation"), samples); |
|
2659 if (samples != 0) |
|
2660 { |
|
2661 INFO_PRINTF1(_L("Sample played is not 0 after Play-Initialisation - abort test")); |
|
2662 StopTest(KErrNone, EFail); |
|
2663 return; |
|
2664 } |
|
2665 |
|
2666 // This is to trigger iMMFDevSound->PlayInitL as next step in the base Fsm |
|
2667 iPlayState = EStatePlayInitializing; |
|
2668 Fsm(EEventInitCompletePlay, KErrNone); |
|
2669 } |
|
2670 } |
|
2671 |
|
2672 |
2628 |
2673 // |
2629 // |
2674 // RStepA3FDevSoundInititalizeDuringInitialize |
2630 // RStepA3FDevSoundInititalizeDuringInitialize |
2675 // |
2631 // |
2676 |
2632 |