mmserv/tms/tmscallserver/inc/tmscallcsadpt.h
branchRCL_3
changeset 11 3570217d8c21
child 12 2eb3b066cc7d
equal deleted inserted replaced
9:f5c5c82a163e 11:3570217d8c21
       
     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: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CALLCSADPT_H
       
    19 #define CALLCSADPT_H
       
    20 
       
    21 #include <TelephonyAudioRouting.h>
       
    22 #include <MTelephonyAudioRoutingObserver.h>
       
    23 #include <e32msgqueue.h>
       
    24 #include "tmsclientserver.h"
       
    25 #include "tmscalladpt.h"
       
    26 #include "tmscsdevsoundobserver.h"
       
    27 
       
    28 namespace TMS {
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class TMSCSUplink;
       
    32 class TMSCSDownlink;
       
    33 class TMSTarSettings;
       
    34 
       
    35 /*
       
    36  * CallCSAdapt class
       
    37  */
       
    38 class TMSCallCSAdpt : public TMSCallAdpt,
       
    39                       public TMSCSPDevSoundObserver,
       
    40                       public MTelephonyAudioRoutingObserver
       
    41     {
       
    42 public:
       
    43     TMSCallCSAdpt();
       
    44     virtual ~TMSCallCSAdpt();
       
    45     virtual gint PostConstruct();
       
    46 
       
    47     virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
       
    48             gint& outStrmId);
       
    49     virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType,
       
    50             gint strmId, TMSFormatType frmtType, const RMessage2& aMessage);
       
    51     virtual gint StartStream(TMSCallType callType, TMSStreamType strmType,
       
    52             gint strmId);
       
    53     virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType,
       
    54             gint strmId);
       
    55     virtual gint StopStream(TMSCallType callType, TMSStreamType strmType,
       
    56             gint strmId);
       
    57     virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType,
       
    58             gint strmId);
       
    59     virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType,
       
    60             gint strmId);
       
    61     virtual gint DataXferBufferEmptied(TMSCallType callType,
       
    62             TMSStreamType strmType, gint strmId);
       
    63     virtual gint DataXferBufferFilled(TMSCallType callType,
       
    64             TMSStreamType strmType, gint strmId, guint datasize);
       
    65     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
       
    66             const TMSStreamType strmType, const gint strmId,
       
    67             const guint32 key, RChunk& chunk);
       
    68     virtual gint GetMaxVolume(guint& volume);
       
    69     virtual gint SetVolume(const guint volume);
       
    70     virtual gint GetVolume(guint& volume);
       
    71     virtual gint GetMaxGain(guint& gain);
       
    72     virtual gint SetGain(const guint gain);
       
    73     virtual gint GetGain(guint& gain);
       
    74     virtual gint GetGlobalMaxVolume(guint& volume);
       
    75     virtual gint SetGlobalVolume(const guint volume);
       
    76     virtual gint GetGlobalVolume(guint& volume);
       
    77     virtual gint GetGlobalMaxGain(guint& gain);
       
    78     virtual gint SetGlobalGain(const guint gain);
       
    79     virtual gint GetGlobalGain(guint& gain);
       
    80 
       
    81     virtual gint GetCodecMode(const TMSFormatType fmttype,
       
    82             const TMSStreamType strmtype, gint& mode);
       
    83     virtual gint SetCodecMode(const TMSFormatType fmttype,
       
    84             const TMSStreamType strmtype, const gint mode);
       
    85     virtual gint GetSupportedBitRatesCount(guint& count);
       
    86     virtual gint GetSupportedBitRates(CBufFlat*& brbuffer);
       
    87     virtual gint GetBitRate(guint& bitrate);
       
    88     virtual gint SetBitRate(const guint bitrate);
       
    89     virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad);
       
    90     virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad);
       
    91     virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng);
       
    92     virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng);
       
    93     virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc);
       
    94     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc);
       
    95 
       
    96     virtual gint SetOutput(TMSAudioOutput output);
       
    97     virtual gint GetOutput(TMSAudioOutput& output);
       
    98     virtual gint GetPreviousOutput(TMSAudioOutput& output);
       
    99     virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer);
       
   100 
       
   101     void NotifyClient(const gint strmId, const gint aCommand,
       
   102             const gint aStatus = KErrNone, const gint64 aInt64 = TInt64(0));
       
   103 
       
   104     //From TMSCSPDevSoundObserver
       
   105     void DownlinkInitCompleted(TInt status);
       
   106     void UplinkInitCompleted(TInt status);
       
   107     void UplinkActivatedSuccessfully();
       
   108     void DownlinkActivatedSuccessfully();
       
   109     void UplinkActivationFailed();
       
   110     void DownlinkActivationFailed();
       
   111 
       
   112 protected:
       
   113     void AvailableOutputsChanged(
       
   114             CTelephonyAudioRouting& aTelephonyAudioRouting);
       
   115     void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting);
       
   116     void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting,
       
   117             gint aError);
       
   118     void GetSupportedBitRatesL(CBufFlat*& brbuffer);
       
   119 
       
   120 private:
       
   121     gint iNextStreamId;
       
   122 
       
   123     TMSCSUplink* iCSUplink;
       
   124     TMSCSDownlink* iCSDownlink;
       
   125     CTelephonyAudioRouting* iRouting;
       
   126     TMSTarSettings* iTarSettings;
       
   127     TMSStreamType iStrmtype;
       
   128 
       
   129     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
       
   130     RMsgQueue<TmsMsgBuf> iMsgQueueDn;
       
   131     TmsMsgBuf iMsgBuffer;
       
   132 
       
   133     gboolean iUplinkInitialized;
       
   134     gint iUplinkStreamId;
       
   135     gboolean iDnlinkInitialized;
       
   136     gint iDnlinkStreamId;
       
   137     };
       
   138 
       
   139 } //namespace TMS
       
   140 
       
   141 #endif // CALLCSADPT_H
       
   142 
       
   143 // End of file