videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp
author hgs
Fri, 14 May 2010 15:14:51 +0300
changeset 38 ff53afa8ad05
parent 36 8aed59de29f9
child 40 13331705e488
permissions -rw-r--r--
201019
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
hgs
parents:
diff changeset
    10
* Initial Contributors:
hgs
parents:
diff changeset
    11
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    12
*
hgs
parents:
diff changeset
    13
* Contributors:
hgs
parents:
diff changeset
    14
*
hgs
parents:
diff changeset
    15
* Description:   Class representing album in My Videos collection.
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include <mpxlog.h>
hgs
parents:
diff changeset
    19
#include <mpxmedia.h>
hgs
parents:
diff changeset
    20
#include <mpxmediaarray.h>
hgs
parents:
diff changeset
    21
#include <mpxmediacontainerdefs.h>
36
hgs
parents: 35
diff changeset
    22
#include <mpxmediageneraldefs.h>
34
hgs
parents:
diff changeset
    23
#include "vcxmyvideosalbum.h"
hgs
parents:
diff changeset
    24
#include "vcxmyvideoscollectionplugin.h"
hgs
parents:
diff changeset
    25
#include "vcxmyvideosvideocache.h"
hgs
parents:
diff changeset
    26
#include "vcxmyvideoscollectionutil.h"
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    30
// TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo
hgs
parents:
diff changeset
    31
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    32
//
hgs
parents:
diff changeset
    33
TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo()
hgs
parents:
diff changeset
    34
    {
hgs
parents:
diff changeset
    35
    Set( 0, 0, 0 );
hgs
parents:
diff changeset
    36
    }
hgs
parents:
diff changeset
    37
hgs
parents:
diff changeset
    38
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    39
// TVcxMyVideosAlbumVideo::operator=
hgs
parents:
diff changeset
    40
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    41
//                
hgs
parents:
diff changeset
    42
TVcxMyVideosAlbumVideo& TVcxMyVideosAlbumVideo::operator=( const TVcxMyVideosAlbumVideo& aVideo )
hgs
parents:
diff changeset
    43
    {
hgs
parents:
diff changeset
    44
    Set( aVideo.iMdsId, aVideo.iRelationMdsId, aVideo.iMedia );
hgs
parents:
diff changeset
    45
    return *this;
hgs
parents:
diff changeset
    46
    }
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    49
// TVcxMyVideosAlbumVideo::Set
hgs
parents:
diff changeset
    50
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    51
//            
hgs
parents:
diff changeset
    52
void TVcxMyVideosAlbumVideo::Set( TUint32 aMdsId, TUint32 aRelationMdsId, CMPXMedia* aVideo )
hgs
parents:
diff changeset
    53
    {
hgs
parents:
diff changeset
    54
    iMdsId         = aMdsId;
hgs
parents:
diff changeset
    55
    iRelationMdsId = aRelationMdsId;
hgs
parents:
diff changeset
    56
    iMedia         = aVideo;
hgs
parents:
diff changeset
    57
    }
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    60
// CVcxMyVideosAlbum::CVcxMyVideosAlbum
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    62
//
hgs
parents:
diff changeset
    63
CVcxMyVideosAlbum::CVcxMyVideosAlbum( CVcxMyVideosCollectionPlugin& aCollectionPlugin )
hgs
parents:
diff changeset
    64
: iCollection( aCollectionPlugin )
hgs
parents:
diff changeset
    65
    {
hgs
parents:
diff changeset
    66
    // No implementation required
hgs
parents:
diff changeset
    67
    }
hgs
parents:
diff changeset
    68
hgs
parents:
diff changeset
    69
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    70
// CVcxMyVideosAlbum::~CVcxMyVideosAlbum
hgs
parents:
diff changeset
    71
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    72
//
hgs
parents:
diff changeset
    73
CVcxMyVideosAlbum::~CVcxMyVideosAlbum()
hgs
parents:
diff changeset
    74
    {
hgs
parents:
diff changeset
    75
    iVideoList.Close();
hgs
parents:
diff changeset
    76
    }
hgs
parents:
diff changeset
    77
hgs
parents:
diff changeset
    78
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    79
// CVcxMyVideosAlbum::NewLC
hgs
parents:
diff changeset
    80
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    81
//
hgs
parents:
diff changeset
    82
CVcxMyVideosAlbum* CVcxMyVideosAlbum::NewLC( CVcxMyVideosCollectionPlugin& aCollectionPlugin )
hgs
parents:
diff changeset
    83
    {
hgs
parents:
diff changeset
    84
    CVcxMyVideosAlbum* self = new (ELeave) CVcxMyVideosAlbum( aCollectionPlugin );
hgs
parents:
diff changeset
    85
    CleanupStack::PushL(self);
hgs
parents:
diff changeset
    86
    self->ConstructL();
hgs
parents:
diff changeset
    87
    return self;
hgs
parents:
diff changeset
    88
    }
hgs
parents:
diff changeset
    89
hgs
parents:
diff changeset
    90
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    91
// CVcxMyVideosAlbum::NewL
hgs
parents:
diff changeset
    92
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    93
//
hgs
parents:
diff changeset
    94
CVcxMyVideosAlbum* CVcxMyVideosAlbum::NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin )
hgs
parents:
diff changeset
    95
    {
hgs
parents:
diff changeset
    96
    CVcxMyVideosAlbum* self = CVcxMyVideosAlbum::NewLC( aCollectionPlugin );
35
hgs
parents: 34
diff changeset
    97
    CleanupStack::Pop( self );
34
hgs
parents:
diff changeset
    98
    return self;
hgs
parents:
diff changeset
    99
    }
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   102
// CVcxMyVideosAlbum::ConstructL
hgs
parents:
diff changeset
   103
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   104
//
hgs
parents:
diff changeset
   105
void CVcxMyVideosAlbum::ConstructL()
hgs
parents:
diff changeset
   106
    {
hgs
parents:
diff changeset
   107
    iVideoList.Reset();
hgs
parents:
diff changeset
   108
    }
hgs
parents:
diff changeset
   109
hgs
parents:
diff changeset
   110
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   111
// CVcxMyVideosAlbum::Sort
hgs
parents:
diff changeset
   112
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   113
//
hgs
parents:
diff changeset
   114
void CVcxMyVideosAlbum::Sort()
36
hgs
parents: 35
diff changeset
   115
    {
34
hgs
parents:
diff changeset
   116
    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
hgs
parents:
diff changeset
   117
            CVcxMyVideosAlbum::CompareVideosByMdsId );
hgs
parents:
diff changeset
   118
hgs
parents:
diff changeset
   119
    iVideoList.Sort( KOrderByMdsId );
hgs
parents:
diff changeset
   120
    }
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   123
// CVcxMyVideosAlbum::SetL
hgs
parents:
diff changeset
   124
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   125
//
hgs
parents:
diff changeset
   126
void CVcxMyVideosAlbum::SetL( /*CMPXMedia& aAlbum*/ )
hgs
parents:
diff changeset
   127
    {
hgs
parents:
diff changeset
   128
    //TODO:
hgs
parents:
diff changeset
   129
    }
hgs
parents:
diff changeset
   130
hgs
parents:
diff changeset
   131
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   132
// CVcxMyVideosAlbum::BelongsToAlbum
hgs
parents:
diff changeset
   133
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   134
//
hgs
parents:
diff changeset
   135
TBool CVcxMyVideosAlbum::BelongsToAlbum( TUint32 aMdsId )
hgs
parents:
diff changeset
   136
    {
hgs
parents:
diff changeset
   137
    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
hgs
parents:
diff changeset
   138
            CVcxMyVideosAlbum::CompareVideosByMdsId );
hgs
parents:
diff changeset
   139
    
hgs
parents:
diff changeset
   140
    TInt index;
hgs
parents:
diff changeset
   141
    TVcxMyVideosAlbumVideo video;
hgs
parents:
diff changeset
   142
    video.iMdsId = aMdsId;
hgs
parents:
diff changeset
   143
    TInt err = iVideoList.FindInOrder( video, index, KOrderByMdsId );
hgs
parents:
diff changeset
   144
    
hgs
parents:
diff changeset
   145
    if ( err != KErrNone )
hgs
parents:
diff changeset
   146
        {
hgs
parents:
diff changeset
   147
        return EFalse;
hgs
parents:
diff changeset
   148
        }
hgs
parents:
diff changeset
   149
    
hgs
parents:
diff changeset
   150
    return ETrue;
hgs
parents:
diff changeset
   151
    }
hgs
parents:
diff changeset
   152
hgs
parents:
diff changeset
   153
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   154
// CVcxMyVideosAlbum::Video
hgs
parents:
diff changeset
   155
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   156
//
hgs
parents:
diff changeset
   157
TInt CVcxMyVideosAlbum::Video( TUint32 aMdsId, TVcxMyVideosAlbumVideo& aVideo, TInt& aIndex )
hgs
parents:
diff changeset
   158
    {
hgs
parents:
diff changeset
   159
    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
hgs
parents:
diff changeset
   160
            CVcxMyVideosAlbum::CompareVideosByMdsId );
hgs
parents:
diff changeset
   161
    
hgs
parents:
diff changeset
   162
    TVcxMyVideosAlbumVideo videoToFind;
hgs
parents:
diff changeset
   163
    videoToFind.iMdsId = aMdsId;
hgs
parents:
diff changeset
   164
    TInt err = iVideoList.FindInOrder( videoToFind, aIndex, KOrderByMdsId );
hgs
parents:
diff changeset
   165
hgs
parents:
diff changeset
   166
    if ( err == KErrNone )
hgs
parents:
diff changeset
   167
        {
hgs
parents:
diff changeset
   168
        aVideo = iVideoList[aIndex];
hgs
parents:
diff changeset
   169
        }
hgs
parents:
diff changeset
   170
   
hgs
parents:
diff changeset
   171
    return err;
hgs
parents:
diff changeset
   172
    }
hgs
parents:
diff changeset
   173
hgs
parents:
diff changeset
   174
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   175
// CVcxMyVideosAlbum::AddL
hgs
parents:
diff changeset
   176
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   177
//
hgs
parents:
diff changeset
   178
void CVcxMyVideosAlbum::AddL( TVcxMyVideosAlbumVideo aVideo )
hgs
parents:
diff changeset
   179
    {
hgs
parents:
diff changeset
   180
    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
hgs
parents:
diff changeset
   181
            CVcxMyVideosAlbum::CompareVideosByMdsId );
hgs
parents:
diff changeset
   182
hgs
parents:
diff changeset
   183
    iVideoList.InsertInOrderAllowRepeatsL( aVideo, KOrderByMdsId );
hgs
parents:
diff changeset
   184
    }
hgs
parents:
diff changeset
   185
hgs
parents:
diff changeset
   186
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   187
// CVcxMyVideosAlbum::Remove
hgs
parents:
diff changeset
   188
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   189
//
hgs
parents:
diff changeset
   190
void CVcxMyVideosAlbum::Remove( RArray<TUint32>& aMdsIds )
hgs
parents:
diff changeset
   191
    {
hgs
parents:
diff changeset
   192
    TInt count = aMdsIds.Count();
hgs
parents:
diff changeset
   193
    for ( TInt i = 0; i < count; i++ )
hgs
parents:
diff changeset
   194
        {
hgs
parents:
diff changeset
   195
        Remove( aMdsIds[i], EFalse /* don't compress */ );
hgs
parents:
diff changeset
   196
        }
hgs
parents:
diff changeset
   197
    iVideoList.Compress();
hgs
parents:
diff changeset
   198
    }
hgs
parents:
diff changeset
   199
hgs
parents:
diff changeset
   200
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   201
// CVcxMyVideosAlbum::Remove
hgs
parents:
diff changeset
   202
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   203
//
hgs
parents:
diff changeset
   204
void CVcxMyVideosAlbum::Remove( TUint32 aMdsId, TBool aCompress )
hgs
parents:
diff changeset
   205
    {
hgs
parents:
diff changeset
   206
    const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
hgs
parents:
diff changeset
   207
            CVcxMyVideosAlbum::CompareVideosByMdsId );
hgs
parents:
diff changeset
   208
hgs
parents:
diff changeset
   209
    TVcxMyVideosAlbumVideo video;
hgs
parents:
diff changeset
   210
    video.iMdsId = aMdsId;
hgs
parents:
diff changeset
   211
    TInt pos;
hgs
parents:
diff changeset
   212
    TInt err = iVideoList.FindInOrder( video, pos, KOrderByMdsId );
hgs
parents:
diff changeset
   213
    if ( err == KErrNone )
hgs
parents:
diff changeset
   214
        {
hgs
parents:
diff changeset
   215
        iVideoList.Remove( pos );
hgs
parents:
diff changeset
   216
        }
hgs
parents:
diff changeset
   217
    if ( aCompress )
hgs
parents:
diff changeset
   218
        {
hgs
parents:
diff changeset
   219
        iVideoList.Compress();
hgs
parents:
diff changeset
   220
        }
hgs
parents:
diff changeset
   221
    }
hgs
parents:
diff changeset
   222
hgs
parents:
diff changeset
   223
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   224
// CVcxMyVideosAlbum::CompareVideosByMdsId
hgs
parents:
diff changeset
   225
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   226
//
hgs
parents:
diff changeset
   227
TInt CVcxMyVideosAlbum::CompareVideosByMdsId( const TVcxMyVideosAlbumVideo& aVideo1,
hgs
parents:
diff changeset
   228
        const TVcxMyVideosAlbumVideo& aVideo2 )
hgs
parents:
diff changeset
   229
    {
hgs
parents:
diff changeset
   230
    if ( aVideo1.iMdsId == aVideo2.iMdsId )
hgs
parents:
diff changeset
   231
        {
hgs
parents:
diff changeset
   232
        return 0;
hgs
parents:
diff changeset
   233
        }
hgs
parents:
diff changeset
   234
hgs
parents:
diff changeset
   235
    if ( aVideo1.iMdsId < aVideo2.iMdsId )
hgs
parents:
diff changeset
   236
        {
hgs
parents:
diff changeset
   237
        return -1;
hgs
parents:
diff changeset
   238
        }
hgs
parents:
diff changeset
   239
    return 1;
hgs
parents:
diff changeset
   240
    }
hgs
parents:
diff changeset
   241
hgs
parents:
diff changeset
   242
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   243
// CVcxMyVideosAlbum::CreateVideoListL
hgs
parents:
diff changeset
   244
// Creates album video list from iCollection.iCache->iVideoList.
hgs
parents:
diff changeset
   245
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   246
//
hgs
parents:
diff changeset
   247
CMPXMedia* CVcxMyVideosAlbum::CreateVideoListL()
hgs
parents:
diff changeset
   248
    {
hgs
parents:
diff changeset
   249
    CMPXMedia* toVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
hgs
parents:
diff changeset
   250
    CleanupStack::PushL( toVideoList );
hgs
parents:
diff changeset
   251
hgs
parents:
diff changeset
   252
    AppendToVideoListL( *iCollection.iCache->iVideoList, *toVideoList, 0 );
hgs
parents:
diff changeset
   253
    
hgs
parents:
diff changeset
   254
    CleanupStack::Pop( toVideoList );
hgs
parents:
diff changeset
   255
hgs
parents:
diff changeset
   256
    return toVideoList;
hgs
parents:
diff changeset
   257
    }
hgs
parents:
diff changeset
   258
hgs
parents:
diff changeset
   259
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   260
// CVcxMyVideosAlbum::CreateVideoListL
36
hgs
parents: 35
diff changeset
   261
// Appends to video list the items which belong to this album.
34
hgs
parents:
diff changeset
   262
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   263
//
hgs
parents:
diff changeset
   264
void CVcxMyVideosAlbum::AppendToVideoListL( CMPXMedia& aFromVideoList,
hgs
parents:
diff changeset
   265
        CMPXMedia& aToVideoList, TInt aNewItemStartIndex )
hgs
parents:
diff changeset
   266
    {
hgs
parents:
diff changeset
   267
    if ( aNewItemStartIndex < 0 )
hgs
parents:
diff changeset
   268
        {
hgs
parents:
diff changeset
   269
        return;
hgs
parents:
diff changeset
   270
        }
hgs
parents:
diff changeset
   271
    
hgs
parents:
diff changeset
   272
    CMPXMediaArray* fromArray = aFromVideoList.Value<CMPXMediaArray>( KMPXMediaArrayContents ); 
hgs
parents:
diff changeset
   273
    CMPXMediaArray* toArray   = aToVideoList.Value<CMPXMediaArray>( KMPXMediaArrayContents ); 
hgs
parents:
diff changeset
   274
    TUint32 mdsId;
hgs
parents:
diff changeset
   275
    CMPXMedia* fromVideo;
hgs
parents:
diff changeset
   276
    TInt count = fromArray->Count();
hgs
parents:
diff changeset
   277
    for ( TInt i = aNewItemStartIndex; i < count; i++ )
hgs
parents:
diff changeset
   278
        {
hgs
parents:
diff changeset
   279
        fromVideo = fromArray->AtL( i );
hgs
parents:
diff changeset
   280
        mdsId = TVcxMyVideosCollectionUtil::IdL( *fromVideo ).iId1;
hgs
parents:
diff changeset
   281
        if ( BelongsToAlbum( mdsId ) )
hgs
parents:
diff changeset
   282
            {
hgs
parents:
diff changeset
   283
            CMPXMedia* toVideo = CMPXMedia::NewL( *fromVideo ); //share underlying memory
hgs
parents:
diff changeset
   284
            CleanupStack::PushL( toVideo );
hgs
parents:
diff changeset
   285
            toArray->AppendL( toVideo );
hgs
parents:
diff changeset
   286
            CleanupStack::Pop( toVideo );
hgs
parents:
diff changeset
   287
            }
hgs
parents:
diff changeset
   288
        }
hgs
parents:
diff changeset
   289
    }
36
hgs
parents: 35
diff changeset
   290
hgs
parents: 35
diff changeset
   291
// ---------------------------------------------------------------------------
hgs
parents: 35
diff changeset
   292
// CVcxMyVideosAlbum::CalculateAttributesL
hgs
parents: 35
diff changeset
   293
// ---------------------------------------------------------------------------
hgs
parents: 35
diff changeset
   294
//
hgs
parents: 35
diff changeset
   295
void CVcxMyVideosAlbum::CalculateAttributesL( TInt aStartIndex )
hgs
parents: 35
diff changeset
   296
    {
38
hgs
parents: 36
diff changeset
   297
    TInt videoCount = 0;
36
hgs
parents: 35
diff changeset
   298
    TUint32 count = iVideoList.Count();
hgs
parents: 35
diff changeset
   299
    TInt newCount = 0;
hgs
parents: 35
diff changeset
   300
    CMPXMedia* video;
hgs
parents: 35
diff changeset
   301
    CMPXMedia* latestNewVideo = NULL;
hgs
parents: 35
diff changeset
   302
    TInt pos;
hgs
parents: 35
diff changeset
   303
    TUint32 flags;
hgs
parents: 35
diff changeset
   304
    TInt64 currentItemsCreationDate = 0;
hgs
parents: 35
diff changeset
   305
    TInt64 latestCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *iMedia );
hgs
parents: 35
diff changeset
   306
    for ( TInt i = aStartIndex; i < count; i++ )
hgs
parents: 35
diff changeset
   307
        {
hgs
parents: 35
diff changeset
   308
        video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos );
hgs
parents: 35
diff changeset
   309
        if ( video )
hgs
parents: 35
diff changeset
   310
            {
38
hgs
parents: 36
diff changeset
   311
            videoCount++;
36
hgs
parents: 35
diff changeset
   312
            flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
hgs
parents: 35
diff changeset
   313
            if ( flags & EVcxMyVideosVideoNew )
hgs
parents: 35
diff changeset
   314
                {
hgs
parents: 35
diff changeset
   315
                newCount++;
hgs
parents: 35
diff changeset
   316
                currentItemsCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *video );
hgs
parents: 35
diff changeset
   317
                if ( latestCreationDate < currentItemsCreationDate )
hgs
parents: 35
diff changeset
   318
                    {
hgs
parents: 35
diff changeset
   319
                    latestCreationDate = currentItemsCreationDate;
hgs
parents: 35
diff changeset
   320
                    latestNewVideo     = video;
hgs
parents: 35
diff changeset
   321
                    }
hgs
parents: 35
diff changeset
   322
                }
hgs
parents: 35
diff changeset
   323
            }
hgs
parents: 35
diff changeset
   324
        }
38
hgs
parents: 36
diff changeset
   325
    iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, videoCount );
36
hgs
parents: 35
diff changeset
   326
    iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount, newCount );
hgs
parents: 35
diff changeset
   327
    if ( latestNewVideo )
hgs
parents: 35
diff changeset
   328
        {
hgs
parents: 35
diff changeset
   329
        iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName,
hgs
parents: 35
diff changeset
   330
                TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
hgs
parents: 35
diff changeset
   331
        }
hgs
parents: 35
diff changeset
   332
    iMedia->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, latestCreationDate );
hgs
parents: 35
diff changeset
   333
    }
hgs
parents: 35
diff changeset
   334