mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CustomCommand.cpp
changeset 47 c2e43643db4c
parent 0 71ca22bcf22a
child 46 0ac9a5310753
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CustomCommand.cpp	Wed Aug 18 10:17:22 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CustomCommand.cpp	Thu Sep 02 20:58:01 2010 +0300
@@ -28,7 +28,7 @@
 {
 	console = aConsole;
 	logger = aLogger;
-
+	iCallBackErr = KErrNone;
 }
 
 CCustomCommand::~CCustomCommand()
@@ -107,8 +107,12 @@
 	CleanupStack::PushL(selfObj);
 
 	CActiveScheduler::Start();
-
-
+	
+	if(selfObj->iCallBackErr != KErrNone)
+	    {
+        error = selfObj->iCallBackErr;
+	    }
+	
 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
 
 	return error;
@@ -137,13 +141,16 @@
 #ifdef _DEBUG
     RDebug::Print (_L ("CCustomCommand::MoscoStateChangeEvent"));
 #endif
-	TInt err = KErrNone;
+	
 
 	logger->Log(_L("MoscoStateChangeEvent called, error: %d	prev: %d curr : %d"),aErrorCode,aPreviousState,aCurrentState);
-
+	
+	iCallBackErr = aErrorCode;
+	
 	TUint bitRate = recorder->SourceBitRateL();
 	logger->Log(_L("SourceBitRateL %d "),bitRate);
-
+	
+	
 
 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
 	{
@@ -237,6 +244,12 @@
 		recorder->WillResumePlay();
 		CActiveScheduler::Stop();
 	}
+	if(aErrorCode != KErrNone)
+	        {
+	            
+	            CActiveScheduler::Stop();
+	            
+	        }
 
 	return;