qtinternetradio/ui/src/irnowplayingview.cpp
changeset 8 3b03c28289e6
parent 5 0930554dc389
child 11 f683e24efca3
equal deleted inserted replaced
5:0930554dc389 8:3b03c28289e6
    18 #include <QPixmap>
    18 #include <QPixmap>
    19 #include <hbaction.h>
    19 #include <hbaction.h>
    20 #include <hblabel.h>
    20 #include <hblabel.h>
    21 #include <hbnotificationdialog.h>
    21 #include <hbnotificationdialog.h>
    22 
    22 
       
    23 #ifdef NOWPLAYING_VIEW_OPTION_B
       
    24 #include <hbframedrawer.h>
       
    25 #include <hbframeitem.h>
       
    26 #endif
       
    27 
       
    28 
    23 #include "irviewmanager.h"
    29 #include "irviewmanager.h"
    24 #include "irapplication.h"
    30 #include "irapplication.h"
    25 #include "irplaycontroller.h"
    31 #include "irplaycontroller.h"
    26 #include "irqisdsdatastructure.h"
    32 #include "irqisdsdatastructure.h"
    27 #include "irqmetadata.h"
    33 #include "irqmetadata.h"
    49 const int KNowPlayingLogoSize = 300; // Now playing logo size
    55 const int KNowPlayingLogoSize = 300; // Now playing logo size
    50 static const QString KDefaultStationLogo("qtg_large_internet_radio");
    56 static const QString KDefaultStationLogo("qtg_large_internet_radio");
    51 static const QString KPlayButtonIcon("qtg_mono_play");
    57 static const QString KPlayButtonIcon("qtg_mono_play");
    52 static const QString KStopButtonIcon("qtg_mono_stop");
    58 static const QString KStopButtonIcon("qtg_mono_stop");
    53 
    59 
       
    60 #ifdef NOWPLAYING_VIEW_OPTION_B
       
    61 static const QString KLcdGraphics("qtg_fr_lcd");
       
    62 #endif
       
    63 
    54 /*
    64 /*
    55  * Description : constructor
    65  * Description : constructor
    56  */
    66  */
    57 IRNowPlayingView::IRNowPlayingView(IRApplication* aApplication, TIRViewId aViewId) :
    67 IRNowPlayingView::IRNowPlayingView(IRApplication* aApplication, TIRViewId aViewId) :
    58     IRBaseView(aApplication, aViewId),
    68     IRBaseView(aApplication, aViewId),
    59     iStatisticsReporter(NULL),
    69     iStatisticsReporter(NULL),
    60     iNetworkController(NULL),
    70     iNetworkController(NULL),
       
    71     iStationShare(NULL),
    61     iPlayStopAction(NULL),
    72     iPlayStopAction(NULL),
    62     iLaunchActionNeeded(false),
    73     iLaunchActionNeeded(false),
    63     iLogoDownloadState(EIdle),    
    74     iLogoDownloadState(EIdle),    
    64     iSongName(NULL),
    75     iSongName(NULL),
    65     iArtistName(NULL),
    76     iArtistName(NULL),
    97     
   108     
    98     if (iStatisticsReporter)
   109     if (iStatisticsReporter)
    99     {
   110     {
   100         iStatisticsReporter->closeInstance();
   111         iStatisticsReporter->closeInstance();
   101     }
   112     }
       
   113     
       
   114     delete iStationShare;        
   102 }
   115 }
   103 
   116 
   104 
   117 
   105 /*
   118 /*
   106  * Description: initializing.
   119  * Description: initializing.
   184     iStationName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_STATION_NAME));   
   197     iStationName = qobject_cast<HbLabel *> (iLoader.findObject(NOW_PLAYING_VIEW_OBJECT_STATION_NAME));   
   185     iStationLogo->setIcon(HbIcon(KDefaultStationLogo));   
   198     iStationLogo->setIcon(HbIcon(KDefaultStationLogo));   
   186     iStationName->setPlainText("");
   199     iStationName->setPlainText("");
   187     iSongName->setPlainText("");
   200     iSongName->setPlainText("");
   188     iArtistName->setPlainText("");    
   201     iArtistName->setPlainText("");    
       
   202     
       
   203 #ifdef NOWPLAYING_VIEW_OPTION_B
       
   204 	HbWidget * viewContainer = qobject_cast<HbWidget *> (iLoader.findObject(VIEW_CONTAINER));
       
   205     HbFrameDrawer* drawer = new HbFrameDrawer(KLcdGraphics, HbFrameDrawer::NinePieces);
       
   206     HbFrameItem* backgroundItem = new HbFrameItem(drawer, viewContainer);
       
   207     if (backgroundItem)
       
   208     {
       
   209         viewContainer->setBackgroundItem(backgroundItem);
       
   210     }
       
   211 #endif
       
   212     
   189 #ifdef ADV_ENABLED
   213 #ifdef ADV_ENABLED
   190     iAdvImage = qobject_cast<HbLabel *> (iLoader.findObject( NOW_PLAYING_VIEW_OBJECT_ADVERTISEMENT_IMAGE));
   214     iAdvImage = qobject_cast<HbLabel *> (iLoader.findObject( NOW_PLAYING_VIEW_OBJECT_ADVERTISEMENT_IMAGE));
   191     iAdvImage->setIcon(HbIcon(KDefaultStationLogo));
   215     iAdvImage->setIcon(HbIcon(KDefaultStationLogo));
   192 #endif    
   216 #endif    
   193 }
   217 }
   733     getViewManager()->activateView(EIRView_OpenWebAddressView);
   757     getViewManager()->activateView(EIRView_OpenWebAddressView);
   734 }
   758 }
   735 
   759 
   736 void IRNowPlayingView::handleShareStationAction()
   760 void IRNowPlayingView::handleShareStationAction()
   737 {
   761 {
   738     IRStationShare stationShare;
   762     if (NULL == iStationShare)
   739     stationShare.shareStations(*iPlayController->getNowPlayingPreset());
   763     {
       
   764         iStationShare = new IRStationShare();
       
   765     }
       
   766     iStationShare->shareStations(*iPlayController->getNowPlayingPreset());
   740 }
   767 }
   741 
   768 
   742 void IRNowPlayingView::handleSettingAction()
   769 void IRNowPlayingView::handleSettingAction()
   743 {
   770 {
   744     getViewManager()->activateView(EIRView_SettingsView);
   771     getViewManager()->activateView(EIRView_SettingsView);