mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CropFromBeginning.cpp
branchRCL_3
changeset 21 999b2818a0eb
parent 20 0ac9a5310753
equal deleted inserted replaced
20:0ac9a5310753 21:999b2818a0eb
   105 
   105 
   106 	CleanupStack::PushL(selfObj);
   106 	CleanupStack::PushL(selfObj);
   107 
   107 
   108 	CActiveScheduler::Start();
   108 	CActiveScheduler::Start();
   109 
   109 
   110 	if (error == KErrNone)
   110 	if (selfObj->callbackErr != 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 	TInt err = KErrNone;
   143 
   144 //	callbackErr = KErrNone;
   144 	callbackErr = aErrorCode;
   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 	        }
   188 
   194 
   189 
   195 
   190 	return;
   196 	return;
   191 
   197 
   192 }
   198 }