24 * Constructor |
24 * Constructor |
25 */ |
25 */ |
26 RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) : |
26 RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) : |
27 d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) ) |
27 d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) ) |
28 { |
28 { |
29 Q_D( RadioEngineWrapper ); |
|
30 d->init(); |
|
31 } |
29 } |
32 |
30 |
33 /*! |
31 /*! |
34 * Destructor |
32 * Destructor |
35 */ |
33 */ |
36 RadioEngineWrapper::~RadioEngineWrapper() |
34 RadioEngineWrapper::~RadioEngineWrapper() |
37 { |
35 { |
38 delete d_ptr; |
36 } |
|
37 |
|
38 /*! |
|
39 * |
|
40 */ |
|
41 bool RadioEngineWrapper::init() |
|
42 { |
|
43 Q_D( RadioEngineWrapper ); |
|
44 return d->init(); |
39 } |
45 } |
40 |
46 |
41 /*! |
47 /*! |
42 * |
48 * |
43 */ |
49 */ |
55 Q_D( RadioEngineWrapper ); |
61 Q_D( RadioEngineWrapper ); |
56 d->mObservers.removeAll( observer ); |
62 d->mObservers.removeAll( observer ); |
57 } |
63 } |
58 |
64 |
59 /*! |
65 /*! |
60 * Checks if the radio engine has been constructed properly |
|
61 */ |
|
62 bool RadioEngineWrapper::isEngineConstructed() |
|
63 { |
|
64 Q_D( RadioEngineWrapper ); |
|
65 return d->isEngineConstructed(); |
|
66 } |
|
67 |
|
68 /*! |
|
69 * Returns the settings handler owned by the engine |
66 * Returns the settings handler owned by the engine |
70 */ |
67 */ |
71 RadioSettingsIf& RadioEngineWrapper::settings() |
68 RadioSettingsIf& RadioEngineWrapper::settings() |
72 { |
69 { |
73 Q_D( RadioEngineWrapper ); |
70 Q_D( RadioEngineWrapper ); |
111 } |
108 } |
112 |
109 |
113 /*! |
110 /*! |
114 * Returns the frequency step size from the selected region |
111 * Returns the frequency step size from the selected region |
115 */ |
112 */ |
116 bool RadioEngineWrapper::isFrequencyValid( uint frequency ) |
113 bool RadioEngineWrapper::isFrequencyValid( uint frequency ) const |
117 { |
114 { |
118 Q_UNUSED( frequency ); |
115 Q_UNUSED( frequency ); |
|
116 return frequency >= minFrequency() && frequency <= maxFrequency() && frequency % frequencyStepSize() == 0; |
|
117 } |
|
118 |
|
119 /*! |
|
120 * Checks if the radio engine is on |
|
121 */ |
|
122 bool RadioEngineWrapper::isRadioOn() const |
|
123 { |
119 return true; |
124 return true; |
120 } |
125 } |
121 |
126 |
122 /*! |
127 /*! |
123 * Checks if the radio engine is on |
|
124 */ |
|
125 bool RadioEngineWrapper::isRadioOn() const |
|
126 { |
|
127 return true; |
|
128 } |
|
129 |
|
130 /*! |
|
131 * Returns the currently tuned frequency |
128 * Returns the currently tuned frequency |
132 */ |
129 */ |
133 uint RadioEngineWrapper::currentFrequency() const |
130 uint RadioEngineWrapper::currentFrequency() const |
134 { |
131 { |
135 Q_D( const RadioEngineWrapper ); |
132 Q_D( const RadioEngineWrapper ); |
161 Q_D( const RadioEngineWrapper ); |
158 Q_D( const RadioEngineWrapper ); |
162 return d->mUseLoudspeaker; |
159 return d->mUseLoudspeaker; |
163 } |
160 } |
164 |
161 |
165 /*! |
162 /*! |
|
163 * Sets or unsets the engine to manual seek mode |
|
164 */ |
|
165 void RadioEngineWrapper::setManualSeekMode( bool manualSeek ) |
|
166 { |
|
167 Q_D( RadioEngineWrapper ); |
|
168 d->mManualSeekMode = manualSeek; |
|
169 if ( !manualSeek ) { |
|
170 RUN_NOTIFY_LOOP( d->mObservers, tunedToFrequency( d->mFrequency, d->mTuneReason ) ); |
|
171 } |
|
172 } |
|
173 |
|
174 /*! |
|
175 * Checks if the engine is in manual seek mode |
|
176 */ |
|
177 bool RadioEngineWrapper::isInManualSeekMode() const |
|
178 { |
|
179 Q_D( const RadioEngineWrapper ); |
|
180 return d->mManualSeekMode; |
|
181 } |
|
182 |
|
183 /*! |
|
184 * |
|
185 */ |
|
186 void RadioEngineWrapper::setRdsEnabled( bool rdsEnabled ) |
|
187 { |
|
188 Q_UNUSED( rdsEnabled ); |
|
189 } |
|
190 |
|
191 /*! |
166 * Tunes to the given frequency |
192 * Tunes to the given frequency |
167 */ |
193 */ |
168 void RadioEngineWrapper::tuneFrequency( uint frequency, const int sender ) |
194 void RadioEngineWrapper::setFrequency( uint frequency, const int reason ) |
169 { |
195 { |
170 Q_D( RadioEngineWrapper ); |
196 Q_D( RadioEngineWrapper ); |
171 d->tuneFrequency( frequency, sender ); |
197 d->setFrequency( frequency, reason ); |
172 } |
198 } |
173 |
199 |
174 /*! |
200 /*! |
175 * Tunes to the given frequency after a delay |
201 * |
176 */ |
202 */ |
177 void RadioEngineWrapper::tuneWithDelay( uint frequency, const int sender ) |
203 void RadioEngineWrapper::increaseVolume() |
178 { |
204 { |
179 Q_D( RadioEngineWrapper ); |
205 } |
180 d->tuneWithDelay( frequency, sender ); |
206 |
|
207 /*! |
|
208 * |
|
209 */ |
|
210 void RadioEngineWrapper::decreaseVolume() |
|
211 { |
181 } |
212 } |
182 |
213 |
183 /*! |
214 /*! |
184 * volume update command for the engine |
215 * volume update command for the engine |
185 */ |
216 */ |