videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp
branchRCL_3
changeset 20 2d690156cf8f
parent 15 8f0df5c82986
equal deleted inserted replaced
18:baf439b22ddd 20:2d690156cf8f
    31 #include <thumbnaildata.h>
    31 #include <thumbnaildata.h>
    32 #include <DRMCommon.h> // DRM
    32 #include <DRMCommon.h> // DRM
    33 #include <gulicon.h>
    33 #include <gulicon.h>
    34 
    34 
    35 #include "IptvDebug.h"
    35 #include "IptvDebug.h"
       
    36 #include <myvideosindicator.h>
    36 #include <vcxmyvideosdefs.h>
    37 #include <vcxmyvideosdefs.h>
    37 #include "vcxhgmyvideosmodel.h"
    38 #include "vcxhgmyvideosmodel.h"
    38 #include "vcxhgmyvideosmainview.h"
    39 #include "vcxhgmyvideosmainview.h"
    39 #include "vcxhgmyvideosvideolist.h"
    40 #include "vcxhgmyvideosvideolist.h"
    40 #include "vcxhgmyvideosvideodataupdater.h"
    41 #include "vcxhgmyvideosvideodataupdater.h"
    65 // -----------------------------------------------------------------------------
    66 // -----------------------------------------------------------------------------
    66 //
    67 //
    67 CVcxHgMyVideosVideoDataUpdater* CVcxHgMyVideosVideoDataUpdater::NewL(
    68 CVcxHgMyVideosVideoDataUpdater* CVcxHgMyVideosVideoDataUpdater::NewL(
    68         CVcxHgMyVideosModel& aModel,
    69         CVcxHgMyVideosModel& aModel,
    69         CHgScroller& aScroller,
    70         CHgScroller& aScroller,
    70         CVcxHgMyVideosVideoList& aVideoArray )
    71         CVcxHgMyVideosVideoList& aVideoArray,
       
    72         CMyVideosIndicator& aVideosIndicator )
    71     {
    73     {
    72     CVcxHgMyVideosVideoDataUpdater* self = 
    74     CVcxHgMyVideosVideoDataUpdater* self = 
    73         CVcxHgMyVideosVideoDataUpdater::NewLC( aModel,
    75         CVcxHgMyVideosVideoDataUpdater::NewLC( aModel,
    74                                                aScroller,
    76                                                aScroller,
    75                                                aVideoArray );
    77                                                aVideoArray,
       
    78                                                aVideosIndicator );
    76     CleanupStack::Pop( self );
    79     CleanupStack::Pop( self );
    77     return self;
    80     return self;
    78     }
    81     }
    79 
    82 
    80 // -----------------------------------------------------------------------------
    83 // -----------------------------------------------------------------------------
    82 // -----------------------------------------------------------------------------
    85 // -----------------------------------------------------------------------------
    83 //
    86 //
    84 CVcxHgMyVideosVideoDataUpdater* CVcxHgMyVideosVideoDataUpdater::NewLC(
    87 CVcxHgMyVideosVideoDataUpdater* CVcxHgMyVideosVideoDataUpdater::NewLC(
    85         CVcxHgMyVideosModel& aModel,
    88         CVcxHgMyVideosModel& aModel,
    86         CHgScroller& aScroller,
    89         CHgScroller& aScroller,
    87         CVcxHgMyVideosVideoList& aVideoArray )
    90         CVcxHgMyVideosVideoList& aVideoArray,
       
    91         CMyVideosIndicator& aVideosIndicator)
    88     {
    92     {
    89     CVcxHgMyVideosVideoDataUpdater* self = 
    93     CVcxHgMyVideosVideoDataUpdater* self = 
    90         new (ELeave) CVcxHgMyVideosVideoDataUpdater( aModel,
    94         new (ELeave) CVcxHgMyVideosVideoDataUpdater( aModel,
    91                                                      aScroller,
    95                                                      aScroller,
    92                                                      aVideoArray );
    96                                                      aVideoArray,
       
    97                                                      aVideosIndicator );
    93     CleanupStack::PushL( self );
    98     CleanupStack::PushL( self );
    94     self->ConstructL();
    99     self->ConstructL();
    95     return self;
   100     return self;
    96     }
   101     }
    97 
   102 
   100 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
   101 //
   106 //
   102 CVcxHgMyVideosVideoDataUpdater::CVcxHgMyVideosVideoDataUpdater(
   107 CVcxHgMyVideosVideoDataUpdater::CVcxHgMyVideosVideoDataUpdater(
   103         CVcxHgMyVideosModel& aModel,
   108         CVcxHgMyVideosModel& aModel,
   104         CHgScroller& aScroller,
   109         CHgScroller& aScroller,
   105         CVcxHgMyVideosVideoList& aVideoArray )
   110         CVcxHgMyVideosVideoList& aVideoArray,
       
   111         CMyVideosIndicator& aVideosIndicator )
   106   : CActive( EPriorityStandard ),
   112   : CActive( EPriorityStandard ),
   107     iModel( aModel ),
   113     iModel( aModel ),
   108     iScroller( aScroller ),
   114     iScroller( aScroller ),
   109     iVideoArray( aVideoArray ),
   115     iVideoArray( aVideoArray ),
       
   116     iVideosIndicator( aVideosIndicator ),
   110     iPaused( EFalse )
   117     iPaused( EFalse )
   111     {
   118     {
   112     CActiveScheduler::Add( this );
   119     CActiveScheduler::Add( this );
   113     }
   120     }
   114 
   121 
   394 // CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL()
   401 // CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL()
   395 // -----------------------------------------------------------------------------
   402 // -----------------------------------------------------------------------------
   396 //
   403 //
   397 void CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL( CVcxHgMyVideosVideoData& aVideoData )
   404 void CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL( CVcxHgMyVideosVideoData& aVideoData )
   398     {
   405     {
       
   406     IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() ENTER" );
       
   407 
   399     TInt index = iVideoArray.IndexByMPXItemId( aVideoData.MPXItemId() );
   408     TInt index = iVideoArray.IndexByMPXItemId( aVideoData.MPXItemId() );
   400     
   409     
   401     if ( index >= 0 && index < iScroller.ItemCount() )
   410     if ( index >= 0 && index < iScroller.ItemCount() )
   402         {       
   411         {       
   403         TBool drmUpdate = aVideoData.DrmProtected();
   412         TBool drmUpdate = aVideoData.DrmProtected();
   404         CHgItem& listItem = iScroller.ItemL( index );
   413         CHgItem& listItem = iScroller.ItemL( index );
   405                 
   414                 
   406         if ( aVideoData.Thumbnail() )
   415         if ( aVideoData.Thumbnail() )
   407             {
   416             {
   408             CGulIcon* thumbnail = CGulIcon::NewL( aVideoData.Thumbnail( ETrue ) );
   417             CGulIcon* thumbnail = CGulIcon::NewL( aVideoData.Thumbnail( ETrue ) );
   409             listItem.SetIcon( thumbnail ); 
   418             listItem.SetIcon( thumbnail );
       
   419             CMPXMedia* media = iVideoArray.MPXMediaByMPXItemId( aVideoData.MPXItemId() );
       
   420             if ( iVideosIndicator.IsIndicatorShown( *media ) )
       
   421                 {
       
   422                 IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() has icon, has indicator" );
       
   423                 listItem.SetFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
       
   424                 }
       
   425             else
       
   426                 {
       
   427                 IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() has icon, no indicator" );
       
   428                 listItem.ClearFlags( CHgItem::EHgItemFlagsIconOverlayIndicator );
       
   429                 }
   410             }
   430             }
   411         
   431         
   412         if ( drmUpdate )
   432         if ( drmUpdate )
   413             {
   433             {
   414             TVcxHgMyVideosIndicatorHelper::TIndicatorDrmStatus drmStatus;
   434             TVcxHgMyVideosIndicatorHelper::TIndicatorDrmStatus drmStatus;
   462         if ( ListRefreshNeeded( index ) )
   482         if ( ListRefreshNeeded( index ) )
   463             {
   483             {
   464             RefreshScreen();
   484             RefreshScreen();
   465             }
   485             }
   466         }
   486         }
       
   487     IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosVideoDataUpdater::UpdateVideoDataToUiL() RETURN" );
   467     }
   488     }
   468 
   489 
   469 // -----------------------------------------------------------------------------
   490 // -----------------------------------------------------------------------------
   470 // CVcxHgMyVideosVideoDataUpdater::IndexByMPXItemId()
   491 // CVcxHgMyVideosVideoDataUpdater::IndexByMPXItemId()
   471 // -----------------------------------------------------------------------------
   492 // -----------------------------------------------------------------------------