devsound/a3fintegrationtest/src/tsi_a3f_devsound_play.cpp
branchRCL_3
changeset 50 948c7f65f6d4
parent 49 735348f59235
child 65 af86cc8a4692
--- a/devsound/a3fintegrationtest/src/tsi_a3f_devsound_play.cpp	Tue Aug 31 16:43:06 2010 +0300
+++ b/devsound/a3fintegrationtest/src/tsi_a3f_devsound_play.cpp	Wed Sep 01 12:38:50 2010 +0100
@@ -2610,8 +2610,8 @@
 				ERR_PRINTF2(_L("Could not Open the File: Error = %d"), err);
 				StopTest(err);
 				}
-			iPlayState = EStatePlayInitializing;
-			Fsm(EEventInitCompletePlay, KErrNone);
+            iPlayState = EStatePlayStart;
+            Fsm(EEventPlayStart, KErrNone);
 			}
 		else
 			{
@@ -2626,6 +2626,50 @@
 
 	}
 
+/*
+ *
+ * InitializeComplete
+ *
+ */
+void RStepA3FDevSoundPlayEOFPlayMultipleTimes::InitializeComplete(TInt aError)
+    {
+    INFO_PRINTF2(_L("Initialize returned with = %d"), aError);
+    if (aError == KErrNone)
+        {
+        TTimeIntervalMicroSeconds time;
+        TInt err = iMMFDevSound->GetTimePlayed(time);
+        if (err != KErrNone)
+            {
+            INFO_PRINTF2(_L("CMMFDevSound::GetTimePlayed unexpectedly returned %d - abort test"), err);
+            StopTest(err, EFail);
+            return;
+            }
+        
+        // checking low 32bits should be enough - sample played should never exceed 4000-ish seconds
+        INFO_PRINTF2(_L("Time played is %d after Play-Initialisation"), I64LOW(time.Int64()));
+        if (I64LOW(time.Int64()) != 0)
+            {
+            INFO_PRINTF1(_L("Time played is not 0 after Play-Initialisation - abort test"));
+            StopTest(KErrNone, EFail);
+            return;
+            }
+        
+        TInt samples = iMMFDevSound->SamplesPlayed();
+        INFO_PRINTF2(_L("Sample played is %d after Play-Initialisation"), samples);
+        if (samples != 0)
+            {
+            INFO_PRINTF1(_L("Sample played is not 0 after Play-Initialisation - abort test"));
+            StopTest(KErrNone, EFail);
+            return;
+            }
+        
+        // This is to trigger iMMFDevSound->PlayInitL as next step in the base Fsm
+        iPlayState = EStatePlayInitializing;
+        Fsm(EEventInitCompletePlay, KErrNone);
+        }
+    }
+
+
 //
 // RStepA3FDevSoundInititalizeDuringInitialize
 //