changeset 16 | f54ebcfc1b80 |
parent 14 | 63aabac4416d |
child 19 | afea38384506 |
14:63aabac4416d | 16:f54ebcfc1b80 |
---|---|
31 #include "radiouiengine.h" |
31 #include "radiouiengine.h" |
32 #include "radiouiengine_p.h" |
32 #include "radiouiengine_p.h" |
33 #include "radiologger.h" |
33 #include "radiologger.h" |
34 #include "radioenginewrapper.h" |
34 #include "radioenginewrapper.h" |
35 #include "radiostationmodel.h" |
35 #include "radiostationmodel.h" |
36 #include "radioplaylogmodel.h" |
36 #include "radiohistorymodel.h" |
37 #include "radiosettings.h" |
37 #include "radiosettings.h" |
38 #include "radiostationfiltermodel.h" |
38 #include "radiostationfiltermodel.h" |
39 #include "radiolocalization.h" |
39 #include "radioscannerengine.h" |
40 #ifdef BUILD_WIN32 |
|
41 # include "radiomonitorservice_win32.h" |
|
42 #else |
|
43 # include "radiomonitorservice.h" |
|
44 #endif |
|
40 |
45 |
41 // Constants |
46 // Constants |
42 const QString KPathFormatter = "%1:%2%3"; |
47 const QString KPathFormatter = "%1:%2%3"; |
43 const QString KApplicationDir = "\\sys\\bin\\"; |
48 const QString KApplicationDir = "\\sys\\bin\\"; |
44 const QString KSongRecognitionApp = "Shazam_0x200265B3.exe"; |
49 const QString KSongRecognitionApp = "Shazam_0x200265B3.exe"; |
45 const QString KSongRecognitionAppParams = "-listen"; |
50 const QString KSongRecognitionAppParams = "-listen"; |
51 |
|
52 struct GenreStruct |
|
53 { |
|
54 int mGenreCode; |
|
55 const char* mInCarousel; |
|
56 const char* mInStationsList; |
|
57 const char* mInHomeScreen; |
|
58 }; |
|
59 |
|
60 const GenreStruct EuropeanGenres[] = |
|
61 { |
|
62 { GenreEurope::RdsNone, "", "", "" } |
|
63 ,{ GenreEurope::RdsNews, "txt_rad_info_news", "txt_rad_dblist_l1_mhz_val_news", "txt_rad_info_news_hs" } |
|
64 ,{ GenreEurope::RdsCurrentAffairs, "txt_rad_info_current_affairs", "txt_rad_dblist_l1_mhz_val_current_affairs", "txt_rad_info_current_affairs_hs" } |
|
65 ,{ GenreEurope::RdsInformation, "txt_rad_info_information", "txt_rad_dblist_l1_mhz_val_information", "txt_rad_info_information_hs" } |
|
66 ,{ GenreEurope::RdsSport, "txt_rad_info_sport", "txt_rad_dblist_l1_mhz_val_sport", "txt_rad_info_sport_hs" } |
|
67 ,{ GenreEurope::RdsEducation, "txt_rad_info_education", "txt_rad_dblist_l1_mhz_val_education", "txt_rad_info_education_hs" } |
|
68 ,{ GenreEurope::RdsDrama, "txt_rad_info_drama", "txt_rad_dblist_l1_mhz_val_drama", "txt_rad_info_drama_hs" } |
|
69 ,{ GenreEurope::RdsCulture, "txt_rad_info_culture", "txt_rad_dblist_l1_mhz_val_culture", "txt_rad_info_culture_hs" } |
|
70 ,{ GenreEurope::RdsScience, "txt_rad_info_science", "txt_rad_dblist_l1_mhz_val_science", "txt_rad_info_science_hs" } |
|
71 ,{ GenreEurope::RdsVariedSpeech, "txt_rad_info_varied", "txt_rad_dblist_l1_mhz_val_varied", "txt_rad_info_varied_hs" } |
|
72 ,{ GenreEurope::RdsPopMusic, "txt_rad_info_pop_music", "txt_rad_dblist_l1_mhz_val_pop_music", "txt_rad_info_pop_music_hs" } |
|
73 ,{ GenreEurope::RdsRockMusic, "txt_rad_info_rock_music", "txt_rad_dblist_l1_mhz_val_rock_music", "txt_rad_info_rock_music_hs" } |
|
74 ,{ GenreEurope::RdsEasyListening, "txt_rad_info_easy_listening", "txt_rad_dblist_l1_mhz_val_easy_listening", "txt_rad_info_easy_listening_hs" } |
|
75 ,{ GenreEurope::RdsLightClassical, "txt_rad_info_light_classical", "txt_rad_dblist_l1_mhz_val_light_classical", "txt_rad_info_light_classical_hs" } |
|
76 ,{ GenreEurope::RdsSeriousClassical, "txt_rad_info_serious_classical", "txt_rad_dblist_l1_mhz_val_serious_classical", "txt_rad_info_serious_classical_hs" } |
|
77 ,{ GenreEurope::RdsOtherMusic, "txt_rad_info_other_music", "txt_rad_dblist_l1_mhz_val_other_music", "txt_rad_info_other_music_hs" } |
|
78 ,{ GenreEurope::RdsWeather, "txt_rad_info_weather", "txt_rad_dblist_l1_mhz_val_weather", "txt_rad_info_weather_hs" } |
|
79 ,{ GenreEurope::RdsFinance, "txt_rad_info_finance", "txt_rad_dblist_l1_mhz_val_finance", "txt_rad_info_finance_hs" } |
|
80 ,{ GenreEurope::RdsChildrensProgrammes, "txt_rad_info_childrens_programmes", "txt_rad_dblist_l1_mhz_val_childrens_programmes", "txt_rad_info_childrens_programmes_hs" } |
|
81 ,{ GenreEurope::RdsSocialAffairs, "txt_rad_info_social_affairs", "txt_rad_dblist_l1_mhz_val_social_affairs", "txt_rad_info_social_affairs_hs" } |
|
82 ,{ GenreEurope::RdsReligion, "txt_rad_info_religion", "txt_rad_dblist_l1_mhz_val_religion", "txt_rad_info_religion_hs" } |
|
83 ,{ GenreEurope::RdsPhoneIn, "txt_rad_info_phone_in", "txt_rad_dblist_l1_mhz_val_phone_in", "txt_rad_info_phone_in_hs" } |
|
84 ,{ GenreEurope::RdsTravel, "txt_rad_info_travel", "txt_rad_dblist_l1_mhz_val_travel", "txt_rad_info_travel_hs" } |
|
85 ,{ GenreEurope::RdsLeisure, "txt_rad_info_leisure", "txt_rad_dblist_l1_mhz_val_leisure", "txt_rad_info_leisure_hs" } |
|
86 ,{ GenreEurope::RdsJazzMusic, "txt_rad_info_jazz_music", "txt_rad_dblist_l1_mhz_val_jazz_music", "txt_rad_info_jazz_music_hs" } |
|
87 ,{ GenreEurope::RdsCountryMusic, "txt_rad_info_country_music", "txt_rad_dblist_l1_mhz_val_country_music", "txt_rad_info_country_music_hs" } |
|
88 ,{ GenreEurope::RdsNationalMusic, "txt_rad_info_national_music", "txt_rad_dblist_l1_mhz_val_national_music", "txt_rad_info_national_music_hs" } |
|
89 ,{ GenreEurope::RdsOldiesMusic, "txt_rad_info_oldies_music", "txt_rad_dblist_l1_mhz_val_oldies_music", "txt_rad_info_oldies_music_hs" } |
|
90 ,{ GenreEurope::RdsFolkMusic, "txt_rad_info_folk_music", "txt_rad_dblist_l1_mhz_val_folk_music", "txt_rad_info_folk_music_hs" } |
|
91 ,{ GenreEurope::RdsDocumentary, "txt_rad_info_documentary", "txt_rad_dblist_l1_mhz_val_documentary", "txt_rad_info_documentary_hs" } |
|
92 ,{ GenreEurope::RdsAlarmTest, "txt_rad_info_alarm_test", "txt_rad_dblist_l1_mhz_val_alarm_test", "txt_rad_info_alarm_test_hs" } |
|
93 ,{ GenreEurope::RdsAlarm, "txt_rad_info_alarm", "txt_rad_dblist_l1_mhz_val_alarm", "txt_rad_info_alarm_hs" } |
|
94 }; |
|
95 const int EuropeanGenresCount = sizeof( EuropeanGenres ) / sizeof ( EuropeanGenres[0] ); |
|
96 |
|
97 const GenreStruct AmericanGenres[] = |
|
98 { |
|
99 { GenreAmerica::RbdsNone, "", "", "" } |
|
100 ,{ GenreAmerica::RbdsNews, "txt_rad_info_news", "txt_rad_dblist_l1_mhz_val_news", "txt_rad_info_news_hs" } |
|
101 ,{ GenreAmerica::RbdsInformation, "txt_rad_info_information", "txt_rad_dblist_l1_mhz_val_information", "txt_rad_info_information_hs" } |
|
102 ,{ GenreAmerica::RbdsSports, "txt_rad_info_sport", "txt_rad_dblist_l1_mhz_val_sport", "txt_rad_info_sport_hs" } |
|
103 ,{ GenreAmerica::RbdsTalk, "txt_rad_info_talk", "txt_rad_dblist_l1_mhz_val_talk", "txt_rad_info_talk_hs" } |
|
104 ,{ GenreAmerica::RbdsRock, "txt_rad_info_rock_music", "txt_rad_dblist_l1_mhz_val_rock_music", "txt_rad_info_rock_music_hs" } //TODO: Check |
|
105 ,{ GenreAmerica::RbdsClassicRock, "txt_rad_info_classic_rock", "txt_rad_dblist_l1_mhz_val_classic_rock", "txt_rad_info_classic_rock_hs" } |
|
106 ,{ GenreAmerica::RbdsAdultHits, "txt_rad_info_adult_hits", "txt_rad_dblist_l1_mhz_val_adult_hits", "txt_rad_info_adult_hits_hs" } |
|
107 ,{ GenreAmerica::RbdsSoftRock, "txt_rad_info_soft_rock", "txt_rad_dblist_l1_mhz_val_soft_rock", "txt_rad_info_soft_rock_hs" } |
|
108 ,{ GenreAmerica::RbdsTop40, "txt_rad_info_top_40", "txt_rad_dblist_l1_mhz_val_top_40", "txt_rad_info_top_40_hs" } |
|
109 ,{ GenreAmerica::RbdsCountry, "txt_rad_info_country_music", "txt_rad_dblist_l1_mhz_val_country_music", "txt_rad_info_country_music_hs" } //TODO: Check |
|
110 ,{ GenreAmerica::RbdsOldies, "txt_rad_info_oldies_music", "txt_rad_dblist_l1_mhz_val_oldies_music", "txt_rad_info_oldies_music_hs" } //TODO: Check |
|
111 ,{ GenreAmerica::RbdsSoft, "txt_rad_info_soft", "txt_rad_dblist_l1_mhz_val_soft", "txt_rad_info_soft_hs" } |
|
112 ,{ GenreAmerica::RbdsNostalgia, "txt_rad_info_nostalgia", "txt_rad_dblist_l1_mhz_val_nostalgia", "txt_rad_info_nostalgia_hs" } |
|
113 ,{ GenreAmerica::RbdsJazz, "txt_rad_info_jazz_music", "txt_rad_dblist_l1_mhz_val_jazz_music", "txt_rad_info_jazz_music_hs" } //TODO: Check |
|
114 ,{ GenreAmerica::RbdsClassical, "txt_rad_info_classical", "txt_rad_dblist_l1_mhz_val_classical", "txt_rad_info_classical_hs" } |
|
115 ,{ GenreAmerica::RbdsRhythmAndBlues, "txt_rad_info_rhythm_and_blues", "txt_rad_dblist_l1_mhz_val_rhythm_and_blues", "txt_rad_info_rhythm_and_blues_hs" } |
|
116 ,{ GenreAmerica::RbdsSoftRhythmAndBlues, "txt_rad_info_soft_rhythm_and_blues", "txt_rad_dblist_l1_mhz_val_soft_rhythm_and_blues", "txt_rad_info_soft_rhythm_and_blues_hs" } |
|
117 ,{ GenreAmerica::RbdsLanguage, "txt_rad_info_language", "txt_rad_dblist_l1_mhz_val_language", "txt_rad_info_language_hs" } |
|
118 ,{ GenreAmerica::RbdsReligiousMusic, "txt_rad_info_religious_music", "txt_rad_dblist_l1_mhz_val_religious_music", "txt_rad_info_religious_music_hs" } |
|
119 ,{ GenreAmerica::RbdsReligiousTalk, "txt_rad_info_religious_talk", "txt_rad_dblist_l1_mhz_val_religious_talk", "txt_rad_info_religious_talk_hs" } |
|
120 ,{ GenreAmerica::RbdsPersonality, "txt_rad_info_personality", "txt_rad_dblist_l1_mhz_val_personality", "txt_rad_info_personality_hs" } |
|
121 ,{ GenreAmerica::RbdsPublic, "txt_rad_info_public", "txt_rad_dblist_l1_mhz_val_public", "txt_rad_info_public_hs" } |
|
122 ,{ GenreAmerica::RbdsCollege, "txt_rad_info_college", "txt_rad_dblist_l1_mhz_val_college", "txt_rad_info_college_hs" } |
|
123 ,{ GenreAmerica::RbdsUnassigned1, "", "", "" } |
|
124 ,{ GenreAmerica::RbdsUnassigned2, "", "", "" } |
|
125 ,{ GenreAmerica::RbdsUnassigned3, "", "", "" } |
|
126 ,{ GenreAmerica::RbdsUnassigned4, "", "", "" } |
|
127 ,{ GenreAmerica::RbdsUnassigned5, "", "", "" } |
|
128 ,{ GenreAmerica::RbdsWeather, "txt_rad_info_weather", "txt_rad_dblist_l1_mhz_val_weather", "txt_rad_info_weather_hs" }//TODO: Check |
|
129 ,{ GenreAmerica::RbdsEmergencyTest, "txt_rad_info_alarm_test", "txt_rad_dblist_l1_mhz_val_alarm_test", "txt_rad_info_alarm_test_hs" }//TODO: Check |
|
130 ,{ GenreAmerica::RbdsEmergency, "txt_rad_info_alarm", "txt_rad_dblist_l1_mhz_val_alarm", "txt_rad_info_alarm_hs" }//TODO: Check |
|
131 }; |
|
132 const int AmericanGenresCount = sizeof( AmericanGenres ) / sizeof ( AmericanGenres[0] ); |
|
46 |
133 |
47 /*! |
134 /*! |
48 * |
135 * |
49 */ |
136 */ |
50 bool RadioUiEngine::isOfflineProfile() |
137 bool RadioUiEngine::isOfflineProfile() |
65 } |
152 } |
66 |
153 |
67 /*! |
154 /*! |
68 * |
155 * |
69 */ |
156 */ |
70 QString RadioUiEngine::parseFrequency( uint frequency ) |
|
71 { |
|
72 return QTRANSLATE( KFrequencyMhz ).arg( RadioStation::parseFrequency( frequency ) ); |
|
73 } |
|
74 |
|
75 /*! |
|
76 * |
|
77 */ |
|
78 QString RadioUiEngine::nameOrFrequency( const RadioStation& station, uint frequency ) |
|
79 { |
|
80 if ( frequency == 0 ) |
|
81 { |
|
82 frequency = station.frequency(); |
|
83 } |
|
84 |
|
85 QString text = ""; |
|
86 if ( station.isValid() && !station.name().isEmpty() ) |
|
87 { |
|
88 text = station.name(); |
|
89 } |
|
90 else |
|
91 { |
|
92 text = parseFrequency( frequency ); |
|
93 } |
|
94 |
|
95 return text; |
|
96 } |
|
97 |
|
98 /*! |
|
99 * |
|
100 */ |
|
101 RadioUiEngine::RadioUiEngine( QObject* parent ) : |
157 RadioUiEngine::RadioUiEngine( QObject* parent ) : |
102 QObject( parent ), |
158 QObject( parent ), |
103 d_ptr( new RadioUiEnginePrivate( this ) ) |
159 d_ptr( new RadioUiEnginePrivate( this ) ) |
104 { |
160 { |
105 } |
161 } |
107 /*! |
163 /*! |
108 * |
164 * |
109 */ |
165 */ |
110 RadioUiEngine::~RadioUiEngine() |
166 RadioUiEngine::~RadioUiEngine() |
111 { |
167 { |
168 delete d_ptr; |
|
112 } |
169 } |
113 |
170 |
114 /*! |
171 /*! |
115 * |
172 * |
116 */ |
173 */ |
146 Q_D( RadioUiEngine ); |
203 Q_D( RadioUiEngine ); |
147 return *d->mStationModel; |
204 return *d->mStationModel; |
148 } |
205 } |
149 |
206 |
150 /*! |
207 /*! |
151 * Returns the play log model |
208 * Returns the history model |
152 */ |
209 */ |
153 RadioPlayLogModel& RadioUiEngine::playLogModel() |
210 RadioHistoryModel& RadioUiEngine::historyModel() |
154 { |
211 { |
155 Q_D( RadioUiEngine ); |
212 Q_D( RadioUiEngine ); |
156 if ( !d->mPlayLogModel ) { |
213 if ( !d->mHistoryModel ) { |
157 d->mPlayLogModel = new RadioPlayLogModel( *this ); |
214 d->mHistoryModel = new RadioHistoryModel( *this ); |
158 } |
215 } |
159 |
216 |
160 return *d->mPlayLogModel; |
217 return *d->mHistoryModel; |
161 } |
218 } |
162 |
219 |
163 /*! |
220 /*! |
164 * Returns the stations list |
221 * Returns the stations list |
165 */ |
222 */ |
167 { |
224 { |
168 return new RadioStationFilterModel( *this, parent ); |
225 return new RadioStationFilterModel( *this, parent ); |
169 } |
226 } |
170 |
227 |
171 /*! |
228 /*! |
229 * |
|
230 */ |
|
231 RadioScannerEngine* RadioUiEngine::createScannerEngine() |
|
232 { |
|
233 Q_D( RadioUiEngine ); |
|
234 if ( d->mScannerEngine.isNull() ) { |
|
235 d->mScannerEngine = new RadioScannerEngine( *d ); |
|
236 } |
|
237 return d->mScannerEngine; |
|
238 } |
|
239 |
|
240 /*! |
|
172 * Returns the stations list |
241 * Returns the stations list |
173 */ |
242 */ |
174 RadioMonitorService& RadioUiEngine::monitor() |
243 RadioMonitorService& RadioUiEngine::monitor() |
175 { |
244 { |
176 Q_D( const RadioUiEngine ); |
245 Q_D( const RadioUiEngine ); |
190 * |
259 * |
191 */ |
260 */ |
192 bool RadioUiEngine::isScanning() const |
261 bool RadioUiEngine::isScanning() const |
193 { |
262 { |
194 Q_D( const RadioUiEngine ); |
263 Q_D( const RadioUiEngine ); |
195 return d->mEngineWrapper->isScanning(); |
264 return d->mScannerEngine != 0; |
196 } |
265 } |
197 |
266 |
198 /*! |
267 /*! |
199 * |
268 * |
200 */ |
269 */ |
268 } |
337 } |
269 |
338 |
270 /*! |
339 /*! |
271 * |
340 * |
272 */ |
341 */ |
273 void RadioUiEngine::scanFrequencyBand() |
|
274 { |
|
275 Q_D( RadioUiEngine ); |
|
276 d->mEngineWrapper->scanFrequencyBand(); |
|
277 } |
|
278 |
|
279 /*! |
|
280 * |
|
281 */ |
|
282 void RadioUiEngine::cancelScanFrequencyBand() |
|
283 { |
|
284 Q_D( RadioUiEngine ); |
|
285 d->mEngineWrapper->cancelScanFrequencyBand(); |
|
286 } |
|
287 |
|
288 /*! |
|
289 * |
|
290 */ |
|
291 QList<RadioStation> RadioUiEngine::stationsInRange( uint minFrequency, uint maxFrequency ) |
342 QList<RadioStation> RadioUiEngine::stationsInRange( uint minFrequency, uint maxFrequency ) |
292 { |
343 { |
293 Q_D( RadioUiEngine ); |
344 Q_D( RadioUiEngine ); |
294 return d->mStationModel->stationsInRange( minFrequency, maxFrequency ); |
345 return d->mStationModel->stationsInRange( minFrequency, maxFrequency ); |
295 } |
346 } |
296 |
347 |
297 /*! |
348 /*! |
298 * |
349 * |
299 */ |
350 */ |
300 QString RadioUiEngine::genreToString( int genre ) |
351 QString RadioUiEngine::genreToString( int genre, GenreTarget::Target target ) |
301 { |
352 { |
302 RadioRegion::Region currentRegion = region(); |
353 RadioRegion::Region currentRegion = region(); |
303 |
354 |
304 const GenreStruct* genreArray = currentRegion == RadioRegion::America ? AmericanGenres : EuropeanGenres; |
355 const GenreStruct* genreArray = currentRegion == RadioRegion::America ? AmericanGenres : EuropeanGenres; |
305 const int genreCount = currentRegion == RadioRegion::America ? AmericanGenresCount : EuropeanGenresCount; |
356 const int genreCount = currentRegion == RadioRegion::America ? AmericanGenresCount : EuropeanGenresCount; |
306 |
357 |
307 for( int i = 0; i < genreCount; ++i ) { |
358 for( int i = 0; i < genreCount; ++i ) { |
308 if ( genreArray[i].mGenreCode == genre ) { |
359 if ( genreArray[i].mGenreCode == genre ) { |
309 return TRANSLATE( genreArray[i].mTranslation ); |
360 if ( target == GenreTarget::Carousel ) { |
310 // return qApp->translate( GenreContext, |
361 return qtTrId( genreArray[i].mInCarousel ); |
311 // genreArray[i].mTranslation.source, |
362 } else if ( target == GenreTarget::StationsList ) { |
312 // genreArray[i].mTranslation.comment ); |
363 return qtTrId( genreArray[i].mInStationsList ); |
364 } else if ( target == GenreTarget::HomeScreen ) { |
|
365 return qtTrId( genreArray[i].mInHomeScreen ); |
|
366 } |
|
313 } |
367 } |
314 } |
368 } |
315 |
369 |
316 return ""; |
370 return ""; |
317 } |
371 } |
349 * |
403 * |
350 */ |
404 */ |
351 void RadioUiEngine::addRecognizedSong( const QString& artist, const QString& title, const RadioStation& station ) |
405 void RadioUiEngine::addRecognizedSong( const QString& artist, const QString& title, const RadioStation& station ) |
352 { |
406 { |
353 Q_D( RadioUiEngine ); |
407 Q_D( RadioUiEngine ); |
354 d->mPlayLogModel->addItem( artist, title, station ); |
408 d->mHistoryModel->addItem( artist, title, station ); |
355 } |
409 } |
356 |
410 |
357 /*! |
411 /*! |
358 * Public slot |
412 * Public slot |
359 * Tunes to the given frequency |
413 * Tunes to the given frequency |
361 void RadioUiEngine::tuneFrequency( uint frequency, const int sender ) |
415 void RadioUiEngine::tuneFrequency( uint frequency, const int sender ) |
362 { |
416 { |
363 Q_D( RadioUiEngine ); |
417 Q_D( RadioUiEngine ); |
364 if ( frequency != d->mStationModel->currentStation().frequency() && d->mEngineWrapper->isFrequencyValid( frequency ) ) { |
418 if ( frequency != d->mStationModel->currentStation().frequency() && d->mEngineWrapper->isFrequencyValid( frequency ) ) { |
365 LOG_FORMAT( "RadioUiEngine::tuneFrequency, frequency: %d", frequency ); |
419 LOG_FORMAT( "RadioUiEngine::tuneFrequency, frequency: %d", frequency ); |
420 d->cancelSeeking(); |
|
366 d->mEngineWrapper->tuneFrequency( frequency, sender ); |
421 d->mEngineWrapper->tuneFrequency( frequency, sender ); |
367 } |
422 } |
368 } |
423 } |
369 |
424 |
370 /*! |
425 /*! |
374 void RadioUiEngine::tuneWithDelay( uint frequency, const int sender ) |
429 void RadioUiEngine::tuneWithDelay( uint frequency, const int sender ) |
375 { |
430 { |
376 Q_D( RadioUiEngine ); |
431 Q_D( RadioUiEngine ); |
377 if ( frequency != d->mStationModel->currentStation().frequency() && d->mEngineWrapper->isFrequencyValid( frequency ) ) { |
432 if ( frequency != d->mStationModel->currentStation().frequency() && d->mEngineWrapper->isFrequencyValid( frequency ) ) { |
378 LOG_FORMAT( "RadioEngineWrapperPrivate::tuneWithDelay, frequency: %d", frequency ); |
433 LOG_FORMAT( "RadioEngineWrapperPrivate::tuneWithDelay, frequency: %d", frequency ); |
434 d->cancelSeeking(); |
|
379 d->mEngineWrapper->tuneWithDelay( frequency, sender ); |
435 d->mEngineWrapper->tuneWithDelay( frequency, sender ); |
380 } |
436 } |
381 } |
437 } |
382 |
438 |
383 /*! |
439 /*! |
391 RadioStation station; |
447 RadioStation station; |
392 if ( d->mStationModel->findPresetIndex( presetIndex, station ) != RadioStation::NotFound && |
448 if ( d->mStationModel->findPresetIndex( presetIndex, station ) != RadioStation::NotFound && |
393 d->mEngineWrapper->isFrequencyValid( station.frequency() ) ) { |
449 d->mEngineWrapper->isFrequencyValid( station.frequency() ) ) { |
394 LOG_FORMAT( "RadioEngineWrapperPrivate::tunePreset, presetIndexPosition: %d", presetIndex ); |
450 LOG_FORMAT( "RadioEngineWrapperPrivate::tunePreset, presetIndexPosition: %d", presetIndex ); |
395 |
451 |
396 d->mEngineWrapper->tuneFrequency( station.frequency(), CommandSender::Unspecified ); |
452 d->mEngineWrapper->tuneFrequency( station.frequency(), TuneReason::Unspecified ); |
397 } |
453 } |
398 } |
454 } |
399 } |
455 } |
400 |
456 |
401 /*! |
457 /*! |
452 * Public slot |
508 * Public slot |
453 * |
509 * |
454 */ |
510 */ |
455 void RadioUiEngine::seekUp() |
511 void RadioUiEngine::seekUp() |
456 { |
512 { |
457 Q_D( RadioUiEngine ); |
513 if ( isAntennaAttached() ) { |
458 d->mEngineWrapper->startSeeking( Seeking::Up ); |
514 Q_D( RadioUiEngine ); |
515 emitSeekingStarted( Seeking::Up ); |
|
516 d->mEngineWrapper->startSeeking( Seeking::Up, TuneReason::Seek ); |
|
517 } |
|
459 } |
518 } |
460 |
519 |
461 /*! |
520 /*! |
462 * Public slot |
521 * Public slot |
463 * |
522 * |
464 */ |
523 */ |
465 void RadioUiEngine::seekDown() |
524 void RadioUiEngine::seekDown() |
466 { |
525 { |
467 Q_D( RadioUiEngine ); |
526 if ( isAntennaAttached() ) { |
468 d->mEngineWrapper->startSeeking( Seeking::Down ); |
527 Q_D( RadioUiEngine ); |
528 emitSeekingStarted( Seeking::Down ); |
|
529 d->mEngineWrapper->startSeeking( Seeking::Down, TuneReason::Seek ); |
|
530 } |
|
469 } |
531 } |
470 |
532 |
471 /*! |
533 /*! |
472 * Public slot |
534 * Public slot |
473 * |
535 * |
494 /*! |
556 /*! |
495 * Function used by the private implementation to emit a seekingStarted signal |
557 * Function used by the private implementation to emit a seekingStarted signal |
496 */ |
558 */ |
497 void RadioUiEngine::emitSeekingStarted( Seeking::Direction direction ) |
559 void RadioUiEngine::emitSeekingStarted( Seeking::Direction direction ) |
498 { |
560 { |
499 if ( isAntennaAttached() ) { |
561 emit seekingStarted( direction ); |
500 emit seekingStarted( direction ); |
562 Q_D( RadioUiEngine ); |
501 } |
563 d->mMonitorService->notifyRadioStatus( RadioStatus::Seeking ); |
502 } |
564 } |
503 |
565 |
504 /*! |
566 /*! |
505 * Function used by the private implementation to emit a radioStatusChanged signal |
567 * Function used by the private implementation to emit a radioStatusChanged signal |
506 */ |
568 */ |
540 { |
602 { |
541 emit audioRouteChanged( loudspeaker ); |
603 emit audioRouteChanged( loudspeaker ); |
542 } |
604 } |
543 |
605 |
544 /*! |
606 /*! |
545 * Function used by the private implementation to emit a scanAndSaveFinished signal |
607 * Function used by the private implementation to emit a antennaStatusChanged signal |
546 */ |
608 */ |
547 void RadioUiEngine::emitScanAndSaveFinished() |
609 void RadioUiEngine::emitAntennaStatusChanged( bool connected ) |
548 { |
610 { |
549 emit scanAndSaveFinished(); |
611 emit antennaStatusChanged( connected ); |
550 } |
612 } |
551 /*! |
613 |
552 * Function used by the private implementation to emit a headsetStatusChanged signal |
|
553 */ |
|
554 void RadioUiEngine::emitheadsetStatusChanged( bool connected ) |
|
555 { |
|
556 emit headsetStatusChanged( connected ); |
|
557 } |
|
558 |