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