|
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 <etelmm.h> |
|
25 #include <rmmcustomapi.h> |
|
26 #include "tmsclientserver.h" |
|
27 #include "tmsdtmftoneplayerobserver.h" |
|
28 #include "tmscalladpt.h" |
|
29 #include "tmscsdevsoundobserver.h" |
|
30 #include "tmsdtmfobserver.h" |
|
31 |
|
32 namespace TMS { |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class TMSCSUplink; |
|
36 class TMSCSDownlink; |
|
37 class TMSTarSettings; |
|
38 class TMSAudioDtmfTonePlayer; |
|
39 class TMSDTMFProvider; |
|
40 class TMSDtmfNotifier; |
|
41 |
|
42 /* |
|
43 * CallCSAdapt class |
|
44 */ |
|
45 class TMSCallCSAdpt : public TMSCallAdpt, |
|
46 public TMSCSPDevSoundObserver, |
|
47 public MTelephonyAudioRoutingObserver, |
|
48 public TMSDTMFTonePlayerObserver, |
|
49 public TMSDTMFObserver |
|
50 { |
|
51 public: |
|
52 TMSCallCSAdpt(); |
|
53 virtual ~TMSCallCSAdpt(); |
|
54 virtual gint PostConstruct(); |
|
55 |
|
56 virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType, |
|
57 gint& outStrmId); |
|
58 virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType, |
|
59 gint strmId, TMSFormatType frmtType, const RMessage2& aMessage); |
|
60 virtual gint StartStream(TMSCallType callType, TMSStreamType strmType, |
|
61 gint strmId); |
|
62 virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType, |
|
63 gint strmId); |
|
64 virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, |
|
65 gint strmId); |
|
66 virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType, |
|
67 gint strmId); |
|
68 virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType, |
|
69 gint strmId); |
|
70 virtual gint DataXferBufferEmptied(TMSCallType callType, |
|
71 TMSStreamType strmType, gint strmId); |
|
72 virtual gint DataXferBufferFilled(TMSCallType callType, |
|
73 TMSStreamType strmType, gint strmId, guint datasize); |
|
74 virtual gint GetDataXferBufferHndl(const TMSCallType callType, |
|
75 const TMSStreamType strmType, const gint strmId, |
|
76 const guint32 key, RChunk& chunk); |
|
77 virtual gint GetMaxVolume(guint& volume); |
|
78 virtual gint SetVolume(const guint volume); |
|
79 virtual gint GetVolume(guint& volume); |
|
80 virtual gint GetMaxGain(guint& gain); |
|
81 virtual gint SetGain(const guint gain); |
|
82 virtual gint GetGain(guint& gain); |
|
83 virtual gint GetGlobalMaxVolume(guint& volume); |
|
84 virtual gint SetGlobalVolume(const guint volume); |
|
85 virtual gint GetGlobalVolume(guint& volume); |
|
86 virtual gint GetGlobalMaxGain(guint& gain); |
|
87 virtual gint SetGlobalGain(const guint gain); |
|
88 virtual gint GetGlobalGain(guint& gain); |
|
89 |
|
90 virtual gint GetCodecMode(const TMSFormatType fmttype, |
|
91 const TMSStreamType strmtype, gint& mode); |
|
92 virtual gint SetCodecMode(const TMSFormatType fmttype, |
|
93 const TMSStreamType strmtype, const gint mode); |
|
94 virtual gint GetSupportedBitRatesCount(guint& count); |
|
95 virtual gint GetSupportedBitRates(CBufFlat*& brbuffer); |
|
96 virtual gint GetBitRate(guint& bitrate); |
|
97 virtual gint SetBitRate(const guint bitrate); |
|
98 virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad); |
|
99 virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad); |
|
100 virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng); |
|
101 virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng); |
|
102 virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc); |
|
103 virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc); |
|
104 |
|
105 virtual gint SetOutput(TMSAudioOutput output); |
|
106 virtual gint GetOutput(TMSAudioOutput& output); |
|
107 virtual gint GetPreviousOutput(TMSAudioOutput& output); |
|
108 virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer); |
|
109 virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring); |
|
110 virtual gint StopDTMF(TMSStreamType streamtype); |
|
111 virtual gint ContinueDTMF(TBool continuesending); |
|
112 |
|
113 void NotifyClient(const gint strmId, const gint aCommand, |
|
114 const gint aStatus = KErrNone, const gint64 aInt64 = TInt64(0)); |
|
115 |
|
116 //From TMSCSPDevSoundObserver |
|
117 void DownlinkInitCompleted(TInt status); |
|
118 void UplinkInitCompleted(TInt status); |
|
119 void UplinkActivatedSuccessfully(); |
|
120 void DownlinkActivatedSuccessfully(); |
|
121 void UplinkActivationFailed(); |
|
122 void DownlinkActivationFailed(); |
|
123 |
|
124 //From DTMFTonePlayerObserver |
|
125 void DTMFInitCompleted(TInt error); |
|
126 void DTMFToneFinished(TInt error); |
|
127 |
|
128 //From TMSDTMFObserver |
|
129 void HandleDTMFEvent(const TMSDTMFObserver::TCCPDtmfEvent aEvent, |
|
130 const TInt aError, const TChar aTone); |
|
131 |
|
132 protected: |
|
133 void AvailableOutputsChanged( |
|
134 CTelephonyAudioRouting& aTelephonyAudioRouting); |
|
135 void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting); |
|
136 void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting, |
|
137 gint aError); |
|
138 void GetSupportedBitRatesL(CBufFlat*& brbuffer); |
|
139 |
|
140 private: |
|
141 gint iNextStreamId; |
|
142 |
|
143 TMSCSUplink* iCSUplink; |
|
144 TMSCSDownlink* iCSDownlink; |
|
145 CTelephonyAudioRouting* iRouting; |
|
146 TMSTarSettings* iTarSettings; |
|
147 TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer; |
|
148 TMSDtmfNotifier* iDTMFNotifier; |
|
149 TMSDTMFProvider* iDTMFUplinkPlayer; |
|
150 TMSStreamType iStrmtype; |
|
151 |
|
152 RMsgQueue<TmsMsgBuf> iMsgQueueUp; |
|
153 RMsgQueue<TmsMsgBuf> iMsgQueueDn; |
|
154 TmsMsgBuf iMsgBuffer; |
|
155 |
|
156 gboolean iUplinkInitialized; |
|
157 gint iUplinkStreamId; |
|
158 gboolean iDnlinkInitialized; |
|
159 gint iDnlinkStreamId; |
|
160 }; |
|
161 |
|
162 } //namespace TMS |
|
163 |
|
164 #endif // CALLCSADPT_H |
|
165 |
|
166 // End of file |