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