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