equal
deleted
inserted
replaced
231 { |
231 { |
232 TRAP_IGNORE( iErrorUI->ShowGlobalErrorNoteL( iMediaServerError ) ); |
232 TRAP_IGNORE( iErrorUI->ShowGlobalErrorNoteL( iMediaServerError ) ); |
233 } |
233 } |
234 |
234 |
235 } |
235 } |
236 StopAndNotify(); |
236 if(iMediaServerError == KErrInUse && aPreviousState == CMdaAudioClipUtility::EPlaying) |
|
237 { |
|
238 CVRRecViewModel* iViewModel = NULL; |
|
239 iViewModel = dynamic_cast <CVRRecViewModel*>(iAutoStopObserver); |
|
240 if(iViewModel != NULL) |
|
241 { |
|
242 iViewModel->HandleCommandL(ECmdPause); |
|
243 } |
|
244 return; |
|
245 } |
|
246 else |
|
247 { |
|
248 StopAndNotify(); |
|
249 } |
237 } |
250 } |
238 |
251 |
239 //it will happen when the openfile fails |
252 //it will happen when the openfile fails |
240 if (aPreviousState == CMdaAudioClipUtility::ENotReady && aCurrentState == CMdaAudioClipUtility::ENotReady ) |
253 if (aPreviousState == CMdaAudioClipUtility::ENotReady && aCurrentState == CMdaAudioClipUtility::ENotReady ) |
241 { |
254 { |
980 { |
993 { |
981 __ASSERT_DEBUG( iIsAttachedToMemo, User::Panic( KVRPanic, |
994 __ASSERT_DEBUG( iIsAttachedToMemo, User::Panic( KVRPanic, |
982 EPanicNotAttached ) ); |
995 EPanicNotAttached ) ); |
983 |
996 |
984 iPause = ETrue; |
997 iPause = ETrue; |
985 iPosition = iAudioRecorder->Position(); |
|
986 |
998 |
987 #ifdef _DEBUG |
999 #ifdef _DEBUG |
988 RDebug::Print( _L("VoiceRecorder: Pause called. Position: %d:%d"), |
1000 RDebug::Print( _L("VoiceRecorder: Pause called. Position: %d:%d"), |
989 I64HIGH( iPosition.Int64() ), I64LOW( iPosition.Int64() ) ); |
1001 I64HIGH( iPosition.Int64() ), I64LOW( iPosition.Int64() ) ); |
990 #endif |
1002 #endif |
1286 // |
1298 // |
1287 // --------------------------------------------------------------------------- |
1299 // --------------------------------------------------------------------------- |
1288 // |
1300 // |
1289 void CVRMdaRecorder::SyncAndNotify() |
1301 void CVRMdaRecorder::SyncAndNotify() |
1290 { |
1302 { |
1291 if (iPause) |
1303 if(!iPause) |
1292 { |
1304 { |
1293 iMemo->SetPosition( iPosition ); |
1305 iPosition = iAudioRecorder->Position(); |
1294 } |
1306 } |
1295 // Not sure if iPosition value is valid other than when paused, so do as |
1307 iMemo->SetPosition( iPosition ); |
1296 // previous for all other states: |
|
1297 else |
|
1298 { |
|
1299 iMemo->SetPosition( iAudioRecorder->Position() ); |
|
1300 } |
|
1301 |
1308 |
1302 iMemo->SetDuration( iAudioRecorder->Duration() ); |
1309 iMemo->SetDuration( iAudioRecorder->Duration() ); |
1303 |
1310 |
1304 for ( int i = 0; i < iObservers.Count(); i++ ) |
1311 for ( int i = 0; i < iObservers.Count(); i++ ) |
1305 { |
1312 { |