voicerecorder/RecViewSrc/CVRMdaRecorder.cpp
branchRCL_3
changeset 11 a2fdc35b8f46
parent 8 49233e24b2ab
child 13 4e5b531d23cb
--- a/voicerecorder/RecViewSrc/CVRMdaRecorder.cpp	Wed Apr 14 16:00:13 2010 +0300
+++ b/voicerecorder/RecViewSrc/CVRMdaRecorder.cpp	Tue Apr 27 16:40:59 2010 +0300
@@ -233,7 +233,20 @@
 					}
 
 				}
-				StopAndNotify();
+        	    if(iMediaServerError == KErrInUse && aPreviousState == CMdaAudioClipUtility::EPlaying)
+        	    	{
+					CVRRecViewModel* iViewModel = NULL;
+					iViewModel = dynamic_cast <CVRRecViewModel*>(iAutoStopObserver);
+					if(iViewModel != NULL)
+            		{
+            		iViewModel->HandleCommandL(ECmdPause);
+            		}
+        	        return;
+        	    	}
+        	    else
+        	    	{
+					StopAndNotify();
+        	    	}
         	}
         
         //it will happen when the openfile fails
@@ -982,7 +995,6 @@
 		EPanicNotAttached ) );
 
 	iPause = ETrue;
-	iPosition = iAudioRecorder->Position();
 
 #ifdef _DEBUG
 	RDebug::Print( _L("VoiceRecorder: Pause called. Position: %d:%d"),
@@ -1288,16 +1300,11 @@
 //
 void CVRMdaRecorder::SyncAndNotify()
 	{
-	if (iPause)
+	if(!iPause)
 		{
-		iMemo->SetPosition( iPosition );
+		iPosition = iAudioRecorder->Position();
 		}
-	// Not sure if iPosition value is valid other than when paused, so do as 
-	// previous for all other states:	
-	else 
-		{
-		iMemo->SetPosition( iAudioRecorder->Position() );
-		}
+	iMemo->SetPosition( iPosition );
 
 	iMemo->SetDuration( iAudioRecorder->Duration() );