mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/CustomCommand.cpp
equal
deleted
inserted
replaced
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 iCallBackErr = KErrNone; |
31 |
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 if(selfObj->iCallBackErr != KErrNone) |
111 |
112 { |
|
113 error = selfObj->iCallBackErr; |
|
114 } |
|
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 CCustomCommand::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode) |
135 void CCustomCommand::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode) |
140 { |
136 { |
141 #ifdef _DEBUG |
137 #ifdef _DEBUG |
142 RDebug::Print (_L ("CCustomCommand::MoscoStateChangeEvent")); |
138 RDebug::Print (_L ("CCustomCommand::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; |
|
149 |
|
150 TUint bitRate = recorder->SourceBitRateL(); |
144 TUint bitRate = recorder->SourceBitRateL(); |
151 logger->Log(_L("SourceBitRateL %d "),bitRate); |
145 logger->Log(_L("SourceBitRateL %d "),bitRate); |
152 |
146 |
153 |
|
154 |
147 |
155 if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0) |
148 if (recorder && aErrorCode == KErrNone && aCurrentState == CMdaAudioClipUtility::EOpen && aPreviousState == 0) |
156 { |
149 { |
157 TBuf8<25> dataFrom; |
150 TBuf8<25> dataFrom; |
158 |
151 |
242 logger->Log(_L("MMMFDRMCustomCommand is successful.")); |
235 logger->Log(_L("MMMFDRMCustomCommand is successful.")); |
243 |
236 |
244 recorder->WillResumePlay(); |
237 recorder->WillResumePlay(); |
245 CActiveScheduler::Stop(); |
238 CActiveScheduler::Stop(); |
246 } |
239 } |
247 if(aErrorCode != KErrNone) |
|
248 { |
|
249 |
|
250 CActiveScheduler::Stop(); |
|
251 |
|
252 } |
|
253 |
240 |
254 return; |
241 return; |
255 |
242 |
256 } |
243 } |
257 |
244 |