mmserv/tms/tmscallserver/inc/tmscallcsadpt.h
branchRCL_3
changeset 17 60e492b28869
parent 12 2eb3b066cc7d
child 19 095bea5f582e
equal deleted inserted replaced
15:ab526b8cacfb 17:60e492b28869
    16  */
    16  */
    17 
    17 
    18 #ifndef CALLCSADPT_H
    18 #ifndef CALLCSADPT_H
    19 #define CALLCSADPT_H
    19 #define CALLCSADPT_H
    20 
    20 
       
    21 // INCLUDES
    21 #include <TelephonyAudioRouting.h>
    22 #include <TelephonyAudioRouting.h>
    22 #include <MTelephonyAudioRoutingObserver.h>
    23 #include <MTelephonyAudioRoutingObserver.h>
    23 #include <e32msgqueue.h>
    24 #include <e32msgqueue.h>
    24 #include "tmsclientserver.h"
    25 #include "tmsclientserver.h"
    25 #include "tmscalladpt.h"
    26 #include "tmscalladpt.h"
    31 class TMSCSUplink;
    32 class TMSCSUplink;
    32 class TMSCSDownlink;
    33 class TMSCSDownlink;
    33 class TMSTarSettings;
    34 class TMSTarSettings;
    34 
    35 
    35 /*
    36 /*
    36  * CallCSAdapt class
    37  * TMSCallCSAdpt class
    37  */
    38  */
    38 class TMSCallCSAdpt : public TMSCallAdpt,
    39 class TMSCallCSAdpt : public TMSCallAdpt,
    39                       public TMSCSPDevSoundObserver,
    40                       public TMSCSDevSoundObserver,
    40                       public MTelephonyAudioRoutingObserver
    41                       public MTelephonyAudioRoutingObserver
    41     {
    42     {
    42 public:
    43 public:
    43     TMSCallCSAdpt();
    44 	static TMSCallCSAdpt* NewL();
    44     virtual ~TMSCallCSAdpt();
    45     virtual ~TMSCallCSAdpt();
    45     virtual gint PostConstruct();
    46     virtual gint PostConstruct();
    46 
    47 
    47     virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
    48     // From TMSStream
    48             gint& outStrmId);
    49     virtual gint CreateStream(const TMSCallType callType,
    49     virtual gint InitStream(TMSCallType callType, TMSStreamType strmType,
    50             const TMSStreamType strmType, gint& outStrmId);
    50             gint strmId, TMSFormatType frmtType, const RMessage2& message);
    51     virtual gint InitStream(const TMSCallType callType,
    51     virtual gint StartStream(TMSCallType callType, TMSStreamType strmType,
    52             const TMSStreamType strmType, const gint strmId,
    52             gint strmId);
    53             const TMSFormatType frmtType, const RMessage2& message);
    53     virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType,
    54     virtual gint StartStream(const TMSCallType callType,
    54             gint strmId);
    55             const TMSStreamType strmType, const gint strmId);
    55     virtual gint StopStream(TMSCallType callType, TMSStreamType strmType,
    56     virtual gint PauseStream(const TMSCallType callType,
    56             gint strmId);
    57             const TMSStreamType strmType, const gint strmId);
    57     virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType,
    58     virtual gint StopStream(const TMSCallType callType,
    58             gint strmId);
    59             const TMSStreamType strmType, const gint strmId);
    59     virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType,
    60     virtual gint DeinitStream(const TMSCallType callType,
    60             gint strmId);
    61             const TMSStreamType strmType, const gint strmId);
    61     virtual gint DataXferBufferEmptied(TMSCallType callType,
    62     virtual gint DeleteStream(const TMSCallType callType,
    62             TMSStreamType strmType, gint strmId);
    63             const TMSStreamType strmType, const gint strmId);
    63     virtual gint DataXferBufferFilled(TMSCallType callType,
    64     virtual gint DataXferBufferEmptied(const TMSCallType callType,
    64             TMSStreamType strmType, gint strmId, guint datasize);
    65             const TMSStreamType strmType, const gint strmId);
       
    66     virtual gint DataXferBufferFilled(const TMSCallType callType,
       
    67             const TMSStreamType strmType, const gint strmId,
       
    68             const guint datasize);
    65     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
    69     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
    66             const TMSStreamType strmType, const gint strmId,
    70             const TMSStreamType strmType, const gint strmId,
    67             const guint32 key, RChunk& chunk);
    71             const guint32 key, RChunk& chunk);
    68 
    72 
    69     // From TMS effects
    73     // From TMS effects
    95     virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng);
    99     virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng);
    96     virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc);
   100     virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc);
    97     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc);
   101     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc);
    98 
   102 
    99     // From TMS audio routing
   103     // From TMS audio routing
   100     virtual gint SetOutput(TMSAudioOutput output);
   104     virtual gint SetOutput(const TMSAudioOutput output);
   101     virtual gint GetOutput(TMSAudioOutput& output);
   105     virtual gint GetOutput(TMSAudioOutput& output);
   102     virtual gint GetPreviousOutput(TMSAudioOutput& output);
   106     virtual gint GetPreviousOutput(TMSAudioOutput& output);
   103     virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer);
   107     virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuf);
   104 
   108 
   105     //From TMSCSPDevSoundObserver
   109     //From TMSCSDevSoundObserver
   106     void DownlinkInitCompleted(TInt status);
   110     void DownlinkInitCompleted(gint status);
   107     void UplinkInitCompleted(TInt status);
   111     void UplinkInitCompleted(gint status);
   108     void UplinkActivatedSuccessfully();
   112     void DownlinkActivationCompleted(gint status);
   109     void DownlinkActivatedSuccessfully();
   113     void UplinkActivationCompleted(gint status);
   110     void UplinkActivationFailed();
       
   111     void DownlinkActivationFailed();
       
   112 
   114 
   113 private:
   115 private:
       
   116     TMSCallCSAdpt();
       
   117     void ConstructL();
       
   118 
       
   119     gint InitUplink();
       
   120     gint InitDownlink();
   114     void AvailableOutputsChanged(
   121     void AvailableOutputsChanged(
   115             CTelephonyAudioRouting& aTelephonyAudioRouting);
   122             CTelephonyAudioRouting& aTelephonyAudioRouting);
   116     void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting);
   123     void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting);
   117     void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting,
   124     void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting,
   118             gint aError);
   125             gint status);
   119     void GetSupportedBitRatesL(CBufFlat*& brbuffer);
   126     void GetSupportedBitRatesL(CBufFlat*& brbuffer);
   120     void NotifyClient(const gint strmId, const gint command,
   127     void NotifyClient(const gint strmId, const gint command,
   121             const gint status = KErrNone, const gint64 int64 = TInt64(0));
   128             const gint status = KErrNone, const gint64 int64 = TInt64(0));
   122 
   129 
   123 private:
   130 private:
   124     gint iNextStreamId;
   131     gint iNextStreamId;
   125 
       
   126     TMSCSUplink* iCSUplink;
   132     TMSCSUplink* iCSUplink;
   127     TMSCSDownlink* iCSDownlink;
   133     TMSCSDownlink* iCSDownlink;
   128     CTelephonyAudioRouting* iRouting;
   134     CTelephonyAudioRouting* iRouting;
   129     TMSTarSettings* iTarSettings;
   135     TMSTarSettings* iTarSettings;
   130     TMSStreamType iStrmtype;
       
   131 
   136 
       
   137     // Message queues for communication and data transfer back to the client
   132     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
   138     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
   133     RMsgQueue<TmsMsgBuf> iMsgQueueDn;
   139     RMsgQueue<TmsMsgBuf> iMsgQueueDn;
   134     TmsMsgBuf iMsgBuffer;
   140     TmsMsgBuf iMsgBuffer;
   135 
   141 
   136     gboolean iUplinkInitialized;
   142     gboolean iUplinkInitialized;