35 |
35 |
36 const TInt KMimeLength( 10 ); |
36 const TInt KMimeLength( 10 ); |
37 const TUid KHarvesterRepoUid = { 0x200009FE }; |
37 const TUid KHarvesterRepoUid = { 0x200009FE }; |
38 const TUint32 KEnableAlbumArtHarvest = 0x00090001; |
38 const TUint32 KEnableAlbumArtHarvest = 0x00090001; |
39 |
39 |
40 CHarvesterAudioPluginPropertyDefs::CHarvesterAudioPluginPropertyDefs() : CBase() |
40 CHarvesterAudioPluginPropertyDefs::CHarvesterAudioPluginPropertyDefs() : CBase(), |
|
41 iCreationDatePropertyDef( NULL ) |
41 { |
42 { |
42 } |
43 } |
43 |
44 |
44 void CHarvesterAudioPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef) |
45 void CHarvesterAudioPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef) |
45 { |
46 { |
46 CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef(); |
47 SetByObjectDefL( aObjectDef ); |
47 |
48 } |
48 // Common property definitions |
49 |
49 CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject ); |
50 CHarvesterAudioPluginPropertyDefs* CHarvesterAudioPluginPropertyDefs::NewL() |
50 iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty ); |
51 { |
51 iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty ); |
52 CHarvesterAudioPluginPropertyDefs* self = |
52 iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); |
53 new (ELeave) CHarvesterAudioPluginPropertyDefs(); |
53 iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); |
54 return self; |
54 iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); |
55 } |
|
56 |
|
57 void CHarvesterAudioPluginPropertyDefs::SetByObjectDefL(CMdEObjectDef& aObjectDef) |
|
58 { |
|
59 CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef(); |
|
60 |
|
61 // Common property definitions |
|
62 CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject ); |
|
63 iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty ); |
|
64 iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty ); |
|
65 iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); |
|
66 iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); |
|
67 iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); |
55 iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTimeOffsetProperty ); |
68 iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTimeOffsetProperty ); |
56 iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); |
69 iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); |
57 |
70 |
58 // Media property definitions |
71 // Media property definitions |
59 CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); |
72 CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); |
60 iRatingPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KRatingProperty ); |
73 iRatingPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KRatingProperty ); |
61 iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty ); |
74 iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty ); |
62 iArtistPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty ); |
75 iArtistPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty ); |
63 iDurationPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDurationProperty ); |
76 iDurationPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDurationProperty ); |
64 iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KCopyrightProperty ); |
77 iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KCopyrightProperty ); |
65 iTrackPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KTrackProperty ); |
78 iTrackPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KTrackProperty ); |
66 iThumbnailPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KThumbnailPresentProperty ); |
79 iThumbnailPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KThumbnailPresentProperty ); |
67 iDatePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KReleaseDateProperty ); |
80 iDatePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KReleaseDateProperty ); |
68 iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); |
81 iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); |
69 |
82 |
70 // Audio property definitions |
83 // Audio property definitions |
71 CMdEObjectDef& audioDef = nsDef.GetObjectDefL( MdeConstants::Audio::KAudioObject ); |
84 CMdEObjectDef& audioDef = nsDef.GetObjectDefL( MdeConstants::Audio::KAudioObject ); |
72 iAlbumPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty ); |
85 iAlbumPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty ); |
73 iComposerPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty ); |
86 iComposerPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty ); |
74 iOriginalArtistPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KOriginalArtistProperty ); |
87 iOriginalArtistPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KOriginalArtistProperty ); |
75 } |
88 } |
76 |
|
77 CHarvesterAudioPluginPropertyDefs* CHarvesterAudioPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef) |
|
78 { |
|
79 CHarvesterAudioPluginPropertyDefs* self = |
|
80 new (ELeave) CHarvesterAudioPluginPropertyDefs(); |
|
81 CleanupStack::PushL( self ); |
|
82 self->ConstructL( aObjectDef ); |
|
83 CleanupStack::Pop( self ); |
|
84 return self; |
|
85 } |
|
86 |
89 |
87 using namespace MdeConstants; |
90 using namespace MdeConstants; |
88 |
91 |
89 // --------------------------------------------------------------------------- |
92 // --------------------------------------------------------------------------- |
90 // CHarvesterAudioPlugin::CHarvesterAudioPlugin |
93 // CHarvesterAudioPlugin::CHarvesterAudioPlugin |
534 CThumbnailObjectSource* tnmSource = CThumbnailObjectSource::NewL( jpegBuf, mimeType, uri ); |
526 CThumbnailObjectSource* tnmSource = CThumbnailObjectSource::NewL( jpegBuf, mimeType, uri ); |
535 // Ownership of buffer is transferred to Thumbnail Manager |
527 // Ownership of buffer is transferred to Thumbnail Manager |
536 CleanupStack::Pop(); // jpegBuf |
528 CleanupStack::Pop(); // jpegBuf |
537 iTNM->CreateThumbnails( *tnmSource ); |
529 iTNM->CreateThumbnails( *tnmSource ); |
538 delete tnmSource; |
530 delete tnmSource; |
|
531 tnmSource = NULL; |
539 TBool thumbnailPresent( ETrue ); |
532 TBool thumbnailPresent( ETrue ); |
540 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
533 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
541 *iPropDefs->iThumbnailPropertyDef, &thumbnailPresent, aIsAdd ); |
534 *iPropDefs->iThumbnailPropertyDef, &thumbnailPresent, aIsAdd ); |
542 } |
535 } |
543 else if( iHarvestAlbumArt && iTNM ) |
536 else if( iHarvestAlbumArt && iTNM ) |