author | hgs |
Thu, 08 Jul 2010 12:44:18 +0300 | |
changeset 36 | ba22309243a1 |
parent 34 | bc10a61bd7d3 |
child 37 | 451b2e1545b2 |
child 54 | a8ba0c289b44 |
permissions | -rw-r--r-- |
24 | 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 RADIOENGINEWRAPPER_P_H |
|
19 |
#define RADIOENGINEWRAPPER_P_H |
|
20 |
||
21 |
// System includes |
|
22 |
#include <e32std.h> |
|
23 |
#include <QScopedPointer> |
|
24 |
#include <QList> |
|
25 |
||
26 |
// User includes |
|
27 |
#include "radioenginewrapper.h" |
|
28 |
#include "mradioenginehandlerobserver.h" |
|
29 |
||
30 |
// Forward declarations |
|
34 | 31 |
class RadioEngineHandler; |
24 | 32 |
class RadioControlEventListener; |
33 |
class RadioRdsListener; |
|
34 |
class RadioSettingsIf; |
|
35 |
class RadioSettings; |
|
36 |
class RadioStationHandlerIf; |
|
37 |
class RadioEngineWrapperObserver; |
|
38 |
||
39 |
typedef QList<RadioEngineWrapperObserver*> ObserverList; |
|
40 |
||
41 |
// Constants |
|
42 |
||
43 |
#define RUN_NOTIFY_LOOP( list, func ) \ |
|
44 |
foreach( RadioEngineWrapperObserver* observer, list ) { \ |
|
45 |
observer->func; \ |
|
46 |
} |
|
47 |
||
48 |
// Class declaration |
|
49 |
class RadioEngineWrapperPrivate : public MRadioEngineHandlerObserver |
|
50 |
{ |
|
51 |
Q_DECLARE_PUBLIC( RadioEngineWrapper ) |
|
52 |
Q_DISABLE_COPY( RadioEngineWrapperPrivate ) |
|
53 |
||
54 |
friend class RadioFrequencyScanningHandler; |
|
55 |
||
56 |
public: |
|
57 |
||
58 |
RadioEngineWrapperPrivate( RadioEngineWrapper* wrapper, |
|
59 |
RadioStationHandlerIf& stationHandler ); |
|
60 |
||
61 |
virtual ~RadioEngineWrapperPrivate(); |
|
62 |
||
63 |
/** |
|
64 |
* Initialization and startup |
|
65 |
*/ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
66 |
bool init(); |
24 | 67 |
|
68 |
/** |
|
69 |
* Returns the radio settings |
|
70 |
*/ |
|
71 |
RadioSettingsIf& settings(); |
|
72 |
||
73 |
/** |
|
74 |
* Getter for CRadioEngineHandler instance. |
|
75 |
* Returns reference to the CRadioEngineHandler |
|
76 |
*/ |
|
34 | 77 |
RadioEngineHandler& radioEnginehandler(); |
24 | 78 |
|
79 |
/** |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
80 |
* Tunes to given frequency |
24 | 81 |
*/ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
82 |
void setFrequency( uint frequency, const int reason ); |
24 | 83 |
|
84 |
ObserverList& observers(); |
|
85 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
86 |
void startSeeking( Seek::Direction direction, const int reason = TuneReason::Unspecified ); |
24 | 87 |
|
88 |
private: |
|
89 |
||
90 |
// from base class MRadioEngineObserver |
|
91 |
||
92 |
void PowerEventL( TBool aPowerState, TInt aError ); |
|
93 |
void FrequencyEventL( TUint32 aFrequency, RadioEngine::TRadioFrequencyEventReason aReason, TInt aError ); |
|
94 |
void VolumeEventL( TInt aVolume, TInt aError ); |
|
95 |
void MuteEventL( TBool aMuteState, TInt aError ); |
|
96 |
void AudioModeEventL( TInt aAudioMode, TInt aError ); |
|
97 |
void AntennaEventL( TBool aAntennaAttached, TInt aError ); |
|
98 |
void AudioRoutingEventL( TInt aAudioDestination, TInt aError ); |
|
99 |
void SeekingEventL( TInt aSeekingState, TInt aError ); |
|
100 |
void RegionEventL( TInt aRegion, TInt aError ); |
|
101 |
void FmTransmitterEventL( TBool /*aActive*/ ) {} |
|
102 |
||
103 |
// from base class MRadioAudioRoutingObserver |
|
104 |
||
105 |
void AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute ); |
|
106 |
||
107 |
// from base class MRadioSystemEventObserver |
|
108 |
||
109 |
void HandleSystemEventL( TRadioSystemEventType aEventType ); |
|
110 |
||
111 |
private: // data |
|
112 |
||
113 |
/** |
|
114 |
* Pointer to the public class |
|
115 |
* Not own. |
|
116 |
*/ |
|
117 |
RadioEngineWrapper* q_ptr; |
|
118 |
||
119 |
/** |
|
120 |
* Map of radio stations read from the radio engine |
|
121 |
* Own. |
|
122 |
*/ |
|
123 |
RadioStationHandlerIf& mStationHandler; |
|
124 |
||
125 |
/** |
|
126 |
* Reference to the wrapper observer |
|
127 |
*/ |
|
128 |
ObserverList mObservers; |
|
129 |
||
130 |
/** |
|
131 |
* Radio settings handler |
|
132 |
* Own. |
|
133 |
*/ |
|
134 |
QScopedPointer<RadioSettings> mSettings; |
|
135 |
||
136 |
/** |
|
137 |
* Radio engine handler. |
|
138 |
* Own. |
|
139 |
*/ |
|
34 | 140 |
QScopedPointer<RadioEngineHandler> mEngineHandler; |
24 | 141 |
|
142 |
/** |
|
143 |
* RemCon listener. |
|
144 |
* Own. |
|
145 |
*/ |
|
146 |
QScopedPointer<RadioControlEventListener> mControlEventListener; |
|
147 |
||
148 |
/** |
|
149 |
* Rds listener |
|
150 |
* Own. |
|
151 |
*/ |
|
152 |
QScopedPointer<RadioRdsListener> mRdsListener; |
|
153 |
||
154 |
/** |
|
155 |
* Reason for the tune event. Can be FrequencyStrip, Carousel or station scanner |
|
156 |
*/ |
|
157 |
int mTuneReason; |
|
158 |
||
159 |
/** |
|
160 |
* Flag to indicate whether or not audio should be routed to loudspeaker |
|
161 |
*/ |
|
162 |
bool mUseLoudspeaker; |
|
163 |
||
164 |
}; |
|
165 |
||
166 |
#endif // RADIOENGINEWRAPPER_P_H |