|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CRADIORDSRECEIVERBASE_H |
|
19 #define CRADIORDSRECEIVERBASE_H |
|
20 |
|
21 #include <radiordsutility.h> |
|
22 |
|
23 #include "mradioenginesettings.h" |
|
24 #include "mradiordsdataobserver.h" |
|
25 #include "mradiordsreceiver.h" |
|
26 |
|
27 class CRadioUtility; |
|
28 class CRadioPubSub; |
|
29 |
|
30 NONSHARABLE_CLASS( CRadioRdsReceiverBase ) : public CBase |
|
31 , public MRadioRdsReceiver |
|
32 , public MRadioRdsObserver |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * The destructor |
|
38 */ |
|
39 virtual ~CRadioRdsReceiverBase(); |
|
40 |
|
41 /** |
|
42 * Adds an observer wich will be notified of the new RDS data |
|
43 * If observer already exists, it is not added |
|
44 * |
|
45 * @param aObserver pointer of the observer instance. |
|
46 */ |
|
47 void AddObserverL( MRadioRdsDataObserver* aObserver ); |
|
48 |
|
49 /** |
|
50 * Removes the rds observer. |
|
51 */ |
|
52 void RemoveObserver( MRadioRdsDataObserver* aObserver ); |
|
53 |
|
54 /** |
|
55 * Getter for automatic switching state of alternate frequencies |
|
56 * |
|
57 * @return ETrue if automatic switching is enabled |
|
58 */ |
|
59 TBool AutomaticSwitchingEnabled() const; |
|
60 |
|
61 /** |
|
62 * Getter for the programme service name |
|
63 * |
|
64 * @return Programme service name |
|
65 */ |
|
66 const TDesC& ProgrammeService() const; |
|
67 |
|
68 /** |
|
69 * Getter for the radio text. |
|
70 * |
|
71 * @return Radio text. |
|
72 */ |
|
73 const TDesC& RadioText() const; |
|
74 |
|
75 /** |
|
76 * Getter for the RDS signal availability |
|
77 * |
|
78 * @return ETrue if RDS signal is available, otherwise EFalse |
|
79 */ |
|
80 TBool SignalAvailable() const; |
|
81 |
|
82 /** |
|
83 * Setter for automatic switching of alternate frequencies |
|
84 * If this method is overridden, the base implementation should be called |
|
85 * |
|
86 * @param aEnable ETrue, if automatic swithing is to be enabled |
|
87 */ |
|
88 virtual void SetAutomaticSwitchingL( TBool aEnable ); |
|
89 |
|
90 /** |
|
91 * Clears the RDS information |
|
92 */ |
|
93 void ClearRdsInformation(); |
|
94 |
|
95 protected: |
|
96 |
|
97 CRadioRdsReceiverBase( MRadioEngineSettings& aSettings ); |
|
98 |
|
99 void BaseConstructL(); |
|
100 |
|
101 // from base class MRadioRdsObserver |
|
102 |
|
103 void MrroStationSeekByPTYComplete( TInt aError, TInt aFrequency ); |
|
104 void MrroStationSeekByTAComplete( TInt aError, TInt aFrequency ); |
|
105 void MrroStationSeekByTPComplete( TInt aError, TInt aFrequency ); |
|
106 void MrroGetFreqByPTYComplete( TInt aError, RArray<TInt>& aFreqList ); |
|
107 void MrroGetFreqByTAComplete( TInt aError, RArray<TInt>& aFreqList ); |
|
108 void MrroGetPSByPTYComplete( TInt aError, RArray<TRdsPSName>& aPsList ); |
|
109 void MrroGetPSByTAComplete( TInt aError, RArray<TRdsPSName>& aPsList ); |
|
110 void MrroRdsDataPI( TInt aPi ); |
|
111 void MrroRdsDataPTY( TRdsProgrammeType aPty ); |
|
112 void MrroRdsDataPS( TRdsPSName& aPs ); |
|
113 void MrroRdsDataRT( TRdsRadioText& aRt ); |
|
114 void MrroRdsDataCT( TDateTime& aCt ); |
|
115 void MrroRdsDataTA( TBool aTaOn ); |
|
116 void MrroRdsDataRTplus( TRdsRTplusClass aRtPlusClass, TRdsRadioText& aRtPlusData ); |
|
117 void MrroRdsSearchBeginAF(); |
|
118 void MrroRdsSearchEndAF( TInt aError, TInt aFrequency ); |
|
119 void MrroRdsStationChangeTA( TInt aFrequency ); |
|
120 void MrroRdsEventAutomaticSwitchingChange( TBool aAuto ); |
|
121 void MrroRdsEventAutomaticTrafficAnnouncement( TBool aAuto ); |
|
122 void MrroRdsEventSignalChange( TBool aSignal ); |
|
123 |
|
124 protected: // data |
|
125 |
|
126 /** |
|
127 * The radio settings |
|
128 */ |
|
129 MRadioEngineSettings& iSettings; |
|
130 |
|
131 /** |
|
132 * Publish&Subscribe object. Can be NULL. |
|
133 * Not own. |
|
134 */ |
|
135 CRadioPubSub* iPubSub; |
|
136 |
|
137 private: // data |
|
138 |
|
139 /** |
|
140 * Array of RDS observers. |
|
141 */ |
|
142 RPointerArray<MRadioRdsDataObserver> iObservers; |
|
143 |
|
144 /** |
|
145 * The programme service name cache. |
|
146 * Own. |
|
147 */ |
|
148 HBufC* iPsName; |
|
149 |
|
150 /** |
|
151 * The RDS radio text |
|
152 * Own. |
|
153 */ |
|
154 RBuf iRadioText; |
|
155 |
|
156 /** |
|
157 * ETrue if the RDS signal is available |
|
158 */ |
|
159 TBool iSignalAvailable; |
|
160 |
|
161 /** |
|
162 * ETrue if AF is enabled |
|
163 */ |
|
164 TBool iAfEnabled; |
|
165 |
|
166 }; |
|
167 |
|
168 #endif // CRADIORDSRECEIVERBASE_H |