ui/uiengine/medialists/src/glxthumbnailcontext.cpp
changeset 29 2c833fc9e98f
parent 23 74c9f037fd5d
child 45 863223ea6961
equal deleted inserted replaced
26:c499df2dbb33 29:2c833fc9e98f
    30 #include "glxattributecontext.h"
    30 #include "glxattributecontext.h"
    31 #include "glxthumbnailcontext.h"
    31 #include "glxthumbnailcontext.h"
    32 #include "glxmedialist.h"
    32 #include "glxmedialist.h"
    33 #include "glxerrormanager.h"
    33 #include "glxerrormanager.h"
    34 #include "glxthumbnailutility.h"
    34 #include "glxthumbnailutility.h"
    35 #include "mglxcache.h"
    35 //#include "mglxcache.h"
    36 #include "glxlistutils.h"
    36 #include "glxlistutils.h"
    37 
    37 
    38 /**
    38 /**
    39  * Scoring for thumbnail provision order 
    39  * Scoring for thumbnail provision order 
    40  * Having no thumbnail is the most important, so it gets the highest bit
    40  * Having no thumbnail is the most important, so it gets the highest bit
    79 //
    79 //
    80 void CGlxThumbnailContext::ConstructL()    
    80 void CGlxThumbnailContext::ConstructL()    
    81     {
    81     {
    82     TRACER( "CGlxThumbnailContext::ConstructL");
    82     TRACER( "CGlxThumbnailContext::ConstructL");
    83     
    83     
    84     iCache = MGlxCache::InstanceL();
    84     //iCache = MGlxCache::InstanceL();
    85     iResolutionUtility = CGlxResolutionUtility::InstanceL();
    85     iResolutionUtility = CGlxResolutionUtility::InstanceL();
    86   //  iResolutionUtility->AddObserverL( *this );
    86   //  iResolutionUtility->AddObserverL( *this );
    87 
    87 
    88     iDrmUtility = CGlxDRMUtility::InstanceL();
    88     iDrmUtility = CGlxDRMUtility::InstanceL();
    89 
    89 
   134         {
   134         {
   135       //  iResolutionUtility->RemoveObserver( *this );
   135       //  iResolutionUtility->RemoveObserver( *this );
   136         iResolutionUtility->Close();
   136         iResolutionUtility->Close();
   137         }
   137         }
   138 
   138 
   139     if ( iCache )
   139     /*if ( iCache )
   140         {
   140         {
   141         iCache->Close();
   141         iCache->Close();
   142         }
   142         }*/
   143     }
   143     }
   144 
   144 
   145 // -----------------------------------------------------------------------------
   145 // -----------------------------------------------------------------------------
   146 // Adds a new fetch specification for an item
   146 // Adds a new fetch specification for an item
   147 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   222         return;
   222         return;
   223         }
   223         }
   224     TBool drmValid = EFalse;
   224     TBool drmValid = EFalse;
   225     TSize size = iDefaultSpecSize;
   225     TSize size = iDefaultSpecSize;
   226     const TGlxMedia& item( aList->Item( aListIndex ) );
   226     const TGlxMedia& item( aList->Item( aListIndex ) );
   227 	if( item.GetDrmProtected(drmValid) && drmValid)
   227     // DRM is Not Valid yet, can use it if its valid
       
   228 	/*if( item.GetDrmProtected(drmValid) && drmValid)
   228         {
   229         {
   229         drmValid = CheckDRMStatusL( aListIndex, aList, size );	
   230         drmValid = CheckDRMStatusL( aListIndex, aList, size );	
   230         }
   231         }*/
   231 
   232 
   232     TLinearOrder<TMPXAttribute> orderer (&CGlxMediaList::AttributeOrder);
   233     TLinearOrder<TMPXAttribute> orderer (&CGlxMediaList::AttributeOrder);
   233     // Always want high quality thumbnail
   234     // Always want high quality thumbnail
   234     TMPXAttribute attr( KGlxMediaIdThumbnail,
   235     TMPXAttribute attr( KGlxMediaIdThumbnail,
   235             GlxFullThumbnailAttributeId( ETrue, size.iWidth, size.iHeight ) );
   236             GlxFullThumbnailAttributeId( ETrue, size.iWidth, size.iHeight ) );
   284     if (KErrNotFound != listIndex)
   285     if (KErrNotFound != listIndex)
   285         {
   286         {
   286         GLX_DEBUG2("CGlxThumbnailContext::AttributeRequestL() listIndex=%d", listIndex);
   287         GLX_DEBUG2("CGlxThumbnailContext::AttributeRequestL() listIndex=%d", listIndex);
   287         const TGlxMedia& item = aList->Item( listIndex );
   288         const TGlxMedia& item = aList->Item( listIndex );
   288         TSize size = iDefaultSpecSize;
   289         TSize size = iDefaultSpecSize;
   289 
   290         // DRM is Not Valid yet, can use it if its valid
   290         TBool drmValid = EFalse;
   291         /*TBool drmValid = EFalse;
   291         if( item.GetDrmProtected(drmValid) && drmValid)
   292         if( item.GetDrmProtected(drmValid) && drmValid)
   292 	        {
   293 	        {
   293 	        CheckDRMStatusL( listIndex, aList, size );	
   294 	        CheckDRMStatusL( listIndex, aList, size );	
   294 	        }
   295 	        }*/
   295 
   296 
   296         // Request high quality thumbnail if already have any thumbnail
   297         // Request high quality thumbnail if already have any thumbnail
   297         TBool quality = iHighQualityOnly
   298         TBool quality = iHighQualityOnly
   298                         || HasFullThumbnail( aList->Item( listIndex ) );
   299                         || HasFullThumbnail( aList->Item( listIndex ) );
   299 
   300 
   438     TUint score = 0;
   439     TUint score = 0;
   439     
   440     
   440     if ( properties )
   441     if ( properties )
   441         {
   442         {
   442         TSize size = iDefaultSpecSize;
   443         TSize size = iDefaultSpecSize;
   443 
   444         // DRM is Not Valid yet, can use it if its valid
   444         TBool drmValid = EFalse;
   445         /*TBool drmValid = EFalse;
   445         if( item.GetDrmProtected(drmValid) && drmValid)
   446         if( item.GetDrmProtected(drmValid) && drmValid)
   446 	        {
   447 	        {
   447 	        CheckDRMStatusL( aListIndex, aList, size );	
   448 	        CheckDRMStatusL( aListIndex, aList, size );	
   448 	        }
   449 	        }*/
   449 
   450 
   450         // Want high quality thumbnail if already have any thumbnail
   451         // Want high quality thumbnail if already have any thumbnail
   451         TBool quality = iHighQualityOnly || thumbnail;
   452         TBool quality = iHighQualityOnly || thumbnail;
   452         TMPXAttribute attr( KGlxMediaIdThumbnail, 
   453         TMPXAttribute attr( KGlxMediaIdThumbnail, 
   453                             GlxFullThumbnailAttributeId(
   454                             GlxFullThumbnailAttributeId(