45 #include "irqutility.h" |
52 #include "irqutility.h" |
46 #include "irqlogger.h" |
53 #include "irqlogger.h" |
47 #include "irplaylist.h" |
54 #include "irplaylist.h" |
48 #include "irstationdetailsview.h" |
55 #include "irstationdetailsview.h" |
49 #include "irservicedef.h" |
56 #include "irservicedef.h" |
|
57 #include "irqsettings.h" |
|
58 #include "irqlogger.h" |
50 |
59 |
51 #ifdef ADV_ENABLED |
60 #ifdef ADV_ENABLED |
52 #include <QTimer> |
61 #include <QTimer> |
53 #include <qgraphicssceneevent.h> |
62 #include <qgraphicssceneevent.h> |
54 static const QString KDefaultAdvLink(""); // default advertisement link |
63 static const QString KDefaultAdvLink(""); // default advertisement link |
55 #endif |
64 #endif |
56 |
65 |
57 const int KNowPlayingLogoSize = 300; // Now playing logo size |
66 const int KNowPlayingLogoSize = 300; // Now playing logo size |
|
67 |
58 static const QString KDefaultStationLogo("qtg_large_internet_radio"); |
68 static const QString KDefaultStationLogo("qtg_large_internet_radio"); |
59 static const QString KPlayButtonIcon("qtg_mono_play"); |
69 static const QString KPlayButtonIcon("qtg_mono_play"); |
60 static const QString KStopButtonIcon("qtg_mono_stop"); |
70 static const QString KStopButtonIcon("qtg_mono_stop"); |
|
71 |
|
72 static const QString KArtistColor("qtc_lcd_content_normal"); |
|
73 static const QString KSongColor("qtc_lcd_content_normal"); |
|
74 static const QString KStationColor("qtc_lcd_content_normal"); |
61 |
75 |
62 #ifdef NOWPLAYING_VIEW_OPTION_B |
76 #ifdef NOWPLAYING_VIEW_OPTION_B |
63 static const QString KLcdGraphics("qtg_fr_lcd"); |
77 static const QString KLcdGraphics("qtg_fr_lcd"); |
64 #endif |
78 #endif |
65 |
79 |
128 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME); |
146 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME); |
129 |
147 |
130 initMenu(); |
148 initMenu(); |
131 initToolBar(); |
149 initToolBar(); |
132 initWidget(); |
150 initWidget(); |
|
151 #ifdef SUBTITLE_STR_BY_LOCID |
|
152 setTitle(hbTrId("txt_irad_title_internet_radio")); |
|
153 |
|
154 #else |
|
155 setTitle("Internet radio"); |
|
156 #endif |
133 } |
157 } |
134 |
158 |
135 /* |
159 /* |
136 * Description : create menu for now playing view |
160 * Description : create menu for now playing view |
137 */ |
161 */ |
138 void IRNowPlayingView::initMenu() |
162 void IRNowPlayingView::initMenu() |
139 { |
163 { |
140 #ifdef SONGRECOGNITION_ENABLED |
164 LOG_METHOD; |
141 if(IRQUtility::identifySongAvailable()) |
165 if (iApplication->getSettings()->getIdentifySongEnabled()) |
142 { |
166 { |
143 LOG("Song Recognition is Available"); |
167 int songRecognitionAppUid = iApplication->getSettings()->getSongRecognitionAppUid(); |
144 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, NOW_PLAYING_VIEW_SONG_RECOG_YES_SEC); |
168 if(IRQUtility::findAppByUid(songRecognitionAppUid)) |
|
169 { |
|
170 LOG("Song Recognition is Available"); |
|
171 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, NOW_PLAYING_VIEW_SONG_RECOG_YES_SEC); |
|
172 } |
|
173 else |
|
174 { |
|
175 LOG("Song Recognition is NOT Available"); |
|
176 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, NOW_PLAYING_VIEW_SONG_RECOG_NO_SEC); |
|
177 } |
145 } |
178 } |
146 else |
179 else |
147 { |
180 { |
148 LOG("Song Recognition is NOT Available"); |
181 LOG("Song Recognition is Disabled"); |
149 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, NOW_PLAYING_VIEW_SONG_RECOG_NO_SEC); |
182 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, NOW_PLAYING_VIEW_SONG_RECOG_NO_SEC); |
150 } |
183 } |
151 #else |
184 |
152 LOG("Song Recognition is Disabled"); |
|
153 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, NOW_PLAYING_VIEW_SONG_RECOG_NO_SEC); |
|
154 #endif |
|
155 HbAction *openWebAddressAction = qobject_cast<HbAction *> (iLoader.findObject(GO_TO_STATION_ACTION)); |
185 HbAction *openWebAddressAction = qobject_cast<HbAction *> (iLoader.findObject(GO_TO_STATION_ACTION)); |
156 HbAction *shareStationAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_SHARE_STATION_ACTION)); |
186 HbAction *shareStationAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_SHARE_STATION_ACTION)); |
157 HbAction *settings = qobject_cast<HbAction *> (iLoader.findObject(SETTINGS_ACTION)); |
187 HbAction *settings = qobject_cast<HbAction *> (iLoader.findObject(SETTINGS_ACTION)); |
158 HbAction *exitAction = qobject_cast<HbAction *> (iLoader.findObject(EXIT_ACTION)); |
188 HbAction *exitAction = qobject_cast<HbAction *> (iLoader.findObject(EXIT_ACTION)); |
159 HbAction *songRecAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_IDENTIFYSONG)); |
189 HbAction *songRecAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_IDENTIFYSONG)); |
161 connect(openWebAddressAction, SIGNAL(triggered()), this, SLOT(handleGoToStationAction())); |
191 connect(openWebAddressAction, SIGNAL(triggered()), this, SLOT(handleGoToStationAction())); |
162 connect(shareStationAction, SIGNAL(triggered()), this, SLOT(handleShareStationAction())); |
192 connect(shareStationAction, SIGNAL(triggered()), this, SLOT(handleShareStationAction())); |
163 connect(settings, SIGNAL(triggered()), this, SLOT(handleSettingAction())); |
193 connect(settings, SIGNAL(triggered()), this, SLOT(handleSettingAction())); |
164 connect(exitAction, SIGNAL(triggered()), iApplication, SIGNAL(quit())); |
194 connect(exitAction, SIGNAL(triggered()), iApplication, SIGNAL(quit())); |
165 connect(songRecAction, SIGNAL(triggered()), this, SLOT(handleIdentifySongAction())); |
195 connect(songRecAction, SIGNAL(triggered()), this, SLOT(handleIdentifySongAction())); |
|
196 |
|
197 #ifdef STATISTIC_REPORT_TEST_ENABLED |
|
198 HbAction *dummySongIdentifyAction = menu()->addAction("Dummy Identify Song"); |
|
199 HbAction *dummyGoToNmsAction = menu()->addAction("Dummy Go to Music Store"); |
|
200 HbAction *dummyFindInNmsAction = menu()->addAction("Dummy Find in Music Store"); |
|
201 |
|
202 connect(dummySongIdentifyAction, SIGNAL(triggered()), this, SLOT(handleDummySongIdentify())); |
|
203 connect(dummyGoToNmsAction, SIGNAL(triggered()), this, SLOT(handleDummyGoToNms())); |
|
204 connect(dummyFindInNmsAction, SIGNAL(triggered()), this, SLOT(handleDummyFindInNms())); |
|
205 #endif |
166 } |
206 } |
167 |
207 |
168 /* |
208 /* |
169 * Description : create tool bar for now playing view |
209 * Description : create tool bar for now playing view |
170 */ |
210 */ |
171 void IRNowPlayingView::initToolBar() |
211 void IRNowPlayingView::initToolBar() |
172 { |
212 { |
|
213 LOG_METHOD; |
173 HbAction *musicStoreAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_MUSICSTORE)); |
214 HbAction *musicStoreAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_MUSICSTORE)); |
174 iPlayStopAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_PLAYSTOP)); |
215 iPlayStopAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_PLAYSTOP)); |
175 HbAction *add2FavAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_ADDTOFAV)); |
216 HbAction *add2FavAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_ADDTOFAV)); |
176 HbAction *flipAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_FLIP)); |
217 HbAction *flipAction = qobject_cast<HbAction *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_FLIP)); |
177 |
218 |
178 connect(musicStoreAction, SIGNAL(triggered()), this, SLOT(handleMusicStoreAction())); |
219 connect(musicStoreAction, SIGNAL(triggered()), this, SLOT(handleMusicStoreAction())); |
179 connect(iPlayStopAction, SIGNAL(triggered()), this, SLOT(handlePlayStopAction())); |
220 connect(iPlayStopAction, SIGNAL(triggered()), this, SLOT(handlePlayStopAction())); |
180 connect(add2FavAction, SIGNAL(triggered()), this, SLOT(handleAddToFavAction())); |
221 connect(add2FavAction, SIGNAL(triggered()), this, SLOT(handleAddToFavAction())); |
181 connect(flipAction, SIGNAL(triggered()), this, SLOT(handleDetailInfoAction())); |
222 connect(flipAction, SIGNAL(triggered()), this, SLOT(handleDetailInfoAction())); |
182 |
|
183 //could be removed after toolbar issue is ok |
|
184 HbToolBar *viewToolBar = toolBar(); |
|
185 viewToolBar->addAction(musicStoreAction); |
|
186 viewToolBar->addAction(iPlayStopAction); |
|
187 viewToolBar->addAction(add2FavAction); |
|
188 viewToolBar->addAction(flipAction); |
|
189 } |
223 } |
190 |
224 |
191 void IRNowPlayingView::initWidget() |
225 void IRNowPlayingView::initWidget() |
192 { |
226 { |
|
227 LOG_METHOD; |
193 iStationLogo = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_STATION_LOGO)); |
228 iStationLogo = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_STATION_LOGO)); |
194 iSongName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_SONG_NAME)); |
229 iSongNameLabel = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_SONG_NAME_LABEL)); |
|
230 iSongNameMarquee = qobject_cast<HbMarqueeItem *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_SONG_NAME_MARQUEE)); |
|
231 iSongNameMarquee->setLoopCount(-1); |
195 iArtistName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_ARTIST_NAME)); |
232 iArtistName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_ARTIST_NAME)); |
196 iStationName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_STATION_NAME)); |
233 iStationName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_STATION_NAME)); |
197 iStationLogo->setIcon(HbIcon(KDefaultStationLogo)); |
234 iStationLogo->setIcon(HbIcon(KDefaultStationLogo)); |
198 iStationName->setPlainText(""); |
235 iStationName->setPlainText(""); |
199 iSongName->setPlainText(""); |
236 updateSongName(QString("")); |
200 iArtistName->setPlainText(""); |
237 iArtistName->setPlainText(""); |
|
238 |
|
239 iArtistName->setTextColor(HbColorScheme::color(KArtistColor)); |
|
240 iSongNameLabel->setTextColor(HbColorScheme::color(KSongColor)); |
|
241 iSongNameMarquee->setTextColor(HbColorScheme::color(KSongColor)); |
|
242 iStationName->setTextColor(HbColorScheme::color(KStationColor)); |
201 |
243 |
202 #ifdef NOWPLAYING_VIEW_OPTION_B |
244 #ifdef NOWPLAYING_VIEW_OPTION_B |
203 HbWidget * viewContainer = qobject_cast<HbWidget *> (iLoader.findObject(VIEW_CONTAINER)); |
245 HbWidget * viewContainer = qobject_cast<HbWidget *> (iLoader.findObject(VIEW_CONTAINER)); |
204 HbFrameDrawer* drawer = new HbFrameDrawer(KLcdGraphics, HbFrameDrawer::NinePieces); |
246 HbFrameDrawer* drawer = new HbFrameDrawer(KLcdGraphics, HbFrameDrawer::NinePieces); |
205 HbFrameItem* backgroundItem = new HbFrameItem(drawer, viewContainer); |
247 HbFrameItem* backgroundItem = new HbFrameItem(drawer, viewContainer); |
230 iStationName->setPlainText(iPlayController->getNowPlayingPreset()->name); |
273 iStationName->setPlainText(iPlayController->getNowPlayingPreset()->name); |
231 } |
274 } |
232 loadStationLogo(); |
275 loadStationLogo(); |
233 } |
276 } |
234 |
277 |
|
278 void IRNowPlayingView::updateSongName(const QString &aSongName) |
|
279 { |
|
280 LOG_METHOD; |
|
281 iSongNameMarquee->stopAnimation(); |
|
282 iSongNameLabel->hide(); |
|
283 iSongNameMarquee->hide(); |
|
284 |
|
285 iSongNameLabel->setPlainText(aSongName); |
|
286 iSongNameMarquee->setText(aSongName); |
|
287 |
|
288 QFontMetricsF metrics(iSongNameLabel->font()); |
|
289 LOG_FORMAT("song name = %s, song name length = %f, label width = %f", |
|
290 STRING2CHAR(aSongName), |
|
291 metrics.boundingRect(aSongName).width(), |
|
292 iSongNameLabel->contentsRect().width() |
|
293 ); |
|
294 if (metrics.boundingRect(aSongName).width() > iSongNameLabel->contentsRect().width()) |
|
295 { |
|
296 iSongNameMarquee->show(); |
|
297 iSongNameMarquee->startAnimation(); |
|
298 } |
|
299 else |
|
300 { |
|
301 iSongNameLabel->show(); |
|
302 } |
|
303 } |
|
304 |
235 void IRNowPlayingView::updateMusicStoreStatus() |
305 void IRNowPlayingView::updateMusicStoreStatus() |
236 { |
306 { |
|
307 LOG_METHOD; |
237 IRQPreset *preset = iPlayController->getNowPlayingPreset(); |
308 IRQPreset *preset = iPlayController->getNowPlayingPreset(); |
238 if(preset && (0 == preset->musicStoreStatus.compare("yes",Qt::CaseInsensitive))) |
309 if(preset && (0 == preset->musicStoreStatus.compare("yes",Qt::CaseInsensitive))) |
239 { |
310 { |
240 iFindinNmsAllowed = true; |
311 iFindinNmsAllowed = true; |
241 } |
312 } |
364 /* |
439 /* |
365 * Description : actions when view is launched. |
440 * Description : actions when view is launched. |
366 */ |
441 */ |
367 void IRNowPlayingView::launchAction() |
442 void IRNowPlayingView::launchAction() |
368 { |
443 { |
|
444 LOG_METHOD; |
369 setUseNetworkReason(EIR_UseNetwork_StartingView); |
445 setUseNetworkReason(EIR_UseNetwork_StartingView); |
370 updateForLauchAction(); |
446 updateForLauchAction(); |
371 #ifdef HS_WIDGET_ENABLED |
447 #ifdef HS_WIDGET_ENABLED |
372 iPlayController->setConnectingStationName(iStationName->plainText()); |
448 iPlayController->setConnectingStationName(iStationName->plainText()); |
373 #endif |
449 #endif |
374 iApplication->verifyNetworkConnectivity(); |
450 iApplication->verifyNetworkConnectivity(); |
375 getViewManager()->pushViewById(EIRView_MainView); |
451 if( iApplication->isEmbeddedInstance()) |
|
452 { |
|
453 getViewManager()->pushViewById(EIRView_PlsView); |
|
454 } |
|
455 else |
|
456 { |
|
457 getViewManager()->pushViewById(EIRView_MainView); |
|
458 } |
|
459 |
376 iLaunchActionNeeded = false; |
460 iLaunchActionNeeded = false; |
377 } |
461 } |
378 |
462 |
379 void IRNowPlayingView::lazyInit() |
463 void IRNowPlayingView::lazyInit() |
380 { |
464 { |
|
465 LOG_METHOD; |
381 iLaunchActionNeeded = true; |
466 iLaunchActionNeeded = true; |
382 |
467 |
383 if (!initCompleted()) |
468 if (!initCompleted()) |
384 { |
469 { |
385 normalInit(); |
470 normalInit(); |
386 |
471 |
387 //initization from handleCommand() |
472 //initization from handleCommand() |
388 handleCommand(EIR_ViewCommand_TOBEACTIVATED, EIR_ViewCommandReason_Show); |
473 handleCommand(EIR_ViewCommand_TOBEACTIVATED, EIR_ViewCommandReason_Show); |
389 handleCommand(EIR_ViewCommand_ACTIVATED, EIR_ViewCommandReason_Show); |
474 handleCommand(EIR_ViewCommand_ACTIVATED, EIR_ViewCommandReason_Show); |
|
475 |
|
476 emit applicationReady(); |
390 } |
477 } |
391 } |
478 } |
392 |
479 |
393 void IRNowPlayingView::normalInit() |
480 void IRNowPlayingView::normalInit() |
394 { |
481 { |
|
482 LOG_METHOD; |
395 if (!initCompleted()) |
483 if (!initCompleted()) |
396 { |
484 { |
397 IRBaseView::lazyInit(); |
485 IRBaseView::lazyInit(); |
398 |
486 |
399 iStatisticsReporter = IRQStatisticsReporter::openInstance(); |
487 iStatisticsReporter = IRQStatisticsReporter::openInstance(); |
594 ******************************************************************************************************* |
693 ******************************************************************************************************* |
595 */ |
694 */ |
596 |
695 |
597 void IRNowPlayingView::handleOrientationChanged(Qt::Orientation aOrientation) |
696 void IRNowPlayingView::handleOrientationChanged(Qt::Orientation aOrientation) |
598 { |
697 { |
|
698 LOG_METHOD; |
|
699 |
599 if (aOrientation == Qt::Vertical) |
700 if (aOrientation == Qt::Vertical) |
600 { |
701 { |
|
702 LOG("load portrait layout"); |
601 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, PORTRAIT_SEC); |
703 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, PORTRAIT_SEC); |
602 } |
704 } |
603 else |
705 else |
604 { |
706 { |
|
707 LOG("load landscape layout"); |
605 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, LANDSCAPE_SEC); |
708 iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME, LANDSCAPE_SEC); |
606 } |
709 } |
|
710 // re-load only update the size of the widget, the rect of the widget will get updated only after re-layout. |
|
711 updateGeometry(); |
|
712 QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
|
713 // re-select between label and marquee. |
|
714 updateSongName(iSongNameLabel->plainText()); |
607 } |
715 } |
608 |
716 |
609 /******************************************************************************************************** |
717 /******************************************************************************************************** |
610 * SLOT for Play Controller |
718 * SLOT for Play Controller |
611 ******************************************************************************************************* |
719 ******************************************************************************************************* |
612 */ |
720 */ |
613 void IRNowPlayingView::handlePlayStarted() |
721 void IRNowPlayingView::handlePlayStarted() |
614 { |
722 { |
|
723 LOG_METHOD; |
615 iPlayStopAction->setIcon(HbIcon(KStopButtonIcon)); |
724 iPlayStopAction->setIcon(HbIcon(KStopButtonIcon)); |
616 } |
725 } |
617 |
726 |
618 void IRNowPlayingView::handlePlayStopped() |
727 void IRNowPlayingView::handlePlayStopped() |
619 { |
728 { |
|
729 LOG_METHOD; |
620 iPlayStopAction->setIcon(HbIcon(KPlayButtonIcon)); |
730 iPlayStopAction->setIcon(HbIcon(KPlayButtonIcon)); |
621 iSongName->setPlainText(""); |
731 updateSongName(QString("")); |
622 iArtistName->setPlainText(""); |
732 iArtistName->setPlainText(""); |
623 iSongNameAvailable = false; |
733 iSongNameAvailable = false; |
624 } |
734 } |
625 |
735 |
626 void IRNowPlayingView::updateMetaData(IRQMetaData* aMetaData) |
736 void IRNowPlayingView::updateMetaData(IRQMetaData* aMetaData) |
627 { |
737 { |
|
738 LOG_METHOD; |
628 iSongNameAvailable = false; |
739 iSongNameAvailable = false; |
629 if(aMetaData) |
740 if(aMetaData) |
630 { |
741 { |
631 iSongName->setPlainText(aMetaData->getSongName()); |
742 updateSongName(aMetaData->getSongName()); |
632 iArtistName->setPlainText(aMetaData->getArtistName()); |
743 iArtistName->setPlainText(aMetaData->getArtistName()); |
633 if(!aMetaData->getSongName().isEmpty() || |
744 if(!aMetaData->getSongName().isEmpty() || |
634 !aMetaData->getArtistName().isEmpty()) |
745 !aMetaData->getArtistName().isEmpty()) |
635 { |
746 { |
636 iSongNameAvailable = true; |
747 iSongNameAvailable = true; |
637 } |
748 } |
638 } |
749 } |
639 else |
750 else |
640 { |
751 { |
641 iSongName->setPlainText(""); |
752 updateSongName(QString("")); |
642 iArtistName->setPlainText(""); |
753 iArtistName->setPlainText(""); |
643 } |
754 } |
644 } |
755 } |
645 |
756 |
646 /******************************************************************************************************** |
757 /******************************************************************************************************** |
647 * SLOT for Media Key |
758 * SLOT for Media Key |
648 ******************************************************************************************************* |
759 ******************************************************************************************************* |
649 */ |
760 */ |
650 void IRNowPlayingView::handlePlayPauseMediaKey() |
761 void IRNowPlayingView::handlePlayPauseMediaKey() |
651 { |
762 { |
|
763 LOG_METHOD; |
652 iPlayController->resume(); |
764 iPlayController->resume(); |
653 } |
765 } |
654 |
766 |
655 void IRNowPlayingView::handleStopMediaKey() |
767 void IRNowPlayingView::handleStopMediaKey() |
656 { |
768 { |
|
769 LOG_METHOD; |
657 iPlayController->stop(EIRQUserTerminated); |
770 iPlayController->stop(EIRQUserTerminated); |
658 } |
771 } |
659 |
772 |
660 /******************************************************************************************************** |
773 /******************************************************************************************************** |
661 * SLOT for Toolbar Action |
774 * SLOT for Toolbar Action |
662 ******************************************************************************************************* |
775 ******************************************************************************************************* |
663 */ |
776 */ |
664 void IRNowPlayingView::handleMusicStoreAction() |
777 void IRNowPlayingView::handleMusicStoreAction() |
665 { |
778 { |
|
779 LOG_METHOD; |
666 if(!iFindinNmsAllowed) |
780 if(!iFindinNmsAllowed) |
667 { |
781 { |
668 #ifdef SUBTITLE_STR_BY_LOCID |
782 #ifdef SUBTITLE_STR_BY_LOCID |
669 popupNote(hbTrId("txt_irad_info_not_allowed_by_this_station"), HbMessageBox::MessageTypeInformation); |
783 popupNote(hbTrId("txt_irad_info_not_allowed_by_this_station"), HbMessageBox::MessageTypeInformation); |
670 #else |
784 #else |
671 popupNote(hbTrId("Not allowed by this station"), HbMessageBox::MessageTypeInformation); |
785 popupNote(hbTrId("Not allowed by station"), HbMessageBox::MessageTypeInformation); |
672 #endif |
786 #endif |
673 return; |
787 return; |
674 } |
788 } |
675 |
789 |
676 if(!iSongNameAvailable) |
790 if(!iSongNameAvailable) |
677 { |
791 { |
|
792 #ifdef SUBTITLE_STR_BY_LOCID |
678 popupNote(hbTrId("txt_irad_info_no_song_info"), HbMessageBox::MessageTypeInformation); |
793 popupNote(hbTrId("txt_irad_info_no_song_info"), HbMessageBox::MessageTypeInformation); |
|
794 #else |
|
795 popupNote(hbTrId("No song info"), HbMessageBox::MessageTypeInformation); |
|
796 #endif |
679 return; |
797 return; |
680 } |
798 } |
681 |
799 |
682 // Need to log the find song in NMS event, iStatisticsReporter->logNmsEvent(IRQStatisticsReporter::EIRFind,channelId); |
800 // Need to log the find song in NMS event, iStatisticsReporter->logNmsEvent(IRQStatisticsReporter::EIRNmsFind,channelId); |
683 #ifdef SUBTITLE_STR_BY_LOCID |
801 #ifdef SUBTITLE_STR_BY_LOCID |
684 popupNote(hbTrId("txt_irad_info_music_store_not_available"), HbMessageBox::MessageTypeInformation); |
802 popupNote(hbTrId("txt_irad_info_music_store_not_available"), HbMessageBox::MessageTypeInformation); |
685 #else |
803 #else |
686 popupNote(hbTrId("Music store not available"), HbMessageBox::MessageTypeInformation); |
804 popupNote(hbTrId("Music store not ready"), HbMessageBox::MessageTypeInformation); |
687 #endif |
805 #endif |
688 } |
806 } |
689 |
807 |
690 void IRNowPlayingView::handleIdentifySongAction() |
808 void IRNowPlayingView::handleIdentifySongAction() |
691 { |
809 { |
692 if(IRQUtility::openSongRecognition()) |
810 LOG_METHOD; |
|
811 if(IRQUtility::launchAppByUid(iSettings->getSongRecognitionAppUid())) |
693 { |
812 { |
694 iStatisticsReporter->logSongRecogEvent(); |
813 iStatisticsReporter->logSongRecogEvent(); |
695 } |
814 } |
696 } |
815 } |
697 |
816 |
698 |
817 |
699 void IRNowPlayingView::handlePlayStopAction() |
818 void IRNowPlayingView::handlePlayStopAction() |
700 { |
819 { |
|
820 LOG_METHOD; |
701 switch (iPlayController->state()) |
821 switch (iPlayController->state()) |
702 { |
822 { |
703 case IRPlayController::EPlaying: |
823 case IRPlayController::EPlaying: |
704 iPlayController->stop(EIRQUserTerminated); |
824 iPlayController->stop(EIRQUserTerminated); |
705 return; |
825 return; |
781 * SLOT for Menu Action |
903 * SLOT for Menu Action |
782 ******************************************************************************************************* |
904 ******************************************************************************************************* |
783 */ |
905 */ |
784 void IRNowPlayingView::handleGoToStationAction() |
906 void IRNowPlayingView::handleGoToStationAction() |
785 { |
907 { |
|
908 LOG_METHOD; |
786 getViewManager()->activateView(EIRView_OpenWebAddressView); |
909 getViewManager()->activateView(EIRView_OpenWebAddressView); |
787 } |
910 } |
788 |
911 |
789 void IRNowPlayingView::handleShareStationAction() |
912 void IRNowPlayingView::handleShareStationAction() |
790 { |
913 { |
|
914 LOG_METHOD; |
791 if (NULL == iStationShare) |
915 if (NULL == iStationShare) |
792 { |
916 { |
793 iStationShare = new IRStationShare(); |
917 iStationShare = new IRStationShare(); |
794 } |
918 } |
795 iStationShare->shareStations(*iPlayController->getNowPlayingPreset()); |
919 iStationShare->shareStations(*iPlayController->getNowPlayingPreset()); |
796 } |
920 } |
797 |
921 |
798 void IRNowPlayingView::handleSettingAction() |
922 void IRNowPlayingView::handleSettingAction() |
799 { |
923 { |
|
924 LOG_METHOD_ENTER; |
800 getViewManager()->activateView(EIRView_SettingsView); |
925 getViewManager()->activateView(EIRView_SettingsView); |
801 } |
926 } |
802 |
927 |
803 #ifdef ADV_ENABLED |
928 #ifdef ADV_ENABLED |
804 void IRNowPlayingView::mousePressEvent(QGraphicsSceneMouseEvent *aEvent) |
929 void IRNowPlayingView::mousePressEvent(QGraphicsSceneMouseEvent *aEvent) |
805 { |
930 { |
|
931 LOG_METHOD_ENTER; |
806 QRectF advRect = iAdvImage->geometry(); |
932 QRectF advRect = iAdvImage->geometry(); |
807 QPointF pos = aEvent->pos(); |
933 QPointF pos = aEvent->pos(); |
808 |
934 |
809 if (advRect.contains(pos)) |
935 if (advRect.contains(pos)) |
810 { |
936 { |
812 } |
938 } |
813 } |
939 } |
814 |
940 |
815 void IRNowPlayingView::openAdvLink() |
941 void IRNowPlayingView::openAdvLink() |
816 { |
942 { |
|
943 LOG_METHOD_ENTER; |
817 IRQUtility::openAdvLink(iAdvUrl); |
944 IRQUtility::openAdvLink(iAdvUrl); |
818 } |
945 } |
819 #endif |
946 #endif |
820 |
947 |
|
948 #ifdef STATISTIC_REPORT_TEST_ENABLED |
|
949 void IRNowPlayingView::handleDummySongIdentify() |
|
950 { |
|
951 iStatisticsReporter->logSongRecogEvent(); |
|
952 popupNote("Identify Song ...", HbMessageBox::MessageTypeInformation); |
|
953 } |
|
954 |
|
955 void IRNowPlayingView::handleDummyGoToNms() |
|
956 { |
|
957 iStatisticsReporter->logNmsEvent(IRQStatisticsReporter::EIRNmsLaunch,iPlayController->getNowPlayingPreset()->presetId); |
|
958 popupNote("Go to Music Store ...", HbMessageBox::MessageTypeInformation); |
|
959 } |
|
960 |
|
961 void IRNowPlayingView::handleDummyFindInNms() |
|
962 { |
|
963 iStatisticsReporter->logNmsEvent(IRQStatisticsReporter::EIRNmsFind,iPlayController->getNowPlayingPreset()->presetId); |
|
964 popupNote("Find in Music Store ...", HbMessageBox::MessageTypeInformation); |
|
965 } |
|
966 |
|
967 #endif |
|
968 |
821 void IRNowPlayingView::loadStationLogo() |
969 void IRNowPlayingView::loadStationLogo() |
822 { |
970 { |
|
971 LOG_METHOD; |
823 if (iPlayController->isStationLogoAvailable()) |
972 if (iPlayController->isStationLogoAvailable()) |
824 { |
973 { |
825 QSettings settings(KIrSettingOrganization, KIrSettingApplication); |
974 QSettings settings(KIrSettingOrganization, KIrSettingApplication); |
826 if (settings.value(KIrSettingStationLogo).canConvert<QPixmap>()) |
975 if (settings.value(KIrSettingStationLogo).canConvert<QPixmap>()) |
827 { |
976 { |