|
1 /* |
|
2 * Copyright (c) 2007 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: Radio Utility body implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <RadioFmTunerUtility.h> |
|
20 #include <RadioPlayerUtility.h> |
|
21 #include <RadioRdsUtility.h> |
|
22 #include "RadioUtilityBody.h" |
|
23 #include "RadioServerData.h" |
|
24 |
|
25 // ======== MEMBER FUNCTIONS ======== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CRadioUtility::CBody::NewL |
|
29 // Two-phased constructor. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CRadioUtility::CBody* CRadioUtility::CBody::NewL( |
|
33 TBool aPrimaryClient ) |
|
34 { |
|
35 CRadioUtility::CBody* self = new (ELeave) CRadioUtility::CBody(); |
|
36 CleanupStack::PushL(self); |
|
37 self->ConstructL(aPrimaryClient); |
|
38 CleanupStack::Pop(); |
|
39 return self; |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CRadioUtility::CBody::ConstructL |
|
44 // Symbian 2nd phase constructor can leave. |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 void CRadioUtility::CBody::ConstructL( |
|
48 TBool aPrimaryClient ) |
|
49 { |
|
50 iRadioSession = new (ELeave) RRadioSession(); |
|
51 User::LeaveIfError(iRadioSession->Connect(*this, aPrimaryClient)); |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CRadioUtility::CBody::CBody |
|
56 // (other items were commented in a header). |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CRadioUtility::CBody::CBody() |
|
60 : iRadioSession(NULL), |
|
61 iFmTunerUtility(NULL), |
|
62 iPlayerUtility(NULL), |
|
63 iRdsUtility(NULL) |
|
64 { |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // Destructor. |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CRadioUtility::CBody::~CBody() |
|
72 { |
|
73 #ifdef _DEBUG |
|
74 RDebug::Print(_L("CRadioUtility::CBody::~CBody")); |
|
75 #endif |
|
76 delete iFmTunerUtility; |
|
77 delete iPlayerUtility; |
|
78 delete iRdsUtility; |
|
79 if ( iRadioSession ) |
|
80 { |
|
81 iRadioSession->Close(); |
|
82 delete iRadioSession; |
|
83 } |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CRadioUtility::CBody::RadioFmTunerUtilityL |
|
88 // (other items were commented in a header). |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 CRadioFmTunerUtility& CRadioUtility::CBody::RadioFmTunerUtilityL( |
|
92 MRadioFmTunerObserver& aObserver) |
|
93 { |
|
94 #ifdef _DEBUG |
|
95 RDebug::Print(_L("CRadioUtility::CBody::RadioFmTunerUtilityL")); |
|
96 #endif |
|
97 |
|
98 if ( !iFmTunerUtility ) |
|
99 { |
|
100 iFmTunerUtility = CRadioFmTunerUtility::NewL( *iRadioSession, aObserver ); |
|
101 iTunerObserver = &aObserver; |
|
102 } |
|
103 else |
|
104 { |
|
105 iTunerObserver = &aObserver; |
|
106 } |
|
107 |
|
108 return *iFmTunerUtility; |
|
109 } |
|
110 |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CRadioUtility::CBody::RadioPlayerUtilityL |
|
113 // (other items were commented in a header). |
|
114 // ----------------------------------------------------------------------------- |
|
115 // |
|
116 CRadioPlayerUtility& CRadioUtility::CBody::RadioPlayerUtilityL( |
|
117 MRadioPlayerObserver& aObserver) |
|
118 { |
|
119 #ifdef _DEBUG |
|
120 RDebug::Print(_L("CRadioUtility::CBody::RadioPlayerUtilityL")); |
|
121 #endif |
|
122 |
|
123 if ( !iPlayerUtility ) |
|
124 { |
|
125 iPlayerUtility = CRadioPlayerUtility::NewL( *iRadioSession, aObserver ); |
|
126 iPlayerObserver = &aObserver; |
|
127 } |
|
128 else |
|
129 { |
|
130 iPlayerObserver = &aObserver; |
|
131 } |
|
132 |
|
133 return *iPlayerUtility; |
|
134 } |
|
135 |
|
136 // ----------------------------------------------------------------------------- |
|
137 // CRadioUtility::CBody::RadioRdsUtilityL |
|
138 // (other items were commented in a header). |
|
139 // ----------------------------------------------------------------------------- |
|
140 // |
|
141 CRadioRdsUtility& CRadioUtility::CBody::RadioRdsUtilityL( |
|
142 MRadioRdsObserver& aObserver) |
|
143 { |
|
144 #ifdef _DEBUG |
|
145 RDebug::Print(_L("CRadioUtility::CBody::RadioRdsUtility")); |
|
146 #endif |
|
147 |
|
148 if ( !iRdsUtility ) |
|
149 { |
|
150 iRdsUtility = CRadioRdsUtility::NewL( *iRadioSession, aObserver ); |
|
151 iRdsObserver = &aObserver; |
|
152 } |
|
153 else |
|
154 { |
|
155 iRdsObserver = &aObserver; |
|
156 } |
|
157 |
|
158 return *iRdsUtility; |
|
159 } |
|
160 |
|
161 |
|
162 // --------------------------------------------------------------------------- |
|
163 // From class MRadioObserver. |
|
164 // Handles completion of Tuner Control Request. |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 void CRadioUtility::CBody::RequestTunerControlComplete( |
|
168 TRadioServerError aError ) |
|
169 { |
|
170 #ifdef _DEBUG |
|
171 RDebug::Print(_L("CRadioUtility::CBody::RequestTunerControlComplete")); |
|
172 #endif |
|
173 if ( iTunerObserver ) |
|
174 { |
|
175 iTunerObserver->MrftoRequestTunerControlComplete( aError ); |
|
176 } |
|
177 } |
|
178 |
|
179 // --------------------------------------------------------------------------- |
|
180 // From class MRadioObserver. |
|
181 // Handles completion of Set Frequency Range Request. |
|
182 // --------------------------------------------------------------------------- |
|
183 // |
|
184 void CRadioUtility::CBody::SetFrequencyRangeComplete( |
|
185 TRadioServerError aError ) |
|
186 { |
|
187 #ifdef _DEBUG |
|
188 RDebug::Print(_L("CRadioUtility::CBody::SetFrequencyRangeComplete")); |
|
189 #endif |
|
190 if ( iTunerObserver ) |
|
191 { |
|
192 iTunerObserver->MrftoSetFrequencyRangeComplete( aError ); |
|
193 } |
|
194 } |
|
195 |
|
196 // --------------------------------------------------------------------------- |
|
197 // From class MRadioObserver. |
|
198 // Handles completion of Set Frequency Request. |
|
199 // --------------------------------------------------------------------------- |
|
200 // |
|
201 void CRadioUtility::CBody::SetFrequencyComplete( |
|
202 TRadioServerError aError ) |
|
203 { |
|
204 #ifdef _DEBUG |
|
205 RDebug::Print(_L("CRadioUtility::CBody::SetFrequencyComplete")); |
|
206 #endif |
|
207 if ( iTunerObserver ) |
|
208 { |
|
209 iTunerObserver->MrftoSetFrequencyComplete( aError ); |
|
210 } |
|
211 } |
|
212 |
|
213 // --------------------------------------------------------------------------- |
|
214 // From class MRadioObserver. |
|
215 // Handles completion of Station Seek Request. |
|
216 // --------------------------------------------------------------------------- |
|
217 // |
|
218 void CRadioUtility::CBody::StationSeekComplete( |
|
219 TRadioServerError aError, |
|
220 TInt aFrequency ) |
|
221 { |
|
222 #ifdef _DEBUG |
|
223 RDebug::Print(_L("CRadioUtility::CBody::StationSeekComplete")); |
|
224 #endif |
|
225 if ( iTunerObserver ) |
|
226 { |
|
227 iTunerObserver->MrftoStationSeekComplete( aError, aFrequency ); |
|
228 } |
|
229 } |
|
230 |
|
231 // --------------------------------------------------------------------------- |
|
232 // From class MRadioObserver. |
|
233 // Handles transmitter status change event. |
|
234 // --------------------------------------------------------------------------- |
|
235 // |
|
236 void CRadioUtility::CBody::RadioEventTransmitterStatusChange( |
|
237 TBool aActive ) |
|
238 { |
|
239 #ifdef _DEBUG |
|
240 RDebug::Print(_L("CRadioUtility::CBody::TransmitterStatusChange")); |
|
241 #endif |
|
242 if ( iTunerObserver ) |
|
243 { |
|
244 iTunerObserver->MrftoFmTransmitterStatusChange( aActive ); |
|
245 } |
|
246 } |
|
247 |
|
248 // --------------------------------------------------------------------------- |
|
249 // From class MRadioObserver. |
|
250 // Handles antenna status change event. |
|
251 // --------------------------------------------------------------------------- |
|
252 // |
|
253 void CRadioUtility::CBody::RadioEventAntennaStatusChange( |
|
254 TBool aAttached ) |
|
255 { |
|
256 #ifdef _DEBUG |
|
257 RDebug::Print(_L("CRadioUtility::CBody::RadioEventAntennaStatusChange")); |
|
258 #endif |
|
259 if ( iTunerObserver ) |
|
260 { |
|
261 iTunerObserver->MrftoAntennaStatusChange( aAttached ); |
|
262 } |
|
263 } |
|
264 |
|
265 // --------------------------------------------------------------------------- |
|
266 // From class MRadioObserver. |
|
267 // Handles offline mode change event. |
|
268 // --------------------------------------------------------------------------- |
|
269 // |
|
270 void CRadioUtility::CBody::RadioEventOfflineModeChange( |
|
271 TBool aOfflineMode ) |
|
272 { |
|
273 #ifdef _DEBUG |
|
274 RDebug::Print(_L("CRadioUtility::CBody::RadioEventOfflineModeChange Start offline mode = %d"), aOfflineMode); |
|
275 #endif |
|
276 if ( iTunerObserver ) |
|
277 { |
|
278 iTunerObserver->MrftoOfflineModeStatusChange( aOfflineMode ); |
|
279 } |
|
280 } |
|
281 |
|
282 // --------------------------------------------------------------------------- |
|
283 // From class MRadioObserver. |
|
284 // Handles frequency range change event. |
|
285 // --------------------------------------------------------------------------- |
|
286 // |
|
287 void CRadioUtility::CBody::RadioEventFrequencyRangeChanged( |
|
288 TRsFrequencyRange aNewRange ) |
|
289 { |
|
290 #ifdef _DEBUG |
|
291 RDebug::Print(_L("CRadioUtility::CBody::RadioEventFrequencyRangeChanged")); |
|
292 #endif |
|
293 |
|
294 if ( iTunerObserver ) |
|
295 { |
|
296 TFmRadioFrequencyRange band = EFmRangeEuroAmerica; |
|
297 |
|
298 switch (aNewRange) |
|
299 { |
|
300 case ERsRangeFmEuroAmerica: |
|
301 band = EFmRangeEuroAmerica; |
|
302 break; |
|
303 case ERsRangeFmJapan: |
|
304 band = EFmRangeJapan; |
|
305 break; |
|
306 default: |
|
307 break; |
|
308 } |
|
309 iTunerObserver->MrftoFrequencyRangeChange( band ); |
|
310 } |
|
311 } |
|
312 |
|
313 // --------------------------------------------------------------------------- |
|
314 // From class MRadioObserver. |
|
315 // Handles frequency change event. |
|
316 // --------------------------------------------------------------------------- |
|
317 // |
|
318 void CRadioUtility::CBody::RadioEventFrequencyChange( |
|
319 TInt aNewFrequency ) |
|
320 { |
|
321 #ifdef _DEBUG |
|
322 RDebug::Print(_L("CRadioUtility::CBody::RadioEventFrequencyChange")); |
|
323 #endif |
|
324 if ( iTunerObserver ) |
|
325 { |
|
326 iTunerObserver->MrftoFrequencyChange( aNewFrequency ); |
|
327 } |
|
328 } |
|
329 |
|
330 // --------------------------------------------------------------------------- |
|
331 // From class MRadioObserver. |
|
332 // Handles forced mono change event. |
|
333 // --------------------------------------------------------------------------- |
|
334 // |
|
335 void CRadioUtility::CBody::RadioEventForcedMonoChanged( |
|
336 TBool aForceMono ) |
|
337 { |
|
338 #ifdef _DEBUG |
|
339 RDebug::Print(_L("CRadioUtility::CBody::RadioEventForcedMonoChanged")); |
|
340 #endif |
|
341 if ( iTunerObserver ) |
|
342 { |
|
343 iTunerObserver->MrftoForcedMonoChange( aForceMono ); |
|
344 } |
|
345 } |
|
346 |
|
347 // --------------------------------------------------------------------------- |
|
348 // From class MRadioObserver. |
|
349 // Handles squelch change event. |
|
350 // --------------------------------------------------------------------------- |
|
351 // |
|
352 void CRadioUtility::CBody::RadioEventSquelchChanged( |
|
353 TBool aSquelch ) |
|
354 { |
|
355 #ifdef _DEBUG |
|
356 RDebug::Print(_L("CRadioUtility::CBody::RadioEventSquelchChanged")); |
|
357 #endif |
|
358 if ( iTunerObserver ) |
|
359 { |
|
360 iTunerObserver->MrftoSquelchChange( aSquelch ); |
|
361 } |
|
362 } |
|
363 |
|
364 // --------------------------------------------------------------------------- |
|
365 // From class MRadioObserver. |
|
366 // Handles radio state change event. |
|
367 // --------------------------------------------------------------------------- |
|
368 // |
|
369 void CRadioUtility::CBody::RadioEventStateChange( |
|
370 TBool aRadioOn, |
|
371 TRadioServerError aError ) |
|
372 { |
|
373 #ifdef _DEBUG |
|
374 RDebug::Print(_L("CRadioUtility::CBody::RadioEventStateChange")); |
|
375 #endif |
|
376 if ( iPlayerObserver ) |
|
377 { |
|
378 TPlayerState state = ERadioPlayerIdle; |
|
379 |
|
380 if ( aRadioOn ) |
|
381 { |
|
382 state = ERadioPlayerPlaying; |
|
383 } |
|
384 iPlayerObserver->MrpoStateChange( state, (TInt)aError ); |
|
385 } |
|
386 } |
|
387 |
|
388 // --------------------------------------------------------------------------- |
|
389 // From class MRadioObserver. |
|
390 // Handles volume change event. |
|
391 // --------------------------------------------------------------------------- |
|
392 // |
|
393 void CRadioUtility::CBody::RadioEventVolumeChange( |
|
394 TInt aVolume ) |
|
395 { |
|
396 #ifdef _DEBUG |
|
397 RDebug::Print(_L("CRadioUtility::CBody::RadioEventVolumeChange")); |
|
398 #endif |
|
399 if ( iPlayerObserver ) |
|
400 { |
|
401 iPlayerObserver->MrpoVolumeChange( aVolume ); |
|
402 } |
|
403 } |
|
404 |
|
405 // --------------------------------------------------------------------------- |
|
406 // From class MRadioObserver. |
|
407 // Handles mute change event. |
|
408 // --------------------------------------------------------------------------- |
|
409 // |
|
410 void CRadioUtility::CBody::RadioEventMuteChange( |
|
411 TBool aMute ) |
|
412 { |
|
413 #ifdef _DEBUG |
|
414 RDebug::Print(_L("CRadioUtility::CBody::RadioEventMuteChange")); |
|
415 #endif |
|
416 if ( iPlayerObserver ) |
|
417 { |
|
418 iPlayerObserver->MrpoMuteChange( aMute ); |
|
419 } |
|
420 } |
|
421 |
|
422 // --------------------------------------------------------------------------- |
|
423 // From class MRadioObserver. |
|
424 // Handles balance change event. |
|
425 // --------------------------------------------------------------------------- |
|
426 // |
|
427 void CRadioUtility::CBody::RadioEventBalanceChange( |
|
428 TInt aLeftPercentage, |
|
429 TInt aRightPercentage ) |
|
430 { |
|
431 #ifdef _DEBUG |
|
432 RDebug::Print(_L("CRadioUtility::CBody::RadioEventBalanceChange")); |
|
433 #endif |
|
434 if ( iPlayerObserver ) |
|
435 { |
|
436 iPlayerObserver->MrpoBalanceChange( aLeftPercentage, aRightPercentage ); |
|
437 } |
|
438 } |
|
439 |
|
440 // --------------------------------------------------------------------------- |
|
441 // From class MRadioObserver. |
|
442 // Handles completion of station seek by PTY. |
|
443 // --------------------------------------------------------------------------- |
|
444 // |
|
445 void CRadioUtility::CBody::StationSeekByPTYComplete( |
|
446 TInt aError, |
|
447 TInt aFrequency ) |
|
448 { |
|
449 #ifdef _DEBUG |
|
450 RDebug::Print(_L("CRadioUtility::CBody::StationSeekByPTYComplete")); |
|
451 #endif |
|
452 if ( iRdsObserver ) |
|
453 { |
|
454 iRdsObserver->MrroStationSeekByPTYComplete(aError, aFrequency ); |
|
455 } |
|
456 } |
|
457 |
|
458 |
|
459 // --------------------------------------------------------------------------- |
|
460 // From class MRadioObserver. |
|
461 // Handles completion of station seek by TA. |
|
462 // --------------------------------------------------------------------------- |
|
463 // |
|
464 void CRadioUtility::CBody::StationSeekByTAComplete( |
|
465 TInt aError, |
|
466 TInt aFrequency ) |
|
467 { |
|
468 #ifdef _DEBUG |
|
469 RDebug::Print(_L("CRadioUtility::CBody::StationSeekByTAComplete")); |
|
470 #endif |
|
471 |
|
472 if ( iRdsObserver ) |
|
473 { |
|
474 iRdsObserver->MrroStationSeekByTAComplete( aError, aFrequency ); |
|
475 } |
|
476 } |
|
477 |
|
478 // --------------------------------------------------------------------------- |
|
479 // From class MRadioObserver. |
|
480 // Handles completion of station seek by TP. |
|
481 // --------------------------------------------------------------------------- |
|
482 // |
|
483 void CRadioUtility::CBody::StationSeekByTPComplete( |
|
484 TInt aError, |
|
485 TInt aFrequency ) |
|
486 { |
|
487 #ifdef _DEBUG |
|
488 RDebug::Print(_L("CRadioUtility::CBody::StationSeekByTPComplete")); |
|
489 #endif |
|
490 |
|
491 if ( iRdsObserver ) |
|
492 { |
|
493 iRdsObserver->MrroStationSeekByTPComplete( aError, aFrequency ); |
|
494 } |
|
495 } |
|
496 |
|
497 // --------------------------------------------------------------------------- |
|
498 // From class MRadioObserver. |
|
499 // Handles completion of get frequency by PTY. |
|
500 // --------------------------------------------------------------------------- |
|
501 // |
|
502 void CRadioUtility::CBody::GetFreqByPTYComplete( |
|
503 TInt aError, |
|
504 RArray<TInt>& aFreqList ) |
|
505 { |
|
506 #ifdef _DEBUG |
|
507 RDebug::Print(_L("CRadioUtility::CBody::GetFreqByPTYComplete")); |
|
508 #endif |
|
509 if ( iRdsObserver ) |
|
510 { |
|
511 iRdsObserver->MrroGetFreqByPTYComplete( aError, aFreqList ); |
|
512 } |
|
513 } |
|
514 |
|
515 // --------------------------------------------------------------------------- |
|
516 // From class MRadioObserver. |
|
517 // Handles completion of get frequency by TA. |
|
518 // --------------------------------------------------------------------------- |
|
519 // |
|
520 void CRadioUtility::CBody::GetFreqByTAComplete( |
|
521 TInt aError, |
|
522 RArray<TInt>& aFreqList ) |
|
523 { |
|
524 #ifdef _DEBUG |
|
525 RDebug::Print(_L("CRadioUtility::CBody::GetFreqByTAComplete")); |
|
526 #endif |
|
527 if ( iRdsObserver ) |
|
528 { |
|
529 iRdsObserver->MrroGetFreqByTAComplete( aError, aFreqList ); |
|
530 } |
|
531 } |
|
532 |
|
533 // --------------------------------------------------------------------------- |
|
534 // From class MRadioObserver. |
|
535 // Handles completion of get PS by PTY. |
|
536 // --------------------------------------------------------------------------- |
|
537 // |
|
538 void CRadioUtility::CBody::GetPSByPTYComplete( |
|
539 TInt aError, |
|
540 RArray<TRsRdsPSName>& aPsList ) |
|
541 { |
|
542 #ifdef _DEBUG |
|
543 RDebug::Print(_L("CRadioUtility::CBody::GetPSByPTYComplete")); |
|
544 #endif |
|
545 if ( iRdsObserver ) |
|
546 { |
|
547 RArray<TRdsPSName> psList; |
|
548 if ( aError == KErrNone ) |
|
549 { |
|
550 for( TInt i = 0; i < aPsList.Count(); i++ ) |
|
551 { |
|
552 TRsRdsPSName ps = aPsList[i]; |
|
553 if ( ps.Length() ) |
|
554 { |
|
555 psList[i].Copy(ps); |
|
556 } |
|
557 } |
|
558 } |
|
559 iRdsObserver->MrroGetPSByPTYComplete( aError, psList ); |
|
560 } |
|
561 } |
|
562 |
|
563 // --------------------------------------------------------------------------- |
|
564 // From class MRadioObserver. |
|
565 // Handles completion of get PS by TA. |
|
566 // --------------------------------------------------------------------------- |
|
567 // |
|
568 void CRadioUtility::CBody::GetPSByTAComplete( |
|
569 TInt aError, |
|
570 RArray<TRsRdsPSName>& aPsList ) |
|
571 { |
|
572 #ifdef _DEBUG |
|
573 RDebug::Print(_L("CRadioUtility::CBody::GetPSByTAComplete")); |
|
574 #endif |
|
575 if ( iRdsObserver ) |
|
576 { |
|
577 RArray<TRdsPSName> psList; |
|
578 if ( aError == KErrNone ) |
|
579 { |
|
580 for( TInt i = 0; i < aPsList.Count(); i++ ) |
|
581 { |
|
582 TRsRdsPSName ps = aPsList[i]; |
|
583 if ( ps.Length() ) |
|
584 { |
|
585 psList[i].Copy(ps); |
|
586 } |
|
587 } |
|
588 } |
|
589 iRdsObserver->MrroGetPSByTAComplete( aError, psList ); |
|
590 } |
|
591 } |
|
592 |
|
593 // --------------------------------------------------------------------------- |
|
594 // From class MRadioObserver. |
|
595 // Handles program identification RDS data event. |
|
596 // --------------------------------------------------------------------------- |
|
597 // |
|
598 void CRadioUtility::CBody::RadioEventRdsDataPI( |
|
599 TInt aPi ) |
|
600 { |
|
601 #ifdef _DEBUG |
|
602 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataPI")); |
|
603 #endif |
|
604 if ( iRdsObserver ) |
|
605 { |
|
606 iRdsObserver->MrroRdsDataPI( aPi ); |
|
607 } |
|
608 } |
|
609 |
|
610 // --------------------------------------------------------------------------- |
|
611 // From class MRadioObserver. |
|
612 // Handles program type RDS data event. |
|
613 // --------------------------------------------------------------------------- |
|
614 // |
|
615 void CRadioUtility::CBody::RadioEventRdsDataPTY( |
|
616 TRsRdsProgrammeType aPty ) |
|
617 { |
|
618 #ifdef _DEBUG |
|
619 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataPTY")); |
|
620 #endif |
|
621 if ( iRdsObserver ) |
|
622 { |
|
623 iRdsObserver->MrroRdsDataPTY( aPty ); |
|
624 } |
|
625 } |
|
626 |
|
627 // --------------------------------------------------------------------------- |
|
628 // From class MRadioObserver. |
|
629 // Handles program service name RDS data event. |
|
630 // --------------------------------------------------------------------------- |
|
631 // |
|
632 void CRadioUtility::CBody::RadioEventRdsDataPS( |
|
633 TRsRdsPSName& aPs ) |
|
634 { |
|
635 #ifdef _DEBUG |
|
636 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataPS")); |
|
637 #endif |
|
638 if ( iRdsObserver ) |
|
639 { |
|
640 TRdsPSName ps; |
|
641 |
|
642 if ( aPs.Length() > 0 ) |
|
643 { |
|
644 ps.Copy(aPs); |
|
645 } |
|
646 iRdsObserver->MrroRdsDataPS( ps ); |
|
647 } |
|
648 } |
|
649 |
|
650 // --------------------------------------------------------------------------- |
|
651 // From class MRadioObserver. |
|
652 // Handles radio text RDS data event. |
|
653 // --------------------------------------------------------------------------- |
|
654 // |
|
655 void CRadioUtility::CBody::RadioEventRdsDataRT( |
|
656 TRsRdsRadioText& aRt ) |
|
657 { |
|
658 #ifdef _DEBUG |
|
659 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataRT")); |
|
660 #endif |
|
661 if ( iRdsObserver ) |
|
662 { |
|
663 TRdsRadioText rt; |
|
664 |
|
665 if ( aRt.Length() > 0 ) |
|
666 { |
|
667 rt.Copy( aRt ); |
|
668 } |
|
669 |
|
670 iRdsObserver->MrroRdsDataRT( rt ); |
|
671 } |
|
672 } |
|
673 |
|
674 // --------------------------------------------------------------------------- |
|
675 // From class MRadioObserver. |
|
676 // Handles radio text plus RDS data event. |
|
677 // --------------------------------------------------------------------------- |
|
678 // |
|
679 void CRadioUtility::CBody::RadioEventRdsDataRTplus( |
|
680 TRsRdsRTplusClass aRtPlusClass, |
|
681 TRsRdsRadioText& aRtPlusData ) |
|
682 { |
|
683 #ifdef _DEBUG |
|
684 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataRTplus")); |
|
685 #endif |
|
686 if ( iRdsObserver ) |
|
687 { |
|
688 TRdsRTplusClass rtPlusClass; |
|
689 TRdsRadioText rtPlusData; |
|
690 |
|
691 rtPlusClass = (TRdsRTplusClass)aRtPlusClass; |
|
692 |
|
693 if ( aRtPlusData.Length() > 0 ) |
|
694 { |
|
695 rtPlusData.Copy( aRtPlusData ); |
|
696 } |
|
697 iRdsObserver->MrroRdsDataRTplus( rtPlusClass, rtPlusData ); |
|
698 } |
|
699 } |
|
700 |
|
701 // --------------------------------------------------------------------------- |
|
702 // From class MRadioObserver. |
|
703 // Handles clock time RDS data event. |
|
704 // --------------------------------------------------------------------------- |
|
705 // |
|
706 void CRadioUtility::CBody::RadioEventRdsDataCT( |
|
707 TDateTime& aCt ) |
|
708 { |
|
709 #ifdef _DEBUG |
|
710 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataCT")); |
|
711 #endif |
|
712 if ( iRdsObserver ) |
|
713 { |
|
714 iRdsObserver->MrroRdsDataCT( aCt ); |
|
715 } |
|
716 } |
|
717 |
|
718 // --------------------------------------------------------------------------- |
|
719 // From class MRadioObserver. |
|
720 // Handles traffic annoucement RDS data event. |
|
721 // --------------------------------------------------------------------------- |
|
722 // |
|
723 void CRadioUtility::CBody::RadioEventRdsDataTA( |
|
724 TBool aTaOn ) |
|
725 { |
|
726 #ifdef _DEBUG |
|
727 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataTA")); |
|
728 #endif |
|
729 if ( iRdsObserver ) |
|
730 { |
|
731 iRdsObserver->MrroRdsDataTA( aTaOn ); |
|
732 } |
|
733 } |
|
734 |
|
735 // --------------------------------------------------------------------------- |
|
736 // From class MRadioObserver. |
|
737 // Handles alternate frequency search begin event. |
|
738 // --------------------------------------------------------------------------- |
|
739 // |
|
740 void CRadioUtility::CBody::RadioEventRdsSearchBeginAF() |
|
741 { |
|
742 #ifdef _DEBUG |
|
743 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsSearchBeginAF")); |
|
744 #endif |
|
745 if ( iRdsObserver ) |
|
746 { |
|
747 iRdsObserver->MrroRdsSearchBeginAF(); |
|
748 } |
|
749 } |
|
750 |
|
751 |
|
752 // --------------------------------------------------------------------------- |
|
753 // From class MRadioObserver. |
|
754 // Handles alternate frequency search end event. |
|
755 // --------------------------------------------------------------------------- |
|
756 // |
|
757 void CRadioUtility::CBody::RadioEventRdsSearchEndAF( |
|
758 TInt aError, |
|
759 TInt aFrequency ) |
|
760 { |
|
761 #ifdef _DEBUG |
|
762 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsSearchEndAF")); |
|
763 #endif |
|
764 if ( iRdsObserver ) |
|
765 { |
|
766 iRdsObserver->MrroRdsSearchEndAF( aError, aFrequency ); |
|
767 } |
|
768 } |
|
769 |
|
770 // --------------------------------------------------------------------------- |
|
771 // From class MRadioObserver. |
|
772 // Handles station change to traffic annoucement event. |
|
773 // --------------------------------------------------------------------------- |
|
774 // |
|
775 void CRadioUtility::CBody::RadioEventRdsStationChangeTA( |
|
776 TInt aFrequency ) |
|
777 { |
|
778 #ifdef _DEBUG |
|
779 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsStationChangeTA")); |
|
780 #endif |
|
781 if ( iRdsObserver ) |
|
782 { |
|
783 iRdsObserver->MrroRdsStationChangeTA( aFrequency ); |
|
784 } |
|
785 } |
|
786 |
|
787 // --------------------------------------------------------------------------- |
|
788 // From class MRadioObserver. |
|
789 // Handles automatic switching setting change event. |
|
790 // --------------------------------------------------------------------------- |
|
791 // |
|
792 void CRadioUtility::CBody::RadioEventRdsAutomaticSwitchingChange( |
|
793 TBool aAuto ) |
|
794 { |
|
795 #ifdef _DEBUG |
|
796 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsAutomaticSwitchingChange")); |
|
797 #endif |
|
798 if ( iRdsObserver ) |
|
799 { |
|
800 iRdsObserver->MrroRdsEventAutomaticSwitchingChange( aAuto ); |
|
801 } |
|
802 } |
|
803 |
|
804 // --------------------------------------------------------------------------- |
|
805 // From class MRadioObserver. |
|
806 // Handles automatic traffic annoucement setting change event. |
|
807 // --------------------------------------------------------------------------- |
|
808 // |
|
809 void CRadioUtility::CBody::RadioEventRdsAutomaticTrafficAnnouncement( |
|
810 TBool aAuto ) |
|
811 { |
|
812 #ifdef _DEBUG |
|
813 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsAutomaticTrafficAnnouncement")); |
|
814 #endif |
|
815 if ( iRdsObserver ) |
|
816 { |
|
817 iRdsObserver->MrroRdsEventAutomaticTrafficAnnouncement( aAuto ); |
|
818 } |
|
819 } |
|
820 |
|
821 // --------------------------------------------------------------------------- |
|
822 // From class MRadioObserver. |
|
823 // Handles RDS signal status change event. |
|
824 // --------------------------------------------------------------------------- |
|
825 // |
|
826 void CRadioUtility::CBody::RadioEventRdsSignalChange( |
|
827 TBool aSignal ) |
|
828 { |
|
829 #ifdef _DEBUG |
|
830 RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsSignalChange")); |
|
831 #endif |
|
832 if ( iRdsObserver ) |
|
833 { |
|
834 iRdsObserver->MrroRdsEventSignalChange( aSignal ); |
|
835 } |
|
836 } |
|
837 |
|
838 |
|
839 //End of File |
|
840 |