mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovider.cpp
branchRCL_3
changeset 13 4740b34b83ce
parent 11 780c925249c1
equal deleted inserted replaced
12:51035f0751c2 13:4740b34b83ce
   177             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPSessionOpened event recvd" ) );
   177             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPSessionOpened event recvd" ) );
   178             SessionOpenedL( *reinterpret_cast<const TMTPNotificationParamsSessionChange*> ( aParams ) );
   178             SessionOpenedL( *reinterpret_cast<const TMTPNotificationParamsSessionChange*> ( aParams ) );
   179             break;
   179             break;
   180 
   180 
   181         case EMTPStorageAdded:
   181         case EMTPStorageAdded:
       
   182             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPStorageAdded event recvd" ) );
   182             break;
   183             break;
   183 
   184 
   184         case EMTPStorageRemoved:
   185         case EMTPStorageRemoved:
       
   186             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPStorageRemoved event recvd" ) );
   185             break;
   187             break;
   186 
   188 
   187         case EMTPRenameObject:
   189         case EMTPRenameObject:
   188             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPRenameObject event recvd" ) );
   190             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPRenameObject event recvd" ) );
   189             RenameObjectL( *reinterpret_cast<const TMTPNotificationParamsHandle*> ( aParams ) );
   191             RenameObjectL( *reinterpret_cast<const TMTPNotificationParamsHandle*> ( aParams ) );
       
   192             break;
       
   193 
       
   194         case EMTPObjectAdded:
       
   195             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPObjectAdded event recvd" ) );
       
   196             ObjectAddedL(*reinterpret_cast<const TUint32*>(aParams));
   190             break;
   197             break;
   191 
   198 
   192         default:
   199         default:
   193             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL default" ) );
   200             PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL default" ) );
   194             // Ignore all other notifications.
   201             // Ignore all other notifications.
   269             }
   276             }
   270         }
   277         }
   271 
   278 
   272     // introduce to cleanup DBs at each close session
   279     // introduce to cleanup DBs at each close session
   273     iMediaEnumerator->SessionClosedL();
   280     iMediaEnumerator->SessionClosedL();
       
   281     CMmMtpDpAccessSingleton::CloseSessionL();
       
   282 
   274     PRINT( _L( "MM MTP <= CMediaMtpDataProvider::SessionClosedL" ) );
   283     PRINT( _L( "MM MTP <= CMediaMtpDataProvider::SessionClosedL" ) );
   275     }
   284     }
   276 
   285 
   277 // -----------------------------------------------------------------------------
   286 // -----------------------------------------------------------------------------
   278 // CMediaMtpDataProvider::SessionOpenedL
   287 // CMediaMtpDataProvider::SessionOpenedL
   300         }
   309         }
   301 
   310 
   302     iRenameObject->StartL( aObject.iHandleId, aObject.iFileName );
   311     iRenameObject->StartL( aObject.iHandleId, aObject.iFileName );
   303 
   312 
   304     PRINT( _L( "MM MTP <= CMediaMtpDataProvider::RenameObjectL" ) );
   313     PRINT( _L( "MM MTP <= CMediaMtpDataProvider::RenameObjectL" ) );
       
   314     }
       
   315 
       
   316 // -----------------------------------------------------------------------------
       
   317 // CMediaMtpDataProvider::ObjectAddedL
       
   318 // Process the added object
       
   319 // -----------------------------------------------------------------------------
       
   320 //
       
   321 void CMediaMtpDataProvider::ObjectAddedL( TUint32 aObjectHandle )
       
   322     {
       
   323     PRINT1( _L( "MM MTP => CMediaMtpDataProvider::ObjectAddedL aHandle=0x%x" ), aObjectHandle );
       
   324 
       
   325     CMTPObjectMetaData* object(CMTPObjectMetaData::NewLC());
       
   326     Framework().ObjectMgr().ObjectL( aObjectHandle, *object );
       
   327 
       
   328     //Since the object's processor is not route to media dp, its format code should be reset
       
   329     TUint formatCode = MmMtpDpUtility::FormatFromFilename( object->DesC( CMTPObjectMetaData::ESuid ) );
       
   330     object->SetUint( CMTPObjectMetaData::EFormatCode, formatCode );
       
   331     GetWrapperL().AddObjectL( *object );
       
   332     PRINT2( _L( "MM MTP => CMediaMtpDataProvider::ObjectAddedL formatCode=0x%x Suid=%S" ), formatCode, &(object->DesC( CMTPObjectMetaData::ESuid ) ) );
       
   333     CleanupStack::PopAndDestroy( object );
       
   334     PRINT( _L( "MM MTP <= CMediaMtpDataProvider::ObjectAddedL" ) );
   305     }
   335     }
   306 
   336 
   307 // -----------------------------------------------------------------------------
   337 // -----------------------------------------------------------------------------
   308 // CMediaMtpDataProvider::StartObjectEnumerationL
   338 // CMediaMtpDataProvider::StartObjectEnumerationL
   309 // Start object enumeration
   339 // Start object enumeration
   433         //EMTPFormatCodeASF
   463         //EMTPFormatCodeASF
   434         aStrings.AppendL(KFormatExtensionASF);
   464         aStrings.AppendL(KFormatExtensionASF);
   435         #endif
   465         #endif
   436         //ODF container
   466         //ODF container
   437         aStrings.AppendL(KFormatExtensionODFAudio3GPP);
   467         aStrings.AppendL(KFormatExtensionODFAudio3GPP);
   438         aStrings.AppendL(KFormatExtensionODFAudioMP4);
       
   439         aStrings.AppendL(KFormatExtensionODFVideo3GPP);
   468         aStrings.AppendL(KFormatExtensionODFVideo3GPP);
   440         aStrings.AppendL(KFormatExtensionODFVideoMP4);
       
   441 
   469 
   442         aStrings.AppendL(KFormatExtensionO4A);
   470         aStrings.AppendL(KFormatExtensionO4A);
   443         aStrings.AppendL(KFormatExtensionO4V);
   471         aStrings.AppendL(KFormatExtensionO4V);
   444 
   472 
   445         }
   473         }