tactilefeedback/tactilefeedbackresolver/src/tactilefeedbackresolver.cpp
branchRCL_3
changeset 36 39d4c97df8cb
parent 21 f35d4b6d212e
child 37 09b094b73eb8
--- a/tactilefeedback/tactilefeedbackresolver/src/tactilefeedbackresolver.cpp	Thu Aug 19 10:13:11 2010 +0300
+++ b/tactilefeedback/tactilefeedbackresolver/src/tactilefeedbackresolver.cpp	Tue Aug 31 15:30:39 2010 +0300
@@ -23,6 +23,7 @@
 
 #include <centralrepository.h>
 #include <ecom/implementationinformation.h>
+#include <ProfileEngineInternalCRKeys.h>
 
 #include "tactilefeedbackprivatecrkeys.h"
 #include "tactilefeedbackinternalpskeys.h"
@@ -103,6 +104,7 @@
     {
     delete iCenRepNotifier;
     delete iRepository;
+    delete iProfileRepository;
     delete iPropertyWatcher;
     delete iHapticsPlayer;
     delete iAudioPlayer;
@@ -112,25 +114,21 @@
 TBool CTactileFeedbackResolver::IsHigherThanPlaying(
     TTouchLogicalFeedback aFeedback ) const
     {
-    if( aFeedback == ETouchFeedbackList &&
-        iLastFeedback == ETouchFeedbackSensitiveList )
+    if( aFeedback == ETouchFeedbackBasicItem &&
+        iLastFeedback == ETouchFeedbackSensitiveItem )
         {
         return ETrue;
         }
     
-    return ( ( aFeedback == ETouchFeedbackPopUp || 
-            aFeedback == ETouchFeedbackIncreasingPopUp || 
-            aFeedback == ETouchFeedbackDecreasingPopUp ||
-            aFeedback == ETouchFeedbackBoundaryList ||
-            aFeedback == ETouchFeedbackOptionsMenuOpened ||
-            aFeedback == ETouchFeedbackOptionsMenuClosed ||
-            aFeedback == ETouchFeedbackSubMenuOpened ||
-            aFeedback == ETouchFeedbackSubMenuClosed ) &&
+    return ( aFeedback == ETouchFeedbackPopUp || 
+            aFeedback == ETouchFeedbackPopupOpen || 
+            aFeedback == ETouchFeedbackPopupClose ||
+            aFeedback == ETouchFeedbackBounceEffect ) &&
             ( iLastFeedback == ETouchFeedbackBasicButton ||
             iLastFeedback == ETouchFeedbackSensitiveButton ||
-            iLastFeedback == ETouchFeedbackSensitiveList ||
-            iLastFeedback == ETouchFeedbackList ||
-            iLastFeedback == ETouchFeedbackCheckbox ) );
+            iLastFeedback == ETouchFeedbackSensitiveItem ||
+            iLastFeedback == ETouchFeedbackBasicItem ||
+            iLastFeedback == ETouchFeedbackCheckbox );
     }
 
 // ---------------------------------------------------------------------------
@@ -147,6 +145,14 @@
     TBool aPlayAudio )
     {
     // TRACE("CTactileFeedbackResolver::PlayFeedback - Begin");
+    
+    // A temporary solution to change effect of ETouchFeedbackSensitiveSlider,
+    // it will be removed when the IVT files is ready.
+    if( ETouchFeedbackSensitiveSlider == aFeedback )
+        {
+        aFeedback = ETouchFeedbackBasicSlider;
+        }
+
     // Feedback filtering in order to prevent too many feedbacks
     // in a short time (e.g. when doing text selection).    
     TTime now;
@@ -190,6 +196,16 @@
             aPlayAudio = EFalse;
             }
         
+        // check silent mode, if device is in silent mode, 
+        // audio feedback is not allowed.
+        TInt err;
+        TInt isAudioSupported;
+        err = iProfileRepository->Get( KProEngSilenceMode, isAudioSupported );
+        if ( KErrNone == err && 1 == isAudioSupported )
+            {
+            aPlayAudio = EFalse;
+            }
+
         if ( ( aPlayVibra || aPlayAudio ) &&        // #1
                aFeedback != ETouchFeedbackNone )    // #2
             {
@@ -234,7 +250,12 @@
     if ( !iRepository )
         {
         iRepository = CRepository::NewL( KCRUidTactileFeedback );    
-        }    
+        }
+
+    if ( !iProfileRepository )
+        {
+        iProfileRepository = CRepository::NewL( KCRUidProfileEngine );
+        }
     
     TInt minInterval(0);
     // Read and store minimun feedback interfal
@@ -369,7 +390,7 @@
     }
     
 // ---------------------------------------------------------------------------
-// Stop feedback.
+// Stop continuous feedback.
 // ---------------------------------------------------------------------------
 //    
 void CTactileFeedbackResolver::StopFeedback()
@@ -389,6 +410,13 @@
                           TTouchLogicalFeedback aFeedback,
                           TTouchFeedbackType aType )
     {
+    // A temporary solution to change effect of ETouchFeedbackSensitiveSlider,
+    // it will be removed when the IVT files is ready.
+    if( ETouchFeedbackSensitiveSlider == aFeedback )
+        {
+        aFeedback = ETouchFeedbackBasicSlider;
+        }
+    
     if ( aType & ETouchFeedbackVibra && iHapticsPlayer )
         {
         iHapticsPlayer->PlayPreviewFeedback( aLevel, aFeedback );