videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp
branchRCL_3
changeset 8 ce5ada96ab30
parent 2 dec420019252
child 10 112a725ff2c2
equal deleted inserted replaced
6:7d91903f795f 8:ce5ada96ab30
    27 #include <mpxmediacontainerdefs.h>
    27 #include <mpxmediacontainerdefs.h>
    28 #include <mpxmediageneraldefs.h>
    28 #include <mpxmediageneraldefs.h>
    29 #include <mpxmediageneralextdefs.h>
    29 #include <mpxmediageneralextdefs.h>
    30 #include <mpxmediaarray.h>
    30 #include <mpxmediaarray.h>
    31 #include <mpxmediavideodefs.h>
    31 #include <mpxmediavideodefs.h>
       
    32 #include <centralrepository.h>
    32 #include "vcxmyvideosmdsdb.h"
    33 #include "vcxmyvideosmdsdb.h"
    33 #include "vcxmyvideoscollectionutil.h"
    34 #include "vcxmyvideoscollectionutil.h"
    34 
    35 
    35 _LIT( KVcxVideoObjectName, "Video" );
    36 _LIT( KVcxVideoObjectName, "Video" );
    36                                                               //1 (ID)
    37                                                               //1 (ID)
   190     Cancel();
   191     Cancel();
   191     
   192     
   192     delete iVideoQuery;
   193     delete iVideoQuery;
   193     delete iMDSSession;
   194     delete iMDSSession;
   194     delete iActiveSchedulerWait;
   195     delete iActiveSchedulerWait;
       
   196     delete iRepository;
   195     }
   197     }
   196 
   198 
   197 // ---------------------------------------------------------------------------
   199 // ---------------------------------------------------------------------------
   198 // CVcxMyVideosMdsDb::Cancel
   200 // CVcxMyVideosMdsDb::Cancel
   199 // ---------------------------------------------------------------------------
   201 // ---------------------------------------------------------------------------
   880         }
   882         }
   881 
   883 
   882     //16. ORIGIN, KVcxMediaMyVideosOrigin
   884     //16. ORIGIN, KVcxMediaMyVideosOrigin
   883     if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
   885     if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
   884         {
   886         {
   885         aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin,
   887         TUint8 origin = static_cast<CMdEUint8Property*>(property)->Value();
   886                 static_cast<CMdEUint8Property*>(property)->Value() );
   888         if ( origin == EVcxMyVideosOriginDownloaded ||
       
   889                 origin == EVcxMyVideosOriginSideLoaded ||
       
   890                 origin == EVcxMyVideosOriginTvRecording )
       
   891             {
       
   892             origin = EVcxMyVideosOriginOther;
       
   893             }
       
   894                 
       
   895         aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, origin );
   887         }
   896         }
   888 
   897 
   889     //17. DURATION, (KMPXMediaGeneralDuration can't be used since it is TInt
   898     //17. DURATION, (KMPXMediaGeneralDuration can't be used since it is TInt
   890     //   and we need TReal32 ) (BRIEF)
   899     //   and we need TReal32 ) (BRIEF)
   891     if ( aObject.Property( *iDurationPropertyDef, property, 0 ) != KErrNotFound )
   900     if ( aObject.Property( *iDurationPropertyDef, property, 0 ) != KErrNotFound )
  1259             flags &= ~EVcxMyVideosVideoNew;
  1268             flags &= ~EVcxMyVideosVideoNew;
  1260             
  1269             
  1261             static_cast<CMdEUint32Property*>(property)->SetValueL( flags );
  1270             static_cast<CMdEUint32Property*>(property)->SetValueL( flags );
  1262             }
  1271             }
  1263         
  1272         
       
  1273         // Play pos has really changed -> put the video as last watched
       
  1274         if ( aObject.Property( *iLastPlayPositionPropertyDef, property, 0 ) == KErrNotFound ||
       
  1275              static_cast<CMdEReal32Property*>(property)->Value() != lastPlaybackPos  )
       
  1276             {
       
  1277             if ( !iRepository )
       
  1278                 {
       
  1279                 iRepository = CRepository::NewL( TUid::Uid( KVcxMyVideosCollectionCenrepUid ) );
       
  1280                 }
       
  1281             iRepository->Set( KVcxMyVideosCollectionCenrepKeyLastWatchedMpxId,
       
  1282                                             TInt ( aVideo.ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ).iId1 ) );
       
  1283             }
  1264         if ( aObject.Property( *iLastPlayPositionPropertyDef, property, 0 ) != KErrNotFound )
  1284         if ( aObject.Property( *iLastPlayPositionPropertyDef, property, 0 ) != KErrNotFound )
  1265             {
  1285             {
  1266             static_cast<CMdEReal32Property*>(property)->SetValueL( lastPlaybackPos );
  1286             static_cast<CMdEReal32Property*>(property)->SetValueL( lastPlaybackPos );
  1267             }
  1287             }
  1268         else
  1288         else