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