mmserv/tms/tmsserver/inc/cspaudiohandler.h
branchRCL_3
changeset 10 3d8c721bf319
parent 8 e35735ece90c
child 11 03a293c97d5c
equal deleted inserted replaced
8:e35735ece90c 10:3d8c721bf319
     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 TMSCenRepAudioHandler
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CSPAUDIOHANDLER_H
       
    19 #define CSPAUDIOHANDLER_H
       
    20 
       
    21 #include <sounddevice.h>
       
    22 
       
    23 #include "mcspcenrepobserver.h"
       
    24 #include "tmsserver.h"
       
    25 
       
    26 namespace TMS {
       
    27 
       
    28 class TMSCSPPubSubListener;
       
    29 class TMSCenRepListener;
       
    30 class TMSCSPAudioStreams;
       
    31 
       
    32 /**
       
    33  * Handles call adding from calls not done by the plugin.
       
    34  *
       
    35  */
       
    36 class TMSCenRepAudioHandler : public MCSPCenRepObserver
       
    37     {
       
    38 public:
       
    39     //Constructors and descructor
       
    40 
       
    41     /**
       
    42      * Two-phased constructing for the monitor.
       
    43      *
       
    44      * @param aObserver the observer for getting notification
       
    45      * @param aLine the line to monitor
       
    46      * @param aLineId line identifier
       
    47      */
       
    48     static TMSCenRepAudioHandler* NewL(TMSServer* aServer);
       
    49 
       
    50     /**
       
    51      * C++ default destructor
       
    52      */
       
    53     virtual ~TMSCenRepAudioHandler();
       
    54 
       
    55     void SetLoudSpeakerVol(TInt vol);
       
    56     void SetEarPieceVol(TInt vol);
       
    57 
       
    58     // from base class MCSPPubSubObserver
       
    59     /**
       
    60      * Handler for changed event.
       
    61      * @param aUid uid of setting
       
    62      * @param aKey id of setting
       
    63      * @param aStatus status of completed AO operation
       
    64      */
       
    65     //virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey,
       
    66     //    const TRequestStatus& aStatus );
       
    67 
       
    68     // from base class MCSPCenRepObserver
       
    69     /**
       
    70      * Handler for changed event.
       
    71      * @param aUid uid of setting
       
    72      * @param aVal value
       
    73      */
       
    74     virtual void TMSCenRepAudioHandler::HandleNotifyCenRepL(const TUid aUid,
       
    75             const TUint32 aKey, TInt aVal);
       
    76 
       
    77     // from base class MDevSoundObserver
       
    78 protected:
       
    79     //From DevSound
       
    80 
       
    81 
       
    82 protected:
       
    83     // From CActive
       
    84     /**
       
    85      * From CActive
       
    86      * RunL
       
    87      */
       
    88     void RunL();
       
    89 
       
    90     /**
       
    91      * From CActive
       
    92      * Catches errors if RunL leaves
       
    93      * @param aError error code
       
    94      * @return error code
       
    95      */
       
    96     TInt RunError(TInt aError);
       
    97 
       
    98     /**
       
    99      * From CActive
       
   100      * Cancels the monitor
       
   101      */
       
   102     void DoCancel();
       
   103 
       
   104 private:
       
   105     /**
       
   106      * C++ default constructor
       
   107      * @param aObserver the observer for status change (incoming call)
       
   108      * @param aLine the line associated with the call
       
   109      * @param aLineId line identifier
       
   110      */
       
   111     TMSCenRepAudioHandler(TMSServer* aServer);
       
   112 
       
   113     /**
       
   114      * Constructs the monitor in the second phase.
       
   115      */
       
   116     void ConstructL();
       
   117 
       
   118 private:
       
   119     // data
       
   120 
       
   121     /**
       
   122      * Mute listening from Publish&Subscribe.
       
   123      */
       
   124     TMSCSPPubSubListener* iMuteListener;
       
   125 
       
   126     /**
       
   127      * Incall loudspeaker listening from Central Repository.
       
   128      */
       
   129     TMSCenRepListener* iIncallLoudspeakerVolumeListener;
       
   130 
       
   131     /**
       
   132      * Incall ear volume listening from Central Repository.
       
   133      */
       
   134     TMSCenRepListener* iIncallEarVolumeListener;
       
   135 
       
   136     /**
       
   137      * Audio streams handler.
       
   138      */
       
   139     //CSPAudioStreams* iAudioStreams;
       
   140 
       
   141     /**
       
   142      * Call count
       
   143      */
       
   144     TInt iCallCount;
       
   145     TMSServer* iTMSSer;
       
   146     };
       
   147 
       
   148 } //namespace TMS
       
   149 
       
   150 #endif // CSPAUDIOHANDLER_H