1.Changed appcontrol parameters of contacts 2.GUI changes 3.Changes to alert tone...
[apps/osp/Call.git] / src / CallSoundManager.cpp
index efbc144..3e52598 100644 (file)
@@ -235,29 +235,39 @@ void
 SoundManager::SetDisconnectTone(void)
 {
 
+       AppLogDebug("Enter");
        int unknownRejectStatus = -1;
-       String disconnectTonePath;
+       String disconnectTonePath=L"";
        vconf_get_bool(VCONFKEY_CISSAPPL_CALL_END_TONE_BOOL, &unknownRejectStatus);
        bool disconnectToneSetStatus = unknownRejectStatus;
 
        if(disconnectToneSetStatus == true)
        {
+               AppLogDebug("disconnectToneSetStatus == true");
                disconnectTonePath.Append(CALLDISCONNECTTONE_PATH);
                if(__pPlayer == null)
                {
+                       AppLogDebug("__pPlayer == null");
+
                        __pPlayer =  new (std::nothrow) Player();
                        __pPlayer->Construct(*this);
+                       AppLogDebug("__pPlayer Construct");
                }
                if(disconnectTonePath.IsEmpty() == false)
                {
-                       __pPlayer->Close();
+                       AppLogDebug("__pPlayer OpenFile %ls",disconnectTonePath.GetPointer());
                        __pPlayer->OpenFile(disconnectTonePath,false);
+                       AppLogDebug("__pPlayer OpenFile");
                        __pPlayer->SetLooping(false);
+                       AppLogDebug("__pPlayer SetLooping");
                        __pPlayer->SetVolume(80);
+                       AppLogDebug("__pPlayer SetVolume");
                        SetSoundMode(SOUND_MODE_MEDIA);
+                       AppLogDebug("__pPlayer SetVolume");
                        __pPlayer->Play();
                }
        }
+       AppLogDebug("Exit");
 
 }
 
@@ -315,22 +325,33 @@ SoundManager::StartAlert(String& contactRingTone)
        AppLogDebug("Enter");
        if(__pSoundCallSession != null)
        {
-               AppLogDebug("No Alert already in call");
-               String waitingTonePath;
-               waitingTonePath.Append(CALLWAITINGTONE_PATH);
-               if(__pPlayer == null)
+               CallAlertStatus status= CALL_ALERT_SOUND;
+               int alertStatus = -1;
+               int retVal = vconf_get_int(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, &alertStatus);
+               if (retVal == 0)
                {
-                       __pPlayer =  new (std::nothrow) Player();
-                       __pPlayer->Construct(*this);
+                       status = (CallAlertStatus) alertStatus;
                }
-               if (waitingTonePath.IsEmpty() == false)
+               AppLogDebug("No Alert already in call");
+               if(status == CALL_ALERT_SOUND)
                {
-                       __pPlayer->Close();
-                       __pPlayer->OpenFile(waitingTonePath,false);
-                       __pPlayer->SetLooping(true);
-                       __pPlayer->SetVolume(80);
-                       SetSoundMode(SOUND_MODE_MEDIA);
-                       __pPlayer->Play();
+                       AppLogDebug("Playing alert tone");
+                       String waitingTonePath;
+                       waitingTonePath.Append(CALLWAITINGTONE_PATH);
+                       if(__pPlayer == null)
+                       {
+                               __pPlayer =  new (std::nothrow) Player();
+                               __pPlayer->Construct(*this);
+                       }
+                       if (waitingTonePath.IsEmpty() == false)
+                       {
+                               __pPlayer->Close();
+                               __pPlayer->OpenFile(waitingTonePath,false);
+                               __pPlayer->SetLooping(true);
+                               __pPlayer->SetVolume(80);
+                               SetSoundMode(SOUND_MODE_MEDIA);
+                               __pPlayer->Play();
+                       }
                }
                return;
        }