mmserv/tms/tmsserver/inc/cspaudiohandler.h
changeset 0 71ca22bcf22a
child 3 4f62049db6ac
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Declarations for class CSPAudioHandler
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CSPAUDIOHANDLER_H
       
    19 #define CSPAUDIOHANDLER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <sounddevice.h>
       
    23 
       
    24 #include "mcspcenrepobserver.h"
       
    25 #include "tmsserver.h"
       
    26 
       
    27 namespace TMS {
       
    28 class CSPPubSubListener;
       
    29 class CSPCenRepListener;
       
    30 class CSPAudioStreams;
       
    31 
       
    32 /**
       
    33  * Handles call adding from calls not done by the plugin.
       
    34  *
       
    35  */
       
    36 class CSPAudioHandler : public CBase,
       
    37                         public MCSPCenRepObserver
       
    38     {
       
    39 public:
       
    40     //Constructors and descructor
       
    41 
       
    42     /**
       
    43      * Two-phased constructing for the monitor.
       
    44      *
       
    45      * @param aObserver the observer for getting notification
       
    46      * @param aLine the line to monitor
       
    47      * @param aLineId line identifier
       
    48      */
       
    49     static CSPAudioHandler* NewL(TMSServer* aServer);
       
    50 
       
    51     /**
       
    52      * C++ default destructor
       
    53      */
       
    54     virtual ~CSPAudioHandler();
       
    55 
       
    56     void SetLoudSpeakerVol(TInt vol);
       
    57     void SetEarPieceVol(TInt vol);
       
    58 
       
    59     // from base class MCSPPubSubObserver
       
    60     /**
       
    61      * Handler for changed event.
       
    62      * @param aUid uid of setting
       
    63      * @param aKey id of setting
       
    64      * @param aStatus status of completed AO operation
       
    65      */
       
    66     //virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey,
       
    67     //    const TRequestStatus& aStatus );
       
    68 
       
    69     // from base class MCSPCenRepObserver
       
    70     /**
       
    71      * Handler for changed event.
       
    72      * @param aUid uid of setting
       
    73      * @param aVal value
       
    74      */
       
    75     virtual void CSPAudioHandler::HandleNotifyCenRepL(const TUid aUid,
       
    76             const TUint32 aKey, TInt aVal);
       
    77 
       
    78     // from base class MDevSoundObserver
       
    79 protected:
       
    80     //From DevSound
       
    81 
       
    82 
       
    83 protected:
       
    84     // From CActive
       
    85     /**
       
    86      * From CActive
       
    87      * RunL
       
    88      */
       
    89     void RunL();
       
    90 
       
    91     /**
       
    92      * From CActive
       
    93      * Catches errors if RunL leaves
       
    94      * @param aError error code
       
    95      * @return error code
       
    96      */
       
    97     TInt RunError(TInt aError);
       
    98 
       
    99     /**
       
   100      * From CActive
       
   101      * Cancels the monitor
       
   102      */
       
   103     void DoCancel();
       
   104 
       
   105 private:
       
   106     /**
       
   107      * C++ default constructor
       
   108      * @param aObserver the observer for status change (incoming call)
       
   109      * @param aLine the line associated with the call
       
   110      * @param aLineId line identifier
       
   111      */
       
   112     CSPAudioHandler(TMSServer* aServer);
       
   113 
       
   114     /**
       
   115      * Constructs the monitor in the second phase.
       
   116      */
       
   117     void ConstructL();
       
   118 
       
   119 private:
       
   120     // data
       
   121 
       
   122     /**
       
   123      * Mute listening from Publish&Subscribe.
       
   124      */
       
   125     CSPPubSubListener* iMuteListener;
       
   126 
       
   127     /**
       
   128      * Incall loudspeaker listening from Central Repository.
       
   129      */
       
   130     CSPCenRepListener* iIncallLoudspeakerVolumeListener;
       
   131 
       
   132     /**
       
   133      * Incall ear volume listening from Central Repository.
       
   134      */
       
   135     CSPCenRepListener* iIncallEarVolumeListener;
       
   136 
       
   137     /**
       
   138      * Audio streams handler.
       
   139      */
       
   140     //CSPAudioStreams* iAudioStreams;
       
   141 
       
   142     /**
       
   143      * Call count
       
   144      */
       
   145     TInt iCallCount;
       
   146     TMSServer* iTMSSer;
       
   147     };
       
   148 
       
   149 } //namespace TMS
       
   150 
       
   151 #endif // CSPAUDIOHANDLER_H