phoneengine/audiohandling/inc/cpeaudiodata.h
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
--- a/phoneengine/audiohandling/inc/cpeaudiodata.h	Tue Aug 31 15:14:29 2010 +0300
+++ b/phoneengine/audiohandling/inc/cpeaudiodata.h	Wed Sep 01 12:30:10 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  This file contains the header file of the class CPEAudioData
+* Description:  This file contains the header file of the class CPEAudioData 
 *                 which is the interface class for Audio Handling Module
 *
 */
@@ -23,12 +23,8 @@
 //  INCLUDES
 #include "mpeaudiodata.h"
 #include <PSVariables.h>
-
+ 
 #include <TelephonyAudioRouting.h>
-#include <tmseffect.h>
-#include <tmseffectobsrvr.h>
-
-
 // CONSTANTS
 // None.
 
@@ -41,8 +37,6 @@
 // FUNCTION PROTOTYPES
 // None.
 
-using namespace TMS;
-
 // FORWARD DECLARATIONS
 class MPEPhoneModelInternal;
 class CPEAudioDtmfTonePlayer;
@@ -50,23 +44,22 @@
 class CPECallAudioRoutingHandler;
 class CPEAudioFactory;
 class CTelephonyAudioRouting;
-class CPEAudioEffect;
 
 // CLASS DECLARATION
 
 /**
-*  This file contains the header file of the class CPEAudioData,
-*  which is an interface class to audio
+*  This file contains the header file of the class CPEAudioData, 
+*  which is an interface class to audio 
 *  properties of the system
 *
 *  @lib audiohandling.lib
 *  @since S60_5.0
 */
-class CPEAudioData : public CBase,
-                     public MPEAudioData,
-                     public TMSEffectObserver
+class CPEAudioData: 
+        public CBase, 
+        public MPEAudioData 
     {
-
+    
     public:
 
         /**
@@ -82,7 +75,7 @@
         CPEAudioData( MPEPhoneModelInternal& aPhoneModel );
 
     public: // from MPEAudioData
-
+       
         /**
         * Retrieves Audio mute synchronously.
         * @param  aAudioMute, audio mute is returned in this parameter.
@@ -94,7 +87,7 @@
         * @param  aAudioVolume, audio volume is returned in this parameter.
         */
         IMPORT_C void GetAudioVolumeSync( TInt& aAudioVolume ) const;
-
+                
         /**
         * Makes synchronous request to set Audio Mute.
         * @param  aAudioMute, mute to be set.
@@ -113,42 +106,47 @@
         * @param aShowNote, audio note status
         * @return KErrNone or possible errorcode.
         */
-        IMPORT_C TInt SetAudioOutput(
+        IMPORT_C TInt SetAudioOutput( 
             const TPEAudioOutput aOutput,
             TBool aShowNote );
-
+  
         /**
-        * Gets volume levels, audio mute, audio mode and audio volume
+        * Gets volume levels, audio mute, audio mode and audio volume 
         * at startup and starts monitors.
         * @param  None.
         * @return None.
         */
         IMPORT_C void StartUp();
-
+  
+        /**
+        * Sets default volume level if muted when call ended
+        */
+        IMPORT_C void SetDefaultVolume();
+ 
         /**
         * Handles call audio route preference changed
         */
         IMPORT_C TInt CallAudioRoutePreferenceChanged();
-
+     
         /**
         * Initialises call audio route when call is alerting or answered
         */
         IMPORT_C TInt HandleCallStarting( TBool aVideoCall );
-
+        
         /**
         * Initialises energency call audio route
         */
         IMPORT_C TInt HandleEnergencyCallStarting();
-
+        
         /**
         * Ends call audio route when call disconnected
         */
         IMPORT_C void HandleCallEnding();
-
+    
     public: // new
-
+        
         /**
-        * Sends AudioHandlingError message to PhoneEngine and saves
+        * Sends AudioHandlingError message to PhoneEngine and saves 
         * errorcode to member variable.
         * @param  aErrorCode, errorcode that is saved to member variable.
         * @return None.
@@ -160,7 +158,7 @@
         * @param  aMessage, message to be forwarded.
         * @return None.
         */
-        void SendMessage(
+        void SendMessage( 
             const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
 
         /**
@@ -169,7 +167,7 @@
         * @param  aOutput, audio output path that is saved in member variable.
         * @return None.
         */
-        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
                           const CTelephonyAudioRouting::TAudioOutput aOutput );
 
         /**
@@ -178,87 +176,82 @@
         * @param  aOutput, audio output path that is saved in member variable.
         * @return None.
         */
-        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
                           CTelephonyAudioRouting& aTelephonyAudioRouting );
 
         /**
         * Sets value of audio routing preference
-        */
+        */        
         void SetRoutePreference( TBool aShowNote );
 
         /**
         * Return value of audio routing preference
         */
         CTelephonyAudioRouting::TAudioOutput RoutePreference();
-
+        
         /**
         * Return value of previous output
-        */
+        */        
         CTelephonyAudioRouting::TAudioOutput PreviousOutput();
-
+        
         /**
         * Return value of current output
-        */
+        */        
         CTelephonyAudioRouting::TAudioOutput Output();
-
+ 
         /**
         * Return status of wired accessory availability
         */
         TBool IsWiredAvailable();
-
+        
         /**
         * Return status of BT accessory availability
-        */
+        */        
         TBool IsBTAvailable();
 
         /**
         * Return status of TTY accessory availability
-        */
+        */        
         TBool IsTTYAvailable();
-
+        
         /**
         * Set new audio route to TAR
         */
         void SetTAROutput( CTelephonyAudioRouting::TAudioOutput aOutput,
                            TBool aShowNote );
-
-        /**
-         * From TMSEffectObserver
-         */
-    void EffectsEvent(const TMSEffect& tmseffect, TMSSignalEvent event);
+     
 
     protected:
 
         /**
-        * By default Symbian 2nd phase constructor is private, but we use
+        * By default Symbian 2nd phase constructor is private, but we use 
         * it at generalized class.
         */
-        void ConstructL( CPEAudioFactory& aAudioFactory );
+        void ConstructL( CPEAudioFactory& aAudioFactory ); 
 
     protected:  // New functions
-
+        
         /**
-         * Updates volume on DataStore and if aSendMsg==ETrue sends
-         * notification to engine monitor.
+         * Protected function for derived classes to implement for
+         * extended volume handling. Default implementation is empty.
          * @since S60 v5.0
          * @param aVolume New volume value.
-         * @param aSendMsg ETrue will send notification.
          */
-        virtual void DoHandleVolumeChange( TInt aVolume, TBool aSendMsg=EFalse );
-
+        virtual void DoHandleVolumeChange( TInt aVolume );
+     
     private:
-
+    
         /**
-        * Gets all audio volume value and update member variable
+        * Gets all audio volume values from reporitory and update member variables
         */
-        void InitializeAudioVolume();
-
-
+        void InitializeAudioVolumes();
+        
+                       
         /**
         * Makes request to Telephony Audio Routing to get available audio outputs
         * @return list of available outputs
         */
-        TArray< TPEAudioOutput> GetAvailableOutputs(
+        TArray< TPEAudioOutput> GetAvailableOutputs( 
                 CTelephonyAudioRouting& aTelephonyAudioRouting );
 
         /**
@@ -268,11 +261,15 @@
 
         /**
         * Converts PE route value to TAR value
+        */        
+        CTelephonyAudioRouting::TAudioOutput ConvertToTAR( TPEAudioOutput aOutput );
+        /**
+        * Return status of mic mute
         */
-        CTelephonyAudioRouting::TAudioOutput ConvertToTAR( TPEAudioOutput aOutput );
+        TBool IsMuted() const;
 
     protected:
-        // CPhoneModel object which owns this object.
+        // CPhoneModel object which owns this object. 
         MPEPhoneModelInternal& iPhoneModel;
         // Audio Routing Monitor
         CPEAudioRoutingMonitor* iAudioRoutingMonitor;
@@ -284,10 +281,19 @@
         RArray<TPEAudioOutput> iPEavailableOutputs;
         //Flag to indicate whether is Call audio route initialized
         TBool iRouteInitialized;
-
-        CPEAudioEffect* iAudioEffect;
+        #ifdef __WINSCW__
+        // dummy implementation for WINSCW
+        TInt  iVolume;
+        TBool iMute; 
+        #endif        
+        // HeadSet Mode Audio volume
+        TInt iHeadSetVolume;
+        // Loudspeaker Mode Audio volume
+        TInt iLoudspeakerVolume;
+        // ETrue when audio output changed 
+        TBool iAudioOutputChanged; 
      };
 
-#endif      // CPEAUDIODATA_H
-
+#endif      // CPEAUDIODATA_H  
+            
 // End of File