harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp
changeset 23 33ae025ac1e8
parent 21 50bf9db68373
child 25 8e4539ab1889
child 41 2290317b9ec5
equal deleted inserted replaced
21:50bf9db68373 23:33ae025ac1e8
   274 	
   274 	
   275 	if( !iPropDefs )
   275 	if( !iPropDefs )
   276 		{
   276 		{
   277 		CMdEObjectDef& objectDef = mdeObject.Def();
   277 		CMdEObjectDef& objectDef = mdeObject.Def();
   278 		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
   278 		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
       
   279 		// Prefetch max text lengt for validity checking
       
   280 		iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
   279 		}
   281 		}
   280 	
   282 	
   281 	CMdeObjectWrapper::HandleObjectPropertyL(
   283 	CMdeObjectWrapper::HandleObjectPropertyL(
   282                  mdeObject, *iPropDefs->iCreationDatePropertyDef, &localModifiedDate, aIsAdd );
   284                  mdeObject, *iPropDefs->iCreationDatePropertyDef, &localModifiedDate, aIsAdd );
   283 
   285 
   307         {
   309         {
   308     	if( !iPropDefs )
   310     	if( !iPropDefs )
   309     		{
   311     		{
   310     		CMdEObjectDef& objectDef = mdeObject.Def();
   312     		CMdEObjectDef& objectDef = mdeObject.Def();
   311     		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
   313     		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
       
   314     		// Prefetch max text lengt for validity checking
       
   315     		iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
   312     		}
   316     		}
   313         
   317         
   314     	CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   318     	CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   315     			*iPropDefs->iItemTypePropertyDef, (TAny*)&(mapping->iMimeType), aIsAdd );
   319     			*iPropDefs->iItemTypePropertyDef, (TAny*)&(mapping->iMimeType), aIsAdd );
   316         }
   320         }
   337  
   341  
   338     if( !iPropDefs )
   342     if( !iPropDefs )
   339         {
   343         {
   340         CMdEObjectDef& audioObjectDef = mdeObject.Def();
   344         CMdEObjectDef& audioObjectDef = mdeObject.Def();
   341         iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( audioObjectDef );
   345         iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( audioObjectDef );
       
   346         // Prefetch max text lengt for validity checking
       
   347         iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
   342         }
   348         }
   343     
   349     
   344     TPtrC ext;
   350     TPtrC ext;
   345     MdsUtils::GetExt( uri, ext );
   351     MdsUtils::GetExt( uri, ext );
   346     
   352     
   388     TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
   394     TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
   389     TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60;
   395     TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60;
   390     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd );
   396     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd );
   391 	
   397 	
   392     if ( song.Length() > 0
   398     if ( song.Length() > 0
   393         && song.Length() < iPropDefs->iTitlePropertyDef->MaxTextLengthL() )
   399         && song.Length() < iMaxTextLength )
   394         {    
   400         {    
   395         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   401         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   396         		*iPropDefs->iTitlePropertyDef, &song, EFalse );
   402         		*iPropDefs->iTitlePropertyDef, &song, EFalse );
   397         }
   403         }
   398 
   404 
   399     if ( artist.Length() > 0
   405     if ( artist.Length() > 0
   400         && artist.Length() < iPropDefs->iArtistPropertyDef->MaxTextLengthL() )
   406         && artist.Length() < iMaxTextLength )
   401         {
   407         {
   402         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   408         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   403         		*iPropDefs->iArtistPropertyDef, &artist, aIsAdd );
   409         		*iPropDefs->iArtistPropertyDef, &artist, aIsAdd );
   404         }
   410         }
   405 
   411 
   406     if ( album.Length() > 0
   412     if ( album.Length() > 0
   407         && album.Length() < iPropDefs->iAlbumPropertyDef->MaxTextLengthL() )
   413         && album.Length() < iMaxTextLength )
   408         {
   414         {
   409         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   415         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   410         		*iPropDefs->iAlbumPropertyDef, &album, aIsAdd );
   416         		*iPropDefs->iAlbumPropertyDef, &album, aIsAdd );
   411         }
   417         }
   412  
   418  
   413     if ( genre.Length() > 0
   419     if ( genre.Length() > 0
   414         && genre.Length() < iPropDefs->iGenrePropertyDef->MaxTextLengthL() )
   420         && genre.Length() < iMaxTextLength )
   415         {
   421         {
   416         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   422         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   417         		*iPropDefs->iGenrePropertyDef, &genre, aIsAdd );
   423         		*iPropDefs->iGenrePropertyDef, &genre, aIsAdd );
   418         }
   424         }
   419 
   425 
   420     if ( composer.Length() > 0
   426     if ( composer.Length() > 0
   421         && composer.Length() < iPropDefs->iComposerPropertyDef->MaxTextLengthL() )
   427         && composer.Length() < iMaxTextLength )
   422         {
   428         {
   423         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   429         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   424         		*iPropDefs->iComposerPropertyDef, &composer, aIsAdd );
   430         		*iPropDefs->iComposerPropertyDef, &composer, aIsAdd );
   425         }
   431         }
   426 
   432 
   435                 *iPropDefs->iRatingPropertyDef, &ratingValue, aIsAdd );        
   441                 *iPropDefs->iRatingPropertyDef, &ratingValue, aIsAdd );        
   436             }
   442             }
   437         }
   443         }
   438     
   444     
   439     if ( orgArtist.Length() > 0
   445     if ( orgArtist.Length() > 0
   440         && orgArtist.Length() < iPropDefs->iOriginalArtistPropertyDef->MaxTextLengthL() )
   446         && orgArtist.Length() < iMaxTextLength )
   441         {
   447         {
   442         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   448         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   443         		*iPropDefs->iOriginalArtistPropertyDef, &orgArtist, aIsAdd );
   449         		*iPropDefs->iOriginalArtistPropertyDef, &orgArtist, aIsAdd );
   444         }
   450         }
   445     
   451     
   466                 }
   472                 }
   467             }
   473             }
   468         }
   474         }
   469     
   475     
   470     if ( copyright.Length() > 0
   476     if ( copyright.Length() > 0
   471         && copyright.Length() < iPropDefs->iCopyrightPropertyDef->MaxTextLengthL() )
   477         && copyright.Length() < iMaxTextLength )
   472         {
   478         {
   473         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   479         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
   474         		*iPropDefs->iCopyrightPropertyDef, &copyright, aIsAdd );
   480         		*iPropDefs->iCopyrightPropertyDef, &copyright, aIsAdd );
   475         }
   481         }
   476     
   482