|
1 /* |
|
2 * Copyright (c) 2006 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: This class provides an interface for accessing the Radio Data System (RDS) |
|
15 * for FM sound broadcasting. CRadioRdsUtility can also be used with |
|
16 * Radio Broadcast Data System (RDBS). Client must first instantiate |
|
17 * CRadioFmTunerUtility before this utility can be used. |
|
18 * |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #ifndef C_RADIORDSUTILITY_H |
|
25 #define C_RADIORDSUTILITY_H |
|
26 |
|
27 #include <RadioUtility.h> |
|
28 |
|
29 class RRadioSession; |
|
30 |
|
31 /** |
|
32 * RDS control error definitions. |
|
33 * In addition to the standard system error code, the following error codes may |
|
34 * be returned. |
|
35 */ |
|
36 typedef TInt TRdsControlError; |
|
37 const TRdsControlError KRdsErrHardwareFaulty = -13050; |
|
38 const TRdsControlError KRdsErrNotPermittedInCurrentState = -13051; |
|
39 const TRdsControlError KRdsErrDuplicateRequest = -13052; |
|
40 |
|
41 /** |
|
42 * RDS Programme Type. |
|
43 * |
|
44 * The interpretation of values of this type depends on the origin of the RDS |
|
45 * broadcast: in North America, a slightly different standard, RBDS, is used. |
|
46 * These PTY codes are defined by static values KRbdsPtyXxxxx, for example |
|
47 * KRbdsPtySoftRock. |
|
48 * |
|
49 * Elsewhere, including Europe, the RDS standard is used. In these areas, the |
|
50 * PTY codes are defined by static values KRdsPtyXxxxx, for example |
|
51 * KRdsPtyChildrensProgrammes. |
|
52 * |
|
53 * In all other important aspects, the European RDS and North American RBDS |
|
54 * standards are identical. |
|
55 */ |
|
56 typedef TInt TRdsProgrammeType; |
|
57 |
|
58 const TRdsProgrammeType KRdsPtyNone = 0; |
|
59 const TRdsProgrammeType KRdsPtyNews = 1; |
|
60 const TRdsProgrammeType KRdsPtyCurrentAffairs = 2; |
|
61 const TRdsProgrammeType KRdsPtyInformation = 3; |
|
62 const TRdsProgrammeType KRdsPtySport = 4; |
|
63 const TRdsProgrammeType KRdsPtyEducation = 5; |
|
64 const TRdsProgrammeType KRdsPtyDrama = 6; |
|
65 const TRdsProgrammeType KRdsPtyCulture = 7; |
|
66 const TRdsProgrammeType KRdsPtyScience = 8; |
|
67 const TRdsProgrammeType KRdsPtyVariedSpeech = 9; |
|
68 const TRdsProgrammeType KRdsPtyPopMusic = 10; |
|
69 const TRdsProgrammeType KRdsPtyRockMusic = 11; |
|
70 const TRdsProgrammeType KRdsPtyEasyListening = 12; |
|
71 const TRdsProgrammeType KRdsPtyLightClassical = 13; |
|
72 const TRdsProgrammeType KRdsPtySeriousClassical = 14; |
|
73 const TRdsProgrammeType KRdsPtyOtherMusic = 15; |
|
74 const TRdsProgrammeType KRdsPtyWeather = 16; |
|
75 const TRdsProgrammeType KRdsPtyFinance = 17; |
|
76 const TRdsProgrammeType KRdsPtyChildrensProgrammes = 18; |
|
77 const TRdsProgrammeType KRdsPtySocialAffairs = 19; |
|
78 const TRdsProgrammeType KRdsPtyReligion = 20; |
|
79 const TRdsProgrammeType KRdsPtyPhoneIn = 21; |
|
80 const TRdsProgrammeType KRdsPtyTravel = 22; |
|
81 const TRdsProgrammeType KRdsPtyLeisure = 23; |
|
82 const TRdsProgrammeType KRdsPtyJazzMusic = 24; |
|
83 const TRdsProgrammeType KRdsPtyCountryMusic = 25; |
|
84 const TRdsProgrammeType KRdsPtyNationalMusic = 26; |
|
85 const TRdsProgrammeType KRdsPtyOldiesMusic = 27; |
|
86 const TRdsProgrammeType KRdsPtyFolkMusic = 28; |
|
87 const TRdsProgrammeType KRdsPtyDocumentary = 29; |
|
88 const TRdsProgrammeType KRdsPtyAlarmTest = 30; |
|
89 const TRdsProgrammeType KRdsPtyAlarm = 31; |
|
90 |
|
91 const TRdsProgrammeType KRbdsPtyNone = 0; |
|
92 const TRdsProgrammeType KRbdsPtyNews = 1; |
|
93 const TRdsProgrammeType KRbdsPtyInformation = 2; |
|
94 const TRdsProgrammeType KRbdsPtySports = 3; |
|
95 const TRdsProgrammeType KRbdsPtyTalk = 4; |
|
96 const TRdsProgrammeType KRbdsPtyRock = 5; |
|
97 const TRdsProgrammeType KRbdsPtyClassicRock = 6; |
|
98 const TRdsProgrammeType KRbdsPtyAdultHits = 7; |
|
99 const TRdsProgrammeType KRbdsPtySoftRock = 8; |
|
100 const TRdsProgrammeType KRbdsPtyTop40 = 9; |
|
101 const TRdsProgrammeType KRbdsPtyCountry = 10; |
|
102 const TRdsProgrammeType KRbdsPtyOldies = 11; |
|
103 const TRdsProgrammeType KRbdsPtySoft = 12; |
|
104 const TRdsProgrammeType KRbdsPtyNostalgia = 13; |
|
105 const TRdsProgrammeType KRbdsPtyJazz = 14; |
|
106 const TRdsProgrammeType KRbdsPtyClassical = 15; |
|
107 const TRdsProgrammeType KRbdsPtyRhythmAndBlues = 16; |
|
108 const TRdsProgrammeType KRbdsPtySoftRhythmAndBlues = 17; |
|
109 const TRdsProgrammeType KRbdsPtyLanguage = 18; |
|
110 const TRdsProgrammeType KRbdsPtyReligiousMusic = 19; |
|
111 const TRdsProgrammeType KRbdsPtyReligiousTalk = 20; |
|
112 const TRdsProgrammeType KRbdsPtyPersonality = 21; |
|
113 const TRdsProgrammeType KRbdsPtyPublic = 22; |
|
114 const TRdsProgrammeType KRbdsPtyCollege = 23; |
|
115 const TRdsProgrammeType KRbdsPtyUnassigned1 = 24; |
|
116 const TRdsProgrammeType KRbdsPtyUnassigned2 = 25; |
|
117 const TRdsProgrammeType KRbdsPtyUnassigned3 = 26; |
|
118 const TRdsProgrammeType KRbdsPtyUnassigned4 = 27; |
|
119 const TRdsProgrammeType KRbdsPtyUnassigned5 = 28; |
|
120 const TRdsProgrammeType KRbdsPtyWeather = 29; |
|
121 const TRdsProgrammeType KRbdsPtyEmergencyTest = 30; |
|
122 const TRdsProgrammeType KRbdsPtyEmergency = 31; |
|
123 |
|
124 /** |
|
125 * Table 1: Class codes for RTplus content types |
|
126 * Defined in Radiotext plus (RTplus) Specification Version 2.1 |
|
127 * RDS Forum 2006-07-21 - R06/040_1 |
|
128 */ |
|
129 enum TRdsRTplusClass |
|
130 { |
|
131 // Category: Item (0 - 10) |
|
132 ERTplusItemDummy = 0, |
|
133 ERTplusItemTitle, |
|
134 ERTplusItemAlbum, |
|
135 ERTplusItemTrackNumber, |
|
136 ERTplusItemArtist, |
|
137 ERTplusItemComposition, |
|
138 ERTplusItemMovement, |
|
139 ERTplusItemConductor, |
|
140 ERTplusItemComposer, |
|
141 ERTplusItemBand, |
|
142 ERTplusItemComment, |
|
143 ERTplusItemGenre, |
|
144 // Category: Info (12 - 30) |
|
145 ERTplusInfoNews, |
|
146 ERTplusInfoNewsLocal, |
|
147 ERTplusInfoStockMarket, |
|
148 ERTplusInfoSport, |
|
149 ERTplusInfoLottery, |
|
150 ERTplusInfoHoroscope, |
|
151 ERTplusInfoDailyDiversion, |
|
152 ERTplusInfoHealth, |
|
153 ERTplusInfoEvent, |
|
154 ERTplusInfoSzene, |
|
155 ERTplusInfoCinema, |
|
156 ERTplusInfoTV, |
|
157 ERTplusInfoDateTime, |
|
158 ERTplusInfoWeather, |
|
159 ERTplusInfoTraffic, |
|
160 ERTplusInfoAlarm, |
|
161 ERTplusInfoAdvisertisement, |
|
162 ERTplusInfoURL, |
|
163 ERTplusInfoOther, |
|
164 // Category: Programme (31 - 40) |
|
165 ERTplusStationNameShort, |
|
166 ERTplusStationNameLong, |
|
167 ERTplusProgramNow, |
|
168 ERTplusProgramNext, |
|
169 ERTplusProgramPart, |
|
170 ERTplusProgramHost, |
|
171 ERTplusProgramEditorialStaff, |
|
172 ERTplusStationFrequency, |
|
173 ERTplusProgramHomepage, |
|
174 ERTplusProgramSubChannel, |
|
175 // Category: Interactivity (41 - 53) |
|
176 ERTplusPhoneHotline, |
|
177 ERTplusPhoneStudio, |
|
178 ERTplusPhoneOther, |
|
179 ERTplusSmsStudio, |
|
180 ERTplusSmsOther, |
|
181 ERTplusEmailHotline, |
|
182 ERTplusEmailStudio, |
|
183 ERTplusEmailOther, |
|
184 ERTplusMmsOther, |
|
185 ERTplusChat, |
|
186 ERTplusChatCenter, |
|
187 ERTplusVoteQuestion, |
|
188 ERTplusVoteCenter, |
|
189 // Category: Reserved for future (54 - 55) |
|
190 ERTplusRfuClass54, |
|
191 ERTplusRfuClass55, |
|
192 // Category: Private classes (56 - 58) |
|
193 ERTplusPrivateClass56, |
|
194 ERTplusPrivateClass57, |
|
195 ERTplusPrivateClass58, |
|
196 // Category: Descriptor (59 - 63) |
|
197 ERTplusPlace, |
|
198 ERTplusAppointment, |
|
199 ERTplusIdentifier, |
|
200 ERTplusPurchase, |
|
201 ERTplusGetData |
|
202 }; |
|
203 |
|
204 |
|
205 /** |
|
206 * RDS Function Bit Flags used by TRdsCapabilities and TRdsData. |
|
207 * |
|
208 * @since S60 3.2 |
|
209 */ |
|
210 enum TRdsFeatures |
|
211 { |
|
212 ERdsProgrammeIdentification = 0x001, |
|
213 ERdsProgrammeType = 0x002, |
|
214 ERdsProgrammeService = 0x004, |
|
215 ERdsRadioText = 0x008, |
|
216 ERdsRadioTextPlus = 0x010, |
|
217 ERdsClockTime = 0x020, |
|
218 ERdsTrafficProgramme = 0x040, |
|
219 ERdsTrafficAnnouncement = 0x080, |
|
220 ERdsAlternateFrequency = 0x100 |
|
221 }; |
|
222 |
|
223 |
|
224 /** |
|
225 * The RDS Capabilities class defines the capabilities of the RDS control on the |
|
226 * device, as retrieved using the function GetCapabilities. |
|
227 * |
|
228 * @lib RadioUtility.lib |
|
229 * @since S60 3.2 |
|
230 */ |
|
231 class TRdsCapabilities |
|
232 { |
|
233 public: |
|
234 // Bitfield as defined by TRdsFeatures with the bits of the supported functions set |
|
235 // Valid bitfieds are: |
|
236 // ERdsProgrammeIdentification | ERdsProgrammeType | ERdsProgrammeService | |
|
237 // ERdsRadioText | ERdsRadioTextPlus | ERdsClockTime | ERdsTrafficProgramme | |
|
238 // ERdsTrafficAnnouncement | ERdsAlternateFrequency |
|
239 TUint32 iRdsFunctions; |
|
240 // Reserved for future |
|
241 TUint32 iAdditionalFunctions1; |
|
242 // Reserved for future |
|
243 TUint32 iAdditionalFunctions2; |
|
244 }; |
|
245 |
|
246 |
|
247 /** |
|
248 * This class provides RDS features that can be enabled or disabled. Used in |
|
249 * function NotifyRdsDataChange. |
|
250 * |
|
251 * @lib RadioUtility.lib |
|
252 * @since S60 3.2 |
|
253 */ |
|
254 class TRdsData |
|
255 { |
|
256 public: |
|
257 // A value indicating a set containing all RDS data encapsulated by class TRdsData. |
|
258 static const TUint32 KAllRdsData = ( ERdsProgrammeIdentification | ERdsProgrammeType | ERdsProgrammeService |
|
259 | ERdsRadioText | ERdsClockTime | ERdsTrafficAnnouncement ); |
|
260 |
|
261 public: |
|
262 // Bitfield as defined by TRdsFeatures with the bits of the supported functions set |
|
263 // Valid bitfieds are: |
|
264 // ERdsProgrammeIdentification | ERdsProgrammeType | ERdsProgrammeService | |
|
265 // ERdsRadioText | ERdsClockTime | ERdsTrafficAnnouncement |
|
266 TUint32 iRdsFunctions; |
|
267 // Reserved for future |
|
268 TUint32 iAdditionalFunctions1; |
|
269 // Reserved for future |
|
270 TUint32 iAdditionalFunctions2; |
|
271 }; |
|
272 |
|
273 |
|
274 /** Programme Service name, 8 characters */ |
|
275 typedef TBuf16<8> TRdsPSName; |
|
276 /** Radio Text, 64 characters */ |
|
277 typedef TBuf16<64> TRdsRadioText; |
|
278 |
|
279 |
|
280 /** |
|
281 * This class provides the interface class to be implemented by object receiving request |
|
282 * complete notification from RDS control. These functions are called once the asynchronous |
|
283 * request completes successfully or with an error. |
|
284 * |
|
285 * In addition, this class provides the interface for receiving events from FM tuner control. |
|
286 * |
|
287 * @since S60 3.2 |
|
288 */ |
|
289 class MRadioRdsObserver |
|
290 { |
|
291 public: |
|
292 |
|
293 /** |
|
294 * Station seek by Programme Type(PTY) complete event. This event is asynchronous and |
|
295 * is received after a call to CRadioRdsUtility::StationSeekByPTY. |
|
296 * |
|
297 * @since S60 3.2 |
|
298 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
299 * @param aFrequency The frequency(Hz) of the radio station that was found. |
|
300 */ |
|
301 virtual void MrroStationSeekByPTYComplete( TInt aError, TInt aFrequency ) = 0; |
|
302 |
|
303 /** |
|
304 * Station seek by Traffic Announcement(TA) complete event. This event is asynchronous |
|
305 * and is received after a call to CRadioRdsUtility::StationSeekByTA. |
|
306 * |
|
307 * @since S60 3.2 |
|
308 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
309 * @param aFrequency The frequency(Hz) of the radio station that was found. |
|
310 */ |
|
311 virtual void MrroStationSeekByTAComplete( TInt aError, TInt aFrequency ) = 0; |
|
312 |
|
313 /** |
|
314 * Station seek by Traffic Programme(TP) complete event. This event is asynchronous and |
|
315 * is received after a call to CRadioRdsUtility::StationSeekByTP. |
|
316 * |
|
317 * @since S60 3.2 |
|
318 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
319 * @param aFrequency The frequency(Hz) of the radio station that was found. |
|
320 */ |
|
321 virtual void MrroStationSeekByTPComplete( TInt aError, TInt aFrequency ) = 0; |
|
322 |
|
323 |
|
324 /** |
|
325 * Get frequencies by Programme Type(PTY) complete event. This event is asynchronous |
|
326 * and is received after a call to CRadioRdsUtility::GetFreqByPTY. |
|
327 * |
|
328 * Client takes ownership of the array and therefore is responsible for deallocating it. |
|
329 * |
|
330 * @since S60 3.2 |
|
331 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
332 * @param aFreqList Array of frequencies (Hz), valid only if aError is KErrNone. |
|
333 */ |
|
334 virtual void MrroGetFreqByPTYComplete( TInt aError, RArray<TInt>& aFreqList ) = 0; |
|
335 |
|
336 /** |
|
337 * Get frequencies by Traffic Announcement(TA) complete event. This event is asynchronous |
|
338 * and is received after a call to CRadioRdsUtility::GetFreqByTA. |
|
339 * |
|
340 * Client takes ownership of the array and therefore is responsible for deallocating it. |
|
341 * |
|
342 * @since S60 3.2 |
|
343 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
344 * @param aFreqList Array of frequencies (Hz), valid only if aError is KErrNone. |
|
345 */ |
|
346 virtual void MrroGetFreqByTAComplete( TInt aError, RArray<TInt>& aFreqList ) = 0; |
|
347 |
|
348 /** |
|
349 * Get Programme Service names (PS) by Programme Type(PTY) complete event. This event is |
|
350 * asynchronous and is received after a call to CRadioRdsUtility::GetPSByPTY. |
|
351 * |
|
352 * Client takes ownership of the array and therefore is responsible for deallocating it. |
|
353 * |
|
354 * @since S60 3.2 |
|
355 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
356 * @param aPsList Array of programme service names, valid only if aError is KErrNone. |
|
357 */ |
|
358 virtual void MrroGetPSByPTYComplete( TInt aError, RArray<TRdsPSName>& aPsList ) = 0; |
|
359 |
|
360 /** |
|
361 * Get Programme Service names (PS) by Traffic Announcement(TA) complete event. This event is |
|
362 * asynchronous and is received after a call to CRadioRdsUtility::GetPSByTA. |
|
363 * |
|
364 * Client takes ownership of the array and therefore is responsible for deallocating it. |
|
365 * |
|
366 * @since S60 3.2 |
|
367 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
368 * @param aPsList Array of programme service names, valid only if aError is KErrNone. |
|
369 */ |
|
370 virtual void MrroGetPSByTAComplete( TInt aError, RArray<TRdsPSName>& aPsList ) = 0; |
|
371 |
|
372 /** |
|
373 * New Programme Identification(PI) is available. This event is asynchronous and is |
|
374 * received after a call to CRadioRdsUtility::NotifyRdsDataChange. Client will continue to |
|
375 * receive this notification whenever new PI is available until clients unsubscribes. |
|
376 * |
|
377 * @since S60 3.2 |
|
378 * @param aPi Programme identification |
|
379 */ |
|
380 virtual void MrroRdsDataPI( TInt aPi ) = 0; |
|
381 |
|
382 /** |
|
383 * New Programme Type(PTY) is available. This event is asynchronous and is received after |
|
384 * a call to CRadioRdsUtility::NotifyRdsDataChange. Client will continue to receive this |
|
385 * notification whenever new PTY is available until clients unsubscribes. |
|
386 * |
|
387 * @since S60 3.2 |
|
388 * @param aPty Programme type |
|
389 */ |
|
390 virtual void MrroRdsDataPTY( TRdsProgrammeType aPty ) = 0; |
|
391 |
|
392 /** |
|
393 * New Programme Service(PS) is available. This event is asynchronous and is received after |
|
394 * a call to CRadioRdsUtility::NotifyRdsDataChange. Client will continue to receive this |
|
395 * notification whenever new PS is available until clients unsubscribes. |
|
396 * |
|
397 * @since S60 3.2 |
|
398 * @param aPs Programme service |
|
399 */ |
|
400 virtual void MrroRdsDataPS( TRdsPSName& aPs ) = 0; |
|
401 |
|
402 /** |
|
403 * New Radio Text(RT) is available. This event is asynchronous and is received after |
|
404 * a call to CRadioRdsUtility::NotifyRdsDataChange. Client will continue to receive this |
|
405 * notification whenever new RT is available until clients unsubscribes. |
|
406 * |
|
407 * @since S60 3.2 |
|
408 * @param aRt Radio text |
|
409 */ |
|
410 virtual void MrroRdsDataRT( TRdsRadioText& aRt ) = 0; |
|
411 |
|
412 /** |
|
413 * Clock Time(CT) is available. This event is asynchronous and is received after a call |
|
414 * to CRadioRdsUtility::NotifyRdsDataChange. Client will continue to receive this notification |
|
415 * whenever new CT is available until clients unsubscribes. |
|
416 * |
|
417 * @since S60 3.2 |
|
418 * @param aCt Clock time |
|
419 */ |
|
420 virtual void MrroRdsDataCT( TDateTime& aCt ) = 0; |
|
421 |
|
422 /** |
|
423 * Called when Traffice Announcement(TA) status changes. This event is asynchronous |
|
424 * and is received after a call to CRadioRdsUtility::NotifyRdsDataChange. Client will continue |
|
425 * to receive this notification whenever TA status changes until clients unsubscribes. |
|
426 * |
|
427 * @since S60 3.2 |
|
428 * @param aTaOn ETrue indicates that Traffic Announcement is on. |
|
429 */ |
|
430 virtual void MrroRdsDataTA( TBool aTaOn ) = 0; |
|
431 |
|
432 /** |
|
433 * New Radio Text+(RT+) is available. This event is asynchronous and is received after |
|
434 * a call to CRadioRdsUtility::NotifyRadioTextPlusChange. Client will continue to |
|
435 * receive this notification whenever new RT+ is available until clients unsubscribes. |
|
436 * |
|
437 * @since S60 3.2 |
|
438 * @param aRtPlusClass Radio text plus class |
|
439 * @param aRtPlusData Radio text plus data |
|
440 */ |
|
441 virtual void MrroRdsDataRTplus( TRdsRTplusClass aRtPlusClass, TRdsRadioText& aRtPlusData ) = 0; |
|
442 |
|
443 /** |
|
444 * Called when tuner starts to search for an Alternate Frequency(AF) with stronger signal. |
|
445 * This event is asynchronous and is received after a call to |
|
446 * CRadioRdsUtility::SetAutomaticSwitching. Client will continue to receive this notification |
|
447 * whenever new search is started until clients turns automatic switching off. |
|
448 * |
|
449 * @since S60 3.2 |
|
450 */ |
|
451 virtual void MrroRdsSearchBeginAF() = 0; |
|
452 |
|
453 /** |
|
454 * Called when search for an Alternate Frequency(AF) ends. This event is asynchronous and |
|
455 * is received after a call to CRadioRdsUtility::SetAutomaticSwitching. Client will continue |
|
456 * to receive this notification until clients turns automatic switching off. |
|
457 * |
|
458 * Most common error codes: |
|
459 * KErrNone - Successful, new frequency found |
|
460 * KErrNotFound - Ended, but frequency hasn't changed |
|
461 * KErrCancel - Cancelled |
|
462 * |
|
463 * @since S60 3.2 |
|
464 * @param aError A standard system error code or RDS control error (TRdsControlError). |
|
465 * @param aFrequency The frequency(Hz) of the radio station that was found. |
|
466 */ |
|
467 virtual void MrroRdsSearchEndAF( TInt aError, TInt aFrequency ) = 0; |
|
468 |
|
469 /** |
|
470 * Called when the tuner has re-tuned to another frequency that is broadcasting |
|
471 * Traffic Announcement(TA). This notification sent only when the client has turned the |
|
472 * automatic traffic announcement on. |
|
473 * |
|
474 * @since S60 3.2 |
|
475 * @param aFrequency The frequency(Hz) of the radio station that was found. |
|
476 */ |
|
477 virtual void MrroRdsStationChangeTA( TInt aFrequency ) = 0; |
|
478 |
|
479 /** |
|
480 * Called when automatic switching (AF) setting changes. |
|
481 * |
|
482 * @since S60 3.2 |
|
483 * @param aAuto ETrue indicates that automatic switching is on. |
|
484 */ |
|
485 virtual void MrroRdsEventAutomaticSwitchingChange( TBool aAuto ) = 0; |
|
486 |
|
487 /** |
|
488 * Called when automatic traffic announcement setting changes. |
|
489 * |
|
490 * @since S60 3.2 |
|
491 * @param aAuto ETrue indicates that automatic traffic announcement is on. |
|
492 */ |
|
493 virtual void MrroRdsEventAutomaticTrafficAnnouncement( TBool aAuto ) = 0; |
|
494 |
|
495 /** |
|
496 * Called when RDS signal status change (i.e. signal is lost/restored). |
|
497 * |
|
498 * @since S60 3.2 |
|
499 * @param aSignal ETrue indicates that RDS signal is available in the tuned frequency. |
|
500 */ |
|
501 virtual void MrroRdsEventSignalChange( TBool aSignal ) = 0; |
|
502 }; |
|
503 |
|
504 /** |
|
505 * This class provides an interface to allow clients to control the RDS hardware |
|
506 * present on a device. |
|
507 * |
|
508 * @lib RadioUtility.lib |
|
509 * @since S60 3.2 |
|
510 */ |
|
511 class CRadioRdsUtility : public CBase |
|
512 { |
|
513 friend class CRadioUtility::CBody; |
|
514 |
|
515 public: |
|
516 |
|
517 /** |
|
518 * Close the RDS utility and free all memory allocated. |
|
519 * |
|
520 * @since S60 3.2 |
|
521 */ |
|
522 IMPORT_C void Close(); |
|
523 |
|
524 |
|
525 /** |
|
526 * Get the capabilities of the RDS control on the device. |
|
527 * |
|
528 * @since S60 3.2 |
|
529 * @param aCaps The capabilities object to fill |
|
530 * @return A standard system error code or RDS control error (TRdsControlError). |
|
531 */ |
|
532 IMPORT_C TInt GetCapabilities( TRdsCapabilities& aCaps ) const; |
|
533 |
|
534 /** |
|
535 * Get the status of the RDS reception. |
|
536 * |
|
537 * @since S60 3.2 |
|
538 * @param aRdsSignal On return, will be ETrue if RDS signal can be recepted, EFalse otherwise. |
|
539 * @return A standard system error code or RDS control error (TRdsControlError). |
|
540 */ |
|
541 IMPORT_C TInt GetRdsSignalStatus( TBool& aRdsSignal ) const; |
|
542 |
|
543 /** |
|
544 * Subscribe for notification for the specified RDS data. Client should first check |
|
545 * the capabilities to see if a feature is supported. |
|
546 * Request for notification for non-supported features will simply be ignored. |
|
547 * |
|
548 * For example, if the client wishes to be notified when new Programme Type and |
|
549 * Traffic Announcement is available: |
|
550 * iRdsData = ERdsProgrammeType | ERdsTrafficAnnouncement; |
|
551 * iRdsUtility->NotifyRdsDataChange(iRdsData); |
|
552 * |
|
553 * @since S60 3.2 |
|
554 * @param aRdsData Bitfield indicating notification request. |
|
555 * @see MRadioRdsObserver::MrroRdsDataPI |
|
556 * @see MRadioRdsObserver::MrroRdsDataPTY |
|
557 * @see MRadioRdsObserver::MrroRdsDataPS |
|
558 * @see MRadioRdsObserver::MrroRdsDataRT |
|
559 * @see MRadioRdsObserver::MrroRdsDataCT |
|
560 * @see MRadioRdsObserver::MrroRdsDataTA |
|
561 */ |
|
562 IMPORT_C TInt NotifyRdsDataChange( TRdsData aRdsData ); |
|
563 |
|
564 /** |
|
565 * Cancel NotifyRdsDataChange request. |
|
566 * |
|
567 * @since S60 3.2 |
|
568 */ |
|
569 IMPORT_C void CancelNotifyRdsDataChange(); |
|
570 |
|
571 /** |
|
572 * Subscribe for notification for the specified RadioText+ data. Client should first check |
|
573 * the capabilities to see if RT+ feature is supported. |
|
574 * Returns KErrNotSupported if RT+ is not supported. |
|
575 * |
|
576 * For example, if the client wishes to be notified only when new Title and Genre are available: |
|
577 * iRtPlusClassArray.Append(ERTplusItemTitle); |
|
578 * iRtPlusClassArray.Append(ERTplusItemTitle); |
|
579 * iRdsUtility->NotifyRadioTextPlusChangeL(iRtPlusClassArray); |
|
580 * |
|
581 * Note that if the client wishes to receive the entire radio text data chunk, client should |
|
582 * subscribe for ERdsRadioText using NotifyRdsDataChange instead. |
|
583 * |
|
584 * @since S60 3.2 |
|
585 * @param aRtPlusClasses Array of RT+ class to be notified |
|
586 * @see MRadioRdsObserver::MrroRdsDataRTplus |
|
587 */ |
|
588 IMPORT_C TInt NotifyRadioTextPlusChange( RArray<TInt>& aRtPlusClasses ); |
|
589 |
|
590 /** |
|
591 * Cancel NotifyRadioTextPlusChange request. |
|
592 * |
|
593 * @since S60 3.2 |
|
594 */ |
|
595 IMPORT_C void CancelNotifyRadioTextPlusChange(); |
|
596 |
|
597 /** |
|
598 * Turn on/off automatic switching of frequency based on Alternate Frequency. |
|
599 * This will cause RDS device to search for alternate frequency when the signal strength |
|
600 * deteriorates. User should be ready to receive MrroRdsSearchBeginAF and MrroRdsSearchEndAF. |
|
601 * Automatic switching is off by default. |
|
602 * |
|
603 * @since S60 3.2 |
|
604 * @param aAuto ETrue to turn automatic switching on, EFalse to turn it off. |
|
605 * @return A standard system error code. |
|
606 * @see MRadioRdsObserver::MrroRdsSearchBeginAF |
|
607 * @see MRadioRdsObserver::MrroRdsSearchEndAF |
|
608 */ |
|
609 IMPORT_C TInt SetAutomaticSwitching( TBool aAuto ); |
|
610 |
|
611 /** |
|
612 * Find out whether automatic switching is on or off. |
|
613 * |
|
614 * @since S60 3.2 |
|
615 * @param aAuto On return, ETrue indicates that automatic switching is enabled. |
|
616 * @return A standard system error code. |
|
617 */ |
|
618 IMPORT_C TInt GetAutomaticSwitching( TBool& aAuto ); |
|
619 |
|
620 /** |
|
621 * Cancel ongoing search for an Alternate Frequency (AF) with stronger signal. |
|
622 * |
|
623 * Client can issue this request to interrupt the search indicated with |
|
624 * MRadioRdsObserver::MrroRdsSearchBeginAF. |
|
625 * |
|
626 * @since S60 3.2 |
|
627 */ |
|
628 IMPORT_C void CancelAFSearch(); |
|
629 |
|
630 /** |
|
631 * Turns on/off automatic switching of frequency based on Traffic Announcement. |
|
632 * This will cause RDS device to search for frequencies broadcasting traffic announcement. |
|
633 * Client will be notified of frequency change though the tuner event. |
|
634 * It's up to the client to return to the previous frequency when the traffic announcement |
|
635 * is finished. |
|
636 * |
|
637 * NOTE: This is only supported in dual tuner configuration since the secondary tuner |
|
638 * needs to perform continuous scanning for frequency broadcasting traffic announcement, |
|
639 * while the primary tuner is used for normal tuner activities. |
|
640 * |
|
641 * @since S60 3.2 |
|
642 * @param aAuto ETrue indicates that automatic switching is on. |
|
643 * @return A standard system error code. |
|
644 */ |
|
645 IMPORT_C TInt SetAutomaticTrafficAnnouncement( TBool aAuto ); |
|
646 |
|
647 /** |
|
648 * Find out whether automatic traffic announcement is enabled. |
|
649 * |
|
650 * @since S60 3.2 |
|
651 * @param aAuto On return, ETrue indicates that automatic traffic announcement is on. |
|
652 * @return A standard system error code. |
|
653 */ |
|
654 IMPORT_C TInt GetAutomaticTrafficAnnouncement( TBool& aAuto ); |
|
655 |
|
656 /** |
|
657 * Asynchronous request to find a radio station with the specified Programme Type(PTY), |
|
658 * starting from the currently tuned frequency and searching in the direction specified |
|
659 * (i.e. up or down). User must be ready to receive callback method MrroStationSeekByPTYComplete |
|
660 * The station found is returned in the callback. |
|
661 * |
|
662 * @since S60 3.2 |
|
663 * @param aPty The type of programme to search for. |
|
664 * @param aSeekUp The direction to search in. Searches upwards if set to ETrue. |
|
665 * @see MRadioRdsObserver::MrroStationSeekByPTYComplete |
|
666 */ |
|
667 IMPORT_C void StationSeekByPTY( TRdsProgrammeType aPty, TBool aSeekUp ); |
|
668 |
|
669 /** |
|
670 * Asynchronous request to find a radio station with Traffic Announcement(TA), |
|
671 * starting from the currently tuned frequency and searching in the direction specified |
|
672 * (i.e. up or down). User must be ready to receive callback method MrroStationSeekByTAComplete |
|
673 * The station found is returned in the callback. |
|
674 * |
|
675 * @since S60 3.2 |
|
676 * @param aSeekUp The direction to search in. Searches upwards if set to ETrue. |
|
677 * @see MRadioRdsObserver::MrroStationSeekByTAComplete |
|
678 */ |
|
679 IMPORT_C void StationSeekByTA( TBool aSeekUp ); |
|
680 |
|
681 /** |
|
682 * Asynchronous request to find a radio station with Traffic Programme(TP), |
|
683 * starting from the currently tuned frequency and searching in the direction specified |
|
684 * (i.e. up or down). User must be ready to receive callback method MrroStationSeekByTPComplete |
|
685 * The station found is returned in the callback. |
|
686 * |
|
687 * @since S60 3.2 |
|
688 * @param aSeekUp The direction to search in. Searches upwards if set to ETrue. |
|
689 * @see MRadioRdsObserver::MrroStationSeekByTPComplete |
|
690 */ |
|
691 IMPORT_C void StationSeekByTP( TBool aSeekUp ); |
|
692 |
|
693 /** |
|
694 * Cancels an ongoing retune operation, as initiated by a call to StationSeekByPTY, |
|
695 * StationSeekByTA, or StationSeekByTP. |
|
696 * The usual callback will not occur if this has been called. |
|
697 * |
|
698 * @since S60 3.2 |
|
699 */ |
|
700 IMPORT_C void CancelRdsStationSeek(); |
|
701 |
|
702 /** |
|
703 * Asynchronous request to find all frequencies sending the given Programme Type (PTY). |
|
704 * User must be ready to receive callback method MrroGetFreqByPTYComplete. |
|
705 * |
|
706 * NOTE: This is only supported in dual tuner configuration since the secondary tuner |
|
707 * needs to perform continuous scanning for frequencies broadcasting given Programme Type |
|
708 * while the primary tuner is used for normal tuner activities. |
|
709 * Client should first check the tuner capabilities. Will return KErrNotSupported in |
|
710 * callback method if this feature is not supported. |
|
711 * |
|
712 * @since S60 3.2 |
|
713 * @param aPty The type of programme to search for |
|
714 * @see MRadioRdsObserver::MrroGetFreqByPTYComplete |
|
715 */ |
|
716 IMPORT_C void GetFreqByPTY( TRdsProgrammeType aPty ); |
|
717 |
|
718 /** |
|
719 * Cancels an ongoing request to find all frequencies sending a given Programme Type (PTY). |
|
720 * The usual callback will not occur if this has been called. |
|
721 * |
|
722 * @since S60 3.2 |
|
723 */ |
|
724 IMPORT_C void CancelGetFreqByPTY(); |
|
725 |
|
726 /** |
|
727 * Asynchronous request to find all frequencies sending Traffic Announcement (TA). User must |
|
728 * be ready to receive callback method MrroGetFreqByTAComplete. |
|
729 * |
|
730 * NOTE: This is only supported in dual tuner configuration since the secondary tuner |
|
731 * needs to perform continuous scanning for frequencies broadcasting given Traffic Announcement |
|
732 * while the primary tuner is used for normal tuner activities. |
|
733 * Client should first check the tuner capabilities. Will return KErrNotSupported in |
|
734 * callback method if this feature is not supported. |
|
735 * |
|
736 * @since S60 3.2 |
|
737 * @see MRadioRdsObserver::MrroGetFreqByTAComplete |
|
738 */ |
|
739 IMPORT_C void GetFreqByTA(); |
|
740 |
|
741 /** |
|
742 * Cancels an ongoing request to find all frequencies sending Traffic Announcement. |
|
743 * The usual callback will not occur if this has been called. |
|
744 * |
|
745 * @since S60 3.2 |
|
746 */ |
|
747 IMPORT_C void CancelGetFreqByTA(); |
|
748 |
|
749 /** |
|
750 * Asynchronous request to find all Programme Service names (PS) sending the given Programme |
|
751 * Type (PTY). User must be ready to receive callback method MrroGetPSByPTYComplete. |
|
752 * |
|
753 * NOTE: This is only supported in dual tuner configuration since the secondary tuner |
|
754 * needs to perform continuous scanning for frequencies broadcasting given Programme Type |
|
755 * while the primary tuner is used for normal tuner activities. |
|
756 * Client should first check the tuner capabilities. Will return KErrNotSupported in |
|
757 * callback method if this feature is not supported. |
|
758 * |
|
759 * @since S60 3.2 |
|
760 * @param aPty The type of programme to search for |
|
761 * @see MRadioRdsObserver::MrroGetPSByPTYComplete |
|
762 */ |
|
763 IMPORT_C void GetPSByPTY( TRdsProgrammeType aPty ); |
|
764 |
|
765 /** |
|
766 * Cancels an ongoing request to find all Programme Service names (PS) sending a given |
|
767 * Programme Type (PTY). The usual callback will not occur if this has been called. |
|
768 * |
|
769 * @since S60 3.2 |
|
770 */ |
|
771 IMPORT_C void CancelGetPSByPTY(); |
|
772 |
|
773 /** |
|
774 * Asynchronous request to find all Programme Service names (PS) sending Traffic Announcement (TA). |
|
775 * User must be ready to receive callback method MrroGetPSByTAComplete. |
|
776 * |
|
777 * NOTE: This is only supported in dual tuner configuration since the secondary tuner |
|
778 * needs to perform continuous scanning for frequencies broadcasting given Traffic Announcement |
|
779 * while the primary tuner is used for normal tuner activities. |
|
780 * Client should first check the tuner capabilities. Will return KErrNotSupported in |
|
781 * callback method if this feature is not supported. |
|
782 * |
|
783 * @since S60 3.2 |
|
784 * @see MRadioRdsObserver::MrroGetPSByTAComplete |
|
785 */ |
|
786 IMPORT_C void GetPSByTA(); |
|
787 |
|
788 /** |
|
789 * Cancels an ongoing request to find all Programme Service names (PS) sending Traffic Announcement. |
|
790 * The usual callback will not occur if this has been called. |
|
791 * |
|
792 * @since S60 3.2 |
|
793 */ |
|
794 IMPORT_C void CancelGetPSByTA(); |
|
795 |
|
796 /** |
|
797 * Get the current Programme Identification code. |
|
798 * RDS data is received over the air and may not be available immediately following |
|
799 * tune operation. If data is not available, this function will return KErrNotFound. |
|
800 * If a value is returned, this is the last known value, which may not be up to date. |
|
801 * To be notified of the most recent value, client should use NotifyRdsDataChange. |
|
802 * |
|
803 * @since S60 3.2 |
|
804 * @param aPi On return contains Programme Identification code |
|
805 * @return A standard system error code or RDS control error (TRdsControlError). |
|
806 */ |
|
807 IMPORT_C TInt GetProgrammeIdentification( TInt& aPi ); |
|
808 |
|
809 /** |
|
810 * Get the current Programme Type. |
|
811 * RDS data is received over the air and may not be available immediately following |
|
812 * tune operation. If data is not available, this function will return KErrNotFound. |
|
813 * If a value is returned, this is the last known value, which may not be up to date. |
|
814 * To be notified of the most recent value, client should use NotifyRdsDataChange. |
|
815 * |
|
816 * @since S60 3.2 |
|
817 * @param aPty On return contains Programme Type |
|
818 * @return A standard system error code or RDS control error (TRdsControlError). |
|
819 */ |
|
820 IMPORT_C TInt GetProgrammeType( TRdsProgrammeType& aPty ); |
|
821 |
|
822 /** |
|
823 * Get the current Programme Service name. |
|
824 * RDS data is received over the air and may not be available immediately following |
|
825 * tune operation. If data is not available, this function will return KErrNotFound. |
|
826 * If a value is returned, this is the last known value, which may not be up to date. |
|
827 * To be notified of the most recent value, client should use NotifyRdsDataChange. |
|
828 * |
|
829 * Programme Service name is fixed to 8 characters. |
|
830 * |
|
831 * @since S60 3.2 |
|
832 * @param aPs On return contains Programme Service name |
|
833 * @return A standard system error code or RDS control error (TRdsControlError). |
|
834 */ |
|
835 IMPORT_C TInt GetProgrammeService( TRdsPSName& aPs ); |
|
836 |
|
837 /** |
|
838 * Get the current Radio Text. |
|
839 * RDS data is received over the air and may not be available immediately following |
|
840 * tune operation. If data is not available, this function will return KErrNotFound. |
|
841 * If a value is returned, this is the last known value, which may not be up to date. |
|
842 * To be notified of the most recent value, client should use NotifyRdsDataChange. |
|
843 * |
|
844 * The maximum possible length for radio text is 64 characters. |
|
845 * |
|
846 * @since S60 3.2 |
|
847 * @param aRt On return contains Radio Text |
|
848 * @return A standard system error code or RDS control error (TRdsControlError). |
|
849 */ |
|
850 IMPORT_C TInt GetRadioText( TRdsRadioText& aRt ); |
|
851 |
|
852 /** |
|
853 * Get the current Radio Text+. |
|
854 * RDS data is received over the air and may not be available immediately following |
|
855 * tune operation. If data is not available, this function will return KErrNotFound. |
|
856 * If a value is returned, this is the last known value, which may not be up to date. |
|
857 * To be notified of the most recent value, client should use NotifyRdsDataChange. |
|
858 * |
|
859 * The maximum possible length for radio text+ field is 64 characters. |
|
860 * |
|
861 * @since S60 3.2 |
|
862 * @param aRtPlusClass Radio text plus class |
|
863 * @param aRtPlusData On return contains Radio Text+ field |
|
864 * @return A standard system error code or RDS control error (TRdsControlError). |
|
865 */ |
|
866 IMPORT_C TInt GetRadioTextPlus( TRdsRTplusClass aRtPlusClass, TRdsRadioText& aRtPlusData ); |
|
867 |
|
868 /** |
|
869 * Get the current Clock Time and date. |
|
870 * RDS data is received over the air and may not be available immediately following |
|
871 * tune operation. If data is not available, this function will return KErrNotFound. |
|
872 * If a value is returned, this is the last known value, which may not be up to date. |
|
873 * To be notified of the most recent value, client should use NotifyRdsDataChange. |
|
874 * |
|
875 * @since S60 3.2 |
|
876 * @param aCt On return contains current time and date |
|
877 * @return A standard system error code or RDS control error (TRdsControlError). |
|
878 */ |
|
879 IMPORT_C TInt GetClockTime( TDateTime& aCt ); |
|
880 |
|
881 /** |
|
882 * Get Traffic Announcement status at the current station. |
|
883 * |
|
884 * @since S60 3.2 |
|
885 * @param aTaStatus On return, will be ETrue if current station has ongoing traffic announcement |
|
886 * @return A standard system error code or RDS control error (TRdsControlError). |
|
887 */ |
|
888 IMPORT_C TInt GetTrafficAnnouncementStatus( TBool& aTaStatus ); |
|
889 |
|
890 /** |
|
891 * Get Traffic Programme status at the current station. |
|
892 * |
|
893 * @since S60 3.2 |
|
894 * @param aTpStatus On return, will be ETrue if current station supports traffic programme |
|
895 * @return A standard system error code or RDS control error (TRdsControlError). |
|
896 */ |
|
897 IMPORT_C TInt GetTrafficProgrammeStatus( TBool& aTpStatus ); |
|
898 |
|
899 private: |
|
900 |
|
901 /** |
|
902 * Factory function to create a new instance of the RDS utility. |
|
903 * |
|
904 * @since S60 3.2 |
|
905 * @param aRadioSession Reference to radio session |
|
906 * @param aObserver The observer object for receiving async completion callbacks |
|
907 * @return A new RDS utility object. |
|
908 */ |
|
909 static CRadioRdsUtility* NewL( RRadioSession& aRadioSession, MRadioRdsObserver& aObserver ); |
|
910 |
|
911 virtual ~CRadioRdsUtility(); |
|
912 |
|
913 CRadioRdsUtility(); |
|
914 |
|
915 void ConstructL(); |
|
916 |
|
917 private: // data |
|
918 |
|
919 class CBody; |
|
920 |
|
921 /** |
|
922 * RDS utility implementation body |
|
923 * Own. |
|
924 */ |
|
925 CBody* iBody; |
|
926 }; |
|
927 |
|
928 #endif // C_RADIORDSUTILITY_H |
|
929 |
|
930 // End of File |