1 /* |
|
2 * Copyright (c) 2006-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: The RDS receiver simulator for FM Radio |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFMRADIORDSRECEIVERSIMULATOR_H |
|
20 #define CFMRADIORDSRECEIVERSIMULATOR_H |
|
21 |
|
22 #include "fmradioengineradiosettings.h" |
|
23 #include "fmradiordsobserver.h" |
|
24 #include "fmradiordsreceiverbase.h" |
|
25 |
|
26 NONSHARABLE_CLASS( CFMRadioRdsReceiverSimulator ) : public CFMRadioRdsReceiverBase |
|
27 { |
|
28 public: |
|
29 |
|
30 /** |
|
31 * The two-phased constructor |
|
32 * |
|
33 * @param aSettings The radio settings |
|
34 */ |
|
35 static CFMRadioRdsReceiverSimulator* NewL( TRadioSettings& aSettings ); |
|
36 |
|
37 /** |
|
38 * The destructor |
|
39 */ |
|
40 virtual ~CFMRadioRdsReceiverSimulator(); |
|
41 |
|
42 // from CFMRadioRdsReceiverBase |
|
43 void InitL( CRadioUtility& aRadioUtility, CFMRadioPubSub* aPubSub ); |
|
44 void StartReceiver(); |
|
45 void StopReceiver(); |
|
46 |
|
47 /** |
|
48 * For simulate MrftoFrequencyChange method from MRadioFmTunerObserver |
|
49 */ |
|
50 void SetRadioEngineForRadioFmTunerSimulation( CRadioEngine* aEngine ); |
|
51 private: |
|
52 |
|
53 /** The simulated events */ |
|
54 enum TFMRadioRdsSimulationEvent |
|
55 { |
|
56 EFMRadioRdsEventSignalOn, |
|
57 EFMRadioRdsEventSignalOff, |
|
58 EFMRadioRdsEventPS, |
|
59 EFMRadioRdsEventRadioText, |
|
60 EFMRadioRdsEventAFBegin, |
|
61 EFMRadioRdsEventAFEnd, |
|
62 EFMRadioRdsEventRadioTextPlus |
|
63 }; |
|
64 |
|
65 /** |
|
66 * The default constructor |
|
67 * |
|
68 * @param aSettings The radio settings |
|
69 */ |
|
70 CFMRadioRdsReceiverSimulator( TRadioSettings& aSettings ); |
|
71 |
|
72 /** |
|
73 * Second phase constructor |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 /** |
|
78 * StaticRdsSimulationCallback Callback for RDS simulation |
|
79 */ |
|
80 static TInt StaticRdsSimulationCallback( TAny* aSelfPtr ); |
|
81 |
|
82 private: // data |
|
83 |
|
84 /** Timer for RDS event simulation */ |
|
85 CPeriodic* iEventSimulatorTimer; |
|
86 |
|
87 /** The iterator for RDS events */ |
|
88 TInt iEventIterator; |
|
89 |
|
90 /** The iterator for PS names */ |
|
91 TInt iPsIterator; |
|
92 |
|
93 /** The iterator for radio texts */ |
|
94 TInt iRadioTextIterator; |
|
95 |
|
96 /** The iterator for frequencies */ |
|
97 TInt iFrequencyIterator; |
|
98 |
|
99 /** The iterator for radio text plus'*/ |
|
100 TInt iRadioTextPlusIterator; |
|
101 |
|
102 /** Pointer to the engine for simulate MrftoFrequencyChange method from MRadioFmTunerObserver */ |
|
103 CRadioEngine* iEngine; |
|
104 }; |
|
105 |
|
106 #endif // CFMRADIORDSRECEIVERSIMULATOR_H |
|