mmserv/tms/tmsserver/src/tmsserver.cpp
branchRCL_3
changeset 3 4f62049db6ac
parent 0 71ca22bcf22a
child 7 3d8c721bf319
--- a/mmserv/tms/tmsserver/src/tmsserver.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/src/tmsserver.cpp	Fri Feb 19 23:19:48 2010 +0200
@@ -100,8 +100,7 @@
         }
 
     const TVersion version(KTMSServMajorVersionNumber,
-                           KTMSServMinorVersionNumber,
-                           KTMSServBuildVersionNumber);
+            KTMSServMinorVersionNumber, KTMSServBuildVersionNumber);
 
     if (!User::QueryVersionSupported(version, aVersion))
         {
@@ -126,7 +125,7 @@
     iShutdownTimer = TMSServerShutDown::NewL();
     StartL(KTMSServerName);
     RThread().SetPriority(EPriorityRealTime);
-    iEffectSettings = GlobalEffectsSettings::NewL();
+    iEffectSettings = TMSGlobalEffectsSettings::NewL();
     iTarHandler = NULL;
     iAudioCenRepHandler = NULL;
     iCurrentRouting = TMS_AUDIO_OUTPUT_NONE;
@@ -229,7 +228,7 @@
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
         if (!callThread->IsActive())
             {
             iTMSCallServList.Remove(i);
@@ -258,9 +257,9 @@
     TRACE_PRN_FN_ENT;
     TInt status = KErrNone;
 
-    CStartAndMonitorTMSCallThread* callServerThread = NULL;
-    TRAP(status, callServerThread =
-    CStartAndMonitorTMSCallThread::NewL(const_cast<TMSServer*>(this)));
+    TMSStartAndMonitorTMSCallThread* callServerThread = NULL;
+    TRAP(status, callServerThread =TMSStartAndMonitorTMSCallThread::NewL(
+            const_cast<TMSServer*>(this)));
     if (status != KErrNone)
         {
         delete callServerThread;
@@ -315,7 +314,7 @@
     {
     if (!iTarHandler)
         {
-        iTarHandler = CTarEventHandler::NewL((const_cast<TMSServer*> (this)));
+        iTarHandler = TMSTarEventHandler::NewL((const_cast<TMSServer*> (this)));
         }
     }
 
@@ -392,7 +391,7 @@
     TInt status(KErrNone);
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -425,7 +424,7 @@
     TInt status(KErrNone);
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -478,7 +477,7 @@
 
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -723,7 +722,7 @@
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -758,7 +757,7 @@
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -834,11 +833,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::CStartAndMonitorTMSCallThread
+// TMSStartAndMonitorTMSCallThread::TMSStartAndMonitorTMSCallThread
 // Perhaps we need to move this to a .cpp?
 // -----------------------------------------------------------------------------
 //
-CStartAndMonitorTMSCallThread::CStartAndMonitorTMSCallThread(
+TMSStartAndMonitorTMSCallThread::TMSStartAndMonitorTMSCallThread(
         TMSServer* aServer) :
     CActive(EPriorityStandard),
     iTMSServer(aServer)
@@ -849,11 +848,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::~CStartAndMonitorTMSCallThread
+// TMSStartAndMonitorTMSCallThread::~TMSStartAndMonitorTMSCallThread
 //
 // -----------------------------------------------------------------------------
 //
-CStartAndMonitorTMSCallThread::~CStartAndMonitorTMSCallThread()
+TMSStartAndMonitorTMSCallThread::~TMSStartAndMonitorTMSCallThread()
     {
     TRACE_PRN_FN_ENT;
     Cancel();
@@ -861,16 +860,16 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::NewL
+// TMSStartAndMonitorTMSCallThread::NewL
 //
 // -----------------------------------------------------------------------------
 //
-CStartAndMonitorTMSCallThread* CStartAndMonitorTMSCallThread::NewL(
+TMSStartAndMonitorTMSCallThread* TMSStartAndMonitorTMSCallThread::NewL(
         TMSServer* aServer)
     {
     TRACE_PRN_FN_ENT;
-    CStartAndMonitorTMSCallThread* self =
-            new (ELeave) CStartAndMonitorTMSCallThread(aServer);
+    TMSStartAndMonitorTMSCallThread* self =
+            new (ELeave) TMSStartAndMonitorTMSCallThread(aServer);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -879,22 +878,23 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::ConstructL
+// TMSStartAndMonitorTMSCallThread::ConstructL
 //
 // -----------------------------------------------------------------------------
 //
-void CStartAndMonitorTMSCallThread::ConstructL()
+void TMSStartAndMonitorTMSCallThread::ConstructL()
     {
     TRACE_PRN_FN_ENT;
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::StartTMSCallServer
+// TMSStartAndMonitorTMSCallThread::StartTMSCallServer
 //
 // -----------------------------------------------------------------------------
 //
-TInt CStartAndMonitorTMSCallThread::StartTMSCallServer(TMSCallProxyLocal& aHndl)
+TInt TMSStartAndMonitorTMSCallThread::StartTMSCallServer(
+        TMSCallProxyLocal& aHndl)
     {
     TRACE_PRN_FN_ENT;
 
@@ -950,6 +950,7 @@
         return status;
         }
     aHndl.ShareProtected();
+    iStatus = KRequestPending;
     iServerThread.Logon(iStatus);
     SetActive();
 
@@ -958,28 +959,32 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::RunL
+// TMSStartAndMonitorTMSCallThread::RunL
 // From CActive
 // -----------------------------------------------------------------------------
 //
-void CStartAndMonitorTMSCallThread::RunL()
+void TMSStartAndMonitorTMSCallThread::RunL()
     {
     TRACE_PRN_FN_ENT;
     iServerThread.Close();
-    //NOTE: This is causing a panic when closing down tms server.
+    //NOTE: This is causing a panic when closing down TMS server.
     //iCallSrvrHndl.Close();
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::DoCancel
+// TMSStartAndMonitorTMSCallThread::DoCancel
 // From CActive
 // -----------------------------------------------------------------------------
 //
-void CStartAndMonitorTMSCallThread::DoCancel()
+void TMSStartAndMonitorTMSCallThread::DoCancel()
     {
     TRACE_PRN_FN_ENT;
-    iServerThread.LogonCancel(iStatus);
+    if (iServerThread.Handle())
+        {
+        iServerThread.LogonCancel(iStatus);
+        User::WaitForRequest(iStatus);
+        }
     TRACE_PRN_FN_EXT;
     }