mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CustomCommand.cpp
branchRCL_3
changeset 50 999b2818a0eb
parent 46 0ac9a5310753
equal deleted inserted replaced
46:0ac9a5310753 50:999b2818a0eb
    26 
    26 
    27 CCustomCommand::CCustomCommand(CTestModuleIf *aConsole, CStifLogger *aLogger)
    27 CCustomCommand::CCustomCommand(CTestModuleIf *aConsole, CStifLogger *aLogger)
    28 {
    28 {
    29 	console = aConsole;
    29 	console = aConsole;
    30 	logger = aLogger;
    30 	logger = aLogger;
    31 
    31 	iCallBackErr = KErrNone;
    32 }
    32 }
    33 
    33 
    34 CCustomCommand::~CCustomCommand()
    34 CCustomCommand::~CCustomCommand()
    35 {
    35 {
    36 
    36 
   105 
   105 
   106 
   106 
   107 	CleanupStack::PushL(selfObj);
   107 	CleanupStack::PushL(selfObj);
   108 
   108 
   109 	CActiveScheduler::Start();
   109 	CActiveScheduler::Start();
   110 
   110 	
   111 
   111 	if(selfObj->iCallBackErr != KErrNone)
       
   112 	    {
       
   113         error = selfObj->iCallBackErr;
       
   114 	    }
       
   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 CCustomCommand::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   139 void CCustomCommand::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
   136 {
   140 {
   137 #ifdef _DEBUG
   141 #ifdef _DEBUG
   138     RDebug::Print (_L ("CCustomCommand::MoscoStateChangeEvent"));
   142     RDebug::Print (_L ("CCustomCommand::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 	
       
   148 	iCallBackErr = aErrorCode;
       
   149 	
   144 	TUint bitRate = recorder->SourceBitRateL();
   150 	TUint bitRate = recorder->SourceBitRateL();
   145 	logger->Log(_L("SourceBitRateL %d "),bitRate);
   151 	logger->Log(_L("SourceBitRateL %d "),bitRate);
   146 
   152 	
       
   153 	
   147 
   154 
   148 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
   155 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
   149 	{
   156 	{
   150 		TBuf8<25> dataFrom;
   157 		TBuf8<25> dataFrom;
   151 
   158 
   235         logger->Log(_L("MMMFDRMCustomCommand is successful."));
   242         logger->Log(_L("MMMFDRMCustomCommand is successful."));
   236 
   243 
   237 		recorder->WillResumePlay();
   244 		recorder->WillResumePlay();
   238 		CActiveScheduler::Stop();
   245 		CActiveScheduler::Stop();
   239 	}
   246 	}
       
   247 	if(aErrorCode != KErrNone)
       
   248 	        {
       
   249 	            
       
   250 	            CActiveScheduler::Stop();
       
   251 	            
       
   252 	        }
   240 
   253 
   241 	return;
   254 	return;
   242 
   255 
   243 }
   256 }
   244 
   257