mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CropFromBeginning.cpp
branchRCL_3
changeset 20 0ac9a5310753
parent 19 095bea5f582e
child 21 999b2818a0eb
equal deleted inserted replaced
19:095bea5f582e 20:0ac9a5310753
   105 
   105 
   106 	CleanupStack::PushL(selfObj);
   106 	CleanupStack::PushL(selfObj);
   107 
   107 
   108 	CActiveScheduler::Start();
   108 	CActiveScheduler::Start();
   109 
   109 
   110 	if (selfObj->callbackErr != KErrNone)
   110 	if (error == KErrNone)
   111 	{
   111 	{
   112 		error = selfObj->callbackErr;
   112 		error = selfObj->callbackErr;
   113 	}
   113 	}
   114 
   114 
   115 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
   115 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
   138 void CCropFromBeginning::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   138 void CCropFromBeginning::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   139 {
   139 {
   140 #ifdef _DEBUG
   140 #ifdef _DEBUG
   141     RDebug::Print (_L ("CCropFromBeginning::MoscoStateChangeEvent"));
   141     RDebug::Print (_L ("CCropFromBeginning::MoscoStateChangeEvent"));
   142 #endif
   142 #endif
   143 
   143 	TInt err = KErrNone;
   144 	callbackErr = aErrorCode;
   144 //	callbackErr = KErrNone;
   145 
   145 
   146 	logger->Log(_L("MoscoStateChangeEvent called, error: %d	prev: %d curr : %d"),aErrorCode,aPreviousState,aCurrentState);
   146 	logger->Log(_L("MoscoStateChangeEvent called, error: %d	prev: %d curr : %d"),aErrorCode,aPreviousState,aCurrentState);
   147 
   147 
   148     TInt aState = recorder->State();
   148     TInt aState = recorder->State();
   149     logger->Log(_L("Current State %d"), aState);
   149     logger->Log(_L("Current State %d"), aState);
   183 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == CMdaAudioClipUtility::EPlaying)
   183 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == CMdaAudioClipUtility::EPlaying)
   184 	{
   184 	{
   185 
   185 
   186 		CActiveScheduler::Stop();
   186 		CActiveScheduler::Stop();
   187 	}
   187 	}
   188 	if (aErrorCode != KErrNone)
       
   189 	        {
       
   190 
       
   191 	        CActiveScheduler::Stop();
       
   192 	        
       
   193 	        }
       
   194 
   188 
   195 
   189 
   196 	return;
   190 	return;
   197 
   191 
   198 }
   192 }