harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp
changeset 28 c461c7fa72c2
parent 25 8e4539ab1889
child 40 910a23996aa0
child 45 a93990e5815e
equal deleted inserted replaced
25:8e4539ab1889 28:c461c7fa72c2
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <e32std.h>
    18 #include <e32std.h>
    19 #include <caf/caf.h>
    19 #include <caf/caf.h>
       
    20 #include <pathinfo.h>
    20 
    21 
    21 #include "mdsutils.h"
    22 #include "mdsutils.h"
    22 #include "harvesterdata.h"
    23 #include "harvesterdata.h"
    23 #include "harvesterlog.h"
    24 #include "harvesterlog.h"
    24 #include "harvestercommon.h"
    25 #include "harvestercommon.h"
    43 	iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
    44 	iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
    44 	iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
    45 	iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
    45 	iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
    46 	iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
    46 	iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
    47 	iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
    47     iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
    48     iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
       
    49     iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder );
    48 	
    50 	
    49     CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
    51     CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
    50     iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty );
    52     iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty );
    51     iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDescriptionProperty );
    53     iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDescriptionProperty );
    52     iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KAuthorProperty );
    54     iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KAuthorProperty );
    85 //
    87 //
    86 CHarvesterWMVPlugin::~CHarvesterWMVPlugin()
    88 CHarvesterWMVPlugin::~CHarvesterWMVPlugin()
    87     {
    89     {
    88     WRITELOG( "CHarvesterWMVPlugin::~CHarvesterWMVPlugin()" );
    90     WRITELOG( "CHarvesterWMVPlugin::~CHarvesterWMVPlugin()" );
    89     delete iPropDefs;
    91     delete iPropDefs;
       
    92     
       
    93     delete iPhoneVideosPath;
       
    94     delete iMmcVideosPath;
    90     }
    95     }
    91 
    96 
    92 // ---------------------------------------------------------------------------
    97 // ---------------------------------------------------------------------------
    93 // Harvest file
    98 // Harvest file
    94 // ---------------------------------------------------------------------------
    99 // ---------------------------------------------------------------------------
   162 // ---------------------------------------------------------------------------
   167 // ---------------------------------------------------------------------------
   163 //
   168 //
   164 void CHarvesterWMVPlugin::ConstructL()
   169 void CHarvesterWMVPlugin::ConstructL()
   165     {
   170     {
   166     WRITELOG( "CHarvesterWMVPlugin::ConstructL()" );
   171     WRITELOG( "CHarvesterWMVPlugin::ConstructL()" );
       
   172     
       
   173     TFileName videos = PathInfo::VideosPath();
       
   174     
       
   175     TFileName phonePath = PathInfo::PhoneMemoryRootPath();
       
   176     phonePath.Append( videos );
       
   177     iPhoneVideosPath = phonePath.AllocL();
       
   178 
       
   179     TFileName mmcPath = PathInfo::MemoryCardRootPath();
       
   180     mmcPath.Append( videos );
       
   181     iMmcVideosPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL();
       
   182    
   167     SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );
   183     SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );
   168     }
   184     }
   169 
   185 
   170 // ---------------------------------------------------------------------------
   186 // ---------------------------------------------------------------------------
   171 // GatherDataL
   187 // GatherDataL
   300     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   316     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   301     			*iPropDefs->iSizePropertyDef, &aClipDetails.iFileSize, aIsAdd );
   317     			*iPropDefs->iSizePropertyDef, &aClipDetails.iFileSize, aIsAdd );
   302         // Mime Type
   318         // Mime Type
   303         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   319         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   304                 *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd );
   320                 *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd );
       
   321 
       
   322         const TDesC& uri = mdeObject.Uri();
       
   323         if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound ||
       
   324             uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound ||
       
   325             uri.FindF( KDCIMFolder ) != KErrNotFound )
       
   326             {
       
   327             TBool inDefaultFolder( ETrue );
       
   328             CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd );
       
   329             }
       
   330         else
       
   331             {
       
   332             TBool inDefaultFolder( EFalse );
       
   333             CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd );    
       
   334             }
   305     	}
   335     	}
   306     
   336     
   307     // DRM protection
   337     // DRM protection
   308     if( aClipDetails.iDrmProtected )
   338     if( aClipDetails.iDrmProtected )
   309         {
   339         {