81 { |
81 { |
82 CPEAudioData::ConstructL( aAudioFactory ); |
82 CPEAudioData::ConstructL( aAudioFactory ); |
83 |
83 |
84 iInbandTonePlayer = |
84 iInbandTonePlayer = |
85 CPEAudioInbandTonePlayer::NewL( *this, iFsSession, aAudioFactory ); |
85 CPEAudioInbandTonePlayer::NewL( *this, iFsSession, aAudioFactory ); |
86 TInt volume = iPhoneModel.DataStore()->AudioVolume(); |
|
87 iInbandTonePlayer->SetVolume( volume ); |
|
88 |
|
89 iDtmfTonePlayer = CPEAudioDtmfTonePlayer::NewL(); |
86 iDtmfTonePlayer = CPEAudioDtmfTonePlayer::NewL(); |
90 } |
87 } |
91 |
88 |
92 // ----------------------------------------------------------------------------- |
89 // ----------------------------------------------------------------------------- |
93 // CPEGsmAudioData::NewL |
90 // CPEGsmAudioData::NewL |
119 // |
116 // |
120 EXPORT_C CPEGsmAudioData* CPEGsmAudioData::NewL |
117 EXPORT_C CPEGsmAudioData* CPEGsmAudioData::NewL |
121 ( |
118 ( |
122 MPEPhoneModelInternal& aPhoneModel, |
119 MPEPhoneModelInternal& aPhoneModel, |
123 RFs& aFsSession, |
120 RFs& aFsSession, |
124 CPEAudioFactory& aAudioFactory |
121 CPEAudioFactory& aAudioFactory |
125 ) |
122 ) |
126 { |
123 { |
127 CPEGsmAudioData* self = new ( ELeave ) |
124 CPEGsmAudioData* self = new ( ELeave ) |
128 CPEGsmAudioData ( aPhoneModel, aFsSession ); |
125 CPEGsmAudioData ( aPhoneModel, aFsSession ); |
129 CleanupStack::PushL( self ); |
126 CleanupStack::PushL( self ); |
152 EXPORT_C void CPEGsmAudioData::PlayDtmfTone |
149 EXPORT_C void CPEGsmAudioData::PlayDtmfTone |
153 ( |
150 ( |
154 const TChar& aTone //DTMF tone to play |
151 const TChar& aTone //DTMF tone to play |
155 ) const |
152 ) const |
156 { |
153 { |
157 TInt volume; //DTMF tone volume |
154 TInt volume; //DTMF tone volume |
158 volume = iPhoneModel.DataStore()->KeypadVolume(); |
155 volume = iPhoneModel.DataStore()->KeypadVolume(); |
159 |
156 |
160 TEFLOGSTRING3( KTAREQIN, |
157 TEFLOGSTRING3( KTAREQIN, |
161 "AUD CPEGsmAudioData::PlayDtmfTone, aTone = %s, volume = %d", |
158 "AUD CPEGsmAudioData::PlayDtmfTone, aTone = %s, volume = %d", |
162 &aTone, |
159 &aTone, |
163 volume ); |
160 volume ); |
164 |
161 |
165 iDtmfTonePlayer->SetVolume( volume ); |
162 // If profile key tones setting is OFF, the volume will be O |
166 iDtmfTonePlayer->PlayDtmfTone( aTone ); |
163 // Don't play dtmf tone here to avoid interrupting the possible touch tone's playing. |
|
164 if ( KDtmfSilent != volume ) |
|
165 { |
|
166 iDtmfTonePlayer->SetVolume( volume ); |
|
167 iDtmfTonePlayer->PlayDtmfTone( aTone ); |
|
168 } |
167 } |
169 } |
168 |
170 |
169 // ----------------------------------------------------------------------------- |
171 // ----------------------------------------------------------------------------- |
170 // CPEGsmAudioData::StopDtmfTonePlay |
172 // CPEGsmAudioData::StopDtmfTonePlay |
171 // Stops the playing of dtmf tone. |
173 // Stops the playing of dtmf tone. |
233 case ECCEDtmfManualStart: |
235 case ECCEDtmfManualStart: |
234 case ECCEDtmfSequenceStart: |
236 case ECCEDtmfSequenceStart: |
235 if ( DtmfLocalPlayAllowed() ) |
237 if ( DtmfLocalPlayAllowed() ) |
236 { |
238 { |
237 TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: PlayDtmfTone" ); |
239 TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: PlayDtmfTone" ); |
238 PlayDtmfTone( aTone ); |
240 PlayDtmfTone( aTone ); |
239 } |
241 } |
240 else |
242 else |
241 { |
243 { |
242 TEFLOGSTRING( KTAERROR, "AUD CPEGSMAUDIODATA::HANDLEDTMFEVENT ! LOCAL PLAY NOT ALLOWED" ); |
244 TEFLOGSTRING( KTAERROR, "AUD CPEGSMAUDIODATA::HANDLEDTMFEVENT ! LOCAL PLAY NOT ALLOWED" ); |
243 } |
245 } |
250 case ECCEDtmfSequenceAbort: |
252 case ECCEDtmfSequenceAbort: |
251 case ECCEDtmfStopInDtmfString: |
253 case ECCEDtmfStopInDtmfString: |
252 case ECCEDtmfStringSendingCompleted: |
254 case ECCEDtmfStringSendingCompleted: |
253 default: |
255 default: |
254 TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: StopDtmfTonePlay" ); |
256 TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: StopDtmfTonePlay" ); |
255 //Stop tone playing |
257 //Stop tone playing |
256 StopDtmfTonePlay(); |
258 StopDtmfTonePlay(); |
257 break; |
259 break; |
258 } |
260 } |
259 } |
261 } |
260 else |
262 else |
261 { |
263 { |
262 TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: Error case" ); |
264 TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: Error case" ); |
263 //Stop tone playing |
265 //Stop tone playing |
264 StopDtmfTonePlay(); |
266 StopDtmfTonePlay(); |
265 } |
267 } |
266 } |
268 } |
267 |
269 |
268 // ----------------------------------------------------------------------------- |
270 // ----------------------------------------------------------------------------- |
269 // CPEGsmAudioData::DtmfLocalPlayAllowed |
271 // CPEGsmAudioData::DtmfLocalPlayAllowed |
296 |
298 |
297 // ----------------------------------------------------------------------------- |
299 // ----------------------------------------------------------------------------- |
298 // CPEGsmAudioData::DoHandleVolumeChange |
300 // CPEGsmAudioData::DoHandleVolumeChange |
299 // ----------------------------------------------------------------------------- |
301 // ----------------------------------------------------------------------------- |
300 // |
302 // |
301 void CPEGsmAudioData::DoHandleVolumeChange( TInt aVolume, TBool aSendMsg) |
303 void CPEGsmAudioData::DoHandleVolumeChange( TInt aVolume ) |
302 |
304 |
303 { |
305 { |
304 iInbandTonePlayer->SetVolume( aVolume ); |
306 iInbandTonePlayer->SetVolume( aVolume ); |
305 CPEAudioData::DoHandleVolumeChange(aVolume , aSendMsg); |
|
306 } |
307 } |
307 |
308 |
308 // ================= OTHER EXPORTED FUNCTIONS =============================== |
309 // ================= OTHER EXPORTED FUNCTIONS =============================== |
309 // None |
310 // None |
310 |
311 |