mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CustomCommandAsync.cpp
branchRCL_3
changeset 21 999b2818a0eb
parent 20 0ac9a5310753
equal deleted inserted replaced
20:0ac9a5310753 21:999b2818a0eb
    26 
    26 
    27 CCustomCommandAsync::CCustomCommandAsync(CTestModuleIf *aConsole, CStifLogger *aLogger)
    27 CCustomCommandAsync::CCustomCommandAsync(CTestModuleIf *aConsole, CStifLogger *aLogger)
    28 {
    28 {
    29 	console = aConsole;
    29 	console = aConsole;
    30 	logger = aLogger;
    30 	logger = aLogger;
       
    31 	iCallBackErr = KErrNone;
    31 
    32 
    32 }
    33 }
    33 
    34 
    34 CCustomCommandAsync::~CCustomCommandAsync()
    35 CCustomCommandAsync::~CCustomCommandAsync()
    35 {
    36 {
   106 
   107 
   107 	CleanupStack::PushL(selfObj);
   108 	CleanupStack::PushL(selfObj);
   108 
   109 
   109 	CActiveScheduler::Start();
   110 	CActiveScheduler::Start();
   110 
   111 
   111 
   112 	if(selfObj->iCallBackErr != KErrNone)
       
   113 	        {
       
   114 	        error = selfObj->iCallBackErr;
       
   115 	        }
   112 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
   116 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
   113 
   117 
   114 	return error;
   118 	return error;
   115 }
   119 }
   116 
   120 
   135 void CCustomCommandAsync::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   139 void CCustomCommandAsync::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   136 {
   140 {
   137 #ifdef _DEBUG
   141 #ifdef _DEBUG
   138     RDebug::Print (_L ("CCustomCommandAsync::MoscoStateChangeEvent"));
   142     RDebug::Print (_L ("CCustomCommandAsync::MoscoStateChangeEvent"));
   139 #endif
   143 #endif
   140 	TInt err = KErrNone;
   144 	
   141 
   145 
   142 	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);
   143 
   147 
   144 
   148 	iCallBackErr = aErrorCode;
   145 
       
   146 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
   149 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
   147 	{
   150 	{
   148 		TBuf8<25> dataFrom;
   151 		TBuf8<25> dataFrom;
   149 
   152 
   150  	   	TRequestStatus status;
   153  	   	TRequestStatus status;
   202 
   205 
   203 		recorder->WillResumePlay();
   206 		recorder->WillResumePlay();
   204 		CActiveScheduler::Stop();
   207 		CActiveScheduler::Stop();
   205 	}
   208 	}
   206 
   209 
       
   210     if (aErrorCode != KErrNone)
       
   211     {
       
   212     
       
   213     CActiveScheduler::Stop();
       
   214     
       
   215     }
   207 	return;
   216 	return;
   208 
   217 
   209 }
   218 }
   210 
   219 
   211 void CCustomCommandAsync::MaloLoadingStarted()
   220 void CCustomCommandAsync::MaloLoadingStarted()