mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/RecordDataFormat.cpp
branchRCL_3
changeset 50 999b2818a0eb
parent 46 0ac9a5310753
equal deleted inserted replaced
46:0ac9a5310753 50:999b2818a0eb
   120 
   120 
   121 	CleanupStack::PushL(selfObj);
   121 	CleanupStack::PushL(selfObj);
   122 
   122 
   123 	CActiveScheduler::Start();
   123 	CActiveScheduler::Start();
   124 
   124 
   125 	if (error == KErrNone)
   125 	if (selfObj->callbackErr != KErrNone)
   126 	{
   126 	{
   127 		error = selfObj->callbackErr;
   127 		error = selfObj->callbackErr;
   128 	}
   128 	}
   129 
   129 
   130 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
   130 	CleanupStack::PopAndDestroy(2); // schedule, selfObj
   158 	TInt err = KErrNone;
   158 	TInt err = KErrNone;
   159 	logger->Log(_L("MoscoStateChangeEvent called, error: %d	prev: %d curr : %d"),aErrorCode,aPreviousState,aCurrentState);
   159 	logger->Log(_L("MoscoStateChangeEvent called, error: %d	prev: %d curr : %d"),aErrorCode,aPreviousState,aCurrentState);
   160 
   160 
   161 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
   161 	if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0)
   162 	{
   162 	{
   163 
       
   164 		if (dataFormat == KFormatWav)
   163 		if (dataFormat == KFormatWav)
   165 		{
   164 		{
   166 			logger->Log(_L("SetDestinationFormatL(KMmfUidFormatWAVWrite)"));
   165 			logger->Log(_L("SetDestinationFormatL(KMmfUidFormatWAVWrite)"));
   167 			TUid id;
   166 			TUid id;
   168 			id.iUid = KMmfUidFormatWAVWrite;
   167 			id.iUid = KMmfUidFormatWAVWrite;
   172 				logger->Log(_L("SetDestinationFormatL(%d) failed with error %d"),KMmfUidFormatWAVWrite, err);
   171 				logger->Log(_L("SetDestinationFormatL(%d) failed with error %d"),KMmfUidFormatWAVWrite, err);
   173 				callbackErr = err;
   172 				callbackErr = err;
   174 				CActiveScheduler::Stop();
   173 				CActiveScheduler::Stop();
   175 				return;
   174 				return;
   176 			}
   175 			}
   177 
       
   178 			if (recorder->DestinationFormatL() != id)
   176 			if (recorder->DestinationFormatL() != id)
   179 			{
   177 			{
   180 				logger->Log(_L("Retrieved format is not same as set format") );
   178 				logger->Log(_L("Retrieved format is not same as set format") );
   181 				callbackErr = KErrOutOfRange;
   179 				callbackErr = KErrOutOfRange;
   182 			}
   180 			}
   183 
       
   184 		}
   181 		}
   185 		else
   182 		else
   186 		{
   183 		{
   187 			// Only WAV use format object
   184 			// Only WAV use format object
   188 			logger->Log(_L("Invalid input dataFormat - %S"), &dataFormat);
   185 			logger->Log(_L("Invalid input dataFormat - %S"), &dataFormat);
   207 					callbackErr = KErrOutOfRange;
   204 					callbackErr = KErrOutOfRange;
   208 				}
   205 				}
   209 			}*/
   206 			}*/
   210 		}
   207 		}
   211 	}
   208 	}
       
   209 	if (aErrorCode != KErrNone)
       
   210 	    {
       
   211         callbackErr = aErrorCode;	    
       
   212 	    }
   212 
   213 
   213 	CActiveScheduler::Stop();
   214 	CActiveScheduler::Stop();
   214 	return;
   215 	return;
   215 
   216 
   216 }
   217 }