videocollection/hgmyvideos/src/vcxhgmyvideoscollectionclient.cpp
branchRCL_3
changeset 70 375929f879c2
parent 64 3eb824b18d67
equal deleted inserted replaced
64:3eb824b18d67 70:375929f879c2
    45 // CONSTANTS
    45 // CONSTANTS
    46 const TInt KVcxHgEventLevelRoot     = 1;
    46 const TInt KVcxHgEventLevelRoot     = 1;
    47 const TInt KVcxHgEventLevelCategory = 2;
    47 const TInt KVcxHgEventLevelCategory = 2;
    48 const TInt KVcxHgEventLevelVideo    = 3;
    48 const TInt KVcxHgEventLevelVideo    = 3;
    49 
    49 
    50 const TInt KVcxMpxLevelRoot       = 1;
       
    51 const TInt KVcxMpxLevelCategories = 2;
    50 const TInt KVcxMpxLevelCategories = 2;
    52 const TInt KVcxMpxLevelVideos     = 3;
    51 const TInt KVcxMpxLevelVideos     = 3;
    53 
    52 
    54 const TUint32 KVcxHgMyVideosTransactionId = 5;
    53 const TUint32 KVcxHgMyVideosTransactionId = 5;
    55 
    54 
   219         iCollectionUtility->Collection().OpenL( aIndex );
   218         iCollectionUtility->Collection().OpenL( aIndex );
   220         iCollectionLevel = KErrNotFound;
   219         iCollectionLevel = KErrNotFound;
   221         }
   220         }
   222     else if ( iCollectionLevel == KVcxMpxLevelVideos )
   221     else if ( iCollectionLevel == KVcxMpxLevelVideos )
   223         {
   222         {
   224 		TInt currentIndex = CategoryIndexL();
   223         // OpenL() will return a list if there has been any changes.
   225 		
   224         // No reply if list is same as with previous OpenL().
   226         if ( aIndex == currentIndex )
   225         iCollectionUtility->Collection().OpenL();
   227             {
       
   228             // OpenL() will return a list if there has been any changes.
       
   229             // No reply if list is same as with previous OpenL().
       
   230             iCollectionUtility->Collection().OpenL();
       
   231             }
       
   232         else
       
   233             {
       
   234             iCollectionUtility->Collection().BackL( );
       
   235             iCollectionUtility->Collection().OpenL( aIndex );
       
   236             iCollectionLevel = KErrNotFound;
       
   237             }
       
   238         }
   226         }
   239     else
   227     else
   240         {
   228         {
   241         // NOP
   229         // NOP
   242         }
   230         }
   391 void CVcxHgMyVideosCollectionClient::PlayVideoL( TMPXItemId aMpxItemId )
   379 void CVcxHgMyVideosCollectionClient::PlayVideoL( TMPXItemId aMpxItemId )
   392     {
   380     {
   393     IPTVLOGSTRING2_LOW_LEVEL( 
   381     IPTVLOGSTRING2_LOW_LEVEL( 
   394                 "CVcxHgMyVideosCollectionClient::PlayVideoL: Play video at collection index %d", aMpxItemId.iId1 );
   382                 "CVcxHgMyVideosCollectionClient::PlayVideoL: Play video at collection index %d", aMpxItemId.iId1 );
   395     
   383     
   396     CMPXCollectionPath* collectionPath = iCollectionUtility->Collection().PathL();
   384     CMPXCollectionPath* path = CMPXCollectionPath::NewL();
   397     CleanupStack::PushL( collectionPath );
   385     CleanupStack::PushL(path);
   398     
   386     
   399     if ( collectionPath->Levels() == KVcxMpxLevelVideos )
   387     path->AppendL( KVcxUidMyVideosMpxCollection );
   400         {
   388     path->AppendL( KVcxMvcCategoryIdAll );
   401         collectionPath->DeselectAll();
   389     path->AppendL( aMpxItemId );
   402         collectionPath->SelectL( aMpxItemId );
   390     path->SelectL( aMpxItemId );
   403         iCollectionUtility->Collection().OpenL( *collectionPath );
   391     
   404 	    }
   392     iCollectionUtility->Collection().OpenL( *path );
   405     else
   393     CleanupStack::PopAndDestroy(path);
   406         {
       
   407         CMPXCollectionPath* customPath = CMPXCollectionPath::NewL();
       
   408         CleanupStack::PushL(customPath);
       
   409         
       
   410         customPath->AppendL( KVcxUidMyVideosMpxCollection );
       
   411         customPath->AppendL( KVcxMvcCategoryIdAll );
       
   412         customPath->AppendL( aMpxItemId );
       
   413         customPath->SelectL( aMpxItemId );
       
   414        
       
   415         iCollectionUtility->Collection().OpenL( *customPath );
       
   416         CleanupStack::PopAndDestroy( customPath );
       
   417         }
       
   418 
       
   419     CleanupStack::PopAndDestroy( collectionPath );
       
   420     }
   394     }
   421 
   395 
   422 // -----------------------------------------------------------------------------
   396 // -----------------------------------------------------------------------------
   423 // CVcxHgMyVideosCollectionClient::FetchMpxMediaByMpxIdL()
   397 // CVcxHgMyVideosCollectionClient::FetchMpxMediaByMpxIdL()
   424 // -----------------------------------------------------------------------------
   398 // -----------------------------------------------------------------------------
  1164         {
  1138         {
  1165         iVideoModelObserver->VideoDetailsCompletedL( *media );
  1139         iVideoModelObserver->VideoDetailsCompletedL( *media );
  1166         }
  1140         }
  1167     }
  1141     }
  1168 
  1142 
  1169 // -----------------------------------------------------------------------------
       
  1170 // CVcxHgMyVideosCollectionClient::CategoryIndexL()
       
  1171 // -----------------------------------------------------------------------------
       
  1172 //
       
  1173 TInt CVcxHgMyVideosCollectionClient::CategoryIndexL()
       
  1174     {
       
  1175     CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
       
  1176     CleanupStack::PushL( path );
       
  1177     TInt index ( -1 );
       
  1178     if ( path->Levels() > KVcxMpxLevelCategories )
       
  1179         {
       
  1180         index = path->Index( KVcxMpxLevelRoot );
       
  1181         }
       
  1182     CleanupStack::PopAndDestroy( path );
       
  1183     
       
  1184     return index;
       
  1185     }
       
  1186 
       
  1187 #if defined(_DEBUG) && IPTV_LOGGING_METHOD != 0
  1143 #if defined(_DEBUG) && IPTV_LOGGING_METHOD != 0
  1188 // -----------------------------------------------------------------------------
  1144 // -----------------------------------------------------------------------------
  1189 // CVcxHgMyVideosCollectionClient::DebugPrintVideoListL()
  1145 // CVcxHgMyVideosCollectionClient::DebugPrintVideoListL()
  1190 // -----------------------------------------------------------------------------
  1146 // -----------------------------------------------------------------------------
  1191 //
  1147 //