mmserv/tms/tmsserver/src/cspaudiohandler.cpp
branchRCL_3
changeset 3 4f62049db6ac
parent 0 71ca22bcf22a
equal deleted inserted replaced
0:71ca22bcf22a 3:4f62049db6ac
     9  * Initial Contributors:
     9  * Initial Contributors:
    10  * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  *
    13  *
    14  * Description:  Implements the class CSPAudioHandler
    14  * Description:  Implements the class TMSCenRepAudioHandler
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <e32base.h>
    18 #include <e32base.h>
    19 #include "tmstelephonycenrep.h"
    19 #include "tmstelephonycenrep.h"
    31 #include "cspcenreplistener.h"
    31 #include "cspcenreplistener.h"
    32 #include "tmsutility.h"
    32 #include "tmsutility.h"
    33 
    33 
    34 using namespace TMS;
    34 using namespace TMS;
    35 // ---------------------------------------------------------------------------
    35 // ---------------------------------------------------------------------------
    36 // CSPAudioHandler::NewL.
    36 // TMSCenRepAudioHandler::NewL.
    37 // ---------------------------------------------------------------------------
    37 // ---------------------------------------------------------------------------
    38 //
    38 //
    39 CSPAudioHandler* CSPAudioHandler::NewL(TMSServer* aServer)
    39 TMSCenRepAudioHandler* TMSCenRepAudioHandler::NewL(TMSServer* aServer)
    40     {
    40     {
    41     TRACE_PRN_FN_ENT;
    41     TRACE_PRN_FN_ENT;
    42     CSPAudioHandler* self = new (ELeave) CSPAudioHandler(aServer);
    42     TMSCenRepAudioHandler* self = new (ELeave) TMSCenRepAudioHandler(aServer);
    43     CleanupStack::PushL(self);
    43     CleanupStack::PushL(self);
    44     self->ConstructL();
    44     self->ConstructL();
    45     CleanupStack::Pop(self);
    45     CleanupStack::Pop(self);
    46     TRACE_PRN_FN_EXT;
    46     TRACE_PRN_FN_EXT;
    47     return self;
    47     return self;
    49 
    49 
    50 // ---------------------------------------------------------------------------
    50 // ---------------------------------------------------------------------------
    51 // Destructs the object by canceling first ongoing monitoring.
    51 // Destructs the object by canceling first ongoing monitoring.
    52 // ---------------------------------------------------------------------------
    52 // ---------------------------------------------------------------------------
    53 //
    53 //
    54 CSPAudioHandler::~CSPAudioHandler()
    54 TMSCenRepAudioHandler::~TMSCenRepAudioHandler()
    55     {
    55     {
    56     TRACE_PRN_FN_ENT;
    56     TRACE_PRN_FN_ENT;
    57     delete iIncallLoudspeakerVolumeListener;
    57     delete iIncallLoudspeakerVolumeListener;
    58     delete iIncallEarVolumeListener;
    58     delete iIncallEarVolumeListener;
    59     TRACE_PRN_FN_EXT;
    59     TRACE_PRN_FN_EXT;
    60     }
    60     }
    61 
    61 
    62 // ---------------------------------------------------------------------------
    62 // ---------------------------------------------------------------------------
    63 // CSPAudioHandler::SetLoudSpeakerVol
    63 // TMSCenRepAudioHandler::SetLoudSpeakerVol
    64 // ---------------------------------------------------------------------------
    64 // ---------------------------------------------------------------------------
    65 //
    65 //
    66 void CSPAudioHandler::SetLoudSpeakerVol(TInt vol)
    66 void TMSCenRepAudioHandler::SetLoudSpeakerVol(TInt vol)
    67     {
    67     {
    68     if (iIncallLoudspeakerVolumeListener)
    68     if (iIncallLoudspeakerVolumeListener)
    69         {
    69         {
    70         iIncallLoudspeakerVolumeListener->Set(vol);
    70         iIncallLoudspeakerVolumeListener->Set(vol);
    71         }
    71         }
    72     }
    72     }
    73 
    73 
    74 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    75 // CSPAudioHandler::SetEarPieceVol
    75 // TMSCenRepAudioHandler::SetEarPieceVol
    76 // ---------------------------------------------------------------------------
    76 // ---------------------------------------------------------------------------
    77 //
    77 //
    78 void CSPAudioHandler::SetEarPieceVol(TInt vol)
    78 void TMSCenRepAudioHandler::SetEarPieceVol(TInt vol)
    79     {
    79     {
    80     if (iIncallEarVolumeListener)
    80     if (iIncallEarVolumeListener)
    81         {
    81         {
    82         iIncallEarVolumeListener->Set(vol);
    82         iIncallEarVolumeListener->Set(vol);
    83         }
    83         }
    84     }
    84     }
    85 
    85 
    86 // ---------------------------------------------------------------------------
    86 // ---------------------------------------------------------------------------
    87 // From MCSPCenRepObserver
    87 // From MCSPCenRepObserver
    88 // CSPAudioHandler::HandleNotifyCenRepL
    88 // TMSCenRepAudioHandler::HandleNotifyCenRepL
    89 // ---------------------------------------------------------------------------
    89 // ---------------------------------------------------------------------------
    90 //
    90 //
    91 void CSPAudioHandler::HandleNotifyCenRepL(const TUid /*aUid*/,
    91 void TMSCenRepAudioHandler::HandleNotifyCenRepL(const TUid /*aUid*/,
    92         const TUint32 aKey, TInt aVal)
    92         const TUint32 aKey, TInt aVal)
    93     {
    93     {
    94     TRACE_PRN_FN_ENT;
    94     TRACE_PRN_FN_ENT;
    95     if (aKey == KTelIncallLoudspeakerVolume)
    95     if (aKey == KTelIncallLoudspeakerVolume)
    96         {
    96         {
   105 
   105 
   106 // ---------------------------------------------------------------------------
   106 // ---------------------------------------------------------------------------
   107 // Constructs the monitor.
   107 // Constructs the monitor.
   108 // ---------------------------------------------------------------------------
   108 // ---------------------------------------------------------------------------
   109 //
   109 //
   110 CSPAudioHandler::CSPAudioHandler(TMSServer* aServer) :
   110 TMSCenRepAudioHandler::TMSCenRepAudioHandler(TMSServer* aServer) :
   111     iTMSSer(aServer)
   111     iTMSSer(aServer)
   112     {
   112     {
   113     TRACE_PRN_FN_ENT;
   113     TRACE_PRN_FN_ENT;
   114     iCallCount = 0; // Active calls count
   114     iCallCount = 0; // Active calls count
   115     TRACE_PRN_FN_EXT;
   115     TRACE_PRN_FN_EXT;
   117 
   117 
   118 // ---------------------------------------------------------------------------
   118 // ---------------------------------------------------------------------------
   119 // Second phase construction.
   119 // Second phase construction.
   120 // ---------------------------------------------------------------------------
   120 // ---------------------------------------------------------------------------
   121 //
   121 //
   122 void CSPAudioHandler::ConstructL()
   122 void TMSCenRepAudioHandler::ConstructL()
   123     {
   123     {
   124     TRACE_PRN_FN_ENT;
   124     TRACE_PRN_FN_ENT;
   125 
   125 
   126     iIncallLoudspeakerVolumeListener = CSPCenRepListener::NewL(
   126     iIncallLoudspeakerVolumeListener = TMSCenRepListener::NewL(
   127             KCRUidInCallVolume, KTelIncallLoudspeakerVolume, this);
   127             KCRUidInCallVolume, KTelIncallLoudspeakerVolume, this);
   128 
   128 
   129     iIncallEarVolumeListener = CSPCenRepListener::NewL(KCRUidInCallVolume,
   129     iIncallEarVolumeListener = TMSCenRepListener::NewL(KCRUidInCallVolume,
   130             KTelIncallEarVolume, this);
   130             KTelIncallEarVolume, this);
   131 
   131 
   132     // Initialize audio volumes
   132     // Initialize audio volumes
   133     TInt volEar;
   133     TInt volEar;
   134     TInt volLoud;
   134     TInt volLoud;