# HG changeset patch # User William Roberts # Date 1268572308 0 # Node ID da1f3efa404b985281e22451d5622d90c658eb4a # Parent 5529f24b6aaf70f7a770332ea45177b9668107f0# Parent 835a21e50645cdbf91089a2fc72e912bf22bb617 Automatic merge from PDK_3.0.h diff -r 5529f24b6aaf -r da1f3efa404b inc/mmappfwbldvariant.hrh --- a/inc/mmappfwbldvariant.hrh Mon Mar 08 21:44:04 2010 +0000 +++ b/inc/mmappfwbldvariant.hrh Sun Mar 14 13:11:48 2010 +0000 @@ -20,7 +20,7 @@ #ifndef MMAPPFWBLDVARIANT_HRH #define MMAPPFWBLDVARIANT_HRH -#define IAD_INCLUDE_BACKSTEPPING +#undef IAD_INCLUDE_BACKSTEPPING #define IAD_INCLUDE_AUDIOFETCHER #endif // MMAPPFWBLDVARIANT_HRH diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/asxparser/group/asxparser.mmp --- a/mmappcomponents/asxparser/group/asxparser.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/asxparser/group/asxparser.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,7 +15,7 @@ * */ -// Version : %version: 9.1.2 % +// Version : %version: 9.1.3 % #include @@ -42,7 +42,6 @@ LIBRARY xmlenginedom.lib LIBRARY xmlparser.lib LIBRARY xmldom.lib -LIBRARY flogger.lib LIBRARY charconv.lib NOSTRICTDEF diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/asxparser/inc/AsxParser_debug.h --- a/mmappcomponents/asxparser/inc/AsxParser_debug.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/asxparser/inc/AsxParser_debug.h Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,8 +15,7 @@ * */ -// Version : %version: 4.1.1 % - +// Version : %version: 4.1.2 % #ifndef __MP_DEBUG_H__ @@ -24,40 +23,20 @@ #include #include -#include - -// -// Forward declaration -// -class AsxParserDebug; - -// #ifdef __MARM__ -// #define _ASX_PARSER_FILE_LOGGING_ -// #endif - -#ifdef _ASX_PARSER_FILE_LOGGING_ - #define ASX_DEBUG AsxParserDebug::FileLog -#else - #ifdef _DEBUG - #define ASX_DEBUG RDebug::Print - #else - #define ASX_DEBUG AsxParserDebug::NullLog - #endif -#endif class AsxParserDebug { public: - inline static void NullLog(TRefByValue /*aFmt*/,...) + inline static void NullLog( TRefByValue /*aFmt*/, ... ) { - } - - inline static void FileLog(TRefByValue aFmt,...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(_L("AsxParser"), _L("ap.log"),EFileLoggingModeAppend,aFmt,list); } }; +#ifdef _DEBUG + #define ASX_DEBUG RDebug::Print +#else + #define ASX_DEBUG AsxParserDebug::NullLog +#endif + + #endif // __MP_DEBUG_H__ diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/asxparser/test/test.cpp --- a/mmappcomponents/asxparser/test/test.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/asxparser/test/test.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -12,12 +12,10 @@ * Contributors: * * Description: Simple v2/v3 ASX-fileparser - * +* */ -// Version : %version: e003sa33#6 % - - +// Version : %version: 7 % #include #include @@ -25,7 +23,6 @@ #include #include -#include #include diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/asxparser/test/test.mmp --- a/mmappcomponents/asxparser/test/test.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/asxparser/test/test.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,8 +15,7 @@ * */ -// Version : %version: 9 % - +// Version : %version: 10 % #include @@ -41,5 +40,4 @@ LIBRARY bafl.lib LIBRARY efsrv.lib -LIBRARY flogger.lib LIBRARY charconv.lib diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/audiofetcher/src/audiofetcherdialog.cpp --- a/mmappcomponents/audiofetcher/src/audiofetcherdialog.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/audiofetcher/src/audiofetcherdialog.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -468,13 +468,7 @@ { return; } - - TInt resultCount = iFileHandler->ResultCount(); - - if(resultCount > 0){ - CEikButtonGroupContainer& dialogCba = ButtonGroupContainer(); - dialogCba.MakeCommandVisible(EAknSoftkeySelect, ETrue); - } + iListBox->HandleItemAdditionL(); iListBox->SetCurrentItemIndex( 0 ); DrawNow(); @@ -563,7 +557,7 @@ switch ( aEventType ) { - case EEventItemDoubleClicked: // fallthrough + case EEventItemSingleClicked: // fallthrough case EEventEnterKeyPressed: { TBool closeDialog = HandleListSelectionL(); diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/group/mpxfilehandler.mmp --- a/mmappcomponents/harvester/filehandler/group/mpxfilehandler.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/group/mpxfilehandler.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -28,6 +28,9 @@ CAPABILITY CAP_GENERAL_DLL VENDORID VID_DEFAULT +MACRO __RAMDISK_PERF_ENABLE +#define __RAMDISK_PERF_ENABLE + SOURCEPATH ../src SOURCE mpxharvesterfilehandler.cpp SOURCE mpxharvesterfilehandlerimp.cpp diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/inc/mpxharvesterdb.h --- a/mmappcomponents/harvester/filehandler/inc/mpxharvesterdb.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/inc/mpxharvesterdb.h Sun Mar 14 13:11:48 2010 +0000 @@ -25,6 +25,17 @@ // FORWARD DECLARATIONS class CMPXHarvesterDatabaseTable; +// ENUMS +#ifdef __RAMDISK_PERF_ENABLE +// enum for database state +enum TDbState + { + EDbClose, + EDbOpen, + EDbInTransaction + }; +#endif // __RAMDISK_PERF_ENABLE + /** * Database class for the Harvester Component * @@ -51,6 +62,8 @@ /** * Open the database + * @return State of the opened database: KErrNone or KErrCorrupt + * Leaves if cannot open the database */ TInt OpenL(); @@ -141,6 +154,27 @@ */ void Rollback(); +#ifdef __RAMDISK_PERF_ENABLE + /** + * Set RAM drive info + */ + void SetRamDriveInfo(TDriveNumber aDrive, TBool aUseRamDrive); + + /** + * Get UseRamDrive + */ + TBool IsUseRamDrive(); + + /** + * Get the state of the database. + */ + TDbState GetDbState(); + + /** + * Set the state of the database. + */ + void SetDbStateL( TDbState aState ); +#endif // __RAMDISK_PERF_ENABLE private: // private functions @@ -151,7 +185,8 @@ /** * Opens a database - * @return error for the operation + * @return State of the opened database: KErrNone or KErrCorrupt + * Leaves if cannot open the database */ TInt OpenDBL(); @@ -163,6 +198,12 @@ void FindAndReplaceSingleQuote(const TDesC& aSrc, TDes& aTrg); + /** + * Generate the database name. + * @return the database file name. + */ + TFileName GenerateDbName(); + private: /** @@ -182,6 +223,10 @@ CFileStore* iStore; RDbStoreDatabase* iDatabase; // Local single client db TBool iDBOpen; // Is the db open and ready +#ifdef __RAMDISK_PERF_ENABLE + TDriveNumber iRamDrive; + TBool iUseRamDrive; +#endif // __RAMDISK_PERF_ENABLE }; #endif // CMPXHARVESTERDB_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/inc/mpxharvesterdbmanager.h --- a/mmappcomponents/harvester/filehandler/inc/mpxharvesterdbmanager.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/inc/mpxharvesterdbmanager.h Sun Mar 14 13:11:48 2010 +0000 @@ -122,7 +122,112 @@ * Checks if the spefified drive is a remove drive */ TBool IsRemoteDrive(TDriveNumber aDrive); - + +#ifdef __RAMDISK_PERF_ENABLE + /** + * Copy all databases from RAM disk back to normal drive, E, F,... + * + * @return none + * Leaves if DB is not usable after the operation + */ + void CopyDBsFromRamL(); + + /** + * Copy all databases to RAM disk from normal drive, E, F,... + * + * @return none + * Leaves if DB is not usable after the operation + */ + void CopyDBsToRamL(TBool aMtpMode = EFalse); + + /** + * Update all databases from RAM drive + */ + //void UpdateDBsFromRamL( TInt aCount ); + + /** + * If Ram disk is low, copy dbs from ram. + */ + void EnsureRamSpaceL(); +#endif //__RAMDISK_PERF_ENABLE + +private: // new functions + +#ifdef __RAMDISK_PERF_ENABLE + /** + * Find available RAMDISK + */ + TInt GetRAMDiskPath(); + + /** + * Check if disk is available to copy. + * + * @return ETrue if there is enough space, EFalse otherwise + */ + TBool IsRamDiskSpaceAvailable(); + + /** + * Copy database to ram drive + */ + void DoCopyDBToRamL(TDriveUnit aDriveUnit); + + /** + * Copy database from RAM disk + */ + void DoCopyDBFromRamL(TDriveUnit aDriveUnit); + + /** + * To block a disk space so that it can gurantee for a write back from RAM disk + * + * @return KErrNone if the dummy file is created successfully + */ + TInt BlockDiskSpaceL( TDriveUnit aDrive, TInt aOrigDbSize ); + + /** + * To calculate necessary file size of the dummy file + * + * @return TInt64 estimated file size + */ + TInt64 CalculateInitalDummyDBSizeL( TVolumeInfo aVol, TInt aOrigDbSize ); + + /** + * Remove dummy file + * + * @return TInt index to the database handler + */ + void RemoveDummyFile( TInt aIndex ); + + /** + * Update the database from ram drive. + */ + //void DoUpdateDBFromRamL( TDriveUnit aDriveUnit ); + + /** + * Generate the harvester db path and name. + */ + TFileName GenerateHarvesterDbName( TDriveUnit aDriveUnit, TBool aForRamDrive = EFalse ); + + /** + * Generate the dummy db path and name. + */ + TFileName GenerateDummyDbName( TDriveUnit aDriveUnit ); + + /** + * Check if Ram disk is low. + */ + TBool IsRamDiskLow(); + + /** + * Sum up the total size in bytes of the databases. + * + * @param aSize - On return, the total size of the databases. + * @param aRamDrive - if True, will sum up dbs on Ram Drive, if False, will sum up dbs on other drives. + * @return TInt System error. + */ + TInt GetTotalDatabasesSize(TInt& aSize, TBool aRamDrive); + +#endif // __RAMDISK_PERF_ENABLE + private: /** @@ -140,6 +245,17 @@ RPointerArray iDatabases; RFs& iFs; // Not Owned + +#ifdef __RAMDISK_PERF_ENABLE + // Defined for RAM disk performance + TBool iRAMDiskPerfEnabled; // flag to indicate RAM disk feature is enabled from cenrep. + TUint64 iMaximumAllowedRAMDiskSpaceToCopy; // max size in megabytes allowed for RAM copying. + TFileName iRAMFolder; + TDriveNumber iRAMDrive; + //TInt iUpdateCount; + TBool iMtpMode; + //TInt iMtpAddCount; +#endif //__RAMDISK_PERF_ENABLE }; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/inc/mpxharvesterfilehandlerimp.h --- a/mmappcomponents/harvester/filehandler/inc/mpxharvesterfilehandlerimp.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/inc/mpxharvesterfilehandlerimp.h Sun Mar 14 13:11:48 2010 +0000 @@ -432,6 +432,7 @@ TUid iPodcastCollectionId; TBool iDisablePodcasting; + TInt iCurUSBEvent; // DRM CDRMNotifier* iDrmNotifier; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/src/mpxdiskspacewatcher.cpp --- a/mmappcomponents/harvester/filehandler/src/mpxdiskspacewatcher.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/src/mpxdiskspacewatcher.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -147,8 +147,12 @@ void CMPXDiskSpaceWatcher::RunL() { // Callback to observer about which drive is low on disk space - // - iObs.HandleLowDiskEvent( iDriveToMonitor ); + //Check whether the current disk is low on disk space in Mass Storage mode. + // + if (IsLowOnDisk()) + { + iObs.HandleLowDiskEvent( iDriveToMonitor ); + } } // END OF FILE diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/src/mpxfoldermonitor.cpp --- a/mmappcomponents/harvester/filehandler/src/mpxfoldermonitor.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/src/mpxfoldermonitor.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -128,7 +128,7 @@ User::LeaveIfError( iFs.DriveToChar( aDrive, driveChar ) ); MPX_DEBUG2("CMPXFolderMonitor::Start: Drive %c: not supported!", - driveChar ); + (TUint)driveChar ); User::Leave( KErrNotSupported ); } break; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/src/mpxharvesterdb.cpp --- a/mmappcomponents/harvester/filehandler/src/mpxharvesterdb.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/src/mpxharvesterdb.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -31,8 +31,12 @@ // --------------------------------------------------------------------------- // CMPXHarvesterDB::CMPXHarvesterDB( TDriveNumber aDrive, RFs& aFs ) : - iDrive( aDrive), - iFs( aFs ) + iDrive( aDrive), + iFs( aFs ) +#ifdef __RAMDISK_PERF_ENABLE + ,iRamDrive(aDrive), + iUseRamDrive(EFalse) +#endif // __RAMDISK_PERF_ENABLE { } @@ -75,7 +79,7 @@ // TInt CMPXHarvesterDB::OpenL() { - MPX_DEBUG1("CMPXHarvesterDB::OpenL <---"); + MPX_FUNC("CMPXHarvesterDB::OpenL"); // There is no need to re-open if it was already open if( iDBOpen ) @@ -84,18 +88,11 @@ } TInt rtn( KErrNone ); - TDriveUnit drive( iDrive ); - TFileName fileName; - fileName.Append( drive.Name() ); - fileName.Append( KHarvesterDBPath ); - - // Make sure Path exists - if (!BaflUtils::PathExists(iFs, fileName)) - { - iFs.MkDirAll(fileName); - } - - fileName.Append( KHarvesterDBName ); + TFileName fileName = GenerateDbName(); + TParsePtr fileParser( fileName ); + TFileName filePath = fileParser.DriveAndPath(); + // Make sure Path exists; allow to leave if can't create the path + BaflUtils::EnsurePathExistsL(iFs, filePath); // Try to open the stream TRAPD( err, @@ -107,20 +104,9 @@ if( err ) { MPX_DEBUG2("CMPXHarvesterDB::OpenL -- New database %i", err); - - TRAPD( openErr, - iStore = CPermanentFileStore::ReplaceL(iFs, fileName ,EFileRead|EFileWrite); - iStore->SetTypeL(iStore->Layout()); - CreateDBL(); - iDBOpen = ETrue; - ); - - if( KErrNone != openErr ) - { - iDBOpen = EFalse; - User::Leave( openErr ); - } - + iStore = CPermanentFileStore::ReplaceL(iFs, fileName ,EFileRead|EFileWrite); + iStore->SetTypeL(iStore->Layout()); + CreateDBL(); // If the open stream error was not found, that is fine // because it is a new db, other errors means the stream // is corrupted @@ -131,9 +117,8 @@ { MPX_DEBUG1("CMPXHarvesterDB::OpenL -- Opening database" ); rtn = OpenDBL(); - iDBOpen = ETrue; } - + iDBOpen = ETrue; // Check volume Id // @@ -160,7 +145,6 @@ rtn = OpenL(); } - MPX_DEBUG1("CMPXHarvesterDB::OpenL --->"); return rtn; } @@ -196,15 +180,26 @@ MPX_DEBUG1("CMPXHarvesterDB::CreateDBL <---"); // remove old databases before creating/replacing new database - - TFileName dbFileName; - TDriveUnit drive( iDrive ); - dbFileName.Append( drive.Name() ); - dbFileName.Append( KHarvesterDBPath ); - dbFileName.Append( KHarvesterDBPattern ); + TFileName fileName = GenerateDbName(); + TParsePtr fileParser( fileName ); + TFileName filePath = fileParser.DriveAndPath(); +#ifdef __RAMDISK_PERF_ENABLE + if ( iUseRamDrive ) + { + TDriveUnit drive( iDrive ); + filePath.Append(drive.Name()[0]); + filePath.Append(KHarvesterDBPattern); + } + else + { +#endif // __RAMDISK_PERF_ENABLE + filePath.Append( KHarvesterDBPattern ); +#ifdef __RAMDISK_PERF_ENABLE + } +#endif // __RAMDISK_PERF_ENABLE CFileMan* fileManager = CFileMan::NewL(iFs); - TInt ret = fileManager->Delete(dbFileName); + TInt ret = fileManager->Delete(filePath); delete fileManager; fileManager = NULL; @@ -474,12 +469,7 @@ // TInt CMPXHarvesterDB::DeleteDatabase() { - TDriveUnit drive( iDrive ); - TFileName fileName; - fileName.Append( drive.Name() ); - fileName.Append( KHarvesterDBPath ); - fileName.Append( KHarvesterDBName ); - + TFileName fileName = GenerateDbName(); return iFs.Delete( fileName ); } @@ -607,4 +597,127 @@ iDatabase->Rollback(); } +#ifdef __RAMDISK_PERF_ENABLE +// --------------------------------------------------------------------------- +// Set RAM drive info +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDB::SetRamDriveInfo(TDriveNumber aDrive, TBool aUseRamDrive) + { + MPX_FUNC("CMPXHarvesterDB::SetRamDriveInfo"); + iRamDrive = aDrive; + iUseRamDrive = aUseRamDrive; + } + +// --------------------------------------------------------------------------- +// Get UseRamDrive +// --------------------------------------------------------------------------- +// +TBool CMPXHarvesterDB::IsUseRamDrive() + { + MPX_FUNC("CMPXHarvesterDB::IsUseRamDrive"); + return iUseRamDrive; + } + +// --------------------------------------------------------------------------- +// Get the state of the database. +// --------------------------------------------------------------------------- +// +TDbState CMPXHarvesterDB::GetDbState() + { + MPX_FUNC("CMPXHarvesterDB::GetDbState"); + TDbState state = EDbClose; + if ( InTransaction() ) + { + state = EDbInTransaction; + } + else if ( iDBOpen ) + { + state = EDbOpen; + } + + MPX_DEBUG2("CMPXHarvesterDB::GetDbState state = %d", state ); + return state; + } + +// --------------------------------------------------------------------------- +// Set the state of the database. +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDB::SetDbStateL( TDbState aState ) + { + MPX_FUNC("CMPXHarvesterDB::SetDbState"); + MPX_DEBUG2("CMPXHarvesterDB::SetDbState state = %d", aState ); + + switch( aState ) + { + case EDbClose: + { + if ( InTransaction() ) + { + CommitL(); + } + Close(); + break; + } + case EDbOpen: + { + if ( InTransaction() ) + { + CommitL(); + } + OpenL(); + break; + } + case EDbInTransaction: + { + if ( !InTransaction() ) + { + OpenL(); + BeginL(); + } + break; + } + default: + { + // should never get here + User::Leave(KErrNotSupported); + } + } + } + +#endif // __RAMDISK_PERF_ENABLE + +// --------------------------------------------------------------------------- +// Generate the database name +// --------------------------------------------------------------------------- +// +TFileName CMPXHarvesterDB::GenerateDbName() + { + MPX_FUNC("CMPXHarvesterDB::GenerateDbName"); + TFileName fileName; +#ifdef __RAMDISK_PERF_ENABLE + if ( iUseRamDrive ) + { + TDriveUnit ramDrive( iRamDrive ); + fileName.Append( ramDrive.Name() ); + fileName.Append( KHarvesterDBPath ); + TDriveUnit drive( iDrive ); + fileName.Append(drive.Name()[0]); + fileName.Append(KHarvesterDBName); + } + else + { +#endif // __RAMDISK_PERF_ENABLE + TDriveUnit drive( iDrive ); + fileName.Append( drive.Name() ); + fileName.Append( KHarvesterDBPath ); + fileName.Append( KHarvesterDBName ); +#ifdef __RAMDISK_PERF_ENABLE + } +#endif // __RAMDISK_PERF_ENABLE + MPX_DEBUG2("CMPXHarvesterDB::GenerateDbName file name = %S", &fileName ); + return fileName; + } + // End of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/src/mpxharvesterdbmanager.cpp --- a/mmappcomponents/harvester/filehandler/src/mpxharvesterdbmanager.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/src/mpxharvesterdbmanager.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -21,17 +21,43 @@ #include #include #endif //RD_MULTIPLE_DRIVE + +#ifdef __RAMDISK_PERF_ENABLE +#include +#include +#include +#include "mpxdbcommon.h" +#endif //__RAMDISK_PERF_ENABLE + #include #include "mpxharvesterdbmanager.h" #include "mpxharvesterdb.h" #include "mpxharvesterdbtable.h" +// CONSTANTS +#ifdef __RAMDISK_PERF_ENABLE +_LIT( KHarvesterDummyDBName, "harvesterDummy.dat" ); +const TInt64 KMPMegaByte = 1048576; +const TInt64 KMPEstimatedSongInBytes = KMPMegaByte * 2; +const TInt KMPEstimatedSizePerDBEntry = KMaxFileName; // worst scenario, can be lower if needed +//const TInt KUpdateDBCount = 200; +const TInt KMPMinimumRAMSizeToRun = 6 * KMPMegaByte; +#endif //__RAMDISK_PERF_ENABLE + + // --------------------------------------------------------------------------- // C++ Constructor // --------------------------------------------------------------------------- // -CMPXHarvesterDatabaseManager::CMPXHarvesterDatabaseManager( RFs& aFs ) - : iFs( aFs ) +CMPXHarvesterDatabaseManager::CMPXHarvesterDatabaseManager( RFs& aFs ): + iFs( aFs ) +#ifdef __RAMDISK_PERF_ENABLE + ,iRAMDiskPerfEnabled(EFalse), + iMaximumAllowedRAMDiskSpaceToCopy(0), + //iUpdateCount(0), + iMtpMode(EFalse) + //iMtpAddCount(0) +#endif //__RAMDISK_PERF_ENABLE { } @@ -43,7 +69,38 @@ // void CMPXHarvesterDatabaseManager::ConstructL() { + MPX_FUNC("CMPXHarvesterDatabaseManager::ConstructL"); User::LeaveIfError( iDBSession.Connect() ); + +#ifdef __RAMDISK_PERF_ENABLE + TInt temp; + CRepository* repository = CRepository::NewLC( KCRUIDMpxHarvesterFeatures ); + MPX_DEBUG1("CMPXHarvesterDatabaseManager::ConstructL got repository"); + User::LeaveIfError( repository->Get( KMpxHarvesterEnableRamDisk, temp )); + iRAMDiskPerfEnabled = temp; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::ConstructL KMpxHarvesterEnableRamDisk %d", iRAMDiskPerfEnabled); + + User::LeaveIfError( repository->Get( KMpxHarvesterMaxAllowedRamDiskSpace, temp) ); + iMaximumAllowedRAMDiskSpaceToCopy = temp * KMPMegaByte; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::ConstructL KMpxHarvesterMaxAllowedRamDiskSpace %Lu", iMaximumAllowedRAMDiskSpaceToCopy); + CleanupStack::PopAndDestroy(repository); + + if ( iRAMDiskPerfEnabled ) + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::ConstructL RAMDisk performance is enabled."); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::ConstructL RAMDisk iMaximumAllowedRAMDiskSpaceToCopy=%Lu", iMaximumAllowedRAMDiskSpaceToCopy); + if ( GetRAMDiskPath() != KErrNone ) + { + // Error finding ram drive, disable ram disk + iRAMDiskPerfEnabled = EFalse; + } + } + else + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::ConstructL RAMDisk performance is NOT enabled iRAMDiskPerfEnabled=%d", iRAMDiskPerfEnabled); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::ConstructL RAMDisk iMaximumAllowedRAMDiskSpaceToCopy=%Lu", iMaximumAllowedRAMDiskSpaceToCopy); + } +#endif //__RAMDISK_PERF_ENABLE } @@ -68,6 +125,13 @@ // CMPXHarvesterDatabaseManager::~CMPXHarvesterDatabaseManager() { +#ifdef __RAMDISK_PERF_ENABLE + TInt count(iDatabases.Count()); + for (TInt i = 0; i < count; ++i) + { + RemoveDummyFile(i); + } +#endif // __RAMDISK_PERF_ENABLE iDatabases.ResetAndDestroy(); iDatabases.Close(); iDBSession.Close(); @@ -189,17 +253,17 @@ // if (!IsRemoteDrive(aDrive)) { - TInt count( iDatabases.Count() ); - for( TInt i=0; iGetDbDrive() == aDrive ) + TInt count( iDatabases.Count() ); + for( TInt i=0; iOpenL(); - break; + CMPXHarvesterDB* db = (CMPXHarvesterDB*) iDatabases[i]; + if( db->GetDbDrive() == aDrive ) + { + db->OpenL(); + break; + } } } - } MPX_DEBUG1("CMPXHarvesterDatabaseManager::OpenDatabaseL --->"); } @@ -415,5 +479,621 @@ MPX_DEBUG1("CMPXHarvesterDatabaseManager::Rollback -->"); } +#ifdef __RAMDISK_PERF_ENABLE +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::CopyDBsToRamL +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::CopyDBsToRamL( TBool aMtpMode ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::CopyDBsToRamL"); + iMtpMode = aMtpMode; + //iMtpAddCount = 0; + //iUpdateCount = 0; + + if( iRAMDiskPerfEnabled ) + { + // Check for low ram disk space. + if ( !IsRamDiskSpaceAvailable() || IsRamDiskLow() ) + { + return; + } + + // Check if we are over the allowed ram space. + TInt dbSize=0; + TInt err = GetTotalDatabasesSize(dbSize, EFalse); + if ( err || (dbSize > iMaximumAllowedRAMDiskSpaceToCopy) ) + { + MPX_DEBUG2("CMPXDbManager::CopyDBsToRamL Over the allowed Ram disk limit %Lu", iMaximumAllowedRAMDiskSpaceToCopy ); + return; + } + + TInt count(iDatabases.Count()); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CopyDBsToRamL() iDatabaseHandles.Count()=%d", count); + for (TInt i = 0; i < count; ++i) + { + TDriveUnit drive( iDatabases[i]->GetDbDrive() ); + // Don't copy db on C drive. + if ( (TInt)drive == EDriveC ) + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::CopyDBsToRamL() Drive C: skipped."); + continue; + } + + // Check if database is in RAM drive. + if ( iDatabases[i]->IsUseRamDrive()) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CopyDBsToRamL Drive %d is already in Ram Drive.", (TInt)drive); + continue; + } + + // Get the db state in order to restore it later. + TDbState dbState = iDatabases[i]->GetDbState(); + iDatabases[i]->SetDbStateL( EDbClose ); + TRAPD(err, DoCopyDBToRamL( drive )); + if ( err != KErrNone ) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CopyDBsToRamL error=%d", err); + // delete dummy file + RemoveDummyFile(i); + + // delete db in ram drive + TFileName ramDb = GenerateHarvesterDbName( drive, ETrue ); + TInt delErr = BaflUtils::DeleteFile(iFs, ramDb); + MPX_DEBUG3("CMPXHarvesterDatabaseManager::CopyDBsToRamL db on ram drive deleted file=%S, err=%d", &ramDb, delErr); + + iDatabases[i]->SetRamDriveInfo( iRAMDrive, EFalse); + } + // Restore the db state. + iDatabases[i]->SetDbStateL( dbState ); + } + } + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::DoCopyDBToRamL +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::DoCopyDBToRamL(TDriveUnit aDriveUnit) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::DoCopyDBToRamL"); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::DoCopyDBToRamL Database from drive %d", (TInt)aDriveUnit ); + TFileName dst; + TFileName src; + dst.Zero(); + dst.Append(iRAMFolder); + BaflUtils::EnsurePathExistsL( iFs, dst ); + src = GenerateHarvesterDbName( aDriveUnit ); + MPX_DEBUG2("RAMDisk src path=%S", &src); + dst = GenerateHarvesterDbName( aDriveUnit, ETrue ); + MPX_DEBUG2("RAMDisk dst path=%S", &dst); + TEntry entry; + iFs.Entry( src, entry ); + User::LeaveIfError( BlockDiskSpaceL( aDriveUnit, entry.iSize )); + User::LeaveIfError( BaflUtils::CopyFile(iFs, src, dst ) ); + MPX_DEBUG1("CMPXHarvesterDatabaseManager::DoCopyDBToRamL Copy to Ram Drive Successful."); + GetDatabaseL( (TDriveNumber) (TInt)aDriveUnit ).SetRamDriveInfo(iRAMDrive, ETrue); + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::CopyDBsFromRamL +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::CopyDBsFromRamL() + { + MPX_FUNC("CMPXHarvesterDatabaseManager::CopyDBsFromRamL"); + // Stop monitoring ram drive for low disk space. + iMtpMode = EFalse; + //iMtpAddCount = 0; + //iUpdateCount = 0; + + if( iRAMDiskPerfEnabled ) + { + TInt count(iDatabases.Count()); + for (TInt i = 0; i < count; ++i) + { + TInt err = KErrNone; + TDriveUnit drive( iDatabases[i]->GetDbDrive() ); + // Check if database is in RAM drive. + if ( !iDatabases[i]->IsUseRamDrive()) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CopyDBsFromRamL Drive %d is NOT in Ram Drive.", (TInt)drive); + continue; + } + + // Set the UseRamDrive bool to False. + iDatabases[i]->SetRamDriveInfo( iRAMDrive, EFalse ); + // Get the db state in order to restore it later. + TDbState dbState = iDatabases[i]->GetDbState(); + iDatabases[i]->SetDbStateL(EDbClose); + TRAP( err, DoCopyDBFromRamL(drive) ); + if ( err ) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CopyDBsFromRamL copy error=%d", err); + //anyting wrong, delete the temp file. + RemoveDummyFile(i); + } + + // Restore the db state. + iDatabases[i]->SetDbStateL( dbState ); + } + } + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::DoCopyDBFromRamL +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::DoCopyDBFromRamL(TDriveUnit aDriveUnit) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::DoCopyDBFromRamL"); + TFileName dst; + TFileName src; + TInt err = KErrNone; + + dst = GenerateHarvesterDbName( aDriveUnit ); + src = GenerateHarvesterDbName( aDriveUnit, ETrue ); + MPX_DEBUG3("CMPXHarvesterDatabaseManager::DoCopyDBFromRamL from %S to %S", &src, &dst ); + + // Rename the temp file into real Db name + TFileName dummyDbFileName = GenerateDummyDbName( aDriveUnit ); + + //Copy Db from RAM to replace dummy file + err = BaflUtils::CopyFile(iFs, src, dummyDbFileName); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::DoCopyDBFromRamL database copied from ram drive err=%d.", err); + + // delete db in ram drive. + TInt delErr = BaflUtils::DeleteFile(iFs, src); + MPX_DEBUG3("CMPXHarvesterDatabaseManager::DoCopyDBFromRamL db on ram drive deleted file=%S, err=%d", &src, delErr); + + // Make sure we del db from ram drive before leaving. + User::LeaveIfError( err ); + + // Delete existing DB on drive + delErr = BaflUtils::DeleteFile(iFs, dst); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::DoCopyDBFromRamL destination file deleted err=%d", delErr); + + // rename dummy file to real db name + User::LeaveIfError( BaflUtils::RenameFile(iFs, dummyDbFileName, dst) ); + MPX_DEBUG1("CMPXHarvesterDatabaseManager::DoCopyDBFromRamL dummy file renamed."); + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::GetRAMDiskPath +// --------------------------------------------------------------------------- +// +TInt CMPXHarvesterDatabaseManager::GetRAMDiskPath() + { + MPX_FUNC("CMPXHarvesterDatabaseManager::GetRAMDiskPath"); + TDriveList driveList; + TBool ramDriveFound = EFalse; + iRAMFolder.Zero(); + + TInt error = iFs.DriveList( driveList ); + if ( error == KErrNone ) + { + for ( TInt i = 0; i < driveList.Length(); i++ ) + { + if ( driveList[i] != 0 ) + { + TDriveInfo info; + TInt err = iFs.Drive( info, i ); + if ( !err && info.iType == EMediaRam ) + { + TDriveUnit driveUnit( i ); + iRAMDrive = (TDriveNumber)i; + iRAMFolder.Append(driveUnit.Name()); + iRAMFolder.Append(KHarvesterDBPath); + ramDriveFound = ETrue; + MPX_DEBUG2("RAMDisk path=%S", &iRAMFolder); + break; + } + } + } + + // Check if ram drive is found. + if ( !ramDriveFound ) + { + error = KErrNotFound; + } + } + MPX_DEBUG2("CMPXDbManager::GetRAMDiskPath Get DriveList error=%d", error); + return error; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable +// --------------------------------------------------------------------------- +// +TBool CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable() + { + MPX_FUNC("CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable"); + TVolumeInfo vol; + TInt err = iFs.Volume( vol, iRAMDrive ); + if ( err != KErrNone ) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable Disk Not available to use. Error = %d", err); + return EFalse; + } + MPX_DEBUG2("CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable Free in bytes =%Lu", vol.iFree); + if ( vol.iFree > KMPMinimumRAMSizeToRun ) + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable Ok to copy"); + return ETrue; + } + + MPX_DEBUG1("CMPXHarvesterDatabaseManager::IsRamDiskSpaceAvailable NOT Ok to copy"); + return EFalse; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::BlockDiskSpaceL +// --------------------------------------------------------------------------- +// +TInt CMPXHarvesterDatabaseManager::BlockDiskSpaceL( TDriveUnit aDrive, TInt aOrigDbSize ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::BlockDiskSpaceL"); + + // if current DB size can not fit in RAM, abort now + TVolumeInfo vol; + TInt err = KErrNone; + err = iFs.Volume( vol, iRAMDrive ); + if ( err ) + { + return err; + } + + if ( vol.iFree < aOrigDbSize + KMPMinimumRAMSizeToRun ) + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::BlockDiskSpaceL Not enough space on ram drive." ); + return KErrDiskFull; + } + + MPX_DEBUG2("CMPXHarvesterDatabaseManager::BlockDiskSpaceL %d", (TInt)aDrive ); + err = iFs.Volume( vol, (TInt)aDrive ); + if ( err ) + { + return err; + } + + MPX_DEBUG2("CMPXHarvesterDatabaseManager::BlockDiskSpaceL Disk total free space in bytes =%Lu", vol.iFree); + TInt64 blockingSize( CalculateInitalDummyDBSizeL( vol, aOrigDbSize )); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::BlockDiskSpaceL Disk blocking size =%Lu", blockingSize); + // Pad blockingSize by 1Mb so we don't use all the free disk space. + if ( vol.iFree > (blockingSize + 1*KMPMegaByte) ) + { + TFileName dummyDbFileName = GenerateDummyDbName( aDrive ); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::BlockDiskSpaceL Dummy db file name=%S", &dummyDbFileName); + + RFile dummyDb; + err = dummyDb.Replace( iFs, dummyDbFileName, EFileWrite ); + if (err != KErrNone) + { + MPX_DEBUG2("CMPXDbManager::BlockDiskSpaceL Can't open dummy file %d", err); + return err; + } + + err = dummyDb.SetSize( blockingSize ); + // Close the dummy RFile + dummyDb.Close(); + if ( err ) + { + MPX_DEBUG2("CMPXDbManager::BlockDiskSpaceL Can't resize dummy file %d", err); + return err; + } + } + else + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::BlockDiskSpaceL - Not enough disk space for dummy file."); + err = KErrDiskFull; + } + return err; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSizeL +// --------------------------------------------------------------------------- +// +TInt64 CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSizeL( TVolumeInfo aVol, TInt aOrigDbSize ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSizeL"); + TInt64 size; + + if ( iMtpMode ) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSize aVol.iFree=%Lu", aVol.iFree ); + TInt64 totalNumOfSongsCanFit = aVol.iFree / KMPEstimatedSongInBytes; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSize (MTP) totalNumOfSongsCanFit=%Lu", totalNumOfSongsCanFit ); + TInt64 estimatedSize = totalNumOfSongsCanFit * (TInt64) KMPEstimatedSizePerDBEntry + aOrigDbSize; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSize (MTP) estimated DB size from calculation=%Lu", estimatedSize ); + if ( estimatedSize > iMaximumAllowedRAMDiskSpaceToCopy ) + { + size = iMaximumAllowedRAMDiskSpaceToCopy; + } + else + { + size = estimatedSize; + } + } + else + { + TInt64 totalNumOfSongsCanFit = aVol.iSize / KMPEstimatedSongInBytes; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSize totalNumOfSongsCanFit=%Lu", totalNumOfSongsCanFit ); + TInt64 estimatedSize = totalNumOfSongsCanFit * (TInt64) KMPEstimatedSizePerDBEntry + aOrigDbSize; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSize estimated DB size from calculation=%Lu", estimatedSize ); + if ( estimatedSize > iMaximumAllowedRAMDiskSpaceToCopy ) + { + size = iMaximumAllowedRAMDiskSpaceToCopy; + } + else + { + size = estimatedSize; + } + } + + MPX_DEBUG2("CMPXHarvesterDatabaseManager::CalculateInitalDummyDBSize Dummy DB size=%Lu", size ); + return size; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::RemoveDummyFile +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::RemoveDummyFile( TInt aIndex ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::RemoveDummyFile"); + + TDriveUnit driveUnit(iDatabases[aIndex]->GetDbDrive()); + TFileName file = GenerateDummyDbName(driveUnit); + + if ( (file.Length() > 0) && + (BaflUtils::FileExists(iFs, file)) ) + { + BaflUtils::DeleteFile(iFs, file); + } + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::UpdateDBsFromRamL +// --------------------------------------------------------------------------- +// +/*void CMPXHarvesterDatabaseManager::UpdateDBsFromRamL( TInt aCount ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::UpdateDBsFromRamL"); + TBool updateDb = EFalse; + + // In MTP mode, aCount is invalid, songs are added one at a time. + if ( iMtpMode ) + { + iMtpAddCount++; + MPX_DEBUG2("CMPXHarvesterDatabaseManager::UpdateDBsFromRamL iMtpAddCount=%d", iMtpAddCount); + if ( (iMtpAddCount - iUpdateCount) > KUpdateDBCount ) + { + updateDb = ETrue; + iUpdateCount = iMtpAddCount; + } + } + else + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::UpdateDBsFromRamL aCount=%d", aCount); + if ( (aCount - iUpdateCount) > KUpdateDBCount ) + { + updateDb = ETrue; + iUpdateCount = aCount; + } + } + + if ( updateDb ) + { + CommitL(); + TInt count(iDatabases.Count()); + for (TInt i = 0; i < count; ++i) + { + TDriveUnit drive( iDatabases[i]->GetDbDrive() ); + // Check if database is not in RAM drive. + if ( !iDatabases[i]->IsUseRamDrive() ) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::UpdateDBsFromRamL Drive %d is not in Ram Drive.", (TInt)drive); + continue; + } + + iDatabases[i]->Close(); + // update the database from ram drive. + TRAP_IGNORE( DoUpdateDBFromRamL( drive ) ); + // + iDatabases[i]->OpenL(); + } + BeginL(); + } + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::DoUpdateDBFromRamL +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::DoUpdateDBFromRamL(TDriveUnit aDriveUnit) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::DoUpdateDBFromRamL"); + + TFileName dst; + TFileName src; + + dst = GenerateHarvesterDbName( aDriveUnit ); + src = GenerateHarvesterDbName( aDriveUnit, ETrue ); + MPX_DEBUG3("CMPXHarvesterDatabaseManager::DoUpdateDBFromRamL from %S to %S", &src, &dst ); + + //Copy Db from RAM to real db file + TInt err = BaflUtils::CopyFile(iFs, src, dst); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::DoUpdateDBFromRamL database copied from ram drive err=%d.", err); + }*/ + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::GenerateHarvesterDbName +// --------------------------------------------------------------------------- +// +TFileName CMPXHarvesterDatabaseManager::GenerateHarvesterDbName( TDriveUnit aDriveUnit, TBool aForRamDrive ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::GenerateHarvesterDbName"); + TFileName name; + name.Zero(); + + if ( aForRamDrive ) + { + name.Append(iRAMFolder); + name.Append(aDriveUnit.Name()[0]); + name.Append(KHarvesterDBName); + } + else + { + name.Append(aDriveUnit.Name()); + name.Append(KHarvesterDBPath); + name.Append(KHarvesterDBName); + } + + MPX_DEBUG2("CMPXHarvesterDatabaseManager::GenerateHarvesterDbName name = %S", &name ); + return name; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::GenerateDummyDbName +// --------------------------------------------------------------------------- +// +TFileName CMPXHarvesterDatabaseManager::GenerateDummyDbName( TDriveUnit aDriveUnit ) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::GenerateDummyDbName"); + TFileName name; + name.Zero(); + name.Append(aDriveUnit.Name()); + name.Append(KHarvesterDBPath); + name.Append(KHarvesterDummyDBName); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::GenerateDummyDbName name = %S", &name ); + return name; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::EnsureRamSpaceL +// --------------------------------------------------------------------------- +// +void CMPXHarvesterDatabaseManager::EnsureRamSpaceL() + { + MPX_FUNC("CMPXHarvesterDatabaseManager::EnsureRamSpaceL()"); + + // Ram disk disabled, no need to continue. + if( !iRAMDiskPerfEnabled ) + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::EnsureRamSpaceL RAM Disk Disabled."); + return; + } + + // Check if any DBs are in RAM drive. + TInt count(iDatabases.Count()); + TBool ramDriveInUse = EFalse; + for (TInt i = 0; i < count; ++i) + { + // Check if database is in RAM drive. + if ( iDatabases[i]->IsUseRamDrive() ) + { + ramDriveInUse = ETrue; + break; + } + } + + // DBs not in ram drive, no need to continue. + if ( !ramDriveInUse ) + { + MPX_DEBUG1("CMPXHarvesterDatabaseManager::EnsureRamSpaceL No DBs in RAM drive."); + return; + } + + // Check if low on Ram disk. + if ( IsRamDiskLow() ) + { + // RAM not enough, copy back to normal drive and continue to harvest. + MPX_DEBUG1("CMPXHarvesterDatabaseManager::EnsureRamSpaceL RAM diskspace is full, copy dbs back."); + CopyDBsFromRamL(); + } + else + { + TInt size=0; + TInt err = GetTotalDatabasesSize(size, ETrue); + if ( err || (size > iMaximumAllowedRAMDiskSpaceToCopy) ) + { + // Databases using too much RAM space, copy back to normal drive and continue to harvest. + if ( err ) + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::EnsureRamSpaceL Get DBs Size Err = %d, copy dbs back.", err); + } + else + { + MPX_DEBUG2("CMPXHarvesterDatabaseManager::EnsureRamSpaceL DBs using too much RAM space size = %d, copy dbs back.", size); + } + CopyDBsFromRamL(); + } + } + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::IsRamDiskLow +// --------------------------------------------------------------------------- +// +TBool CMPXHarvesterDatabaseManager::IsRamDiskLow() + { + MPX_FUNC("CMPXHarvesterDatabaseManager::IsRamDiskLow()"); + TBool low = EFalse; + TVolumeInfo vol; + TInt errRAM = iFs.Volume( vol, iRAMDrive ); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::IsRamDiskLow Get vol err: %d", errRAM); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::IsRamDiskLow Free RAM Disk Space: %Lu", vol.iFree); + if ( errRAM == KErrNone && vol.iFree < KMPMinimumRAMSizeToRun ) + { + low = ETrue; + } + return low; + } + +// --------------------------------------------------------------------------- +// CMPXHarvesterDatabaseManager::GetTotalDatabasesSize +// --------------------------------------------------------------------------- +// +TInt CMPXHarvesterDatabaseManager::GetTotalDatabasesSize(TInt& aSize, TBool aRamDrive) + { + MPX_FUNC("CMPXHarvesterDatabaseManager::GetTotalDatabasesSize"); + TInt err = KErrNone; + TInt size=0; + TInt count(iDatabases.Count()); + for ( TInt i = 0; i < count ; ++i ) + { + TDriveUnit drive( iDatabases[i]->GetDbDrive() ); + // Ignore C drive + if ( (TInt)drive == EDriveC ) + { + continue; + } + // Generate database name. + TFileName dbFilename = GenerateHarvesterDbName(drive, aRamDrive); + MPX_DEBUG2("CMPXHarvesterDatabaseManager::GetTotalDatabasesSize - Database name = %S", &dbFilename); + TEntry entry; + err = iFs.Entry( dbFilename, entry ); + if (err == KErrNotFound || err == KErrNotReady) + { + MPX_DEBUG3("CMPXHarvesterDatabaseManager::GetTotalDatabasesSize - Ignored %S, err = %d", &dbFilename, err); + err = KErrNone; + continue; + } + if ( err != KErrNone ) + { + break; + } + MPX_DEBUG3("CMPXHarvesterDatabaseManager::GetTotalDatabasesSize - Size of Db %S = %d", &dbFilename, entry.iSize); + // sum up size + size += entry.iSize; + } + aSize = size; + MPX_DEBUG3("CMPXHarvesterDatabaseManager::GetTotalDatabasesSize - Total Size of Dbs = %d, err = %d", size, err); + return err; + } + +#endif // __RAMDISK_PERF_ENABLE + // END OF FILE diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/filehandler/src/mpxharvesterfilehandlerimp.cpp --- a/mmappcomponents/harvester/filehandler/src/mpxharvesterfilehandlerimp.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/filehandler/src/mpxharvesterfilehandlerimp.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -12,7 +12,7 @@ * Contributors: * * Description: Handles all file related activities -* Version : %version: da1mmcf#72.1.14.2.4.1.4.1.2 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: e003sa33#72.1.14.2.4.1.4.1.2.1.3 % << Don't touch! Updated by Synergy at check-out. * */ @@ -224,6 +224,7 @@ // Create DRM Notifier and register for AddRemove event iDrmNotifier = CDRMNotifier::NewL(); iDrmNotifier->RegisterEventObserverL( *this, KEventAddRemove ); + iCurUSBEvent = KErrNotFound; } // --------------------------------------------------------------------------- @@ -428,7 +429,7 @@ void CMPXHarvesterFileHandlerImp::HandleSystemEventL( TSystemEvent aEvent, TInt aData ) { - MPX_DEBUG2("CMPXHarvesterFileHandlerImp::HandleSystemEventL %i", aEvent); + MPX_DEBUG3("CMPXHarvesterFileHandlerImp::HandleSystemEventL %i, drive %d", aEvent, aData); // How to handle each event // // 1: Format and eject, we stop scanning and close only the mmc db @@ -465,7 +466,7 @@ User::LeaveIfError( iFs.DriveToChar( driveNum, driveChar ) ); MPX_DEBUG5 ("CMPXHarvesterFileHandlerImp::HandleSystemEventL - drive %c: is %S, %S and %S", - driveChar, + (TUint)driveChar, (driveStatus&DriveInfo::EDrivePresent)?&drivePresent:&driveNotPresent, (driveStatus&DriveInfo::EDriveInUse)?&driveInUse:&driveAvailable, (driveStatus&DriveInfo::EDriveFormatted)?&driveFormatted:&driveNotFormatted); @@ -487,6 +488,7 @@ iIdle->Cancel(); CancelScan(); #ifdef RD_MULTIPLE_DRIVE + TBool dbClosed( EFalse ); for( TInt driveNum = EDriveA; driveNum <= EDriveZ; driveNum++ ) { if (driveList[driveNum] && (!iDBManager->IsRemoteDrive(static_cast(driveNum)))) @@ -500,10 +502,27 @@ iDBManager->CloseDatabase( (TDriveNumber) driveNum ); // Save the drive iRemovedDrive = driveNum; + dbClosed = ETrue; break; } } } + + if( !dbClosed ) + { + // GetUserVisibleDrives / RFs::DriveList does not return drive at all + // if it is dismounted using file server methods. This occurs at least + // when removing card using power menu eject. + // If the drive reported as removed is not ready, close db on that drive. + TUint driveStatus(0); + TInt err( DriveInfo::GetDriveStatus( iFs, aData, driveStatus ) ); + MPX_DEBUG4("Drive %d status 0x%x, err %d", aData, driveStatus, err); + if( err == KErrNotReady ) + { + iDBManager->CloseDatabase( (TDriveNumber) aData ); + iRemovedDrive = aData; + } + } #else iDBManager->CloseDatabase( (TDriveNumber) aData ); #endif // RD_MULTIPLE_DRIVE @@ -529,6 +548,10 @@ } case EUSBMassStorageStartEvent: { + if (iCurUSBEvent == EUSBMassStorageStartEvent) + { + break; + } iIdle->Cancel(); CancelScan(); #ifdef RD_MULTIPLE_DRIVE @@ -546,6 +569,7 @@ #else iDBManager->CloseDatabase( (TDriveNumber) aData ); #endif // RD_MULTIPLE_DRIVE + iCurUSBEvent = EUSBMassStorageStartEvent; break; } case EUSBMassStorageEndEvent: @@ -565,25 +589,47 @@ #else iDBManager->OpenDatabaseL( (TDriveNumber) aData ); #endif // RD_MULTIPLE_DRIVE + iCurUSBEvent = EUSBMassStorageEndEvent; break; } case EUSBMTPNotActiveEvent: // deliberate fall through { + if (iCurUSBEvent == EUSBMTPNotActiveEvent) + { + break; + } if ( iRefreshing ) { // Notify clients that refresh is cancelled. iCollectionUtil->Collection().NotifyL( EMcMsgRefreshEnd, KErrLocked ); } + CancelScan(); + iCurUSBEvent = EUSBMTPNotActiveEvent; + break; } case EUSBMTPStartEvent: { CancelScan(); + iCurUSBEvent = EUSBMTPStartEvent; // nothing to do, db is needed for MTP +#ifdef __RAMDISK_PERF_ENABLE + // if statement needed because of fall through above. + if ( aEvent == EUSBMTPStartEvent ) + { + // copy dbs to ram drive + iDBManager->CopyDBsToRamL(ETrue); + } +#endif //__RAMDISK_PERF_ENABLE break; } case EUSBMTPEndEvent: { + iCurUSBEvent = EUSBMTPEndEvent; // nothing to do, db is updated by MTP +#ifdef __RAMDISK_PERF_ENABLE + // copy dbs from ram drive + iDBManager->CopyDBsFromRamL(); +#endif //__RAMDISK_PERF_ENABLE break; } case EPowerKeyEjectEvent: @@ -705,6 +751,10 @@ } } // Add to database +#ifdef __RAMDISK_PERF_ENABLE + // EnsureRamSpaceL will copy dbs from ram if ram space is low or dbs exceeded max space. + iDBManager->EnsureRamSpaceL(); +#endif // __RAMDISK_PERF_ENABLE CMPXHarvesterDB& db = iDBManager->GetDatabaseL( ::ExtractDrive( path ) ); CMPXHarvesterDatabaseTable* table = db.OpenFileL( path ); CleanupStack::PushL( table ); @@ -721,6 +771,10 @@ // Return the collection that it should belong to. r = col.iUid; +#ifdef __RAMDISK_PERF_ENABLE + // This feature will be turned on in the second phase. + //TRAP_IGNORE( iDBManager->UpdateDBsFromRamL(0) ); +#endif // __RAMDISK_PERF_ENABLE } else { @@ -742,6 +796,10 @@ TInt r(0); // Open the db +#ifdef __RAMDISK_PERF_ENABLE + // EnsureRamSpaceL will copy dbs from ram if ram space is low or dbs exceeded max space. + iDBManager->EnsureRamSpaceL(); +#endif // __RAMDISK_PERF_ENABLE CMPXHarvesterDB& db = iDBManager->GetDatabaseL( ::ExtractDrive(aPath) ); MPX_PERF_START( MPX_PERF_HARV_DB_DELETE_SUB1 ); CMPXHarvesterDatabaseTable* table = db.OpenFileL( aPath ); @@ -1024,6 +1082,11 @@ } case ECleanupBrokenLink: { +#ifdef __RAMDISK_PERF_ENABLE + // copy dbs to ram drive + iDBManager->CopyDBsToRamL(); +#endif //__RAMDISK_PERF_ENABLE + MPX_DEBUG1("Start Metadata Scan"); iMetadataScanner->Start(); break; @@ -1224,6 +1287,10 @@ // Delete previous table and open the next one Reset(); +#ifdef __RAMDISK_PERF_ENABLE + // EnsureRamSpaceL will copy dbs from ram if ram space is low or dbs exceeded max space. + iDBManager->EnsureRamSpaceL(); +#endif // __RAMDISK_PERF_ENABLE MPX_TRAPD( err, iCurDB = &iDBManager->GetDatabaseL( aDrive ) ); if ( err != KErrNone ) { @@ -1374,6 +1441,10 @@ iAddedCount++; } +#ifdef __RAMDISK_PERF_ENABLE + // This feature will be turned on in the second phase. + //TRAP_IGNORE( iDBManager->UpdateDBsFromRamL(iAddedCount) ); +#endif // __RAMDISK_PERF_ENABLE } else if ( addErr == KErrDiskFull ) { @@ -1556,6 +1627,10 @@ User::Leave( KErrDiskFull ); } } +#ifdef __RAMDISK_PERF_ENABLE + // This feature will be turned on in the second phase. + //TRAP_IGNORE( iDBManager->UpdateDBsFromRamL(iAddedCount) ); +#endif // __RAMDISK_PERF_ENABLE MPX_DEBUG1("CMPXHarvesterFileHandlerImp::AddPlaylistToCollectionL --->"); } @@ -1922,6 +1997,10 @@ { Reset(); TDriveNumber num = ::ExtractDrive( aPath ); +#ifdef __RAMDISK_PERF_ENABLE + // EnsureRamSpaceL will copy dbs from ram if ram space is low or dbs exceeded max space. + iDBManager->EnsureRamSpaceL(); +#endif // __RAMDISK_PERF_ENABLE iCurDB = &iDBManager->GetDatabaseL( num ); iCurTable = iCurDB->OpenFileL( aPath ); } @@ -1950,6 +2029,11 @@ iDBManager->Rollback(); } +#ifdef __RAMDISK_PERF_ENABLE + // copy dbs from ram drive + iDBManager->CopyDBsFromRamL(); +#endif //__RAMDISK_PERF_ENABLE + if( aErr == KErrNone || aErr == KErrCancel ) { aErr = iAddedCount; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp --- a/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -337,14 +337,21 @@ TMetaDataFieldId fieldType; HBufC* value = NULL; - TRAPD( err, value = metaCont.At( i, fieldType ).AllocL() ); - CleanupStack::PushL(value); - if ( KErrNone != err ) - { - CleanupStack::PopAndDestroy(value); - continue; - } - + metaCont.FieldIdAt( i, fieldType ); // get the field type + + // get the value, except for album art + if ( fieldType != EMetaDataJpeg ) + { + TRAPD( err, value = metaCont.At( i, fieldType ).AllocL() ); + CleanupStack::PushL( value ); + if ( KErrNone != err ) + { + MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL - error = %i", err); + CleanupStack::PopAndDestroy( value ); + continue; + } + } + switch( fieldType ) { case EMetaDataSongTitle: @@ -445,10 +452,17 @@ { #ifdef RD_MPX_TNM_INTEGRATION MPX_PERF_START(CMPXMetadataExtractor_SetMediaPropertiesL_JPEG_TNM); - HBufC8* value8 = MPXUser::Alloc8L(metaCont.At( i, fieldType )); + TPtrC8 ptr8 = metaCont.Field8( EMetaDataJpeg ); + HBufC8* value8; + TRAPD( err, value8 = ptr8.AllocL() ); + if ( KErrNone != err ) + { + MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL - error jpeg = %i", err); + User::Leave( err ); + } CleanupStack::PushL( value8 ); AddMediaAlbumArtL( aMedia, aFile, *value8 ); - CleanupStack::Pop(value8); + CleanupStack::Pop( value8 ); MPX_PERF_END(CMPXMetadataExtractor_SetMediaPropertiesL_JPEG_TNM); #else //RD_MPX_TNM_INTEGRATION aMedia.SetTextValueL( KMPXMediaMusicAlbumArtFileName, @@ -478,7 +492,10 @@ break; } } - CleanupStack::PopAndDestroy(value); + if (fieldType != EMetaDataJpeg) + { + CleanupStack::PopAndDestroy( value ); + } } MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL --->" ); @@ -761,16 +778,23 @@ // get metadata container. const CMetaDataFieldContainer& metaCont = iMetadataUtility->MetaDataFieldsL(); - TPtrC data = metaCont.Field( EMetaDataJpeg ); + TPtrC8 data8 = metaCont.Field8( EMetaDataJpeg ); - if ( data.Length() ) + if ( data8.Length() ) { MPX_DEBUG1("CMPXMetadataExtractor::GetMediaAlbumArtL(): Album art exist."); + #ifdef RD_MPX_TNM_INTEGRATION - HBufC8* value8 = MPXUser::Alloc8L( data ); + HBufC8* value8; + TRAPD( err, value8 = data8.AllocL() ); + if ( KErrNone != err ) + { + MPX_DEBUG2("CMPXMetadataExtractor::GetMediaAlbumArtL - error jpeg = %i", err); + User::Leave( err ); + } CleanupStack::PushL( value8 ); AddMediaAlbumArtL( aMedia, aFile, *value8 ); - CleanupStack::Pop(value8); + CleanupStack::Pop( value8 ); #else // RD_MPX_TNM_INTEGRATION aMedia.SetTextValueL( KMPXMediaMusicAlbumArtFileName, aFile ); #endif // RD_MPX_TNM_INTEGRATION diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mediaplayersettingsengine/group/MPSettEng.mmp --- a/mmappcomponents/mediaplayersettingsengine/group/MPSettEng.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mediaplayersettingsengine/group/MPSettEng.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,15 +15,15 @@ * */ -// Version : %version: 4.1.2 % - +// Version : %version: 4.1.3 % #include + TARGET mpsettengine.dll TARGETTYPE dll UID 0x1000006C 0x101F853D -VENDORID VID_DEFAULT +VENDORID VID_DEFAULT SOURCEPATH ../src SOURCE MPSettingsModel.cpp @@ -34,16 +34,15 @@ LIBRARY euser.lib LIBRARY ecom.lib -LIBRARY flogger.lib #if defined(ARMCC) -deffile ../eabi/ +deffile ../eabi/ #elif defined(WINSCW) -deffile ../bwinscw/ +deffile ../bwinscw/ #elif defined(WINS) -deffile ../bwins/ +deffile ../bwins/ #else -deffile ../bmarm/ +deffile ../bmarm/ #endif //end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpaccesssingleton.h --- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpaccesssingleton.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpaccesssingleton.h Sun Mar 14 13:11:48 2010 +0000 @@ -83,6 +83,7 @@ private: CMmMtpDpMetadataAccessWrapper* iWrapper; + }; #endif // CMMMTPDPACCESSSINGLETON_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h --- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h Sun Mar 14 13:11:48 2010 +0000 @@ -38,7 +38,7 @@ class CMmMtpDpMetadataAccessWrapper : public CBase { public: - static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs, + static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs, MMTPDataProviderFramework& aFramework ); /** @@ -48,43 +48,48 @@ public: /** - * Get all playlists from MPX database in the assigned store - * @param aStoreRoot, specify in which drive playlists are stored - * @param aPlaylists, return result array + * Get all abstract medias from MPX database in the assigned store + * @param aStoreRoot, specify in which drive abstract medias are stored + * @param aAbstractMedias, return result array + * @param aCategory, indicate the category of abstract medias */ - IMPORT_C void GetAllPlaylistL( const TDesC& aStoreRoot, - CMPXMediaArray** aPlaylists ); + IMPORT_C void GetAllAbstractMediaL( const TDesC& aStoreRoot, + CMPXMediaArray** aAbstractMedias, + TMPXGeneralCategory aCategory ); /** - * Get all references of specified playlist - * @param aPlaylist, specify of which reference should be get + * Get all references of specified abstract medias + * @param aAbstractMedia, specify of which reference should be get * @param aReferences, return result array which stored handles of all references */ - IMPORT_C void GetAllReferenceL( CMPXMedia* aPlaylist, + IMPORT_C void GetAllReferenceL( CMPXMedia* aAbstractMedia, CDesCArray& aReferences ); /** - * Get an playlist name from CMPXMedia object - * @param aPlaylist, specify the source - * @param aPlaylistName, return result + * Get an abstract media name from CMPXMedia object + * @param aAbstractMedia, specify the source + * @param aCategory, specify the category + * @return, name of the source, ownership transferred */ - IMPORT_C void GetPlaylistNameL( CMPXMedia* aPlaylist, TDes& aPlaylistName ); - + IMPORT_C HBufC* GetAbstractMediaNameL( CMPXMedia* aAbstractMedia, + TMPXGeneralCategory aCategory ); /** - * Add object (music, video and playlist) info to DB + * Add object (music, video, playlist and abstract album) info to DB * @param aFullFileName, full file name of file * @return void */ - void AddObjectL( const TDesC& aFullFileName, TBool aIsVideo = EFalse ); + void AddObjectL( const TDesC& aFullFileName, TUint aFormatCode, TUint aSubFormatCode ); /** - * Set playlist to DB - * @param aPlaylistFileName, full file name of playlist file + * Set abstract media to DB + * @param aAbstractMediaFileName, full file name of abstract media file * @param aRefFileArray, a array to store the full file name of media files + * @param aCategory, the category of abstract media * @return void */ - IMPORT_C void SetPlaylistL( const TDesC& aPlaylistFileName, - CDesCArray& aRefFileArray ); + IMPORT_C void SetAbstractMediaL( const TDesC& aAbstractMediaFileName, + CDesCArray& aRefFileArray, + TMPXGeneralCategory aCategory ); /** * Gets a piece of metadata from the collection @@ -140,8 +145,8 @@ * @parem aHeight, the height of an object in pixels to set */ void SetImageObjPropL( const TDesC& aFullFileName, - const TUint32 aWidth, - const TUint32 aHeight ); + const TUint32 aWidth, + const TUint32 aHeight ); /* * get image specific properties specific to videos @@ -150,9 +155,9 @@ * @parem aHeight, the height of an object in pixels to get */ void GetImageObjPropL( const TDesC& aFullFileName, - TUint32& aWidth, - TUint32& aHeight ); - + TUint32& aWidth, + TUint32& aHeight ); + /** * Get Modified object from DB * @param aStorageRoot, the root path of storage @@ -160,16 +165,16 @@ * @param aRefFileArray, a array to store the full file name of media files * @return void */ - IMPORT_C void GetModifiedContentL( const TDesC& aStorageRoot, + IMPORT_C void GetModifiedContentL( const TDesC& aStorageRoot, TInt& arrayCount, CDesCArray& aRefFileArray ); - + /** * Updated Music DB * @return void */ - IMPORT_C void UpdateMusicCollectionL(); - + IMPORT_C void UpdateMusicCollectionL(); + /* * Called when the MTP session is initialised */ @@ -179,35 +184,35 @@ * clean up db resource especially for video dp */ void CloseSessionL(); - + /** * Cleanup database */ IMPORT_C void CleanupDatabaseL(); - + /** * if the playlsit exist in the MPX DB * @param aSuid, the suid of playlsit */ TBool IsExistL( const TDesC& aSuid ); - + // related to dummy files /** * Add one dummy file to dummy files array */ IMPORT_C void AddDummyFileL( const TDesC& aDummyFileName ); - + /** * Delete one dummy file from dummy files array - */ + */ IMPORT_C void DeleteDummyFile( const TDesC& aDummyFileName ); - + /** * Create a Dummy File from the virtual playlist URI * @param aPlaylistName, specify the filename of the dummy file */ IMPORT_C void CreateDummyFile( const TDesC& aPlaylistName ); - + private: CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework ); @@ -215,7 +220,7 @@ void ConstructL(); TMPXGeneralCategory Category( const TUint aFormatCode ); - + /** * Remove all dummy file of which format is "pla", and leave the "m3u" */ @@ -227,11 +232,11 @@ CMmMtpDpMetadataMpxAccess* iMmMtpDpMetadataMpxAccess; CMmMtpDpMetadataVideoAccess* iMmMtpDpMetadataVideoAccess; TBool iOpenSession; - - MMTPDataProviderFramework& iFramework; - - CDesCArray* iPlaylistArray; - + + MMTPDataProviderFramework& iFramework; + + CDesCArray* iAbstractMediaArray; + }; #endif // CMMMTPDPMETADATAACCESSWRAPPER_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadatampxaccess.h --- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadatampxaccess.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadatampxaccess.h Sun Mar 14 13:11:48 2010 +0000 @@ -1,20 +1,19 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Meta data Mpx access -* -*/ - + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Meta data Mpx access + * + */ #ifndef CMMMTPDPMETADATAMPXACCESS_H #define CMMMTPDPMETADATAMPXACCESS_H @@ -23,16 +22,6 @@ #include "cmmmtpdpperflog.h" -// keep here to avoid warning on urel -_LIT( KMpxCollectionNewL, "MpxCollectionNewL" ); -_LIT( KMpxCollectionAddL, "MpxCollectionAddL" ); -_LIT( KMpxCollectionGetL, "MpxCollectionGetL" ); -_LIT( KMpxCollectionSetL, "MpxCollectionSetL" ); -_LIT( KMpxCollectionGetPlaylist, "MpxCollectionGetPlaylist" ); -_LIT( KMpxCollectionGetReference, "MpxCollectionGetReference" ); -_LIT( KMpxCollectionFindAllLValidate, "MpxCollectionValidate" ); -_LIT( KMpxCollectionFindAllLBeforeAdd, "KMpxCollectionFindAllLBeforeAdd" ); - // forward declacration class CMPXMedia; class CMTPObjectMetaData; @@ -50,158 +39,173 @@ } TMetadataTable; /** -* Controls access to the music MPX store database. Allows access to the -* information about any of the music stored in any of the MPX db's on any -* of the drives. Also supports deletions and insertions into the db. -*/ + * Controls access to the music MPX store database. Allows access to the + * information about any of the music stored in any of the MPX db's on any + * of the drives. Also supports deletions and insertions into the db. + */ class CMmMtpDpMetadataMpxAccess : public CBase { public: - static CMmMtpDpMetadataMpxAccess* NewL( RFs& aRfs, MMTPDataProviderFramework& aFramework ); + static CMmMtpDpMetadataMpxAccess* NewL( RFs& aRfs, + MMTPDataProviderFramework& aFramework ); /** - * Destructor - */ + * Destructor + */ ~CMmMtpDpMetadataMpxAccess(); public: /** - * Get all playlists from MPX database in the assigned store - * @param aStoreRoot, specify in which drive playlists are stored - * @param aPlaylists, return result array - */ - void GetAllPlaylistL( const TDesC& aStoreRoot, CMPXMediaArray** aPlaylists ); + * Get all abstract medias from MPX database in the assigned store + * @param aStoreRoot, specify in which drive abstract medias are stored + * @param aAbstractMedias, return result array + * @param aCategory, indicate the category of abstract medias + */ + void GetAllAbstractMediaL( const TDesC& aStoreRoot, + CMPXMediaArray** aAbstractMedias, + TMPXGeneralCategory aCategory ); /** - * Get all references of specified playlist - * @param aPlaylist, specify of which reference should be get - * @param aReferences, return result array which stored handles of all references - */ - void GetAllReferenceL( CMPXMedia* aPlaylist, CDesCArray& aReferences ); + * Get all references of specified abstract media + * @param aAbstractMedia, specify of which reference should be get + * @param aReferences, return result array which stored handles of all references + */ + void GetAllReferenceL( CMPXMedia* aAbstractMedia, + CDesCArray& aReferences ); /** - * Get an playlist name from CMPXMedia object - * @param aPlaylist, specify the source - * @param aPlaylistName, return result - */ - void GetPlaylistNameL( CMPXMedia* aPlaylist, TDes& aPlaylistName ); + * Get an abstract media name from CMPXMedia object + * @param aAbstractMedia, specify the source + * @param aCategory, specify the category + * @return, name of the source, ownership transferred + */ + HBufC* CMmMtpDpMetadataMpxAccess::GetAbstractMediaNameL( CMPXMedia* aAbstractMedia, + TMPXGeneralCategory aCategory ); /** - * Adds Songs info to Mpx DB - * @param aFullFileName, full file name of Media file - */ + * Adds Songs info to Mpx DB + * @param aFullFileName, full file name of Media file + */ void AddSongL( const TDesC& aFullFileName ); /** - * Adds Playlist to Mpx DB - * @param aFullFileName, full file name of Playlist file - */ - void AddPlaylistL( const TDesC& aFullFileName ); + * Adds abstract media to Mpx DB + * @param aFullFileName, full file name of abstract media file + * @param aCategory, indicate the category of abstract media + */ + void AddAbstractMediaL( const TDesC& aFullFileName, + TMPXGeneralCategory aCategory ); /** - * Set playlist to DB - * @param aPlaylistFileName, full file name of playlist file - * @param aRefFileArray, a array to store the full file name of media files - */ - void SetPlaylistL( const TDesC& aPlaylistFileName, - CDesCArray& aRefFileArray ); + * Set abstract media to DB + * @param aAbstractMediaFileName, full file name of abstract media file + * @param aRefFileArray, a array to store the full file name of media files + * @param aCategory, indicate the category of abstract media + */ + void SetAbstractMediaL( const TDesC& aAbstractMediaFileName, + CDesCArray& aRefFileArray, + TMPXGeneralCategory aCategory ); void GetObjectMetadataValueL( const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObjectMetaData ); + MMTPType& aNewData, + const CMTPObjectMetaData& aObjectMetaData ); /** - * Set object property and updated object in DB according property code, - * only for update, not for creation - * @param aPropCode, property code of aObjectMetaData - * @param aNewData, object property value which will be set into - * aObjectMetaData - * @param aObjectMetaData, owner of the property which should be - * updated into database - */ + * Set object property and updated object in DB according property code, + * only for update, not for creation + * @param aPropCode, property code of aObjectMetaData + * @param aNewData, object property value which will be set into + * aObjectMetaData + * @param aObjectMetaData, owner of the property which should be + * updated into database + */ void SetObjectMetadataValueL( const TUint16 aPropCode, - const MMTPType& aNewData, - const CMTPObjectMetaData& aObjectMetaData ); + const MMTPType& aNewData, + const CMTPObjectMetaData& aObjectMetaData ); /** - * Set object property and updated object in DB according property code, - * only for update, not for creation - * @param aPropCode, property code of aObjectMetaData - * @param aNewData, object property value which will be set into - * aObjectMetaData - * @param aSuid, full file name of object of which properties need to set - */ + * Set object property and updated object in DB according property code, + * only for update, not for creation + * @param aPropCode, property code of aObjectMetaData + * @param aNewData, object property value which will be set into + * aObjectMetaData + * @param aSuid, full file name of object of which properties need to set + */ void SetObjectMetadataValueL( const TUint16 aPropCode, - const MMTPType& aNewData, - const TDesC& aSuid ); + const MMTPType& aNewData, + const TDesC& aSuid ); - CMPXMedia* FindWMPMediaLC( TMPXAttributeData aWMPMediaID, TBool aFlag ); + CMPXMedia* FindWMPMediaLC( TMPXAttributeData aWMPMediaID, + TBool aFlag ); /** - * Update the Sync flag for those not synchronized, Update the Modified - * flag for those have been modified, and delete the stale records for - * files that have been deleted. - */ + * Update the Sync flag for those not synchronized, Update the Modified + * flag for those have been modified, and delete the stale records for + * files that have been deleted. + */ void UpdateMusicCollectionL(); /** - * Remove the file from MPX DB - * @param aFullFileName, the file to remove - * @param aCategory, the category of the file - */ - void DeleteObjectL( const TDesC& aFullFileName, TMPXGeneralCategory aCategory ); + * Remove the file from MPX DB + * @param aFullFileName, the file to remove + * @param aCategory, the category of the file + */ + void DeleteObjectL( const TDesC& aFullFileName, + TMPXGeneralCategory aCategory ); /** - * Rename the filename onto MPX DB - * @param aOldFileName, the old file to rename - * @param aNewFileName, the new file name - * @param aFormatCode, the format of object - */ - void RenameObjectL( const TDesC& aOldFileName, const TDesC& aNewFileName, - TUint aFormatCode ); + * Rename the filename onto MPX DB + * @param aOldFileName, the old file to rename + * @param aNewFileName, the new file name + * @param aFormatCode, the format of object + */ + void RenameObjectL( const TDesC& aOldFileName, + const TDesC& aNewFileName, + TUint aFormatCode ); /** - * Set current drive info - * @param aStorageRoot, current drive info - */ + * Set current drive info + * @param aStorageRoot, current drive info + */ void SetStorageRootL( const TDesC& aStorageRoot ); /** - * Get modified content - * @param arrayCount, count of modified content - * @param aModifiedcontent, modified files name list - */ - void GetModifiedContentL( TInt& arrayCount, CDesCArray& aModifiedcontent ); - + * Get modified content + * @param arrayCount, count of modified content + * @param aModifiedcontent, modified files name list + */ + void GetModifiedContentL( TInt& arrayCount, + CDesCArray& aModifiedcontent ); + /** - * if the playlsit exist in the MPX DB - * @param aSuid, the suid of playlsit - */ + * if the playlsit exist in the MPX DB + * @param aSuid, the suid of playlsit + */ TBool IsExistL( const TDesC& aSuid ); private: - CMmMtpDpMetadataMpxAccess( RFs& aFs, MMTPDataProviderFramework& aFramework ); + CMmMtpDpMetadataMpxAccess( RFs& aFs, + MMTPDataProviderFramework& aFramework ); void ConstructL(); void SetDefaultL( CMPXMedia& aMediaProp ); /** - * Set property value into MPX object according to property code, - * only used by member functions of this class. - * @param aPropCode, specify property code of aMediaProp - * @param aNewData, object property value which will be set into - * aObjectMetaData - * @param aObjectMetaData, owner of the property which should be - * inserted or updated into database - */ + * Set property value into MPX object according to property code, + * only used by member functions of this class. + * @param aPropCode, specify property code of aMediaProp + * @param aNewData, object property value which will be set into + * aObjectMetaData + * @param aObjectMetaData, owner of the property which should be + * inserted or updated into database + */ void SetMetadataValueL( const TUint16 aPropCode, - const MMTPType& aNewData, - CMPXMedia& aMediaProp ); + const MMTPType& aNewData, + CMPXMedia& aMediaProp ); - TMPXAttributeData MpxAttribFromPropL( const CMPXMedia& aMedia, - const TUint16 aPropCode ); + TMPXAttributeData MpxAttribFromPropL( const TUint16 aPropCode ); MMPXCollectionHelper* CollectionHelperL(); @@ -212,8 +216,8 @@ TBuf iStoreRoot; MMPXCollectionHelper* iCollectionHelper; - - MMTPDataProviderFramework& iFramework; + + MMTPDataProviderFramework& iFramework; #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) CMmMtpDpPerfLog* iPerfLog; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.h --- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.h Sun Mar 14 13:11:48 2010 +0000 @@ -38,47 +38,46 @@ class TMmMtpDpOverflowHandler : public TDesOverflow { - public: - - inline void SetOwner( CMmMtpDpPerfLog* aOwner ); - inline void Overflow( TDes& aDes ); - - private: - - CMmMtpDpPerfLog* iOwner; +public: + inline void SetOwner( CMmMtpDpPerfLog* aOwner ); + inline void Overflow( TDes& aDes ); + +private: + CMmMtpDpPerfLog* iOwner; + }; class CMmMtpDpPerfLog : public CBase { - public: - - inline static CMmMtpDpPerfLog* NewL( const TDesC& aTitle ); - inline ~CMmMtpDpPerfLog(); - - inline void Write( const TDesC& aText); - inline void WriteFormat( TRefByValue aFmt, ... ); +public: + + inline static CMmMtpDpPerfLog* NewL( const TDesC& aTitle ); + inline ~CMmMtpDpPerfLog(); + + inline void Write( const TDesC& aText ); + inline void WriteFormat( TRefByValue aFmt, ... ); + + inline void Start( const TDesC& aDescription ); + inline void Stop( const TDesC& aDescription ); + +private: - inline void Start( const TDesC& aDescription ); - inline void Stop( const TDesC& aDescription ); - - private: - - inline CMmMtpDpPerfLog(); - inline void ConstructL( const TDesC& aTitle ); + inline CMmMtpDpPerfLog(); + inline void ConstructL( const TDesC& aTitle ); + +private: + + TMmMtpDpOverflowHandler iOverflowHandler; - private: - - TMmMtpDpOverflowHandler iOverflowHandler; + HBufC16* iTitle; + CDesC16ArrayFlat iDescription; + CArrayFixFlat iStartTick; + CArrayFixFlat iTotalTime; + CArrayFixFlat iTotalUsage; - HBufC16* iTitle; - CDesC16ArrayFlat iDescription; - CArrayFixFlat iStartTick; - CArrayFixFlat iTotalTime; - CArrayFixFlat iTotalUsage; - - TInt iNTickPeriod; - TInt iLastIndex; - + TInt iNTickPeriod; + TInt iLastIndex; + }; #include "cmmmtpdpperflog.inl" diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.inl --- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.inl Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.inl Sun Mar 14 13:11:48 2010 +0000 @@ -189,7 +189,7 @@ { WriteFormat( _L( "%S-%S, usage = %u, last time = %u.%S ms, total time = %u.%S ms, average time = %u.%S ms" ), iTitle, - &iDescription[index], + &iDescription[index], iTotalUsage[index], lastTimeValue, &lastTimeDecimal, @@ -202,7 +202,7 @@ { WriteFormat( _L( "%S-%S, usage = %u, last time = %u.%S ms, total time = %u%u.%S ms, average time = %u.%S ms" ), iTitle, - &iDescription[index], + &iDescription[index], iTotalUsage[index], lastTimeValue, &lastTimeDecimal, diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/mmmtpdpconfig.h --- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdpconfig.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdpconfig.h Sun Mar 14 13:11:48 2010 +0000 @@ -20,23 +20,27 @@ #define MMMTPDPCONFIG_H class CMmMtpDpMetadataAccessWrapper; +class CPropertySettingUtility; +class CDescriptionUtility; class MMmMtpDpConfig { public: /** * Get supported format from special data provider - * @param aArray The array which is used to store supported format + * @return The array which is used to store supported format */ virtual const RArray* GetSupportedFormat() const = 0; /** - * + * Get the arry of property code which is inline with the format code + * @return The array of what specified format supported */ virtual const RArray* GetSupportedPropertiesL( TUint32 aFormatCode ) const = 0; /** - * + * Get the array of property code what dp supported all + * @return The array of what dp supported */ virtual const RArray* GetAllSupportedProperties() const = 0; @@ -46,10 +50,22 @@ */ virtual TUint32 GetDefaultStorageIdL() const = 0; - /* - * + /** + * Get db handler wrapper + * @return wrapper references */ virtual CMmMtpDpMetadataAccessWrapper& GetWrapperL() = 0; + + /** + * Get the utility to setting properties + */ + virtual CPropertySettingUtility* PropSettingUtility() = 0; + + /** + * Get the utiltiy to setting descriptions + */ + virtual CDescriptionUtility* DescriptionUtility() = 0; + }; #endif // MMMTPDPCONFIG_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h --- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h Sun Mar 14 13:11:48 2010 +0000 @@ -45,6 +45,13 @@ static TBool HasMetadata( TUint16 aObjFormatCode ); /** + * Utility function to decide if there is any reference + * @param aObjFormatCode, object format code + * @return TBool for decide if there are some references + */ + static TBool HasReference( TUint16 aObjFormatCode ); + + /** * Utility function to decide if the file is video. * @param aFullFileName, the full file name * @return TBool for decide if the file is video @@ -61,6 +68,15 @@ static TBool IsVideoL( const TDesC& aFullFileName, const MMTPDataProviderFramework& aFramework ); /** + * Utility function to decide if the file is video. + * For internal use, this is fast version by querying framework DB + * @param aFormatCode, + * @param aSubFormatCode, + * @return TBool for decide if the file is video + */ + static TBool IsVideoL( TUint aFormatCode, TUint aSubFormatCode ); + + /** * Check the filename length to see if it exceeds Symbian 256 limit. * @param aPathName, the path name of the file * @param aFileName, the file to be check diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/inc/tobjectdescription.h --- a/mmappcomponents/mmmtpdataprovider/inc/tobjectdescription.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/inc/tobjectdescription.h Sun Mar 14 13:11:48 2010 +0000 @@ -32,7 +32,7 @@ enum TGroupCodeType { - EGroupCodeGeneral = 0x00000001, + EGroupCodeGeneral = 0x00000001, EGroupCodeMediaDB = 0x00FF0000, EGroupCodeNotDefined = 0xFFFFFFFF // TODO: need to reconsider }; @@ -45,54 +45,55 @@ static const TObjectDescription KPropGroupMapTable[] = { - // First group, mandatory for all - { EMTPObjectPropCodeStorageID, EGroupCodeGeneral }, - { EMTPObjectPropCodeObjectFormat, EGroupCodeGeneral }, + // The first group, mandatory for all + { EMTPObjectPropCodeStorageID, EGroupCodeGeneral }, + { EMTPObjectPropCodeObjectFormat, EGroupCodeGeneral }, { EMTPObjectPropCodeProtectionStatus, EGroupCodeGeneral }, - { EMTPObjectPropCodeObjectSize, EGroupCodeGeneral }, - { EMTPObjectPropCodeObjectFileName, EGroupCodeGeneral }, - { EMTPObjectPropCodeParentObject, EGroupCodeGeneral }, + { EMTPObjectPropCodeObjectSize, EGroupCodeGeneral }, + { EMTPObjectPropCodeObjectFileName, EGroupCodeGeneral }, + { EMTPObjectPropCodeParentObject, EGroupCodeGeneral }, { EMTPObjectPropCodePersistentUniqueObjectIdentifier, - EGroupCodeGeneral }, - { EMTPObjectPropCodeNonConsumable, EGroupCodeGeneral }, + EGroupCodeGeneral }, + { EMTPObjectPropCodeNonConsumable, EGroupCodeGeneral }, - // First group, addtional for all - { EMTPObjectPropCodeDateCreated, EGroupCodeGeneral }, - { EMTPObjectPropCodeDateModified, EGroupCodeGeneral }, + // The first group, addtional for all + { EMTPObjectPropCodeDateCreated, EGroupCodeGeneral }, + { EMTPObjectPropCodeDateModified, EGroupCodeGeneral }, - // Second group, additional for all - { EMTPObjectPropCodeName, EGroupCodeMediaDB }, - { EMTPObjectPropCodeDateAdded, EGroupCodeMediaDB }, + // The second group, additional for all + { EMTPObjectPropCodeName, EGroupCodeMediaDB }, + { EMTPObjectPropCodeDateAdded, EGroupCodeMediaDB }, - // Second group, mandatory for audio - { EMTPObjectPropCodeArtist, EGroupCodeMediaDB }, - { EMTPObjectPropCodeTrack, EGroupCodeMediaDB }, - { EMTPObjectPropCodeGenre, EGroupCodeMediaDB }, - { EMTPObjectPropCodeAlbumName, EGroupCodeMediaDB }, - { EMTPObjectPropCodeSampleRate, EGroupCodeMediaDB }, + // The second group, mandatory for audio + { EMTPObjectPropCodeArtist, EGroupCodeMediaDB }, + { EMTPObjectPropCodeTrack, EGroupCodeMediaDB }, + { EMTPObjectPropCodeGenre, EGroupCodeMediaDB }, + { EMTPObjectPropCodeAlbumName, EGroupCodeMediaDB }, + { EMTPObjectPropCodeSampleRate, EGroupCodeMediaDB }, { EMTPObjectPropCodeNumberOfChannels, EGroupCodeMediaDB }, - { EMTPObjectPropCodeAudioWAVECodec, EGroupCodeMediaDB }, - { EMTPObjectPropCodeAudioBitRate, EGroupCodeMediaDB }, - { EMTPObjectPropCodeDuration, EGroupCodeMediaDB }, + { EMTPObjectPropCodeAudioWAVECodec, EGroupCodeMediaDB }, + { EMTPObjectPropCodeAudioBitRate, EGroupCodeMediaDB }, + { EMTPObjectPropCodeDuration, EGroupCodeMediaDB }, { EMTPObjectPropCodeOriginalReleaseDate, EGroupCodeMediaDB }, - { EMTPObjectPropCodeDescription, EGroupCodeMediaDB }, - { EMTPObjectPropCodeComposer, EGroupCodeMediaDB }, + { EMTPObjectPropCodeDescription, EGroupCodeMediaDB }, + { EMTPObjectPropCodeComposer, EGroupCodeMediaDB }, - // Second group, mandatory for video - { EMTPObjectPropCodeWidth, EGroupCodeMediaDB }, - { EMTPObjectPropCodeHeight, EGroupCodeMediaDB }, - { EMTPObjectPropCodeUseCount, EGroupCodeMediaDB }, - { EMTPObjectPropCodeScanType, EGroupCodeMediaDB }, + // The second group, mandatory for video + { EMTPObjectPropCodeWidth, EGroupCodeMediaDB }, + { EMTPObjectPropCodeHeight, EGroupCodeMediaDB }, + { EMTPObjectPropCodeUseCount, EGroupCodeMediaDB }, + { EMTPObjectPropCodeScanType, EGroupCodeMediaDB }, { EMTPObjectPropCodeVideoFourCCCodec, EGroupCodeMediaDB }, - { EMTPObjectPropCodeVideoBitRate, EGroupCodeMediaDB }, + { EMTPObjectPropCodeVideoBitRate, EGroupCodeMediaDB }, { EMTPObjectPropCodeFramesPerThousandSeconds, EGroupCodeMediaDB }, { EMTPObjectPropCodeKeyFrameDistance, EGroupCodeMediaDB }, - { EMTPObjectPropCodeEncodingProfile, EGroupCodeMediaDB }, + { EMTPObjectPropCodeEncodingProfile, EGroupCodeMediaDB }, - // Second group, additional for video - { EMTPObjectPropCodeParentalRating, EGroupCodeMediaDB }, - { EMTPObjectPropCodeDRMStatus, EGroupCodeMediaDB }, - { EMTPExtObjectPropCodeOmaDrmStatus, EGroupCodeMediaDB } + // The second group, additional for video + { EMTPObjectPropCodeParentalRating, EGroupCodeMediaDB }, + { EMTPObjectPropCodeDRMStatus, EGroupCodeMediaDB }, + { EMTPExtObjectPropCodeOmaDrmStatus, EGroupCodeMediaDB } }; #endif // TOBJECTDESCRIPTION_H + diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpstub.pkg Binary file mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpstub.pkg has changed diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpupdate.pkg Binary file mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpupdate.pkg has changed diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpupdatedebug.pkg Binary file mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpupdatedebug.pkg has changed diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/data/abstractmediamtpdataprovider_config.rss --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/data/abstractmediamtpdataprovider_config.rss Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/data/abstractmediamtpdataprovider_config.rss Sun Mar 14 13:11:48 2010 +0000 @@ -11,13 +11,12 @@ * * Contributors: * -* Description: DP configuration information for abstract media dp on armv5 platform +* Description: DP configuration information for abstract media dp * */ #include -#include "abstractmediamtpdataprovider_config.rh" RESOURCE MTP_DATA_PROVIDER dpConfig { @@ -27,14 +26,6 @@ supported_modes = KMTPModeMTP; server_name = ""; server_image_name = ""; - opaque_resource = "folderConfig"; + opaque_resource = 0; enumeration_phase = 12; } - -RESOURCE ABSTRACTMEDIAMTPDATAPROVIDER_CONFIG folderConfig - { - abstractmedia_drive = 4; - } - - - diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/group/abstractmediamtpdataprovider.mmp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/group/abstractmediamtpdataprovider.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/group/abstractmediamtpdataprovider.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -40,19 +40,16 @@ SOURCE abstractmediamtpdataprovidercontrollerimp.cpp SOURCE abstractmediamtpdataproviderprocessor.cpp SOURCE cabstractmediamtpdataproviderenumerator.cpp -SOURCE cabstractmediamtpdataprovidergetobjectpropdesc.cpp -SOURCE cabstractmediamtpdataprovidergetinterdependentpropdesc.cpp SOURCE cabstractmediamtpdataprovidergetobjectpropvalue.cpp SOURCE cabstractmediamtpdataprovidergetobjectproplist.cpp SOURCE cabstractmediamtpdataprovidersetobjectpropvalue.cpp -SOURCE cabstractmediamtpdataprovidersetobjectproplist.cpp SOURCE cabstractmediamtpdataprovidersetobjectreferences.cpp SOURCE cabstractmediamtpdataproviderabstractmediapreference.cpp SOURCE cabstractmediamtpdataprovidercopyobject.cpp SOURCE cabstractmediamtpdataprovidermoveobject.cpp SOURCE cabstractmediamtpdataproviderrenameobject.cpp -SOURCE cabstractmediamtpdataprovidersendobject.cpp -SOURCE cabstractmediamtpdataprovidergetformatcapabilities.cpp +SOURCE cabstractmediamtpdataproviderpropertysettingutility.cpp +SOURCE cabstractmediamtpdataproviderdescriptionutility.cpp SOURCEPATH ../data diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataprovider_config.rh --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataprovider_config.rh Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for project abstractmediadp -* -*/ - - -#ifndef ABSTRACTMEDIAMTPDATAPROVIDER_RH -#define ABSTRACTMEDIAMTPDATAPROVIDER_RH - -// -------------------------------------------------------------------- -// Defines the resource type for abstractmedia dp specific configuration data -// -------------------------------------------------------------------- -// -STRUCT ABSTRACTMEDIAMTPDATAPROVIDER_CONFIG - { - LONG abstractmedia_drive; // Symbian drive number @see TDrive - LTEXT abstractmedia_folder_root; - LTEXT folder_exclusion_list[]; // What to exclude - } - -#endif // ABSTRACTMEDIAMTPDATAPROVIDER_RH diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderconst.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderconst.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderconst.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,11 +11,10 @@ * * Contributors: * -* Description: +* Description: * */ - #ifndef ABSTRACTMEDIAMTPDATAPROVIDERCONST_H #define ABSTRACTMEDIAMTPDATAPROVIDERCONST_H @@ -55,39 +54,14 @@ EMTPOpCodeGetObjectPropList, EMTPOpCodeSetObjectPropList, EMTPOpCodeGetInterdependentPropDesc, - + EMTPExtOpCodeAbstractMediaPreference, // 0x9203 - + EMTPOpCodeCopyObject, EMTPOpCodeMoveObject, - - EMTPOpCodeSendObjectPropList, + + EMTPOpCodeSendObjectPropList, EMTPOpCodeGetFormatCapabilities }; -#if 0 -/** -* define all the object properties that are supported by the abstract media data provider -*/ -static const TUint16 KAbstractMediaMtpDataProviderSupportedProperties[] = - { - // Mandatory for all objects - EMTPObjectPropCodeStorageID, - EMTPObjectPropCodeObjectFormat, - EMTPObjectPropCodeProtectionStatus, - EMTPObjectPropCodeObjectSize, - EMTPObjectPropCodeObjectFileName, - EMTPObjectPropCodeParentObject, - EMTPObjectPropCodePersistentUniqueObjectIdentifier, - EMTPObjectPropCodeName, - EMTPObjectPropCodeNonConsumable, - - // additional for all - EMTPObjectPropCodeDateAdded, - EMTPObjectPropCodeDateCreated, - EMTPObjectPropCodeDateModified, - }; -#endif - - #endif // ABSTRACTMEDIAMTPDATAPROVIDERCONST_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderprocessor.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderprocessor.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderprocessor.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovider.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovider.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovider.h Sun Mar 14 13:11:48 2010 +0000 @@ -25,7 +25,6 @@ #include "mmmtpenumerationcallback.h" #include "mmmtpdpconfig.h" - // Forward declaration class MMmRequestProcessor; class CAbstractMediaMtpDataProviderEnumerator; @@ -66,10 +65,21 @@ TUint32 GetDefaultStorageIdL() const; /** - * @return the reference of CMmMtpDpMetadataAccessWrapper to enumerator + * Get db handler wrapper + * @return wrapper references */ CMmMtpDpMetadataAccessWrapper& GetWrapperL(); + /** + * @return The utility to setting properties + */ + CPropertySettingUtility* PropSettingUtility(); + + /** + * @return The utiltiy to setting descriptions + */ + CDescriptionUtility* DescriptionUtility(); + protected: // from CMTPDataProviderPlugin void Cancel(); @@ -97,7 +107,7 @@ /** * Notify the data provider that the session has been closed - * @param aConnection The connection of the sesssion + * @param aSession The connection of the sesssion */ void SessionClosedL( const TMTPNotificationParamsSessionChange& aSession ); @@ -175,6 +185,7 @@ RArray iPendingEnumerations; TInt iActiveProcessor; + TBool iActiveProcessorRemoved; CAbstractMediaMtpDataProviderRenameObject *iRenameObject; TBool iIsSessionOpen; @@ -183,6 +194,9 @@ RArray iSupportedProperties; + CPropertySettingUtility* iPropSettingUtility; + CDescriptionUtility* iDescriptionUtility; + }; #endif // CABSTRACTMEDIAMTPDATAPROVIDER_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderabstractmediapreference.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderabstractmediapreference.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderabstractmediapreference.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidercopyobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidercopyobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidercopyobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -65,10 +65,6 @@ TUint32 aHandle, const CMTPObjectMetaData& aObject ); - TMTPResponseCode ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - }; #endif // CABSTRACTMEDIAMTPDATAPROVIDERCOPYOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderdescriptionutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderdescriptionutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Abstract media dp specific property description construction utility. +* Used by all request processors which related to property description +* +*/ + +#ifndef CABSTRACTMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H +#define CABSTRACTMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H + +#include "cdescriptionutility.h" + +class CMTPTypeInterdependentPropDesc; +class CMTPTypeObjectPropDesc; + +class CAbstractMediaMtpDataProviderDescriptionUtility : public CDescriptionUtility + { +public: + static CAbstractMediaMtpDataProviderDescriptionUtility* NewL(); + + ~CAbstractMediaMtpDataProviderDescriptionUtility(); + +private: + CAbstractMediaMtpDataProviderDescriptionUtility(); + +public: + /** + * Construct media dp specific interdependent property description. + * according to assigned format code. + * @param aFormatCode + * @return Interdependent property description dataset. + */ + CMTPTypeInterdependentPropDesc* NewInterdepentPropDescL( MMmMtpDpConfig& aDpConfig, TUint aFormatCode ); + + /** + * Construct media dp specific property description + * according to assigned format code and property code. + * @param aFormatCode + * @param aPropCode + * @return Property description dataset. + */ + CMTPTypeObjectPropDesc* NewSpecificPropDescL( TUint aFormatCode, TUint16 aPropCode ); + +private: + // Example for further extension + /** + * Construct audio wave codec property description. + * @param aFormatCode + * @return Property description dataset of audio wave codec. + */ + // CMTPTypeObjectPropDesc* NewAudioWaveCodecPropDescL( TUint aFormatCode ); + + }; + +#endif // CABSTRACTMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderenumerator.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderenumerator.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderenumerator.h Sun Mar 14 13:11:48 2010 +0000 @@ -25,15 +25,6 @@ #include "mmmtpenumerationcallback.h" #include "cmmmtpdpperflog.h" -// keep here to avoid warning on urel -_LIT( KMpxGetAllPlaylist, "MpxGetAllPlaylist" ); -_LIT( KMpxGetPlaylistName, "MpxGetPlaylistName" ); -_LIT( KMpxQueryPlaylistReference, "MpxQueryPlaylistReference" ); -_LIT( KObjectManagerObjectUid, "ObjectManagerObjectUid" ); -_LIT( KObjectManagerInsert, "ObjectManagerInsert" ); -_LIT( KObjectManagerHandle, "ObjectManagerHandle" ); -_LIT( KReferenceManagerSetReference, "ReferenceManagerSetReference" ); - // Forward declarations class MMTPDataProviderFramework; class MMTPObjectMgr; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetformatcapabilities.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetformatcapabilities.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef CABSTRACTMEDIAMTPDATAPROVIDERGETFORMATCAPABILITIES_H -#define CABSTRACTMEDIAMTPDATAPROVIDERGETFORMATCAPABILITIES_H - -#include "cgetformatcapabilities.h" - -// forward declaration -class MMmMtpDpConfig; -class CMTPTypeObjectPropDesc; -class CMTPTypeInterdependentPropDesc; -class CMTPTypeObjectPropDesc; -class CMTPTypeString; -class CGetFormatCapabilities; - -/** -* Defines abstract media data provider GetFormatCapabilities -*/ -class CAbstractMediaMtpDataProviderGetFormatCapabilities : public CGetFormatCapabilities - { -public: - - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - -/* * - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - - static MMmRequestProcessor* NewLC( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig );*/ - - /** - * Destructor - */ - ~CAbstractMediaMtpDataProviderGetFormatCapabilities(); - -protected: - // from CGetFormatCapabilities, override from baseclass - - /** - * Service specific object property - * @param aPropCode, The prop code - * @return MTPType object propdesc - */ - CMTPTypeObjectPropDesc* ServiceSpecificPropertyDescL( TUint16 aPropCode ); - - /** - * Service interdepent propdesc - * @param aFormatCode, The format code - * @return MTPTypeInterdependentPropDesc - */ - void ServiceInterdepentPropDescL(); - -private: - - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CAbstractMediaMtpDataProviderGetFormatCapabilities( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * two-phase construction - */ - void ConstructL(); - }; - -#endif // CAbstractMediaMTPDATAPROVIDERGETFORMATCAPABILITIES_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetinterdependentpropdesc.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetinterdependentpropdesc.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef CABSTRACTMEDIAMTPDATAPROVIDERGETINTERDEPENTENTPROPDESC_H -#define CABSTRACTMEDIAMTPDATAPROVIDERGETINTERDEPENTENTPROPDESC_H - -#include "crequestprocessor.h" - -class CMTPTypeInterdependentPropDesc; -class MMmMtpDpConfig; - -/** -* Defines abstract media data provider GetInterdependentPropDesc request processor -*/ -class CAbstractMediaMtpDataProviderGetInterdependentPropDesc: public CRequestProcessor - { -public: - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CAbstractMediaMtpDataProviderGetInterdependentPropDesc(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - */ - CAbstractMediaMtpDataProviderGetInterdependentPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection ); - - /** - * two-phase construction - */ - void ConstructL(); - -protected: - // from CRequestProcessor - TMTPResponseCode CheckRequestL(); - - void ServiceL(); - -private: - void ServiceAudioWaveCodecL(); - - void ServiceAudioBitrateL(); - - void SetFormForResponseL( TUint16 aPropertyCode, const MMTPType& aForm ); - -private: - /** Dataset to store the prop descriptions*/ - CMTPTypeInterdependentPropDesc* iDataset; - - TUint32 iFormatCode; - - }; - -#endif // CABSTRACTMEDIAMTPDATAPROVIDERGETINTERDEPENTENTPROPDESC_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetobjectpropdesc.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetobjectpropdesc.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef CABSTRACTMEDIAMTPDATAPROVIDERGETOBJECTPROPDESC_H -#define CABSTRACTMEDIAMTPDATAPROVIDERGETOBJECTPROPDESC_H - -#include "cgetobjectpropdesc.h" - -/** -* Defines abstract media data provider GetObjectPropDesc request processor -*/ -class CAbstractMediaMtpDataProviderGetObjectPropDesc: public CGetObjectPropDesc - { -public: - - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CAbstractMediaMtpDataProviderGetObjectPropDesc(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CAbstractMediaMtpDataProviderGetObjectPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * second-phase construction - */ - void ConstructL(); - -protected: - // from CGetObjectPropDesc - void ServiceSpecificObjectPropertyL( TUint16 aPropCode ); - - }; - -#endif // CABSTRACTMEDIAMTPDATAPROVIDERGETOBJECTPROPDESC_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidermoveobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidermoveobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidermoveobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -67,10 +67,6 @@ TUint32 aHandle, const CMTPObjectMetaData& aObject ); - TMTPResponseCode ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - }; #endif // CABSTRACTMEDIAMTPDATAPROVIDERMOVEOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderpropertysettingutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderpropertysettingutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + + +#ifndef CABSTRACTMEDIAMTPDATAPROVIDERPROPERTYSETTINGUTILITY_H +#define CABSTRACTMEDIAMTPDATAPROVIDERPROPERTYSETTINGUTILITY_H + +#include "cpropertysettingutility.h" + +/** +* Defines media data provider SetObjectPropsList request processor +*/ +class CAbstractMediaMtpDataProviderPropertySettingUtility: public CPropertySettingUtility + { +public: + /** + * @param aFramework, The data provider framework + * @param aConnection, The connection from which the request comes + * @param aWrapper Medadata access + * @return A pointer to the created request processor object + */ + static CAbstractMediaMtpDataProviderPropertySettingUtility* NewL(); + + /** + * Destructor + */ + ~CAbstractMediaMtpDataProviderPropertySettingUtility(); + +private: + /** + * Standard C++ Constructor + * @param aFramework, The data provider framework + * @param aConnection, The connection from which the request comes + * @param aWrapper Medadata access + */ + CAbstractMediaMtpDataProviderPropertySettingUtility(); + +protected: + TMTPResponseCode SetSpecificObjectPropertyL( MMmMtpDpConfig& aDpConfig, + TUint16 aPropCode, + const CMTPObjectMetaData& aObject, + const CMTPTypeObjectPropListElement& aElement ); + + }; + +#endif // CABSTRACTMEDIAMTPDATAPROVIDERPROPERTYSETTINGUTILITY_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersendobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersendobject.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: * -*/ - -#ifndef CABSTRACTMEDIAMTPDATAPROVIDERSENDOBJECT_H_ -#define CABSTRACTMEDIAMTPDATAPROVIDERSENDOBJECT_H_ - -#include "csendobject.h" - -/** -* Defines media data provider SetObjectPropsList request processor -*/ -class CAbstractMediaMtpDataProviderSendObject: public CSendObject - { -public: - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CAbstractMediaMtpDataProviderSendObject(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CAbstractMediaMtpDataProviderSendObject( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * 2nd Phase Constructor - */ - void ConstructL(); - -protected: - // from CSendObjectInfo - TMTPResponseCode SetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - - TMTPResponseCode CheckSepecificPropType( TUint16 aPropCode, TUint16 aDataType ); - - TInt HandleSpecificWrapperError(TInt aError, - const CMTPObjectMetaData& aObject); - - }; - -#endif /*CABSTRACTMEDIAMTPDATAPROVIDERSENDOBJECT_H_*/ diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectproplist.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectproplist.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: - * -*/ - - -#ifndef CABSTRACTMEDIAMTPDATAPROVIDERSETOBJECTPROPLIST_H -#define CABSTRACTMEDIAMTPDATAPROVIDERSETOBJECTPROPLIST_H - -#include "csetobjectproplist.h" - -class MMmMtpDpConfig; - -/** -* Defines abstract media data provider SetObjectPropList request processor -*/ -class CAbstractMediaMtpDataProviderSetObjectPropList : public CSetObjectPropList - { -public: - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CAbstractMediaMtpDataProviderSetObjectPropList(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CAbstractMediaMtpDataProviderSetObjectPropList( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * 2nd Phase Constructor - */ - void ConstructL(); - -protected: - // from CSetObjectPropList - TMTPResponseCode ServiceSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - - TInt HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& aObject); - - }; - -#endif // CABSTRACTMEDIAMTPDATAPROVIDERSETOBJECTPROPLIST_H - diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectreferences.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectreferences.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectreferences.h Sun Mar 14 13:11:48 2010 +0000 @@ -69,9 +69,9 @@ * @param aRefFileArray the array of file names, to */ void DoSetObjectReferencesL( CMmMtpDpMetadataAccessWrapper& aWrapper, - TUint16 aObjectFormat, - const TDesC& aSrcFileName, - CDesCArray& aRefFileArray ); + TUint16 aObjectFormat, + const TDesC& aSrcFileName, + CDesCArray& aRefFileArray ); }; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataprovidercontrollerimp.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataprovidercontrollerimp.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataprovidercontrollerimp.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -26,15 +26,14 @@ // static const TImplementationProxy ImplementationTable[] = { - {{0x10207C53}, (TProxyNewLPtr) ( CAbstractMediaMtpDataProvider::NewL )} + { { 0x10207C53 }, ( TProxyNewLPtr ) ( CAbstractMediaMtpDataProvider::NewL ) } }; // ----------------------------------------------------------------------------- // ECOM entry point // ----------------------------------------------------------------------------- // -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) { aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); return ImplementationTable; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataproviderprocessor.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataproviderprocessor.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataproviderprocessor.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -28,15 +28,15 @@ #include "abstractmediamtpdataproviderconst.h" #include "cgetobjectpropssupported.h" -#include "cabstractmediamtpdataprovidergetobjectpropdesc.h" -#include "cabstractmediamtpdataprovidergetinterdependentpropdesc.h" +#include "cgetobjectpropdesc.h" +#include "cgetinterdependentpropdesc.h" #include "cgetobject.h" #include "cgetobjectinfo.h" -#include "cabstractmediamtpdataprovidersendobject.h" +#include "csendobject.h" #include "cabstractmediamtpdataprovidergetobjectpropvalue.h" #include "cabstractmediamtpdataprovidergetobjectproplist.h" #include "cabstractmediamtpdataprovidersetobjectpropvalue.h" -#include "cabstractmediamtpdataprovidersetobjectproplist.h" +#include "csetobjectproplist.h" #include "cgetobjectreferences.h" #include "cabstractmediamtpdataprovidersetobjectreferences.h" #include "cdeleteobject.h" @@ -44,33 +44,32 @@ #include "cabstractmediamtpdataprovidermoveobject.h" #include "cgetpartialobject.h" #include "cabstractmediamtpdataproviderabstractmediapreference.h" -#include "cabstractmediamtpdataprovidergetformatcapabilities.h" +#include "cgetformatcapabilities.h" /** A mapping table from the operation code to the request processor factory method */ const TAbstractMediaMtpDataProviderRequestProcessorEntry KAbstractMediaMtpDataProviderRequestProcessorTable[] = { - {EMTPOpCodeGetObjectPropsSupported, CGetObjectPropsSupported::NewL}, //Get Supported Props - {EMTPOpCodeGetObjectPropDesc, CAbstractMediaMtpDataProviderGetObjectPropDesc::NewL}, //Get Props Description - {EMTPOpCodeGetInterdependentPropDesc, CAbstractMediaMtpDataProviderGetInterdependentPropDesc::NewL}, - {EMTPOpCodeGetObjectInfo, CGetObjectInfo::NewL}, //GetObjectInfo - {EMTPOpCodeGetObject, CGetObject::NewL}, //GetObject - {EMTPOpCodeGetObjectPropValue, CAbstractMediaMtpDataProviderGetObjectPropValue::NewL}, - {EMTPOpCodeGetObjectPropList, CAbstractMediaMtpDataProviderGetObjectPropList::NewL}, //GetObjectPropList - {EMTPOpCodeSendObjectInfo, CAbstractMediaMtpDataProviderSendObject::NewL}, //SendObjectInfo (routed to SendObject) - {EMTPOpCodeSendObject, CAbstractMediaMtpDataProviderSendObject::NewL}, //SendObject - {EMTPOpCodeSendObjectPropList, CAbstractMediaMtpDataProviderSendObject::NewL}, // SendobjectPropList (routed to SendObject) - {EMTPOpCodeSetObjectPropValue, CAbstractMediaMtpDataProviderSetObjectPropValue::NewL}, - {EMTPOpCodeSetObjectPropList, CAbstractMediaMtpDataProviderSetObjectPropList::NewL}, //SetObjectPropList - {EMTPOpCodeGetObjectReferences, CGetObjectReferences::NewL}, //Get Object References - {EMTPOpCodeSetObjectReferences, CAbstractMediaMtpDataProviderSetObjectReferences::NewL}, //Set Object References - {EMTPOpCodeDeleteObject, CDeleteObject::NewL}, //DeleteObject - {EMTPOpCodeCopyObject, CAbstractMediaMtpDataProviderCopyObject::NewL}, // Copy Object - {EMTPOpCodeMoveObject, CAbstractMediaMtpDataProviderMoveObject::NewL}, // Move Object - {EMTPOpCodeGetPartialObject, CGetPartialObject::NewL}, //GetPartialObject - {EMTPExtOpCodeAbstractMediaPreference, CAbstractMediaMtpDataProviderAbstractMediaPreference::NewL}, // WMPReportSyncOnlyAbstractMedias - {EMTPOpCodeGetFormatCapabilities, CAbstractMediaMtpDataProviderGetFormatCapabilities::NewL} // GetFormatCapabilities - + { EMTPOpCodeGetObjectPropsSupported, CGetObjectPropsSupported::NewL }, //Get Supported Props + { EMTPOpCodeGetObjectPropDesc, CGetObjectPropDesc::NewL }, //Get Props Description + { EMTPOpCodeGetInterdependentPropDesc, CGetInterdependentPropDesc::NewL }, + { EMTPOpCodeGetObjectInfo, CGetObjectInfo::NewL }, //GetObjectInfo + { EMTPOpCodeGetObject, CGetObject::NewL }, //GetObject + { EMTPOpCodeGetObjectPropValue, CAbstractMediaMtpDataProviderGetObjectPropValue::NewL }, + { EMTPOpCodeGetObjectPropList, CAbstractMediaMtpDataProviderGetObjectPropList::NewL }, //GetObjectPropList + { EMTPOpCodeSendObjectInfo, CSendObject::NewL }, //SendObjectInfo (routed to SendObject) + { EMTPOpCodeSendObject, CSendObject::NewL }, //SendObject + { EMTPOpCodeSendObjectPropList, CSendObject::NewL }, // SendobjectPropList (routed to SendObject) + { EMTPOpCodeSetObjectPropValue, CAbstractMediaMtpDataProviderSetObjectPropValue::NewL }, + { EMTPOpCodeSetObjectPropList, CSetObjectPropList::NewL }, //SetObjectPropList + { EMTPOpCodeGetObjectReferences, CGetObjectReferences::NewL }, //Get Object References + { EMTPOpCodeSetObjectReferences, CAbstractMediaMtpDataProviderSetObjectReferences::NewL }, //Set Object References + { EMTPOpCodeDeleteObject, CDeleteObject::NewL }, //DeleteObject + { EMTPOpCodeCopyObject, CAbstractMediaMtpDataProviderCopyObject::NewL }, // Copy Object + { EMTPOpCodeMoveObject, CAbstractMediaMtpDataProviderMoveObject::NewL }, // Move Object + { EMTPOpCodeGetPartialObject, CGetPartialObject::NewL }, //GetPartialObject + { EMTPExtOpCodeAbstractMediaPreference, CAbstractMediaMtpDataProviderAbstractMediaPreference::NewL }, // WMPReportSyncOnlyAbstractMedias + { EMTPOpCodeGetFormatCapabilities, CGetFormatCapabilities::NewL } // GetFormatCapabilities }; // ----------------------------------------------------------------------------- diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovider.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovider.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovider.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -38,6 +38,8 @@ #include "cabstractmediamtpdataproviderrenameobject.h" #include "mmmtpdpdefs.h" #include "mmmtpdpfiledefs.h" +#include "cabstractmediamtpdataproviderpropertysettingutility.h" +#include "cabstractmediamtpdataproviderdescriptionutility.h" // Class constants. // Defines the number of MTP Active Processors allowed @@ -76,6 +78,7 @@ iSupportedFormat( KAbstractMediaMtpDpArrayGranularity ), iSupportedProperties( KAbstractMediaMtpDpArrayGranularity ) { + // Do nothing } // ----------------------------------------------------------------------------- @@ -87,6 +90,9 @@ { PRINT( _L( "MM MTP => CAbstractMediaMtpDataProvider::~CAbstractMediaMtpDataProvider" ) ); + delete iPropSettingUtility; + delete iDescriptionUtility; + iPendingEnumerations.Close(); TInt count = iActiveProcessors.Count(); for ( TInt i = 0; i < count; i++ ) @@ -128,6 +134,9 @@ GetSupportedFormatL(); GetSupportedPropertiesL(); + iPropSettingUtility = CAbstractMediaMtpDataProviderPropertySettingUtility::NewL(); + iDescriptionUtility = CAbstractMediaMtpDataProviderDescriptionUtility::NewL(); + PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProvider::ConstructL" ) ); } @@ -158,13 +167,11 @@ { case EMTPSessionClosed: PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProvider::ProcessNotificationL EMTPSessionClosed event recvd" ) ); - SessionClosedL( *reinterpret_cast ( aParams ) ); break; case EMTPSessionOpened: PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProvider::ProcessNotificationL EMTPSessionOpened event recvd" ) ); - SessionOpenedL( *reinterpret_cast ( aParams ) ); break; @@ -201,18 +208,18 @@ MMmRequestProcessor* processor = iActiveProcessors[index]; iActiveProcessor = index; - // iActiveProcessorRemoved = EFalse; + iActiveProcessorRemoved = EFalse; TBool result = processor->HandleRequestL( aRequest, aPhase ); - if( !iIsSessionOpen ) + if ( !iIsSessionOpen ) { processor->Release(); } // iActiveProcessorRemoved will be set to ETrue in the above function - // HandleRequestL(),such as SessionClose() - // else if ( iActiveProcessorRemoved ) - // { - // processor->Release(); // destroy the processor - // } + // HandleRequestL(), such as SessionClose() + else if ( iActiveProcessorRemoved ) + { + processor->Release(); // destroy the processor + } else if ( result ) // destroy the processor { processor->Release(); @@ -231,7 +238,7 @@ iIsSessionOpen = EFalse; TInt count = iActiveProcessors.Count(); PRINT1( _L( "MM MTP => CAbstractMediaMtpDataProvider::SessionClosedL, total processor count = %d" ), count ); - for( TInt i = 0; i < count; i++ ) + for ( TInt i = 0; i < count; i++ ) { MMmRequestProcessor* processor = iActiveProcessors[i]; @@ -240,17 +247,17 @@ TUint32 sessionId = processor->SessionId(); if ( ( sessionId == aSession.iMTPId ) - && ( processor->Connection().ConnectionId() - == aSession.iConnection.ConnectionId() ) ) + && ( processor->Connection().ConnectionId() + == aSession.iConnection.ConnectionId() ) ) { processor->UsbDisconnect(); // Rollback iActiveProcessors.Remove( i ); - // if ( i == iActiveProcessor ) - // { - // iActiveProcessorRemoved = ETrue; - // } - // else + if ( i == iActiveProcessor ) + { + iActiveProcessorRemoved = ETrue; + } + else { processor->Release(); } @@ -472,7 +479,7 @@ // ----------------------------------------------------------------------------- // CAbstractMediaMtpDataProvider::GetWrapper -// return the reference of CMmMtpDpMetadataAccessWrapper to enumerator +// return wrapper references // ----------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper& CAbstractMediaMtpDataProvider::GetWrapperL() @@ -480,6 +487,26 @@ return CMmMtpDpAccessSingleton::GetAccessWrapperL(); } +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProvider::PropSettingUtility +// return The utility to setting properties +// ----------------------------------------------------------------------------- +// +CPropertySettingUtility* CAbstractMediaMtpDataProvider::PropSettingUtility() + { + return iPropSettingUtility; + } + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProvider::DescriptionUtility +// return The utiltiy to setting descriptions +// ----------------------------------------------------------------------------- +// +CDescriptionUtility* CAbstractMediaMtpDataProvider::DescriptionUtility() + { + return iDescriptionUtility; + } + // --------------------------------------------------------------------------- // CAbstractMediaMtpDataProvider::GetSupportedFormat // @@ -501,8 +528,9 @@ } } -const RArray* CAbstractMediaMtpDataProvider::GetSupportedPropertiesL( TUint32 aFormatCode ) const +const RArray* CAbstractMediaMtpDataProvider::GetSupportedPropertiesL( TUint32 /*aFormatCode*/ ) const { + // May need add more implementation here for further extension. return &iSupportedProperties; } @@ -552,10 +580,19 @@ TDriveInfo driveInfo; User::LeaveIfError( Framework().Fs().Drive( driveInfo, driveNum ) ); + PRINT3( _L( "driveInfo.iType = 0x%x, driveInfo.iDriveAtt = 0x%x, driveInfo.iMediaAtt = 0x%x" ), + driveInfo.iType, + driveInfo.iDriveAtt, + driveInfo.iMediaAtt ); if( driveInfo.iType == EMediaNotPresent || driveInfo.iType == EMediaUnknown ) { - err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, driveNum ); - PRINT( _L( "MM MTP <> Memory card doesn't exist, set PhoneMemory to default" ) ); + err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, driveNum ); + User::LeaveIfError( Framework().Fs().Drive( driveInfo, driveNum ) ); + if( driveInfo.iType == EMediaNotPresent || driveInfo.iType == EMediaUnknown ) + { + err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, driveNum ); + PRINT( _L( "MM MTP <> Memory card doesn't exist, set PhoneMemory to default" ) ); + } } return Framework().StorageMgr().FrameworkStorageId( TDriveNumber( driveNum ) ); diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderabstractmediapreference.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderabstractmediapreference.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderabstractmediapreference.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -71,7 +71,7 @@ // CAbstractMediaMtpDataProviderAbstractMediaPreference::~CAbstractMediaMtpDataProviderAbstractMediaPreference() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -81,7 +81,7 @@ // void CAbstractMediaMtpDataProviderAbstractMediaPreference::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -94,3 +94,6 @@ TUint32 referenceType = EMTPAbstractMediaRefOrdinary; SendResponseL( EMTPRespCodeOK, 1, &referenceType ); } + +// end of file + diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidercopyobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidercopyobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidercopyobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -60,7 +60,7 @@ // CAbstractMediaMtpDataProviderCopyObject::~CAbstractMediaMtpDataProviderCopyObject() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -73,7 +73,7 @@ MMmMtpDpConfig& aDpConfig ) : CCopyObject( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -86,21 +86,8 @@ const CMTPObjectMetaData& /*aObject*/ ) { PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderCopyObject::ServiceGetSpecificObjectPropertyL" ) ); - // do nothing - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL -// do nothing here -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CAbstractMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL( TUint16 /*aPropCode*/, - const CMTPObjectMetaData& /*aObject*/, - const CMTPTypeObjectPropListElement& /*aElement*/) - { - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL" ) ); - - return EMTPRespCodeOK; + // Do nothing now. + // May need add implementation here for further extension. } // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderdescriptionutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderdescriptionutility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Media dp specific property description construction utility. +* Used by all request processors which related to property description +* +*/ + +#include +#include + +#include "cabstractmediamtpdataproviderdescriptionutility.h" +#include "mmmtpdpconfig.h" +#include "mmmtpdplogger.h" + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProviderDescriptionUtility::NewL +// +// ----------------------------------------------------------------------------- +// +CAbstractMediaMtpDataProviderDescriptionUtility* CAbstractMediaMtpDataProviderDescriptionUtility::NewL() + { + CAbstractMediaMtpDataProviderDescriptionUtility* self = + new( ELeave ) CAbstractMediaMtpDataProviderDescriptionUtility(); + + return self; + } + +CAbstractMediaMtpDataProviderDescriptionUtility::CAbstractMediaMtpDataProviderDescriptionUtility() + { + // Do nothing + } + +CAbstractMediaMtpDataProviderDescriptionUtility::~CAbstractMediaMtpDataProviderDescriptionUtility() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL +// Construct media dp specific interdependent property description. +// ----------------------------------------------------------------------------- +// +CMTPTypeInterdependentPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL( MMmMtpDpConfig& /*aDpConfig*/, + TUint /*aFormatCode*/ ) + { + PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL" ) ); + + CMTPTypeInterdependentPropDesc* interdependentPropDesc = CMTPTypeInterdependentPropDesc::NewL(); + + PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL" ) ); + return interdependentPropDesc; + } + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProviderDescriptionUtility::NewSpecificPropDescL +// Construct media dp specific property description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewSpecificPropDescL( TUint /*aFormatCode*/, + TUint16 aPropCode ) + { + CMTPTypeObjectPropDesc* propertyDesc = NULL; + + switch ( aPropCode ) + { + // format specific + // May need add implementation here for further extension. + default: + // Do nothing now. + break; + } + return propertyDesc; + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderenumerator.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderenumerator.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderenumerator.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -34,11 +34,20 @@ #include "cmmmtpdpmetadatampxaccess.h" -/** Number of objects to insert into the object manager in one go*/ const TInt KMTPDriveGranularity = 5; +const TInt KAbstractMediaDpArrayGranularity = 2; _LIT( KPlaylistFilePath, "Playlists\\" ); +#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) +_LIT( KMpxGetAllAbstractMedia, "MpxGetAllAbstractMedia" ); +_LIT( KMpxQueryAbstractMediaReference, "MpxQueryAbstractMediaReference" ); +_LIT( KObjectManagerObjectUid, "ObjectManagerObjectUid" ); +_LIT( KObjectManagerInsert, "ObjectManagerInsert" ); +_LIT( KObjectManagerHandle, "ObjectManagerHandle" ); +_LIT( KReferenceManagerSetReference, "ReferenceManagerSetReference" ); +#endif + // ----------------------------------------------------------------------------- // CAbstractMediaMtpDataProviderEnumerator::NewL // Two phase constructor @@ -69,7 +78,7 @@ iObjectMgr( aFramework.ObjectMgr() ), iDataProviderId( aFramework.DataProviderId() ), iDataProvider( aDataProvider ), - iStorages( 2 ), + iStorages( KAbstractMediaDpArrayGranularity ), iAbstractMedias( NULL ), iCount( 0 ), iCurrentIndex( 0 ) @@ -105,6 +114,7 @@ delete iAbstractMedias; iAbstractMedias = NULL; + #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) delete iPerfLog; #endif // _DEBUG @@ -202,7 +212,8 @@ PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL StorageSuid = %S" ), &root ); // created by windows media player, or else return responsecode is Access denied - // Create abstract media directory if it does not exist + // Create playlist directory if it does not exist + // NOTE: Only playlist need to create directory here, for the dummy files HBufC* tempBuf = HBufC::NewLC( KMaxFileName ); // + tempBuf TPtr folder = tempBuf->Des(); folder.Zero(); @@ -232,9 +243,9 @@ // find all abstract medias stored in MPX delete iAbstractMedias; iAbstractMedias = NULL; - PERFLOGSTART( KMpxGetAllPlaylist ); - TRAPD( err, iDataProvider.GetWrapperL().GetAllPlaylistL( root, &iAbstractMedias ) ); - PERFLOGSTOP( KMpxGetAllPlaylist ); + PERFLOGSTART( KMpxGetAllAbstractMedia ); + TRAPD( err, iDataProvider.GetWrapperL().GetAllAbstractMediaL( root, &iAbstractMedias, EMPXPlaylist ) ); + PERFLOGSTOP( KMpxGetAllAbstractMedia ); if ( iAbstractMedias != NULL && err == KErrNone ) { @@ -262,7 +273,7 @@ // void CAbstractMediaMtpDataProviderEnumerator::ScanNextL() { - PRINT1( _L( "MM MTP = > CAbstractMediaMtpDataProviderEnumerator::ScanNextStorageL iStorages.Count = %d" ), iStorages.Count() ); + PRINT1( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::ScanNextL iStorages.Count = %d" ), iStorages.Count() ); if ( iCurrentIndex < iCount ) { TRequestStatus* status = &iStatus; @@ -296,28 +307,31 @@ // void CAbstractMediaMtpDataProviderEnumerator::RunL() { - TBuf playlist; + PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::RunL" ) ); - // insert all playlists into handle db of framework + // insert all abstract medias into handle db of framework CMPXMedia* media = ( *iAbstractMedias )[iCurrentIndex]; - PERFLOGSTART( KMpxGetPlaylistName ); - iDataProvider.GetWrapperL().GetPlaylistNameL( media, playlist ); - PERFLOGSTOP( KMpxGetPlaylistName ); - AddEntryL( playlist ); + + // Increase the index first in case of leave + iCurrentIndex++; + + HBufC* abstractMedia = iDataProvider.GetWrapperL().GetAbstractMediaNameL( media, EMPXPlaylist ); + CleanupStack::PushL( abstractMedia ); // + abstractMedia + AddEntryL( *abstractMedia ); - // find all reference of each playlist and create dummy files for each playlist + // find all reference of each abstract media CDesCArray* references = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity ); CleanupStack::PushL( references ); // + references - PERFLOGSTART( KMpxQueryPlaylistReference ); + PERFLOGSTART( KMpxQueryAbstractMediaReference ); iDataProvider.GetWrapperL().GetAllReferenceL( media, *references ); - PERFLOGSTOP( KMpxQueryPlaylistReference ); + PERFLOGSTOP( KMpxQueryAbstractMediaReference ); // insert references into reference db - AddReferencesL( playlist, *references ); + AddReferencesL( *abstractMedia, *references ); CleanupStack::PopAndDestroy( references ); // - references - iCurrentIndex++; + CleanupStack::PopAndDestroy( abstractMedia ); // - abstractMedia ScanNextL(); } @@ -343,7 +357,7 @@ // void CAbstractMediaMtpDataProviderEnumerator::DoCancel() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -380,9 +394,9 @@ PERFLOGSTOP( KObjectManagerObjectUid ); object->SetUint( CMTPObjectMetaData::EParentHandle, parentHandle ); - PERFLOGSTART(KObjectManagerInsert); + PERFLOGSTART( KObjectManagerInsert ); iObjectMgr.InsertObjectL( *object ); - PERFLOGSTOP(KObjectManagerInsert); + PERFLOGSTOP( KObjectManagerInsert ); CleanupStack::PopAndDestroy( object );// - object diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetformatcapabilities.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetformatcapabilities.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include - -#include "cabstractmediamtpdataprovidergetformatcapabilities.h" - - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetFormatCapabilities::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// - -MMmRequestProcessor* CAbstractMediaMtpDataProviderGetFormatCapabilities::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CAbstractMediaMtpDataProviderGetFormatCapabilities* self = - new ( ELeave ) CAbstractMediaMtpDataProviderGetFormatCapabilities( aFramework, - aConnection, - aDpConfig ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetFormatCapabilities::ConstructL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderGetFormatCapabilities::ConstructL() - { - CGetFormatCapabilities::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetFormatCapabilities::~CAbstractMediaMtpDataProviderGetFormatCapabilities() -// Destructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderGetFormatCapabilities::~CAbstractMediaMtpDataProviderGetFormatCapabilities() - { - - } - - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetFormatCapabilities::CAbstractMediaMtpDataProviderGetFormatCapabilities -// Standard c++ constructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderGetFormatCapabilities::CAbstractMediaMtpDataProviderGetFormatCapabilities( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CGetFormatCapabilities( aFramework, aConnection, aDpConfig ) - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetFormatCapabilities::ServiceInterdepentPropDesc -// -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderGetFormatCapabilities::ServiceInterdepentPropDescL() - { - iInterdependentPropDesc = CMTPTypeInterdependentPropDesc::NewL(); - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetFormatCapabilities::ServiceSpecificObjectPropertyL -// Service specific object property -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderGetFormatCapabilities::ServiceSpecificPropertyDescL( TUint16 aPropCode ) - { - return NULL; - } - - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetinterdependentpropdesc.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetinterdependentpropdesc.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: GetInterdenpendentPropDesc -* -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cabstractmediamtpdataprovidergetinterdependentpropdesc.h" -#include "cmmmtpdpmetadataaccesswrapper.h" -#include "tmmmtpdppanic.h" -#include "abstractmediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "mmmtpdpconfig.h" - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetInterdependentPropDesc::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CAbstractMediaMtpDataProviderGetInterdependentPropDesc::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& /*aDpConfig*/ ) - { - CAbstractMediaMtpDataProviderGetInterdependentPropDesc* self = - new ( ELeave ) CAbstractMediaMtpDataProviderGetInterdependentPropDesc( aFramework, - aConnection ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ConstructL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ConstructL() - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetInterdependentPropDesc::~CAbstractMediaMtpDataProviderGetInterdependentPropDesc -// Destructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderGetInterdependentPropDesc::~CAbstractMediaMtpDataProviderGetInterdependentPropDesc() - { - delete iDataset; - } - -// ----------------------------------------------------------------------------- -// CMTPGetInterdependentPropDesc::CMTPGetInterdependentPropDesc -// Standard c++ constructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderGetInterdependentPropDesc::CAbstractMediaMtpDataProviderGetInterdependentPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection ) : - CRequestProcessor( aFramework, aConnection, 0, NULL ) - { - PRINT( _L( "Operation: GetInterdependentPropDesc(0x9807)" ) ); - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetInterdependentPropDesc::CheckRequestL -// Verify the reqeust and returns it -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CAbstractMediaMtpDataProviderGetInterdependentPropDesc::CheckRequestL() - { - TMTPResponseCode responseCode = CRequestProcessor::CheckRequestL(); - iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); - - if ( EMTPRespCodeOK == responseCode ) - { - TInt count = sizeof( KAbstractMediaMtpDataProviderSupportedFormats ) / sizeof( TUint16 ); - - responseCode = EMTPRespCodeInvalidObjectFormatCode; - - for ( TInt i = 0; i < count; i++ ) - { - if ( iFormatCode == KAbstractMediaMtpDataProviderSupportedFormats[i] ) - { - responseCode = EMTPRespCodeOK; - break; - } - } - } - - return responseCode; - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL -// service a request at request phase -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL() - { - PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL" ) ); - - // Clear the data set. - delete iDataset; - iDataset = NULL; - iDataset = CMTPTypeInterdependentPropDesc::NewL(); - - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL don't have interdependent properties!" ) ); - - // Send the dataset. - SendDataL( *iDataset ); - PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL" ) ); - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropdesc.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropdesc.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: GetObjectPropDesc -* -*/ - -#include -#include - -#include "cabstractmediamtpdataprovidergetobjectpropdesc.h" -#include "mmmtpdplogger.h" -#include "abstractmediamtpdataproviderconst.h" -#include "mmmtpdpdefs.h" - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetObjectPropDesc::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CAbstractMediaMtpDataProviderGetObjectPropDesc::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CAbstractMediaMtpDataProviderGetObjectPropDesc* self = - new ( ELeave ) CAbstractMediaMtpDataProviderGetObjectPropDesc( aFramework, - aConnection, - aDpConfig ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetObjectPropDesc::ConstructL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderGetObjectPropDesc::ConstructL() - { - CGetObjectPropDesc::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetObjectPropDesc::~CAbstractMediaMtpDataProviderGetObjectPropDesc -// Destructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderGetObjectPropDesc::~CAbstractMediaMtpDataProviderGetObjectPropDesc() - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetObjectPropDesc::CAbstractMediaMtpDataProviderGetObjectPropDesc -// Standard c++ constructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderGetObjectPropDesc::CAbstractMediaMtpDataProviderGetObjectPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CGetObjectPropDesc( aFramework, aConnection, aDpConfig ) - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderGetObjectPropDesc::ServiceSpecificObjectPropertyL -// -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderGetObjectPropDesc::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/ ) - { - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetObjectPropDesc::ServiceSpecificObjectPropertyL leave with not supportd" ) ); - User::Leave( KErrNotSupported ); - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -50,7 +50,7 @@ // CAbstractMediaMtpDataProviderGetObjectPropList::~CAbstractMediaMtpDataProviderGetObjectPropList() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -61,9 +61,9 @@ CAbstractMediaMtpDataProviderGetObjectPropList::CAbstractMediaMtpDataProviderGetObjectPropList( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CGetObjectPropList( aFramework, aConnection, aDpConfig ) + CGetObjectPropList( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -85,6 +85,10 @@ TUint32 /*aHandle*/ ) { PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL, leave with KErrNotSupported" ) ); + + // Do nothing now. + // May need add implementation here for further extension. + return KErrNotSupported; } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -49,7 +49,7 @@ // void CAbstractMediaMtpDataProviderGetObjectPropValue::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -59,7 +59,7 @@ // CAbstractMediaMtpDataProviderGetObjectPropValue::~CAbstractMediaMtpDataProviderGetObjectPropValue() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -72,7 +72,7 @@ MMmMtpDpConfig& aDpConfig ) : CGetObjectPropValue( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -84,6 +84,9 @@ void CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/ ) { PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL, leave with KErrNotSupported")); + + // May need add implementation here for further extension. + User::Leave( KErrNotSupported ); } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidermoveobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidermoveobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidermoveobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -61,7 +61,7 @@ // CAbstractMediaMtpDataProviderMoveObject::~CAbstractMediaMtpDataProviderMoveObject() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -74,7 +74,7 @@ MMmMtpDpConfig& aDpConfig ) : CMoveObject( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -87,21 +87,10 @@ const CMTPObjectMetaData& /*aObject*/ ) { PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderMoveObject::ServiceGetSpecificObjectPropertyL" ) ); - // do nothing - } -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL -// do nothing here -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CAbstractMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL( TUint16 /*aPropCode*/, - const CMTPObjectMetaData& /*aObject*/, - const CMTPTypeObjectPropListElement& /*aElement*/ ) - { - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL" ) ); + // Do nothing now. + // May need add implementation here for further extension. - return EMTPRespCodeOK; } // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderpropertysettingutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderpropertysettingutility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include + +#include "cabstractmediamtpdataproviderpropertysettingutility.h" +#include "mmmtpdplogger.h" + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProviderPropertySettingUtility::NewL +// Two-phase construction method +// ----------------------------------------------------------------------------- +// +CAbstractMediaMtpDataProviderPropertySettingUtility* CAbstractMediaMtpDataProviderPropertySettingUtility::NewL() + { + CAbstractMediaMtpDataProviderPropertySettingUtility* self = + new ( ELeave ) CAbstractMediaMtpDataProviderPropertySettingUtility(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProviderPropertySettingUtility::~CAbstractMediaMtpDataProviderPropertySettingUtility +// Destructor +// ----------------------------------------------------------------------------- +// +CAbstractMediaMtpDataProviderPropertySettingUtility::~CAbstractMediaMtpDataProviderPropertySettingUtility() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CAbstractMediaMtpDataProviderPropertySettingUtility::CAbstractMediaMtpDataProviderPropertySettingUtility +// Standard C++ Constructor +// ----------------------------------------------------------------------------- +// +CAbstractMediaMtpDataProviderPropertySettingUtility::CAbstractMediaMtpDataProviderPropertySettingUtility() + { + // Do nothing + } + +TMTPResponseCode CAbstractMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL( MMmMtpDpConfig& /*aDpConfig*/, + TUint16 /*aPropCode*/, + const CMTPObjectMetaData& /*aObject*/, + const CMTPTypeObjectPropListElement& /*aElement*/ ) + { + PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL" ) ); + + // Do nothing now. + // May need add implementation here for further extension. + + return EMTPRespCodeOK; + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderrenameobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderrenameobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderrenameobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -53,9 +53,9 @@ // CAbstractMediaMtpDataProviderRenameObject::CAbstractMediaMtpDataProviderRenameObject( MMTPDataProviderFramework& aFramework, CMmMtpDpMetadataAccessWrapper& aWrapper ) : - CRenameObject( aFramework, aWrapper ) + CRenameObject( aFramework, aWrapper ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -65,7 +65,7 @@ // CAbstractMediaMtpDataProviderRenameObject::~CAbstractMediaMtpDataProviderRenameObject() { - + // Do nothing } // ----------------------------------------------------------------------------- diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersendobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersendobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: SendObjectInfo/SendObjectPropList/SendObject -* -*/ - - -#include -#include - -#include "cabstractmediamtpdataprovidersendobject.h" -#include "abstractmediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "mmmtpdpconfig.h" - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSendObject::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CAbstractMediaMtpDataProviderSendObject::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CAbstractMediaMtpDataProviderSendObject* self = - new (ELeave) CAbstractMediaMtpDataProviderSendObject( aFramework, - aConnection, - aDpConfig ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSendObject::~CAbstractMediaMtpDataProviderSendObject -// Destructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderSendObject::~CAbstractMediaMtpDataProviderSendObject() - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSendObject::CAbstractMediaMtpDataProviderSendObject -// Standard C++ Constructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderSendObject::CAbstractMediaMtpDataProviderSendObject( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CSendObject( aFramework, aConnection, aDpConfig ) - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSendObject::ConstructL -// 2nd Phase Constructor -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderSendObject::ConstructL() - { - CSendObject::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSendObject::ServiceSpecificObjectPropertyL -// no need to do anything here, just leave, as this should never be invoked or -// invalid propcode -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CAbstractMediaMtpDataProviderSendObject::SetSpecificObjectPropertyL( TUint16 /*aPropCode*/, - const CMTPObjectMetaData& /*aObject*/, - const CMTPTypeObjectPropListElement& /*aElement*/ ) - { - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderSendObject::ServiceSpecificObjectPropertyL, leave with KErrNotSupported" ) ); - User::Leave( KErrNotSupported ); - - return EMTPRespCodeOK; - } - -TMTPResponseCode CAbstractMediaMtpDataProviderSendObject::CheckSepecificPropType( TUint16 aPropCode, TUint16 aDataType ) - { - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderSendObject::ServiceSpecificCheckDataTypeL, leave with KErrNotSupported" ) ); - // TODO: User::Leave( KErrNotSupported ); - return EMTPRespCodeOK; - } - -TInt CAbstractMediaMtpDataProviderSendObject::HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& /*aObject*/ ) - { - // do nothing, simply return the error - return aError; - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectproplist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: getobjectproplist -* -*/ - - -#include -#include - -#include "cabstractmediamtpdataprovidersetobjectproplist.h" -#include "abstractmediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "mmmtpdpconfig.h" - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSetObjectPropList::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CAbstractMediaMtpDataProviderSetObjectPropList::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CAbstractMediaMtpDataProviderSetObjectPropList* self = - new (ELeave) CAbstractMediaMtpDataProviderSetObjectPropList( aFramework, - aConnection, - aDpConfig ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSetObjectPropList::~CAbstractMediaMtpDataProviderSetObjectPropList -// Destructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderSetObjectPropList::~CAbstractMediaMtpDataProviderSetObjectPropList() - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSetObjectPropList::CAbstractMediaMtpDataProviderSetObjectPropList -// Standard C++ Constructor -// ----------------------------------------------------------------------------- -// -CAbstractMediaMtpDataProviderSetObjectPropList::CAbstractMediaMtpDataProviderSetObjectPropList( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CSetObjectPropList( aFramework, aConnection, aDpConfig ) - { - - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSetObjectPropList::ConstructL -// 2nd Phase Constructor -// ----------------------------------------------------------------------------- -// -void CAbstractMediaMtpDataProviderSetObjectPropList::ConstructL() - { - CSetObjectPropList::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CAbstractMediaMtpDataProviderSetObjectPropList::ServiceSpecificObjectPropertyL -// no need to do anything here, just leave, as this should never be invoked or -// invalid propcode -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CAbstractMediaMtpDataProviderSetObjectPropList::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/, - const CMTPObjectMetaData& /*aObject*/, - const CMTPTypeObjectPropListElement& /*aElement*/ ) - { - PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderSetObjectPropList::ServiceSpecificObjectPropertyL, leave with KErrNotSupported" ) ); - User::Leave( KErrNotSupported ); - - return EMTPRespCodeOK; - } - -TInt CAbstractMediaMtpDataProviderSetObjectPropList::HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& /*aObject*/ ) - { - // do nothing, simply return the error - return aError; - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectpropvalue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectpropvalue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -49,7 +49,7 @@ // void CAbstractMediaMtpDataProviderSetObjectPropValue::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -60,9 +60,9 @@ CAbstractMediaMtpDataProviderSetObjectPropValue::CAbstractMediaMtpDataProviderSetObjectPropValue( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CSetObjectPropValue( aFramework, aConnection, aDpConfig ) + CSetObjectPropValue( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -72,7 +72,7 @@ // CAbstractMediaMtpDataProviderSetObjectPropValue::~CAbstractMediaMtpDataProviderSetObjectPropValue() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -95,6 +95,10 @@ void CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL( TUint16 /*aPropCode*/ ) { PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL leave with KErrNotSupported" ) ); + + // Do nothing now. + // May need add implementation here for further extension. + User::Leave( KErrNotSupported ); } @@ -107,6 +111,9 @@ TMTPResponseCode CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/ ) { PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL leave with KErrNotSupported" ) ); + + // Do nothing now. + // May need add implementation here for further extension. User::Leave( KErrNotSupported ); return EMTPRespCodeOK; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectreferences.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectreferences.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectreferences.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -48,7 +48,7 @@ // void CAbstractMediaMtpDataProviderSetObjectReferences::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -58,7 +58,7 @@ // CAbstractMediaMtpDataProviderSetObjectReferences::~CAbstractMediaMtpDataProviderSetObjectReferences() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -69,9 +69,9 @@ CAbstractMediaMtpDataProviderSetObjectReferences::CAbstractMediaMtpDataProviderSetObjectReferences( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CSetObjectReferences( aFramework, aConnection, aDpConfig ) + CSetObjectReferences( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -87,7 +87,7 @@ TInt count = sizeof( KAbstractMediaMtpDataProviderSupportedFormats ) / sizeof (TUint16); TBool supported = EFalse; - for( TInt i = 0; i < count; i++ ) + for ( TInt i = 0; i < count; i++ ) { if( KAbstractMediaMtpDataProviderSupportedFormats[i] == aObjectFormat ) { @@ -98,7 +98,7 @@ if ( supported ) { - aWrapper.SetPlaylistL( aSrcFileName, aRefFileArray ); + aWrapper.SetAbstractMediaL( aSrcFileName, aRefFileArray, EMPXPlaylist ); } } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/data/mediamtpdataprovider_config.rss --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/data/mediamtpdataprovider_config.rss Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/data/mediamtpdataprovider_config.rss Sun Mar 14 13:11:48 2010 +0000 @@ -17,24 +17,15 @@ #include -#include "mediamtpdataprovider_config.rh" RESOURCE MTP_DATA_PROVIDER dpConfig { type = KMTPDataProviderTypeECOM; major_version = 1; object_enumeration_persistent = 0; - supported_modes = KMTPModeMTP; + supported_modes = KMTPModeMTP; server_name = ""; server_image_name = ""; - opaque_resource = "folderConfig"; + opaque_resource = 0; enumeration_phase = 11; } - -RESOURCE MEDIAMTPDATAPROVIDE_CONFIG folderConfig - { - media_drive = 4; // 2 change to SD card - } - - - diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/group/mediamtpdataprovider.mmp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/group/mediamtpdataprovider.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/group/mediamtpdataprovider.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -40,16 +40,15 @@ SOURCE mediamtpdataprovidercontrollerimp.cpp SOURCE mediamtpdataproviderprocessor.cpp SOURCE cmediamtpdataproviderenumerator.cpp -SOURCE cmediamtpdataprovidergetobjectpropdesc.cpp -SOURCE cmediamtpdataprovidergetinterdependentpropdesc.cpp SOURCE cmediamtpdataprovidergetobjectpropvalue.cpp SOURCE cmediamtpdataprovidergetobjectproplist.cpp SOURCE cmediamtpdataprovidersetobjectpropvalue.cpp -SOURCE cmediamtpdataprovidersetobjectproplist.cpp + SOURCE cmediamtpdataprovidercopyobject.cpp SOURCE cmediamtpdataprovidermoveobject.cpp -SOURCE cmediamtpdataprovidersendobject.cpp -SOURCE cmediamtpdataprovidergetformatcapabilities.cpp +SOURCE cmediamtpdataproviderpropertysettingutility.cpp +SOURCE cmediamtpdataproviderdescriptionutility.cpp + SOURCEPATH ../data START RESOURCE mediamtpdataprovider.rss diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovider.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovider.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovider.h Sun Mar 14 13:11:48 2010 +0000 @@ -69,6 +69,16 @@ */ CMmMtpDpMetadataAccessWrapper& GetWrapperL(); + /** + * @return The utility to setting properties + */ + CPropertySettingUtility* PropSettingUtility(); + + /** + * @return The utiltiy to setting descriptions + */ + CDescriptionUtility* DescriptionUtility(); + protected: // from CMTPDataProviderPlugin void Cancel(); @@ -168,6 +178,7 @@ RArray iPendingEnumerations; TInt iActiveProcessor; + TBool iActiveProcessorRemoved; TBool iIsSessionOpen; CRenameObject *iRenameObject; @@ -180,6 +191,9 @@ TUint32 iDefaultStorageId; + CPropertySettingUtility* iPropSettingUtility; + CDescriptionUtility* iDescriptionUtility; + }; #endif // CMEDIAMTPDATAPROVIDER_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidercopyobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidercopyobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidercopyobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -65,10 +65,6 @@ TUint32 aHandle, const CMTPObjectMetaData& aObject ); - TMTPResponseCode ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - }; #endif // CMEDIAMTPDATAPROVIDERCOPYOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderdescriptionutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderdescriptionutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Media dp specific property description construction utility. +* Used by all request processors which related to property description +* +*/ + +#ifndef CMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H +#define CMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H + +#include "cdescriptionutility.h" + +class CMTPTypeInterdependentPropDesc; +class CMTPTypeObjectPropDesc; + +class CMediaMtpDataProviderDescriptionUtility : public CDescriptionUtility + { +public: + static CMediaMtpDataProviderDescriptionUtility* NewL(); + +private: + CMediaMtpDataProviderDescriptionUtility(); + +public: + /** + * Construct media dp specific interdependent property description. + * according to assigned format code. + * @param aFormatCode + * @return Interdependent property description dataset. + */ + CMTPTypeInterdependentPropDesc* NewInterdepentPropDescL( MMmMtpDpConfig& aDpConfig, TUint aFormatCode ); + + /** + * Construct media dp specific property description + * according to assigned format code and property code. + * @param aFormatCode + * @param aPropCode + * @return Property description dataset. + */ + CMTPTypeObjectPropDesc* NewSpecificPropDescL( TUint aFormatCode, TUint16 aPropCode ); + +private: + /** + * Construct audio wave codec property description. + * @param aFormatCode + * @return Property description dataset of audio wave codec. + */ + CMTPTypeObjectPropDesc* NewAudioWaveCodecPropDescL( TUint aFormatCode ); + + /** + * Construct audio bitrate property description. + * @param aFormatCode, The format code + * @return Property description dataset of audio bitrate. + */ + CMTPTypeObjectPropDesc* NewAudioBitratePropDescL( TUint aFormatCode ); + + /** + * Construct property description of video fourCC codec. + * @param aFormatCode, The format code + * @return Property description dataset of video fourCC codec. + */ + CMTPTypeObjectPropDesc* NewVideoFourCCCodecPropDescL( TUint aFormatCode ); + + /** + * Construct property description of VideoBitrate. + * @param aFormatCode, The format code + * @return Property description dataset of video bitrate. + */ + CMTPTypeObjectPropDesc* NewVideoBitratePropDescL( TUint aFormatCode ); + + /** + * Construct property description of number of channels. + * @return Property description dataset of number of channels. + */ + CMTPTypeObjectPropDesc* NewNumberOfChannelsPropDescL(); + + /** + * Construct property description of code sample rate. + * @return Property description dataset of sample rate. + */ + CMTPTypeObjectPropDesc* NewCodeSampleRatePropDescL(); + + /** + * Construct property description of description. + * @return Property description dataset of description. + */ + CMTPTypeObjectPropDesc* NewDescriptionPropDescL(); + + /** + * Construct property description of scan type description. + * @return Property description dataset of scan type description. + */ + CMTPTypeObjectPropDesc* NewScanTypeDescriptionPropDescL(); + + /** + * Construct property description of encoding profile description. + * @return Property description dataset of encoding profile description. + */ + CMTPTypeObjectPropDesc* NewEncodingProfileDescriptionPropDescL(); + + /** + * Construct property description of DRM status. + * @return Property description dataset of drm status. + */ + CMTPTypeObjectPropDesc* NewDRMStatusPropDescL(); + + /** + * Construct property description of OMADRM status. + * @return Property description dataset of oma drm status. + */ + CMTPTypeObjectPropDesc* NewOMADRMStatusPropDescL(); + + }; + +#endif // CMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderenumerator.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderenumerator.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderenumerator.h Sun Mar 14 13:11:48 2010 +0000 @@ -25,12 +25,6 @@ #include "mmmtpenumerationcallback.h" #include "cmmmtpdpperflog.h" -// keep here to avoid warning on urel -_LIT( KDirectoryScan, "DirectoryScan" ); -_LIT( KFormatFilter, "FormatFilter" ); -_LIT( KObjectManagerObjectUid, "ObjectManagerObjectUid" ); -_LIT( KObjectManagerInsert, "ObjectManagerInsert" ); - // Forward declarations class MMTPDataProviderFramework; class MMTPObjectMgr; @@ -63,7 +57,7 @@ * @param aStorageId storage to be enumerated */ void StartL( TUint32 aStorageId ); - + // introduce to cleanup db at close session void SessionClosedL(); @@ -192,7 +186,7 @@ /** MTP Data Provider ID */ TUint iDataProviderId; - + CMediaMtpDataProvider& iDataProvider; TParse iPath; RDir iDir; @@ -208,7 +202,7 @@ // record the system tick TUint iTickCountBegin; TInt iTickPeriod; - + #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) CMmMtpDpPerfLog* iPerfLog; #endif diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetformatcapabilities.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetformatcapabilities.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef CMEDIAMTPDATAPROVIDERGETFORMATCAPABILITIES_H -#define CMEDIAMTPDATAPROVIDERGETFORMATCAPABILITIES_H - -#include "cgetformatcapabilities.h" - -class CMTPTypeObjectPropDesc; -/** -* Defines media data provider GetFormatCapabilities -*/ -class CMediaMtpDataProviderGetFormatCapabilities : public CGetFormatCapabilities - { -public: - - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CMediaMtpDataProviderGetFormatCapabilities(); - -protected: - // from CGetFormatCapabilities, override from baseclass - /** - * Service interdepent propdesc - */ - void ServiceInterdepentPropDescL(); - - /** - * Service specific object property - * @param aPropCode, The prop code - * @return MTPType object propdesc - */ - CMTPTypeObjectPropDesc* ServiceSpecificPropertyDescL( TUint16 aPropCode ); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CMediaMtpDataProviderGetFormatCapabilities( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * two-phase construction - */ - void ConstructL(); - - //functions used by ServiceInterdepentPropDesc - /** - * Service AudioWaveCodec - * @param aFormatCode, The format code - * @return MTPTypeInterdependentProperties - */ - CMTPTypeObjectPropDesc* ServiceAudioWaveCodecL(); - - /** - * Service AudioBitrate - * @param aFormatCode, The format code - * @return MTPTypeInterdependentProperties - */ - CMTPTypeObjectPropDesc* ServiceAudioBitrateL(); - - /** - * Service videoFourCCCodec - * @param aFormatCode, The format code - * @return MTPTypeInterdependentProperties - */ - CMTPTypeObjectPropDesc* ServiceVideoFourCCCodecL(); - - /** - * Service VideoBitrate - * @param aFormatCode, The format code - * @return MTPTypeInterdependentProperties - */ - CMTPTypeObjectPropDesc* ServiceVideoBitrateL(); - - /** - * Service RangeForm Description - * @param aMinValue The minimal value - * @param aMaxValue The maximal value - * @param aStepValue The step value - * @return MTPTypeObjectPropDescRangeForm - */ - CMTPTypeObjectPropDesc* ServiceRangeFormDescriptionL( TUint16 aPropCode, - TUint32 aMinValue, - TUint32 aMaxValue, - TUint32 aStepValue, - TBool aIsReadOnly = EFalse ); - - //functions used by ServiceSpecificObjectPropertyL - /** - * Service number of channels - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceNumberOfChannelsL(); - - /** - * Service code sample rate - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceCodeSampleRateL(); - - /** - * Service description - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceDescriptionL(); - - /** - * Service scan type description - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceScanTypeDescriptionL(); - - /** - * Service encoding profile description - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceEncodingProfileDescriptionL(); - - /** - * Service DRM status - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceDRMStatusL(); - - /** - * Service OMADRM status - * @return MTPTypeObjectPropDesc - */ - CMTPTypeObjectPropDesc* ServiceOMADRMStatusL(); - - - }; - -#endif // CMEDIAMTPDATAPROVIDERGETFORMATCAPABILITIES_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetinterdependentpropdesc.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetinterdependentpropdesc.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef CMEDIAMTPDATAPROVIDERGETINTERDEPENTENTPROPDESC_H -#define CMEDIAMTPDATAPROVIDERGETINTERDEPENTENTPROPDESC_H - -#include -#include "crequestprocessor.h" - -class CMTPTypeInterdependentPropDesc; -class CMTPTypeInterdependentProperties; -class MMmMtpDpConfig; - -/** -* Defines media data provider GetInterDependentPropDesc request processor -*/ -class CMediaMtpDataProviderGetInterDependentPropDesc: public CRequestProcessor - { -public: - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CMediaMtpDataProviderGetInterDependentPropDesc(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - */ - CMediaMtpDataProviderGetInterDependentPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection ); - -protected: - // from CRequestProcessor - TMTPResponseCode CheckRequestL(); - void ServiceL(); - -private: - /** - * two-phase construction - */ - void ConstructL(); - - void ServiceAudioWaveCodecL(); - void ServiceAudioBitrateL(); - - void ServiceVideoFourCCCodecL(); - void ServiceVideoBitrateL(); - - void ServiceRangeFormDescriptionL( TUint16 aPropCode, - TUint32 aMinValue, - TUint32 aMaxValue, - TUint32 aStepValue, - TBool aIsReadOnly = EFalse); - - void SetFormForResponseL( TUint16 aPropertyCode, - CMTPTypeObjectPropDesc::TPropertyInfo& aPropInfo, - const MMTPType* aForm ); - -private: - /** Dataset to store the prop descriptions*/ - CMTPTypeInterdependentPropDesc* iDataset; - - /**support configuration correctly*/ - CMTPTypeInterdependentProperties* iProperties; - - TUint32 iFormatCode; - - }; - -#endif // CMEDIAMTPDATAPROVIDERGETINTERDEPENTENTPROPDESC_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetobjectpropdesc.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetobjectpropdesc.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef CMEDIAMTPDATAPROVIDERGETOBJECTPROPDESC_H -#define CMEDIAMTPDATAPROVIDERGETOBJECTPROPDESC_H - -#include "cgetobjectpropdesc.h" - -/** -* Defines media data provider GetObjectPropDesc request processor -*/ -class CMediaMtpDataProviderGetObjectPropDesc: public CGetObjectPropDesc - { -public: - - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CMediaMtpDataProviderGetObjectPropDesc(); - -protected: - // from CGetObjectPropDesc, override from baseclass - void ServiceSpecificObjectPropertyL( TUint16 aPropCode ); - -private: - - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CMediaMtpDataProviderGetObjectPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - /** - * two-phase construction - */ - void ConstructL(); - - void ServiceNumberOfChannelsL(); - void ServiceCodeSampleRateL(); - void ServiceCodeWaveCodecL(); - void ServiceCodeAudioBitrateL(); - void ServiceDurationL(); - void ServiceDescriptionL(); - void ServiceScanTypeDescriptionL(); - void ServiceVideoFourCCCodecL(); - void ServiceVideoBitrateL(); - void ServiceEncodingProfileDescriptionL(); - void ServiceDRMStatusL(); - void ServiceOMADRMStatusL(); - - void ServiceRangeFormDescriptionL( TUint16 aPropCode, - TUint32 aMinValue, - TUint32 aMaxValue, - TUint32 aStepValue, - TBool aIsReadOnly = EFalse ); - - }; - -#endif // CMEDIAMTPDATAPROVIDERGETOBJECTPROPDESC_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidermoveobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidermoveobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidermoveobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -62,15 +62,10 @@ void ConstructL(); protected: - void ServiceGetSpecificObjectPropertyL( TUint16 aPropCode, TUint32 aHandle, const CMTPObjectMetaData& aObject ); - TMTPResponseCode ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - }; #endif // CMEDIAMTPDATAPROVIDERMOVEOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderpropertysettingutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderpropertysettingutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + + +#ifndef CMEDIAMTPDATAPROVIDERPROPERTYSETTINGUTILITY_H +#define CMEDIAMTPDATAPROVIDERPROPERTYSETTINGUTILITY_H + +#include "cpropertysettingutility.h" + +/** +* Defines media data provider SetObjectPropsList request processor +*/ +class CMediaMtpDataProviderPropertySettingUtility: public CPropertySettingUtility + { +public: + /** + * @param aFramework, The data provider framework + * @param aConnection, The connection from which the request comes + * @param aWrapper Medadata access + * @return A pointer to the created request processor object + */ + static CMediaMtpDataProviderPropertySettingUtility* NewL(); + + /** + * Destructor + */ + ~CMediaMtpDataProviderPropertySettingUtility(); + +private: + /** + * Standard C++ Constructor + * @param aFramework, The data provider framework + * @param aConnection, The connection from which the request comes + * @param aWrapper Medadata access + */ + CMediaMtpDataProviderPropertySettingUtility(); + +protected: + TMTPResponseCode SetSpecificObjectPropertyL( MMmMtpDpConfig& aDpConfig, + TUint16 aPropCode, + const CMTPObjectMetaData& aObject, + const CMTPTypeObjectPropListElement& aElement ); + + }; + +#endif // CMEDIAMTPDATAPROVIDERPROPERTYSETTINGUTILITY_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidersendobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidersendobject.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: * -*/ - - -#ifndef CMEDIAMTPDATAPROVIDERSENDOBJECT_H_ -#define CMEDIAMTPDATAPROVIDERSENDOBJECT_H_ - -#include "csendobject.h" - -/** -* Defines media data provider SetObjectPropsList request processor -*/ -class CMediaMtpDataProviderSendObject: public CSendObject - { -public: - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CMediaMtpDataProviderSendObject(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CMediaMtpDataProviderSendObject( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * 2nd Phase Constructor - */ - void ConstructL(); - -protected: - // from CSendObject - TMTPResponseCode SetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - - TMTPResponseCode CheckSepecificPropType( TUint16 aPropCode, TUint16 aDataType ); - - TInt HandleSpecificWrapperError(TInt aError, - const CMTPObjectMetaData& aObject); - - }; - - -#endif /*CMEDIAMTPDATAPROVIDERSENDOBJECT_H_*/ diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidersetobjectproplist.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidersetobjectproplist.h Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: * -*/ - - -#ifndef CMEDIAMTPDATAPROVIDERSETOBJECTPROPLIST_H -#define CMEDIAMTPDATAPROVIDERSETOBJECTPROPLIST_H - -#include"csetobjectproplist.h" - -/** -* Defines media data provider SetObjectPropsList request processor -*/ -class CMediaMtpDataProviderSetObjectPropList: public CSetObjectPropList - { -public: - /** - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - * @return A pointer to the created request processor object - */ - static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * Destructor - */ - ~CMediaMtpDataProviderSetObjectPropList(); - -private: - /** - * Standard C++ Constructor - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper Medadata access - */ - CMediaMtpDataProviderSetObjectPropList( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); - - /** - * 2nd Phase Constructor - */ - void ConstructL(); - -protected: - // from CSetObjectPropList - TMTPResponseCode ServiceSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ); - - TInt HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& aObject); - - }; - -#endif // CMEDIAMTPDATAPROVIDERGETOBJECTPROPLIST_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataprovider_config.rh --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataprovider_config.rh Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for project media mtp data provider -* -*/ - - -#ifndef MEDIAMTPDATAPROVIDER_RH -#define MEDIAMTPDATAPROVIDER_RH - -// -------------------------------------------------------------------- -// Defines the resource type for media mtp data provider specific configuration data -// -------------------------------------------------------------------- -// -STRUCT MEDIAMTPDATAPROVIDE_CONFIG - { - LONG media_drive; // Symbian drive number @see TDrive - LTEXT media_folder_root; - LTEXT folder_exclusion_list[]; // What to exclude - } - -#endif // MEDIAMTPDATAPROVIDER_RH diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderconst.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderconst.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderconst.h Sun Mar 14 13:11:48 2010 +0000 @@ -181,6 +181,8 @@ EMTPOpCodeSetObjectPropList, EMTPOpCodeGetInterdependentPropDesc, EMTPOpCodeSendObjectPropList, + + // window 7 extension EMTPOpCodeGetFormatCapabilities }; @@ -236,5 +238,4 @@ EMTPExtObjectPropCodeOmaDrmStatus, }; - #endif // MEDIAMTPDATAPROVIDERCONST_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovider.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovider.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovider.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -15,7 +15,6 @@ * */ - #include #include #include @@ -36,6 +35,8 @@ #include "crenameobject.h" #include "mmmtpdpdefs.h" #include "mmmtpdpfiledefs.h" +#include "cmediamtpdataproviderpropertysettingutility.h" +#include "cmediamtpdataproviderdescriptionutility.h" // Class constants. // Defines the number of MTP Active Processors allowed @@ -77,6 +78,7 @@ iSupportedPropVideo( KMediaMtpDpArrayGranularity ), iSupportedPropAll( KMediaMtpDpArrayGranularity ) { + // Do nothing } // ----------------------------------------------------------------------------- @@ -90,6 +92,8 @@ CMmMtpDpAccessSingleton::Release(); delete iMediaEnumerator; + delete iPropSettingUtility; + delete iDescriptionUtility; iPendingEnumerations.Close(); TInt count = iActiveProcessors.Count(); @@ -132,6 +136,9 @@ GetSupportedPropL(); GetAllSupportedPropL(); + iPropSettingUtility = CMediaMtpDataProviderPropertySettingUtility::NewL(); + iDescriptionUtility = CMediaMtpDataProviderDescriptionUtility::NewL(); + PRINT( _L( "MM MTP <= CMediaMtpDataProvider::ConstructL" ) ); } @@ -162,13 +169,11 @@ { case EMTPSessionClosed: PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPSessionClosed event recvd" ) ); - SessionClosedL( *reinterpret_cast ( aParams ) ); break; case EMTPSessionOpened: PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPSessionOpened event recvd" ) ); - SessionOpenedL( *reinterpret_cast ( aParams ) ); break; @@ -205,14 +210,19 @@ MMmRequestProcessor* processor = iActiveProcessors[index]; iActiveProcessor = index; - // iActiveProcessorRemoved = EFalse; + iActiveProcessorRemoved = EFalse; TBool result = processor->HandleRequestL( aRequest, aPhase ); - if( !iIsSessionOpen ) + if ( !iIsSessionOpen ) { processor->Release(); } - + // iActiveProcessorRemoved will be set to ETrue in the above function + // HandleRequestL(),such as SessionClose() + else if ( iActiveProcessorRemoved ) + { + processor->Release(); // destroy the processor + } else if ( result ) // destroy the processor { processor->Release(); @@ -246,7 +256,14 @@ processor->UsbDisconnect(); // Rollback iActiveProcessors.Remove( i ); - processor->Release(); + if ( i == iActiveProcessor ) + { + iActiveProcessorRemoved = ETrue; + } + else + { + processor->Release(); + } } } @@ -500,7 +517,7 @@ // ----------------------------------------------------------------------------- // CMediaMtpDataProvider::GetWrapper -// return the reference of CMmMtpDpMetadataAccessWrapper to enumerator +// return wrapper references // ----------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper& CMediaMtpDataProvider::GetWrapperL() @@ -508,6 +525,26 @@ return CMmMtpDpAccessSingleton::GetAccessWrapperL(); } +// ----------------------------------------------------------------------------- +// CMediaMtpDataProvider::PropSettingUtility +// return The utility to setting properties +// ----------------------------------------------------------------------------- +// +CPropertySettingUtility* CMediaMtpDataProvider::PropSettingUtility() + { + return iPropSettingUtility; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProvider::DescriptionUtility +// return The utiltiy to setting descriptions +// ----------------------------------------------------------------------------- +// +CDescriptionUtility* CMediaMtpDataProvider::DescriptionUtility() + { + return iDescriptionUtility; + } + // --------------------------------------------------------------------------- // CMediaMtpDataProvider::GetSupportedFormat // diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidercopyobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidercopyobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidercopyobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -65,7 +65,7 @@ // CMediaMtpDataProviderCopyObject::~CMediaMtpDataProviderCopyObject() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -78,7 +78,7 @@ MMmMtpDpConfig& aDpConfig ) : CCopyObject( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -124,10 +124,6 @@ { iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// *textData ); } CleanupStack::PopAndDestroy( textData ); // - textData @@ -148,10 +144,6 @@ { iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// *desData ); } CleanupStack::PopAndDestroy( desData ); // - desData @@ -173,12 +165,7 @@ { iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// uint16 ); } - } break; @@ -204,9 +191,6 @@ { iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value()); -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// uint32 ); } } break; @@ -220,14 +204,9 @@ if ( drmStatus == EMTPDrmStatusProtected ) result.Set( 1 ); - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EDatatype, EMTPTypeUINT8); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EDatatype, EMTPTypeUINT8 ); iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue, result.Value()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// EMTPTypeUINT8, -// result ); } break; @@ -242,9 +221,9 @@ // leave for KErrNotSupported in base class like previous version. if ( ( err == KErrNotFound ) || ( ( err == KErrNotSupported ) - && ( ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeASF ) - || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeMP4Container ) - || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCode3GPContainer ) ) ) ) + && ( ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeASF ) + || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeMP4Container ) + || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCode3GPContainer ) ) ) ) { iPropertyElement = NULL; } @@ -255,121 +234,4 @@ PRINT( _L( "MM MTP <= CMediaMtpDataProviderCopyObject::ServiceSpecificObjectPropertyL" ) ); } -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL -// -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL" ) ); - TMTPResponseCode responseCode( EMTPRespCodeOK ); - - switch ( aPropCode ) - { - case EMTPObjectPropCodeArtist: - case EMTPObjectPropCodeGenre: - case EMTPObjectPropCodeComposer: - case EMTPObjectPropCodeOriginalReleaseDate: - case EMTPObjectPropCodeAlbumName: - case EMTPObjectPropCodeParentalRating: - case EMTPObjectPropCodeEncodingProfile: - { - CMTPTypeString* stringData = - CMTPTypeString::NewLC( aElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData - - responseCode = ServiceMetaDataToWrapper( aPropCode, - *stringData, - aObject ); - - CleanupStack::PopAndDestroy( stringData ); // - stringData - } - break; - - case EMTPObjectPropCodeVideoBitRate: - { - responseCode = EMTPRespCodeAccessDenied; - } - break; - - case EMTPObjectPropCodeDescription: - { - CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData -// aElement.GetL( CMTPTypeObjectPropListElement::EValue, *desData ); - desData->SetByDesL(aElement.ArrayL(CMTPTypeObjectPropListElement::EValue)); - //desData(aElement.ArrayL(CMTPTypeObjectPropListElement::EValue)); - - responseCode = ServiceMetaDataToWrapper( aPropCode, - *desData, - aObject ); - CleanupStack::PopAndDestroy( desData ); // - desData - } - break; - - case EMTPObjectPropCodeWidth: - case EMTPObjectPropCodeHeight: - case EMTPObjectPropCodeDuration: - case EMTPObjectPropCodeUseCount: - case EMTPObjectPropCodeSampleRate: - case EMTPObjectPropCodeAudioWAVECodec: - case EMTPObjectPropCodeAudioBitRate: - case EMTPObjectPropCodeVideoFourCCCodec: - case EMTPObjectPropCodeFramesPerThousandSeconds: - case EMTPObjectPropCodeKeyFrameDistance: - { - TMTPTypeUint32 uint32( aElement.Uint32L( CMTPTypeObjectPropListElement::EValue ) ); - responseCode = ServiceMetaDataToWrapper( aPropCode, - uint32, - aObject ); - } - break; - - case EMTPObjectPropCodeTrack: - case EMTPObjectPropCodeNumberOfChannels: - case EMTPObjectPropCodeScanType: - case EMTPObjectPropCodeDRMStatus: - { - TMTPTypeUint16 uint16( aElement.Uint16L( CMTPTypeObjectPropListElement::EValue )); - responseCode = ServiceMetaDataToWrapper( aPropCode, - uint16, - aObject ); - } - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - { - TInt drmStatus = MmMtpDpUtility::GetDrmStatus( aObject.DesC( CMTPObjectMetaData::ESuid ) ); - - if (drmStatus == EMTPDrmStatusUnknown) - { - responseCode = EMTPRespCodeAccessDenied; - } - else - { - TMTPTypeUint8 newValue( aElement.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); - - // there's no DB field to remember the value, so return an error - // if there's a mismatch to CAF protection status - if ( ( ( drmStatus == EMTPDrmStatusProtected) && ( newValue.Value() == 0 ) ) || - ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( newValue.Value() == 1 ) ) ) - { - responseCode = EMTPRespCodeAccessDenied; - } - } - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderCopyObject::ServiceSetSpecificObjectPropertyL" ) ); - - return responseCode; - } - // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderdescriptionutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderdescriptionutility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,635 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Media dp specific property description construction utility. +* Used by all request processors which related to property description +* +*/ + +#include +#include + +#include "cmediamtpdataproviderdescriptionutility.h" +#include "mediamtpdataproviderconst.h" +#include "mmmtpdpconfig.h" +#include "mmmtpdplogger.h" + +const TUint32 KMTPDescriptionLen = 0x00000200; + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewL +// +// ----------------------------------------------------------------------------- +// +CMediaMtpDataProviderDescriptionUtility* CMediaMtpDataProviderDescriptionUtility::NewL() + { + CMediaMtpDataProviderDescriptionUtility* self = + new( ELeave ) CMediaMtpDataProviderDescriptionUtility(); + + return self; + } + +CMediaMtpDataProviderDescriptionUtility::CMediaMtpDataProviderDescriptionUtility() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL +// Construct media dp specific interdependent property description. +// ----------------------------------------------------------------------------- +// +CMTPTypeInterdependentPropDesc* CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL( MMmMtpDpConfig& aDpConfig, TUint aFormatCode ) + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL" ) ); + + TBool audioWaveCodecSupported = EFalse; + TBool audioBitRateSupported = EFalse; + TBool videoFourCcCodecSupported = EFalse; + TBool videoBitRateSupported = EFalse; + + const RArray* properties = aDpConfig.GetSupportedPropertiesL( aFormatCode ); + + TInt count = properties->Count(); + for ( TInt i = 0; i < count; i++ ) + { + switch ( ( *properties )[i] ) + { + case EMTPObjectPropCodeAudioWAVECodec: + audioWaveCodecSupported = ETrue; + break; + case EMTPObjectPropCodeAudioBitRate: + audioBitRateSupported = ETrue; + break; + case EMTPObjectPropCodeVideoFourCCCodec: + videoFourCcCodecSupported = ETrue; + break; + case EMTPObjectPropCodeVideoBitRate: + videoBitRateSupported = ETrue; + break; + default: + // do nothing + break; + } + } + + CMTPTypeInterdependentPropDesc* interdependentPropDesc = CMTPTypeInterdependentPropDesc::NewL(); + + if ( audioWaveCodecSupported && audioBitRateSupported ) + { + CMTPTypeInterdependentProperties* properties = CMTPTypeInterdependentProperties::NewL(); + properties->AppendL( NewAudioWaveCodecPropDescL( aFormatCode ) ); + properties->AppendL( NewAudioBitratePropDescL( aFormatCode ) ); + interdependentPropDesc->AppendL( properties ); + } + + if ( videoFourCcCodecSupported && videoBitRateSupported ) + { + CMTPTypeInterdependentProperties* properties = CMTPTypeInterdependentProperties::NewL(); + properties->AppendL( NewVideoFourCCCodecPropDescL( aFormatCode ) ); + properties->AppendL( NewVideoBitratePropDescL( aFormatCode ) ); + interdependentPropDesc->AppendL( properties ); + } + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL" ) ); + return interdependentPropDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewSpecificPropDescL +// Construct media dp specific property description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewSpecificPropDescL( TUint aFormatCode, TUint16 aPropCode ) + { + CMTPTypeObjectPropDesc* propertyDesc = NULL; + + switch ( aPropCode ) + { + // format specific + case EMTPObjectPropCodeArtist: // Artist + case EMTPObjectPropCodeTrack: // Track + case EMTPObjectPropCodeGenre: // Genre + case EMTPObjectPropCodeUseCount: // Use Count + case EMTPObjectPropCodeAlbumName: // Album Name + case EMTPObjectPropCodeAlbumArtist: // Album Artist + case EMTPObjectPropCodeOriginalReleaseDate: // Original Release Date + case EMTPObjectPropCodeComposer: // Composer + case EMTPObjectPropCodeParentalRating: + propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode ); + break; + + // Number of Channels (m) + case EMTPObjectPropCodeNumberOfChannels: + propertyDesc = NewNumberOfChannelsPropDescL(); + break; + + // Sample Rate (HAS MINIMUM AND MAX VALUE) + case EMTPObjectPropCodeSampleRate: + propertyDesc = NewCodeSampleRatePropDescL(); + break; + + // Audio Wave Codec (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) + case EMTPObjectPropCodeAudioWAVECodec: + propertyDesc = NewAudioWaveCodecPropDescL( aFormatCode ); + break; + + // Audio Bit Rate (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) + case EMTPObjectPropCodeAudioBitRate: + propertyDesc = NewAudioBitratePropDescL( aFormatCode ); + break; + + // Duration + case EMTPObjectPropCodeDuration: + propertyDesc = NewRangeFormDescriptionL( aPropCode, + EMTPMinDuration, + EMTPMaxDuration, + EMTPDurationStep ); + break; + + // Description + case EMTPObjectPropCodeDescription: + propertyDesc = NewDescriptionPropDescL(); + break; + + case EMTPObjectPropCodeWidth: + propertyDesc = NewRangeFormDescriptionL( aPropCode, + EMTPMinWidth, + EMTPMaxWidth, + EMTPStepWidth ); + break; + + case EMTPObjectPropCodeHeight: + propertyDesc = NewRangeFormDescriptionL( aPropCode, + EMTPMinHeight, + EMTPMaxHeight, + EMTPStepHeight ); + break; + + case EMTPObjectPropCodeScanType: + propertyDesc = NewScanTypeDescriptionPropDescL(); + break; + + case EMTPObjectPropCodeVideoFourCCCodec: + propertyDesc = NewVideoFourCCCodecPropDescL( aFormatCode ); + break; + + case EMTPObjectPropCodeVideoBitRate: + propertyDesc = NewVideoBitratePropDescL( aFormatCode ); + break; + + case EMTPObjectPropCodeFramesPerThousandSeconds: + propertyDesc = NewRangeFormDescriptionL( aPropCode, + EMTPMinFramesPerThousandSeconds, + EMTPMaxFramesPerThousandSeconds, + EMTPStepFramesPerThousandSeconds ); + break; + + case EMTPObjectPropCodeKeyFrameDistance: + propertyDesc = NewRangeFormDescriptionL( aPropCode, + EMTPMinKeyFrameDistance, + EMTPMaxKeyFrameDistance, + EMTPStepKeyFrameDistance ); + break; + + case EMTPObjectPropCodeEncodingProfile: + propertyDesc = NewEncodingProfileDescriptionPropDescL(); + break; + + case EMTPObjectPropCodeDRMStatus: + propertyDesc = NewDRMStatusPropDescL(); + break; + + case EMTPExtObjectPropCodeOmaDrmStatus: + propertyDesc = NewOMADRMStatusPropDescL(); + break; + + default: + // do nothing + break; + } + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL +// Construct audio wave codec property description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL( TUint aFormatCode ) + { + CMTPTypeObjectPropDescEnumerationForm* form = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + form + + switch( aFormatCode ) + { + case EMTPFormatCodeWMA: + case EMTPFormatCodeWMV: + case EMTPFormatCodeASF: + form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecWMA ) ); + break; + + case EMTPFormatCodeMP3: + form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecMP3 ) ); + break; + + case EMTPFormatCodeMP4Container: + case EMTPFormatCode3GPContainer: + case EMTPFormatCodeAAC: + form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecAAC ) ); + break; + + case EMTPFormatCodeWAV: + form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecPCM ) ); + break; + + default: + User::Leave( KErrNotSupported ); + break; + } + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeAudioWAVECodec, *form ); + + CleanupStack::PopAndDestroy( form ); // - form + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL +// Construct audio bitrate property description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL( TUint aFormatCode ) + { + PRINT1( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL, iFormatCode = 0x%x" ), aFormatCode ); + CMTPTypeObjectPropDesc* propertyDesc = NULL; + switch( aFormatCode ) + { + case EMTPFormatCodeWMA: + case EMTPFormatCodeWMV: + case EMTPFormatCodeASF: + propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, + EMTPWMAMinBitrate, + EMTPWMAMaxBitrate, + EMTPAudioBitrateStep ); + break; + + case EMTPFormatCodeMP3: + propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, + EMTPMP3MinBitrate, + EMTPMP3MaxBitrate, + EMTPAudioBitrateStep ); + break; + + case EMTPFormatCodeAAC: + propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, + EMTPAACMinBitrate, + EMTPAACMaxBitrate, + EMTPAudioBitrateStep ); + break; + + case EMTPFormatCodeWAV: + propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, + EMTPPCMMinBitrate, + EMTPPCMMaxBitrate, + EMTPAudioBitrateStep ); + break; + + case EMTPFormatCodeMP4Container: + case EMTPFormatCode3GPContainer: + propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, + EMTPAACPlusMinBitrate, + EMTPAACPlusMaxBitrate, + EMTPAudioBitrateStep ); + break; + + default: + // do nothing + break; + } + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL +// Construct property description of video fourCC codec. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL( TUint aFormatCode ) + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL" ) ); + + CMTPTypeObjectPropDesc* propertyDesc = NULL; + + if ( ( EMTPFormatCodeWMV == aFormatCode ) + || ( EMTPFormatCodeASF == aFormatCode ) ) + { + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm + + TUint32 values[] = + { + EMTPVideoFourCCCodecWMV3 + }; + + TInt numValues = sizeof( values ) / sizeof( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint32 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeVideoFourCCCodec, + *expectedForm ); + + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + } + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL" ) ); + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL +// Construct property description of VideoBitrate. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL( TUint aFormatCode ) + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL" ) ); + + CMTPTypeObjectPropDesc* propertyDesc = NULL; + + if ( ( EMTPFormatCodeWMV == aFormatCode ) + || ( EMTPFormatCodeASF == aFormatCode ) ) + { + propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeVideoBitRate, + EMTPWMVMinBitrate, + EMTPWMVMaxBitrate, + EMTPVideoBitrateStep, + ETrue ); + } + + PRINT( _L( "MM MTP <= MmMtpDpDescriptionUtiliNewviceVideoBitratePropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL() +// Construct property description of number of channels. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm + + TUint16 values[] = + { + EMTPChannelMono, + EMTPChannelStereo + }; + + TInt numValues = sizeof( values ) / sizeof( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint16 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNumberOfChannels, + *expectedForm ); + + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL +// Construct property description of code sample rate. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm + + TUint32 values[] = + { + EMTPSampleRate8K, + EMTPSampleRate16K, + EMTPSampleRate22_05K, + EMTPSampleRate24K, + EMTPSampleRate32K, + EMTPSampleRate44_1K, + EMTPSampleRate48K + }; + + TInt numValues = sizeof( values ) / sizeof( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint32 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeSampleRate, + CMTPTypeObjectPropDesc::EEnumerationForm, + expectedForm ); + + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL() +// Construct property description of description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL" ) ); + + TMTPTypeUint32 uint32Data( KMTPDescriptionLen ); + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDescription, + CMTPTypeObjectPropDesc::ELongStringForm, + &uint32Data ); + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL +// Construct property description of scan type description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm + + TUint16 values[] = + { + EMTPScanTypeProgressive + }; + + TInt numValues = sizeof( values ) / sizeof( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint16 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc* propertyDesc = NULL; + propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeScanType, + *expectedForm ); + + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL +// Construct property description of encoding profile description. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeString ); // + expectedForm + + CMTPTypeString* string = CMTPTypeString::NewLC( _L( "SP@LL" ) ); // + string + expectedForm->AppendSupportedValueL( *string ); + string->SetL( _L("SP@ML")); + expectedForm->AppendSupportedValueL( *string ); + string->SetL( _L("MP@LL")); + expectedForm->AppendSupportedValueL( *string ); + + CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; + propertyInfo.iDataType = EMTPTypeString; + propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; + propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite; + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeEncodingProfile, + propertyInfo, + expectedForm ); + + CleanupStack::PopAndDestroy( string ); // - string + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL +// Construct property description of DRM status. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm + + TUint16 values[] = + { + EMTPDrmNoProtection, + EMTPDrmProtection, + EMTPDrmReserveForMTP, + EMTPDrmVenderExtension + }; + + TInt numValues = sizeof( values ) / sizeof( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint16 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDRMStatus, + *expectedForm ); + + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderDescriptionUtility::NewOMADRMStatusPropDescL +// Construct property description of OMADRM status. +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewOMADRMStatusPropDescL() + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::NewOMADRMStatusPropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT8 ); // + expectedForm + + TUint8 values[] = + { + EMTPOMADrmNoProtection, + EMTPOMADrmProtection, + }; + + TInt numValues = sizeof( values ) / sizeof( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint8 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; + propertyInfo.iDataType = EMTPTypeUINT8; + propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPExtObjectPropCodeOmaDrmStatus, + propertyInfo, + expectedForm ); + + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::NewOMADRMStatusPropDescL" ) ); + + return propertyDesc; + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderenumerator.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderenumerator.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderenumerator.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -30,6 +30,14 @@ #include "cmmmtpdpaccesssingleton.h" #include "cmmmtpdpmetadataaccesswrapper.h" + +#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) +_LIT( KDirectoryScan, "DirectoryScan" ); +_LIT( KFormatFilter, "FormatFilter" ); +_LIT( KObjectManagerObjectUid, "ObjectManagerObjectUid" ); +_LIT( KObjectManagerInsert, "ObjectManagerInsert" ); +#endif + // Unit: microsecond const TInt KThresholdOfEnumerationLoopDuration = 1000 * 1000; // microsecond @@ -187,7 +195,7 @@ TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) ); PRINT2( _L("MM MTP <> CMediaMtpDataProviderEnumerator::ScanStorageL aStorageId = 0x%x, StorageSuid = %S"), aStorageId, &root ); - iParentHandle = KMTPHandleNone; + iParentHandle = KMTPHandleNoParent; iPath.Set( root, NULL, NULL); iDir.Close(); User::LeaveIfError( iDir.Open( iFramework.Fs(), @@ -218,7 +226,6 @@ } else { - // Round trip suppport const CMTPStorageMetaData& storage( iFramework.StorageMgr().StorageL( iStorages[0] ) ); TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) ); @@ -283,7 +290,7 @@ delete entry; entry = NULL; iDir.Close(); - + // Scan the next directory of the parent ScanNextDirL(); } @@ -314,9 +321,9 @@ // A empty (non-constructed) TEntry is our marker telling us to pop a directory // from iPath when we see this TEntry* entry = new TEntry( TEntry() ); - + User::LeaveIfNull( entry ); - + iDirStack.AppendL( entry ); // Leave with KErrNotFound if we don't find the object handle since it shouldn't be on the @@ -326,7 +333,7 @@ PERFLOGSTART( KObjectManagerObjectUid ); iParentHandle = iFramework.ObjectMgr().HandleL( suid ); PERFLOGSTOP( KObjectManagerObjectUid ); - PRINT1( _L( "MM MTP <> iParentHandle = 0x%Lx" ), iParentHandle ); + PRINT1( _L( "MM MTP <> iParentHandle = 0x%x" ), iParentHandle ); // Kick-off a scan of the next directory iDir.Close(); @@ -553,7 +560,7 @@ // TBool CMediaMtpDataProviderEnumerator::IsFileAccepted( const TDesC& aFullFileName ) { - PERFLOGSTART(KFormatFilter); + PERFLOGSTART( KFormatFilter ); iFormatCode = GetObjectFormatCode( aFullFileName ); PRINT1( _L( "MM MTP <> CMediaMtpDataProviderEnumerator::IsFileAcceptedL formatCode = 0x%x" ), iFormatCode ); TBool accepted = EFalse; @@ -567,7 +574,7 @@ } } - PERFLOGSTOP(KFormatFilter); + PERFLOGSTOP( KFormatFilter ); return accepted; } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetformatcapabilities.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetformatcapabilities.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,795 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#include -#include -#include - -#include "cmediamtpdataprovidergetobjectpropdesc.h" -#include "mediamtpdataproviderconst.h" -#include "cmediamtpdataprovidergetformatcapabilities.h" -#include "mmmtpdplogger.h" - -const TUint32 KMTPDescriptionLen = 0x00000200; - -// forward declaration -class MMmMtpDpConfig; -class CMTPTypeObjectPropDesc; -class CMTPTypeInterdependentPropDesc; -class CMTPTypeObjectPropDesc; -class CMTPTypeString; -class CGetFormatCapabilities; - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CMediaMtpDataProviderGetFormatCapabilities::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CMediaMtpDataProviderGetFormatCapabilities* self = - new ( ELeave ) CMediaMtpDataProviderGetFormatCapabilities( aFramework, - aConnection, - aDpConfig ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ConstructL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetFormatCapabilities::ConstructL() - { - CGetFormatCapabilities::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::~CMediaMtpDataProviderGetFormatCapabilities() -// Destructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderGetFormatCapabilities::~CMediaMtpDataProviderGetFormatCapabilities() - { - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::CMediaMtpDataProviderGetFormatCapabilities -// Standard c++ constructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderGetFormatCapabilities::CMediaMtpDataProviderGetFormatCapabilities( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CGetFormatCapabilities( aFramework, aConnection, aDpConfig ) - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceInterdepentPropDescL -// -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetFormatCapabilities::ServiceInterdepentPropDescL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceInterdepentPropDescL" ) ); - - iInterdependentPropDesc = CMTPTypeInterdependentPropDesc::NewL(); - - TBool audioWaveCodecSupported = EFalse; - TBool audioBitRateSupported = EFalse; - TBool videoFourCcCodecSupported = EFalse; - TBool videoBitRateSupported = EFalse; - - switch ( iFormatCode ) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeMP3: - case EMTPFormatCodeAAC: - case EMTPFormatCodeWAV: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryAudio ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryAudio[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - case EMTPFormatCodeMP4Container: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryAudio ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryAudio[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - case EMTPFormatCode3GPContainer: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryAudio ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryAudio[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryWMV ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryWMV[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - case EMTPObjectPropCodeVideoFourCCCodec: - videoFourCcCodecSupported = ETrue; - break; - case EMTPObjectPropCodeVideoBitRate: - videoBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - - if ( audioWaveCodecSupported && audioBitRateSupported ) - { - CMTPTypeInterdependentProperties* properties = CMTPTypeInterdependentProperties::NewL(); - if ( videoFourCcCodecSupported && videoBitRateSupported ) - { - // TODO: need to confirm - properties->AppendL( ServiceVideoFourCCCodecL() ); - properties->AppendL( ServiceVideoBitrateL() ); - iInterdependentPropDesc->AppendL( properties ); - } - properties = CMTPTypeInterdependentProperties::NewL(); - properties->AppendL( ServiceAudioWaveCodecL() ); - properties->AppendL( ServiceAudioBitrateL() ); - iInterdependentPropDesc->AppendL( properties ); - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceInterdepentPropDescL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioWaveCodecL -// -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioWaveCodecL() - { - PRINT1( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioWaveCodecL, iFormatCode = 0x%X" ), iFormatCode ); - CMTPTypeObjectPropDescEnumerationForm* form = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + form - - switch( iFormatCode ) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecWMA ) ); - break; - - case EMTPFormatCodeMP3: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecMP3 ) ); - break; - - case EMTPFormatCodeMP4Container: - case EMTPFormatCode3GPContainer: - case EMTPFormatCodeAAC: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecAAC ) ); - break; - - case EMTPFormatCodeWAV: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecPCM ) ); - break; - - default: - User::Leave( KErrNotSupported ); - break; - } - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewLC( EMTPObjectPropCodeAudioWAVECodec, *form ); // + propertyDesc - - // Set group code - propertyDesc->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, - EGroupCodeMediaDB ); - CleanupStack::Pop( propertyDesc ); // - propertyDesc - CleanupStack::PopAndDestroy( form ); // - form - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioWaveCodecL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioBitrateL -// -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioBitrateL() - { - PRINT1( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioBitrateL, iFormatCode = 0x%X" ), iFormatCode ); - CMTPTypeObjectPropDesc* propertyDesc = NULL; - switch( iFormatCode ) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - propertyDesc = ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPWMAMinBitrate, - EMTPWMAMaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeMP3: - propertyDesc = ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPMP3MinBitrate, - EMTPMP3MaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeAAC: - propertyDesc = ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPAACMinBitrate, - EMTPAACMaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeWAV: - propertyDesc = ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPPCMMinBitrate, - EMTPPCMMaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeMP4Container: - case EMTPFormatCode3GPContainer: - propertyDesc = ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPAACPlusMinBitrate, - EMTPAACPlusMaxBitrate, - EMTPAudioBitrateStep ); - break; - - default: - User::Leave( KErrNotSupported ); - break; - } - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceAudioBitrateL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoFourCCCodecL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoFourCCCodecL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoFourCCCodecL" ) ); - CMTPTypeObjectPropDesc* propertyDesc = NULL; - if ( ( EMTPFormatCodeWMV == iFormatCode ) - || ( EMTPFormatCodeASF == iFormatCode ) ) - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm - - TUint32 values[] = - { - EMTPVideoFourCCCodecWMV3 - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ); - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint32 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - propertyDesc = CMTPTypeObjectPropDesc::NewLC( EMTPObjectPropCodeVideoFourCCCodec, - *expectedForm ); // + propertyDesc - // Set group code - propertyDesc->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, - EGroupCodeMediaDB ); - CleanupStack::Pop( propertyDesc ); // - propertyDesc - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoFourCCCodecL" ) ); - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoBitrateL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoBitrateL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoBitrateL" ) ); - CMTPTypeObjectPropDesc* propertyDesc = NULL; - if ( ( EMTPFormatCodeWMV == iFormatCode ) - || ( EMTPFormatCodeASF == iFormatCode ) ) - { - propertyDesc = ServiceRangeFormDescriptionL( EMTPObjectPropCodeVideoBitRate, - EMTPWMVMinBitrate, - EMTPWMVMaxBitrate, - EMTPVideoBitrateStep, - ETrue ); - } - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceVideoBitrateL" ) ); - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceRangeFormDescriptionL -// -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceRangeFormDescriptionL( TUint16 aPropertyCode, - TUint32 aMinValue, - TUint32 aMaxValue, - TUint32 aStepValue, - TBool aIsReadOnly ) - { - PRINT1( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceRangeFormDescriptionL, aPropertyCode = 0x%X" ), - aPropertyCode ); - CMTPTypeObjectPropDescRangeForm* form = - CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form - - // Set expected values - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, aMinValue ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, aMaxValue ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, aStepValue ); - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeUINT32; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm; - propertyInfo.iGetSet = !aIsReadOnly; - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewLC( aPropertyCode, - propertyInfo, - form ); // + propertyDesc - // Set group code - propertyDesc->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, EGroupCodeMediaDB ); - - CleanupStack::Pop( propertyDesc ); // - propertyDesc - CleanupStack::PopAndDestroy( form ); // - form - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceRangeFormDescriptionL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceSpecificpropertyDescL -// -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceSpecificPropertyDescL( TUint16 aPropertyCode ) - { - PRINT1( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceSpecificPropertyDescL, aPropertyCode = 0x%X" ), aPropertyCode ); - // Property object to return with the desc value - CMTPTypeObjectPropDesc* propertyDesc = NULL; - - switch ( aPropertyCode ) - { - // format specific - case EMTPObjectPropCodeArtist: // Artist - case EMTPObjectPropCodeTrack: // Track - case EMTPObjectPropCodeGenre: // Genre - case EMTPObjectPropCodeUseCount: // Use Count - case EMTPObjectPropCodeAlbumName: // Album Name - case EMTPObjectPropCodeAlbumArtist: // Album Artist - case EMTPObjectPropCodeOriginalReleaseDate: // Original Release Date - case EMTPObjectPropCodeComposer: // Composer - case EMTPObjectPropCodeParentalRating: - propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropertyCode ); - break; - - // Number of Channels (m) - case EMTPObjectPropCodeNumberOfChannels: - propertyDesc = ServiceNumberOfChannelsL(); - break; - - // Sample Rate (HAS MINIMUM AND MAX VALUE) - case EMTPObjectPropCodeSampleRate: - propertyDesc = ServiceCodeSampleRateL(); - break; - - // Audio Wave Codec (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) - case EMTPObjectPropCodeAudioWAVECodec: - propertyDesc = ServiceAudioWaveCodecL(); - break; - - // Audio Bit Rate (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) - case EMTPObjectPropCodeAudioBitRate: - propertyDesc = ServiceAudioBitrateL(); - break; - - // Duration - case EMTPObjectPropCodeDuration: - propertyDesc = ServiceRangeFormDescriptionL( aPropertyCode, - EMTPMinDuration, - EMTPMaxDuration, - EMTPDurationStep ); - break; - - // Description - case EMTPObjectPropCodeDescription: - propertyDesc = ServiceDescriptionL(); - break; - - case EMTPObjectPropCodeWidth: - propertyDesc = ServiceRangeFormDescriptionL( aPropertyCode, - EMTPMinWidth, - EMTPMaxWidth, - EMTPStepWidth ); - break; - - case EMTPObjectPropCodeHeight: - propertyDesc = ServiceRangeFormDescriptionL( aPropertyCode, - EMTPMinHeight, - EMTPMaxHeight, - EMTPStepHeight ); - break; - - case EMTPObjectPropCodeScanType: - propertyDesc = ServiceScanTypeDescriptionL(); - break; - - case EMTPObjectPropCodeVideoFourCCCodec: - propertyDesc = ServiceVideoFourCCCodecL(); - break; - - case EMTPObjectPropCodeVideoBitRate: - propertyDesc = ServiceRangeFormDescriptionL( aPropertyCode, - EMTPWMVMinBitrate, - EMTPWMVMaxBitrate, - EMTPVideoBitrateStep, - ETrue ); - break; - - case EMTPObjectPropCodeFramesPerThousandSeconds: - propertyDesc = ServiceRangeFormDescriptionL( aPropertyCode, - EMTPMinFramesPerThousandSeconds, - EMTPMaxFramesPerThousandSeconds, - EMTPStepFramesPerThousandSeconds ); - break; - - case EMTPObjectPropCodeKeyFrameDistance: - propertyDesc = ServiceRangeFormDescriptionL( aPropertyCode, - EMTPMinKeyFrameDistance, - EMTPMaxKeyFrameDistance, - EMTPStepKeyFrameDistance ); - break; - - case EMTPObjectPropCodeEncodingProfile: - propertyDesc = ServiceEncodingProfileDescriptionL(); - break; - - case EMTPObjectPropCodeDRMStatus: - propertyDesc = ServiceDRMStatusL(); - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - propertyDesc = ServiceOMADRMStatusL(); - break; - - default: - User::Leave( KErrNotSupported ); - break; - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceSpecificPropertyDescL" ) ); - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceNumberOfChannelsL() -// Create list of possible Channel numbers and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceNumberOfChannelsL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceNumberOfChannelsL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm - - TUint16 values[] = - { - EMTPChannelMono, - EMTPChannelStereo - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ); - - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNumberOfChannels, - *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceNumberOfChannelsL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -//CMediaMtpDataProviderGetFormatCapabilities::ServiceCodeSampleRateL -// Create list of possible Sample rate list and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceCodeSampleRateL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceCodeSampleRateL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm - - TUint32 values[] = - { - EMTPSampleRate8K, - EMTPSampleRate16K, - EMTPSampleRate22_05K, - EMTPSampleRate24K, - EMTPSampleRate32K, - EMTPSampleRate44_1K, - EMTPSampleRate48K - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ); - - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint32 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeSampleRate, - CMTPTypeObjectPropDesc::EEnumerationForm, - expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceCodeSampleRateL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceDescriptionL() -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceDescriptionL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceDescriptionL" ) ); - - TMTPTypeUint32 uint32Data( KMTPDescriptionLen ); - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDescription, - CMTPTypeObjectPropDesc::ELongStringForm, - &uint32Data ); - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceDescriptionL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -//CMediaMtpDataProviderGetFormatCapabilities::ServiceScanTypeDescriptionL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceScanTypeDescriptionL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceScanTypeDescriptionL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm - - TUint16 values[] = - { - EMTPScanTypeProgressive - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ); - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc* propertyDesc = NULL; - propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeScanType, - *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceScanTypeDescriptionL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceEncodingProfileDescriptionL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceEncodingProfileDescriptionL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceEncodingProfileDescriptionL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeString ); // + expectedForm - - CMTPTypeString* string = CMTPTypeString::NewLC( _L( "SP@LL" ) ); // + string - expectedForm->AppendSupportedValueL( *string ); - string->SetL( _L("SP@ML")); - expectedForm->AppendSupportedValueL( *string ); - string->SetL( _L("MP@LL")); - expectedForm->AppendSupportedValueL( *string ); - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeString; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite; - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeEncodingProfile, - propertyInfo, - expectedForm ); - - CleanupStack::PopAndDestroy( string ); // - string - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceEncodingProfileDescriptionL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceDRMStatusL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceDRMStatusL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceDRMStatusL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm - - TUint16 values[] = - { - EMTPDrmNoProtection, - EMTPDrmProtection, - EMTPDrmReserveForMTP, - EMTPDrmVenderExtension - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ); - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDRMStatus, - *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceDRMStatusL" ) ); - - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetFormatCapabilities::ServiceOMADRMStatusL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CMediaMtpDataProviderGetFormatCapabilities::ServiceOMADRMStatusL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::ServiceOMADRMStatusL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT8 ); // + expectedForm - - TUint8 values[] = - { - EMTPOMADrmNoProtection, - EMTPOMADrmProtection, - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ); - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint8 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeUINT8; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPExtObjectPropCodeOmaDrmStatus, - propertyInfo, - expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::ServiceOMADRMStatusL" ) ); - - return propertyDesc; - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetinterdependentpropdesc.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetinterdependentpropdesc.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,461 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: GetInterdenpendentPropDesc -* -*/ - - -#include "cmediamtpdataprovidergetinterdependentpropdesc.h" -#include "mediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "tobjectdescription.h" -#include "mmmtpdpdefs.h" -#include "mmmtpdpconfig.h" - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CMediaMtpDataProviderGetInterDependentPropDesc::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CMediaMtpDataProviderGetInterDependentPropDesc* self = - new ( ELeave ) CMediaMtpDataProviderGetInterDependentPropDesc( aFramework, - aConnection ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CMediaDpMtpGetInterDependentPropDesc::ConstructL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetInterDependentPropDesc::ConstructL() - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::~CMediaMtpDataProviderGetInterDependentPropDesc -// Destructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderGetInterDependentPropDesc::~CMediaMtpDataProviderGetInterDependentPropDesc() - { - delete iDataset; - delete iProperties; - } - -// ----------------------------------------------------------------------------- -// CMTPGetInterDependentPropDesc::CMTPGetInterDependentPropDesc -// Standard c++ constructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderGetInterDependentPropDesc::CMediaMtpDataProviderGetInterDependentPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection ) : - CRequestProcessor( aFramework, aConnection, 0, NULL ) - { - PRINT( _L( "Operation: GetInterdependentPropDesc(0x9807)" ) ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::CheckRequestL -// Verify the reqeust and returns it -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CMediaMtpDataProviderGetInterDependentPropDesc::CheckRequestL() - { - TMTPResponseCode responseCode = CRequestProcessor::CheckRequestL(); - iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); - - if ( EMTPRespCodeOK == responseCode ) - { - TInt count = sizeof( KMediaMtpDataProviderSupportedFormats ) / sizeof( TUint16 ); - - responseCode = EMTPRespCodeInvalidObjectFormatCode; - - for ( TInt i = 0; i < count; i++ ) - { - if ( iFormatCode == KMediaMtpDataProviderSupportedFormats[i] ) - { - responseCode = EMTPRespCodeOK; - break; - } - } - } - - return responseCode; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::ServiceL -// service a request at request phase -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetInterDependentPropDesc::ServiceL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetInterDependentPropDesc::ServiceL" ) ); - - // Clear the data set. - delete iDataset; - iDataset = NULL; - iDataset = CMTPTypeInterdependentPropDesc::NewL(); - - TBool audioWaveCodecSupported = EFalse; - TBool audioBitRateSupported = EFalse; - TBool videoFourCcCodecSupported = EFalse; - TBool videoBitRateSupported = EFalse; - - switch ( iFormatCode ) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeMP3: - case EMTPFormatCodeAAC: - case EMTPFormatCodeWAV: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryAudio ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryAudio[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - default: - PRINT( _L( "MM MTP <> CMediaMtpDataProviderGetInterDependentPropDesc::ServiceL default" ) ); - // do nothing - break; - } - } - } - break; - - case EMTPFormatCodeMP4Container: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryAudio ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryAudio[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - case EMTPFormatCode3GPContainer: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryAudio ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch ( KMmMtpDpSupportedPropMandatoryAudio[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - TInt count = sizeof( KMmMtpDpSupportedPropMandatoryWMV ) / sizeof( TUint16 ); - - for ( TInt i = 0; i < count; i++ ) - { - switch (KMmMtpDpSupportedPropMandatoryWMV[i] ) - { - case EMTPObjectPropCodeAudioWAVECodec: - audioWaveCodecSupported = ETrue; - break; - case EMTPObjectPropCodeAudioBitRate: - audioBitRateSupported = ETrue; - break; - case EMTPObjectPropCodeVideoFourCCCodec: - videoFourCcCodecSupported = ETrue; - break; - case EMTPObjectPropCodeVideoBitRate: - videoBitRateSupported = ETrue; - break; - default: - // do nothing - break; - } - } - } - break; - - default: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetInterDependentPropDesc::ServiceL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - } - break; - } - - if ( audioWaveCodecSupported && audioBitRateSupported ) - { - if ( videoFourCcCodecSupported && videoBitRateSupported ) - { - iProperties = CMTPTypeInterdependentProperties::NewL(); - ServiceVideoFourCCCodecL(); - ServiceVideoBitrateL(); - iDataset->AppendL( iProperties ); -// CleanupStack::Pop(); - iProperties = NULL; - } - - iProperties = CMTPTypeInterdependentProperties::NewL(); - ServiceAudioWaveCodecL(); - ServiceAudioBitrateL(); - iDataset->AppendL( iProperties ); -// CleanupStack::Pop(); - iProperties = NULL; - } - - // Send the dataset. - SendDataL( *iDataset ); - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetInterDependentPropDesc::ServiceL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::ServiceAudioWaveCodecL -// -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetInterDependentPropDesc::ServiceAudioWaveCodecL() - { - CMTPTypeObjectPropDescEnumerationForm* form = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); - - switch( iFormatCode ) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecWMA ) ); - break; - - case EMTPFormatCodeMP3: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecMP3 ) ); - break; - - case EMTPFormatCodeMP4Container: - case EMTPFormatCode3GPContainer: - case EMTPFormatCodeAAC: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecAAC ) ); - break; - - case EMTPFormatCodeWAV: - form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecPCM ) ); - break; - - default: - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetInterDependentPropDesc::ServiceAudioWaveCodecL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - break; - } - - CMTPTypeObjectPropDesc::TPropertyInfo propInfo; - propInfo.iDataType = EMTPTypeUINT32; - propInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - propInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite; - SetFormForResponseL( EMTPObjectPropCodeAudioWAVECodec, propInfo, form ); - CleanupStack::PopAndDestroy( form ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::ServiceAudioBitrateL -// -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetInterDependentPropDesc::ServiceAudioBitrateL() - { - switch( iFormatCode ) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPWMAMinBitrate, - EMTPWMAMaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeMP3: - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPMP3MinBitrate, - EMTPMP3MaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeAAC: - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPAACMinBitrate, - EMTPAACMaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeWAV: - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPPCMMinBitrate, - EMTPPCMMaxBitrate, - EMTPAudioBitrateStep ); - break; - - case EMTPFormatCodeMP4Container: - case EMTPFormatCode3GPContainer: - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPAACPlusMinBitrate, - EMTPAACPlusMaxBitrate, - EMTPAudioBitrateStep ); - break; - - default: - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetInterDependentPropDesc::ServiceAudioBitrateL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - break; - } - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetInterDependentPropDesc::ServiceVideoFourCCCodecL -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetInterDependentPropDesc::ServiceVideoFourCCCodecL() - { - switch( iFormatCode ) - { - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - CMTPTypeObjectPropDescEnumerationForm* form = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT32 ); - CleanupStack::PushL( form ); // + form - - TUint32 values[] = - { - EMTPVideoFourCCCodecWMV3 - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint32 data( values[i] ); - form->AppendSupportedValueL( data ); - } - // TODO: - CMTPTypeObjectPropDesc::TPropertyInfo propInfo; - propInfo.iDataType = EMTPTypeUINT32; - propInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - propInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite; - SetFormForResponseL( EMTPObjectPropCodeVideoFourCCCodec, propInfo, form ); - CleanupStack::PopAndDestroy( form ); // - form - } - break; - - default: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetInterDependentPropDesc::ServiceVideoFourCCCodecL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - } - break; - } - } - -void CMediaMtpDataProviderGetInterDependentPropDesc::ServiceVideoBitrateL() - { - switch( iFormatCode ) - { - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - ServiceRangeFormDescriptionL( EMTPObjectPropCodeVideoBitRate, - EMTPWMVMinBitrate, - EMTPWMVMaxBitrate, - EMTPVideoBitrateStep, - ETrue ); - break; - - default: - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetInterDependentPropDesc::ServiceVideoBitrateL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - break; - } - } - -void CMediaMtpDataProviderGetInterDependentPropDesc::ServiceRangeFormDescriptionL( TUint16 aPropCode, - TUint32 aMinValue, - TUint32 aMaxValue, - TUint32 aStepValue, - TBool aIsReadOnly ) - { - CMTPTypeObjectPropDescRangeForm* form = - CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form - - // Set expected values - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, aMinValue ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, aMaxValue ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, aStepValue ); - - CMTPTypeObjectPropDesc::TPropertyInfo propInfo; - propInfo.iDataType = EMTPTypeUINT32; - propInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm; - propInfo.iGetSet = !aIsReadOnly; - SetFormForResponseL( aPropCode, propInfo, form ); - CleanupStack::PopAndDestroy( form ); // - form - } - -void CMediaMtpDataProviderGetInterDependentPropDesc::SetFormForResponseL( TUint16 aPropertyCode, - CMTPTypeObjectPropDesc::TPropertyInfo& aPropInfo, - const MMTPType* aForm ) - { - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewLC( aPropertyCode, - aPropInfo, - aForm ); - // Set group code - propertyDesc->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, EGroupCodeMediaDB ); - - iProperties->AppendL( propertyDesc ); - CleanupStack::Pop( propertyDesc ); - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropdesc.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropdesc.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,716 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: GetObjectPropDesc -* -*/ - -#include -#include -#include - -#include "cmediamtpdataprovidergetobjectpropdesc.h" -#include "mediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "mmmtpdpdefs.h" - -const TUint32 KMTPDescriptionLen = 0x00000200; - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CMediaMtpDataProviderGetObjectPropDesc::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CMediaMtpDataProviderGetObjectPropDesc* self = - new ( ELeave ) CMediaMtpDataProviderGetObjectPropDesc( aFramework, - aConnection, - aDpConfig ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::ConstructL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ConstructL() - { - CGetObjectPropDesc::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::~CMediaMtpDataProviderGetObjectPropDesc -// Destructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderGetObjectPropDesc::~CMediaMtpDataProviderGetObjectPropDesc() - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::CMediaMtpDataProviderGetObjectPropDesc -// Standard c++ constructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderGetObjectPropDesc::CMediaMtpDataProviderGetObjectPropDesc( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CGetObjectPropDesc( aFramework, aConnection, aDpConfig ) - { - - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceSpecificObjectPropertyL(TUint16 aPropCode) - { - switch (aPropCode) - { - // format specific - case EMTPObjectPropCodeArtist: // Artist - case EMTPObjectPropCodeTrack: // Track - case EMTPObjectPropCodeGenre: // Genre - case EMTPObjectPropCodeUseCount: // Use Count - case EMTPObjectPropCodeAlbumName: // Album Name - case EMTPObjectPropCodeAlbumArtist: // Album Artist - case EMTPObjectPropCodeOriginalReleaseDate: // Original Release Date - case EMTPObjectPropCodeComposer: // Composer - case EMTPObjectPropCodeParentalRating: - iObjectProperty = CMTPTypeObjectPropDesc::NewL( aPropCode ); - break; - - // Number of Channels (m) - case EMTPObjectPropCodeNumberOfChannels: - ServiceNumberOfChannelsL(); - break; - - // Sample Rate (HAS MINIMUM AND MAX VALUE) - case EMTPObjectPropCodeSampleRate: - ServiceCodeSampleRateL(); - break; - - // Audio Wave Codec (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) - case EMTPObjectPropCodeAudioWAVECodec: - ServiceCodeWaveCodecL(); - break; - - // Audio Bit Rate (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) - case EMTPObjectPropCodeAudioBitRate: - ServiceCodeAudioBitrateL(); - break; - - // Duration - case EMTPObjectPropCodeDuration: - ServiceDurationL(); - break; - - // Description - case EMTPObjectPropCodeDescription: - ServiceDescriptionL(); - break; - - case EMTPObjectPropCodeWidth: - ServiceRangeFormDescriptionL( aPropCode, - EMTPMinWidth, - EMTPMaxWidth, - EMTPStepWidth ); - break; - - case EMTPObjectPropCodeHeight: - ServiceRangeFormDescriptionL( aPropCode, - EMTPMinHeight, - EMTPMaxHeight, - EMTPStepHeight ); - break; - - case EMTPObjectPropCodeScanType: - ServiceScanTypeDescriptionL(); - break; - - case EMTPObjectPropCodeVideoFourCCCodec: - ServiceVideoFourCCCodecL(); - break; - - case EMTPObjectPropCodeVideoBitRate: - ServiceRangeFormDescriptionL( aPropCode, - EMTPWMVMinBitrate, - EMTPWMVMaxBitrate, - EMTPVideoBitrateStep, - ETrue ); - break; - - case EMTPObjectPropCodeFramesPerThousandSeconds: - ServiceRangeFormDescriptionL( aPropCode, - EMTPMinFramesPerThousandSeconds, - EMTPMaxFramesPerThousandSeconds, - EMTPStepFramesPerThousandSeconds ); - break; - - case EMTPObjectPropCodeKeyFrameDistance: - ServiceRangeFormDescriptionL( aPropCode, - EMTPMinKeyFrameDistance, - EMTPMaxKeyFrameDistance, - EMTPStepKeyFrameDistance ); - break; - - case EMTPObjectPropCodeEncodingProfile: - ServiceEncodingProfileDescriptionL(); - break; - - case EMTPObjectPropCodeDRMStatus: - ServiceDRMStatusL(); - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - ServiceOMADRMStatusL(); - break; - - default: - User::Leave( KErrNotSupported ); - break; - } - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::ServiceDescriptionL() -// Create Description and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceDescriptionL() - { - TMTPTypeUint32 uint32Data( KMTPDescriptionLen ); - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDescription, - CMTPTypeObjectPropDesc::ELongStringForm, - &uint32Data ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::ServiceNumberOfChannelsL -// Create list of possible Channel numbers and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceNumberOfChannelsL() - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeSampleRateL" ) ); - - CMTPTypeObjectPropDescEnumerationForm* expectedForm = CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT16 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - - TUint16 values[] = - { - EMTPChannelMono, - EMTPChannelStereo - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNumberOfChannels, *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeSampleRateL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeSampleRateL -// Create list of possible Sample rate list and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeSampleRateL() - { - // if some format does not support the sample rate, - // here still need an instance of CMTPTypeObjectPropDesc. - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeSampleRateL" ) ); - - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm - - TUint32 values[] = - { - EMTPSampleRate8K , - EMTPSampleRate16K, - EMTPSampleRate22_05K, - EMTPSampleRate24K, - EMTPSampleRate32K, - EMTPSampleRate44_1K, - EMTPSampleRate48K - }; - - TInt numValues = sizeof( values ) / sizeof( values[0] ) ; - - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint32 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeSampleRate, CMTPTypeObjectPropDesc::EEnumerationForm, expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeSampleRateL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::ServiceWaveCodecL -// Create list of possible bitrate types and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL() - { - PRINT1( _L( "MM MTP => CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL, format = 0x%x" ), iFormatCode ); - - CMTPTypeObjectPropDescEnumerationForm* form = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + form - - switch (iFormatCode) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL format = 0x%x" ), iFormatCode ); - TMTPTypeUint32 data( EMTPAudioWAVECodecWMA ); - form->AppendSupportedValueL( data ); - } - break; - - case EMTPFormatCodeMP3: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL format = 0x%x" ), iFormatCode ); - TMTPTypeUint32 data( EMTPAudioWAVECodecMP3 ); - form->AppendSupportedValueL( data ); - } - break; - - case EMTPFormatCodeMP4Container: - case EMTPFormatCode3GPContainer: - case EMTPFormatCodeAAC: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL format = 0x%x" ), iFormatCode ); - TMTPTypeUint32 data( EMTPAudioWAVECodecAAC ); - form->AppendSupportedValueL( data ); - } - break; - - case EMTPFormatCodeWAV: - { - PRINT1( _L("MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL format = 0x%x"), iFormatCode ); - TMTPTypeUint32 data( EMTPAudioWAVECodecPCM ); - form->AppendSupportedValueL( data ); - } - break; - - default: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave(KErrNotSupported); - } - break; - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeAudioWAVECodec, *form ); - CleanupStack::PopAndDestroy( form ); // - form - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeWaveCodecL" ) ); - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeAudioBitrateL() - { - PRINT1( _L("MM MTP => CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeAudioBitrate, format = 0x%x"), iFormatCode ); - - switch (iFormatCode) - { - case EMTPFormatCodeWMA: - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPWMAMinBitrate, - EMTPWMAMaxBitrate, - EMTPAudioBitrateStep ); - } - break; - - case EMTPFormatCodeMP3: - { - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPMP3MinBitrate, - EMTPMP3MaxBitrate, - EMTPAudioBitrateStep ); - } - break; - - case EMTPFormatCodeAAC: - { - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPAACMinBitrate, - EMTPAACMaxBitrate, - EMTPAudioBitrateStep ); - } - break; - - case EMTPFormatCodeWAV: - { - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPPCMMinBitrate, - EMTPPCMMaxBitrate, - EMTPAudioBitrateStep ); - } - break; - - case EMTPFormatCodeMP4Container: - case EMTPFormatCode3GPContainer: - { - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPAACPlusMinBitrate, - EMTPAACPlusMaxBitrate, - EMTPAudioBitrateStep ); - } - break; - - default: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeAudioBitRateL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - } - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetObjectPropDesc::ServiceCodeAudioBitRateL" ) ); - } - -// ----------------------------------------------------------------------------- -// CGetObjectPropDesc::ServiceDurationL() -// Create list of Duration types and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceDurationL() - { - - PRINT( _L( "MM MTP => CMediaMtpDataProviderGetObjectPropDesc::ServiceDurationL" ) ); - - CMTPTypeObjectPropDescRangeForm* form = CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form - - // Set expected values - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, EMTPMinDuration ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, EMTPMaxDuration ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, EMTPDurationStep ); - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDuration, *form ); - CleanupStack::PopAndDestroy( form ); // - form - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetObjectPropDesc::ServiceDurationL" ) ); - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceScanTypeDescriptionL() - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT16 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - - TUint16 values[] = - { - EMTPScanTypeProgressive - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeScanType, *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceVideoFourCCCodecL() - { - switch( iFormatCode ) - { - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT32 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - - TUint32 values[] = - { - EMTPVideoFourCCCodecWMV3 - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint32 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // comment out asf fourcc for mp2a and mp4a, not sure if this is needed - /*if ( iFormatCode == EMTPFormatCodeASF ) - { - TUint32 additionalValues[] = - { - EMTPVideoFourCCCodecMP2A, - EMTPVideoFourCCCodecMP4A - }; - - for ( TInt j = 0; i < sizeof(additionalValues) / sizeof(additionalValues[0]) ) - { - TMTPTypeUint32 data( additionalValues[i] ); - expectedForm->AppendSupportedValueL( data ); - } - }*/ - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeVideoFourCCCodec, *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - break; - - default: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceVideoFourCCCodecL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - } - break; - } - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceVideoBitrateL() - { - switch( iFormatCode ) - { - case EMTPFormatCodeWMV: - case EMTPFormatCodeASF: - { - ServiceRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, - EMTPWMVMinBitrate, - EMTPWMVMaxBitrate, - EMTPVideoBitrateStep, - ETrue ); - } - break; - - default: - { - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropDesc::ServiceVideoBitrateL leave because of invalid formatcode = 0x%x" ), iFormatCode ); - User::Leave( KErrNotSupported ); - } - break; - } - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceEncodingProfileDescriptionL() - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeString ); // + expectedForm - - CMTPTypeString* string = CMTPTypeString::NewLC( _L( "SP@LL" ) ); - expectedForm->AppendSupportedValueL( *string ); - string->SetL(_L("SP@ML")); - expectedForm->AppendSupportedValueL( *string ); - string->SetL(_L("MP@LL")); - expectedForm->AppendSupportedValueL( *string ); - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeString; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite; - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeEncodingProfile, - propertyInfo, - expectedForm ); - - CleanupStack::PopAndDestroy( string ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - -void CMediaMtpDataProviderGetObjectPropDesc::ServiceRangeFormDescriptionL( TUint16 aPropCode, - TUint32 aMinValue, - TUint32 aMaxValue, - TUint32 aStepValue, - TBool aIsReadOnly ) - { - CMTPTypeObjectPropDescRangeForm* form = - CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form - - // Set expected values - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, aMinValue ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, aMaxValue ); - form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, aStepValue ); - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeUINT32; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm; - propertyInfo.iGetSet = !aIsReadOnly; - iObjectProperty = CMTPTypeObjectPropDesc::NewL( aPropCode, propertyInfo, form ); - - CleanupStack::PopAndDestroy( form ); // - form - } - -// ----------------------------------------------------------------------------- -// CGetObjectPropDesc::ServiceDRMStatusL -// Create list of possible DRM status and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceDRMStatusL() - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT16 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - - TUint16 values[] = - { - EMTPDrmNoProtection, - EMTPDrmProtection, - EMTPDrmReserveForMTP, - EMTPDrmVenderExtension - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDRMStatus, *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderGetObjectPropDesc::ServiceOMADRMStatusL -// Create list of possible OMA DRM status and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderGetObjectPropDesc::ServiceOMADRMStatusL() - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT8 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - - TUint8 values[] = - { - EMTPOMADrmNoProtection, - EMTPOMADrmProtection, - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint8 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeUINT8; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPExtObjectPropCodeOmaDrmStatus, - propertyInfo, - expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectproplist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectproplist.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -54,7 +54,7 @@ // CMediaMtpDataProviderGetObjectPropList::~CMediaMtpDataProviderGetObjectPropList() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -63,10 +63,11 @@ // ----------------------------------------------------------------------------- // CMediaMtpDataProviderGetObjectPropList::CMediaMtpDataProviderGetObjectPropList( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CGetObjectPropList( aFramework, aConnection, aDpConfig ) + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) : + CGetObjectPropList( aFramework, aConnection, aDpConfig ) { + // Do nothing } // ----------------------------------------------------------------------------- diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropvalue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropvalue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -54,7 +54,7 @@ // void CMediaMtpDataProviderGetObjectPropValue::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -64,7 +64,7 @@ // CMediaMtpDataProviderGetObjectPropValue::~CMediaMtpDataProviderGetObjectPropValue() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -77,7 +77,7 @@ MMmMtpDpConfig& aDpConfig ) : CGetObjectPropValue( aFramework, aConnection, aDpConfig ) { - + // Do nothing } void CMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL(TUint16 aPropCode) diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidermoveobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidermoveobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidermoveobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -1,20 +1,19 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: Copy Object -* -*/ - + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implement the operation: Move Object + * + */ #include #include @@ -65,7 +64,7 @@ // CMediaMtpDataProviderMoveObject::~CMediaMtpDataProviderMoveObject() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -78,7 +77,7 @@ MMmMtpDpConfig& aDpConfig ) : CMoveObject( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -90,7 +89,8 @@ TUint32 aHandle, const CMTPObjectMetaData& aObject ) { - PRINT1( _L( "MM MTP => CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL aPropCode(0x%x)" ), aPropCode ); + PRINT1( _L( "MM MTP => CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL aPropCode(0x%x)" ), + aPropCode ); CMTPTypeString* textData = NULL; CMTPTypeArray* desData = NULL; @@ -112,7 +112,7 @@ case EMTPObjectPropCodeParentalRating: case EMTPObjectPropCodeEncodingProfile: { - textData = CMTPTypeString::NewLC(); // + textData + textData = CMTPTypeString::NewLC(); // + textData TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( aPropCode, *textData, @@ -122,45 +122,8 @@ if ( err == KErrNone ) { - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// *textData ); - } - else if ( err == KErrNotFound ) - { - iPropertyElement = NULL; - } - else - { - User::Leave( err ); - } - - CleanupStack::PopAndDestroy( textData ); // - textData - } - break; - - case EMTPObjectPropCodeDescription: - { - desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData - - TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( aPropCode, - *desData, - aObject ) ); - - PRINT1( _L( "MM MTP <> CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL err = %d" ), err ); - - if ( err == KErrNone ) - { - - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// *desData ); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() ); } else if ( err == KErrNotFound ) { @@ -171,7 +134,36 @@ User::Leave( err ); } - CleanupStack::PopAndDestroy( desData ); // - desData + CleanupStack::PopAndDestroy( textData ); // - textData + } + break; + + case EMTPObjectPropCodeDescription: + { + desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData + + TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( aPropCode, + *desData, + aObject ) ); + + PRINT1( _L( "MM MTP <> CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL err = %d" ), err ); + + if ( err == KErrNone ) + { + + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData ); + } + else if ( err == KErrNotFound ) + { + iPropertyElement = NULL; + } + else + { + User::Leave( err ); + } + + CleanupStack::PopAndDestroy( desData ); // - desData } break; @@ -188,13 +180,8 @@ if ( err == KErrNone ) { - - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// uint16 ); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value() ); } else if ( err == KErrNotFound ) { @@ -227,12 +214,8 @@ if ( err == KErrNone ) { - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// uint32 ); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value() ); } else if ( err == KErrNotFound ) { @@ -254,129 +237,9 @@ if ( drmStatus == EMTPDrmStatusProtected ) result.Set( 1 ); - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EDatatype, EMTPTypeUINT8); - iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue, result.Value()); - -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle, -// aPropCode, -// EMTPTypeUINT8, -// result ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL -// -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL" ) ); - TMTPResponseCode responseCode( EMTPRespCodeOK ); - - switch ( aPropCode ) - { - case EMTPObjectPropCodeArtist: - case EMTPObjectPropCodeGenre: - case EMTPObjectPropCodeComposer: - case EMTPObjectPropCodeOriginalReleaseDate: - case EMTPObjectPropCodeAlbumName: - case EMTPObjectPropCodeParentalRating: - case EMTPObjectPropCodeEncodingProfile: - { - CMTPTypeString* stringData = - CMTPTypeString::NewLC( aElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData - - responseCode = ServiceMetaDataToWrapper( aPropCode, - *stringData, - aObject ); - - CleanupStack::PopAndDestroy( stringData );// - stringData - } - break; - - case EMTPObjectPropCodeVideoBitRate: - { - responseCode = EMTPRespCodeAccessDenied; - } - break; - - case EMTPObjectPropCodeDescription: - { - CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData -// aElement.GetL( CMTPTypeObjectPropListElement::EValue, *desData ); - - desData->SetByDesL(aElement.ArrayL(CMTPTypeObjectPropListElement::EValue )); - responseCode = ServiceMetaDataToWrapper( aPropCode, - *desData, - aObject ); - CleanupStack::PopAndDestroy( desData ); // - desData - } - break; - - case EMTPObjectPropCodeWidth: - case EMTPObjectPropCodeHeight: - case EMTPObjectPropCodeDuration: - case EMTPObjectPropCodeUseCount: - case EMTPObjectPropCodeSampleRate: - case EMTPObjectPropCodeAudioWAVECodec: - case EMTPObjectPropCodeAudioBitRate: - case EMTPObjectPropCodeVideoFourCCCodec: - case EMTPObjectPropCodeFramesPerThousandSeconds: - case EMTPObjectPropCodeKeyFrameDistance: - { - TMTPTypeUint32 uint32( aElement.Uint32L( CMTPTypeObjectPropListElement::EValue ) ); - responseCode = ServiceMetaDataToWrapper( aPropCode, - uint32, - aObject ); - } - break; - - case EMTPObjectPropCodeTrack: - case EMTPObjectPropCodeNumberOfChannels: - case EMTPObjectPropCodeScanType: - case EMTPObjectPropCodeDRMStatus: - { - TMTPTypeUint16 uint16( aElement.Uint16L( CMTPTypeObjectPropListElement::EValue )); - responseCode = ServiceMetaDataToWrapper( aPropCode, - uint16, - aObject ); - } - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - { - TInt drmStatus = MmMtpDpUtility::GetDrmStatus( aObject.DesC( - CMTPObjectMetaData::ESuid ) ); - - if ( drmStatus == EMTPDrmStatusUnknown ) - { - responseCode = EMTPRespCodeAccessDenied; - } - else - { - TMTPTypeUint8 newValue( aElement.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); - - // there's no DB field to remember the value, so return an error - // if there's a mismatch to CAF protection status - if ( ( ( drmStatus == EMTPDrmStatusProtected ) && ( newValue.Value() == 0 ) ) - || ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( newValue.Value() == 1 ) ) ) - { - responseCode = EMTPRespCodeAccessDenied; - } - } + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EDatatype, EMTPTypeUINT8 ); + iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue, result.Value() ); } break; @@ -387,9 +250,7 @@ break; } - PRINT( _L( "MM MTP <= CMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL" ) ); - - return responseCode; + PRINT( _L( "MM MTP <= CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL" ) ); } // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderpropertysettingutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderpropertysettingutility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "tobjectdescription.h" +#include "cmmmtpdpmetadataaccesswrapper.h" +#include "mmmtpdpconfig.h" +#include "mmmtpdputility.h" + +#include "cmediamtpdataproviderpropertysettingutility.h" +#include "mmmtpdplogger.h" + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderPropertySettingUtility::NewL +// Two-phase construction method +// ----------------------------------------------------------------------------- +// +CMediaMtpDataProviderPropertySettingUtility* CMediaMtpDataProviderPropertySettingUtility::NewL() + { + CMediaMtpDataProviderPropertySettingUtility* self = + new ( ELeave ) CMediaMtpDataProviderPropertySettingUtility(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderPropertySettingUtility::~CMediaMtpDataProviderPropertySettingUtility +// Destructor +// ----------------------------------------------------------------------------- +// +CMediaMtpDataProviderPropertySettingUtility::~CMediaMtpDataProviderPropertySettingUtility() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CMediaMtpDataProviderSetObjectPropList::CMediaMtpDataProviderSetObjectPropList +// Standard C++ Constructor +// ----------------------------------------------------------------------------- +// +CMediaMtpDataProviderPropertySettingUtility::CMediaMtpDataProviderPropertySettingUtility() + { + // Do nothing + } + +TMTPResponseCode CMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL( MMmMtpDpConfig& aDpConfig, + TUint16 aPropCode, + const CMTPObjectMetaData& aObject, + const CMTPTypeObjectPropListElement& aElement ) + { + PRINT( _L( "MM MTP => CMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL" ) ); + TMTPResponseCode responseCode( EMTPRespCodeOK ); + + switch ( aPropCode ) + { + case EMTPObjectPropCodeArtist: + case EMTPObjectPropCodeGenre: + case EMTPObjectPropCodeComposer: + case EMTPObjectPropCodeOriginalReleaseDate: + case EMTPObjectPropCodeAlbumName: + case EMTPObjectPropCodeParentalRating: + case EMTPObjectPropCodeEncodingProfile: + { + CMTPTypeString* stringData = + CMTPTypeString::NewLC( aElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData + + responseCode = SetMetaDataToWrapperL( aDpConfig, + aPropCode, + *stringData, + aObject ); + + CleanupStack::PopAndDestroy( stringData );// - stringData + } + break; + + case EMTPObjectPropCodeVideoBitRate: + /* + spec: + * Object properties that are get-only (0x00 GET) + * should accept values during object creation by + * way of the SendObjectPropList command. + */ + break; + + case EMTPObjectPropCodeDescription: + { + CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData + desData->SetByDesL( aElement.ArrayL( CMTPTypeObjectPropListElement::EValue ) ); + responseCode = SetMetaDataToWrapperL( aDpConfig, + aPropCode, + *desData, + aObject ); + CleanupStack::PopAndDestroy( desData ); // - desData + } + break; + + case EMTPObjectPropCodeWidth: + case EMTPObjectPropCodeHeight: + case EMTPObjectPropCodeDuration: + case EMTPObjectPropCodeUseCount: + case EMTPObjectPropCodeSampleRate: + case EMTPObjectPropCodeAudioWAVECodec: + case EMTPObjectPropCodeAudioBitRate: + case EMTPObjectPropCodeVideoFourCCCodec: + case EMTPObjectPropCodeFramesPerThousandSeconds: + case EMTPObjectPropCodeKeyFrameDistance: + { + TMTPTypeUint32 uint32( aElement.Uint32L( CMTPTypeObjectPropListElement::EValue ) ); + responseCode = SetMetaDataToWrapperL( aDpConfig, + aPropCode, + uint32, + aObject ); + } + break; + + case EMTPObjectPropCodeTrack: + case EMTPObjectPropCodeNumberOfChannels: + case EMTPObjectPropCodeScanType: + case EMTPObjectPropCodeDRMStatus: + { + TMTPTypeUint16 uint16( aElement.Uint16L( CMTPTypeObjectPropListElement::EValue ) ); + responseCode = SetMetaDataToWrapperL( aDpConfig, + aPropCode, + uint16, + aObject ); + } + break; + + case EMTPExtObjectPropCodeOmaDrmStatus: + { + TInt drmStatus = MmMtpDpUtility::GetDrmStatus( aObject.DesC( CMTPObjectMetaData::ESuid ) ); + + if ( drmStatus == EMTPDrmStatusUnknown ) + { + responseCode = EMTPRespCodeAccessDenied; + } + else + { + TMTPTypeUint8 newValue( aElement.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); + + // there's no DB field to remember the value, so return an error + // if there's a mismatch to CAF protection status + if ( ( ( drmStatus == EMTPDrmStatusProtected ) + && ( newValue.Value() == 0 ) ) + || ( ( drmStatus == EMTPDrmStatusNotProtected ) + && ( newValue.Value() == 1 ) ) ) + { + responseCode = EMTPRespCodeAccessDenied; + } + } + } + break; + + default: + { + // Should not happen, property code should have been checked before set to store. + User::Leave( KErrNotSupported ); + } + break; + } + + PRINT( _L( "MM MTP <= CMediaMtpDataProviderPropertySettingUtility::ServiceSpecificObjectPropertyL" ) ); + + return responseCode; + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersendobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersendobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,289 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Implement the operation: SendObjectInfo/SendObjectPropList/SendObject - * - */ - -#include -#include -#include -#include - -#include "cmediamtpdataprovidersendobject.h" -#include "mediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "cmmmtpdpmetadataaccesswrapper.h" -#include "mmmtpdputility.h" - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSendObject::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CMediaMtpDataProviderSendObject::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig) - { - CMediaMtpDataProviderSendObject* self = new ( ELeave ) CMediaMtpDataProviderSendObject( aFramework, aConnection, aDpConfig ); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSendObject::~CMediaMtpDataProviderSendObject -// Destructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderSendObject::~CMediaMtpDataProviderSendObject() - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSendObject::CMediaMtpDataProviderSendObject -// Standard C++ Constructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderSendObject::CMediaMtpDataProviderSendObject( - MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig) : - CSendObject(aFramework, aConnection, aDpConfig) - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSendObject::ConstructL -// 2nd Phase Constructor -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderSendObject::ConstructL() - { - CSendObject::ConstructL(); - } - -TMTPResponseCode CMediaMtpDataProviderSendObject::CheckSepecificPropType( TUint16 aPropCode, TUint16 aDataType ) - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderSendObject::CheckSepecificPropType" ) ); - TMTPResponseCode responseCode( EMTPRespCodeOK ); - - switch ( aPropCode ) - { - case EMTPObjectPropCodeArtist: // 0xDC46 - case EMTPObjectPropCodeGenre: // 0xDC8C - case EMTPObjectPropCodeParentalRating: // 0xDC94 - case EMTPObjectPropCodeComposer: // 0xDC96 - case EMTPObjectPropCodeOriginalReleaseDate: // 0xDC99 - case EMTPObjectPropCodeAlbumName: // 0xDC9A - case EMTPObjectPropCodeEncodingProfile: // 0xDEA1 - if ( aDataType != EMTPTypeString) - { - responseCode = EMTPRespCodeInvalidObjectPropFormat; - } - break; - - case EMTPObjectPropCodeDescription: - if ( aDataType != EMTPTypeAUINT16) - { - responseCode = EMTPRespCodeInvalidObjectPropFormat; - } - break; - - case EMTPObjectPropCodeTrack: // 0xDC8B - case EMTPObjectPropCodeDRMStatus: // 0xDC9D - case EMTPObjectPropCodeNumberOfChannels: // 0xDE94 - case EMTPObjectPropCodeScanType: // 0xDE97 - if ( aDataType != EMTPTypeUINT16) - { - responseCode = EMTPRespCodeInvalidObjectPropFormat; - } - break; - - //Get Data for Int32 objects - case EMTPObjectPropCodeWidth: // 0xDC87 - case EMTPObjectPropCodeHeight: // 0xDC88 - case EMTPObjectPropCodeDuration: // 0xDC89 - case EMTPObjectPropCodeUseCount: // 0xDC91 - case EMTPObjectPropCodeSampleRate: // 0xDE93 - case EMTPObjectPropCodeAudioWAVECodec: // 0xDE99 - case EMTPObjectPropCodeAudioBitRate: // 0xDE9A - case EMTPObjectPropCodeVideoFourCCCodec: // 0xDE9B - case EMTPObjectPropCodeFramesPerThousandSeconds: // 0xDE9D - case EMTPObjectPropCodeKeyFrameDistance: // 0xDE9E - if ( aDataType != EMTPTypeUINT32) - { - responseCode = EMTPRespCodeInvalidObjectPropFormat; - } - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - if ( aDataType != EMTPTypeUINT8) - { - responseCode = EMTPRespCodeInvalidObjectPropFormat; - } - break; - - default: - // It's not possible to run here. - responseCode = EMTPRespCodeInvalidObjectPropCode; - break; - - } - PRINT1( _L( "MM MTP <= CMediaMtpDataProviderSendObject::CheckSepecificPropType, responseCode = 0x%X" ), responseCode ); - return responseCode; - } - -TMTPResponseCode CMediaMtpDataProviderSendObject::SetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderSendObject::SetSpecificObjectPropertyL" ) ); - TMTPResponseCode responseCode(EMTPRespCodeOK); - - switch ( aPropCode ) - { - case EMTPObjectPropCodeArtist: - case EMTPObjectPropCodeGenre: - case EMTPObjectPropCodeComposer: - case EMTPObjectPropCodeOriginalReleaseDate: - case EMTPObjectPropCodeAlbumName: - case EMTPObjectPropCodeParentalRating: - case EMTPObjectPropCodeEncodingProfile: - { - CMTPTypeString* stringData = - CMTPTypeString::NewLC( aElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData - - responseCode = SetMetaDataToWrapperL( aPropCode, - *stringData, - aObject ); - - CleanupStack::PopAndDestroy( stringData );// - stringData - } - break; - - case EMTPObjectPropCodeVideoBitRate: - // TODO: Does anything need to be done? - /* spec: - * Object properties that are get-only (0x00 GET) - * should accept values during object creation by - * way of the SendObjectPropList command. - */ - break; - - case EMTPObjectPropCodeDescription: - { - CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData - // aElement.GetL( CMTPTypeObjectPropListElement::EValue, *desData ); - desData->SetByDesL( aElement.ArrayL( CMTPTypeObjectPropListElement::EValue ) ); - responseCode = SetMetaDataToWrapperL( aPropCode, - *desData, - aObject ); - CleanupStack::PopAndDestroy( desData ); // - desData - } - break; - - case EMTPObjectPropCodeWidth: - case EMTPObjectPropCodeHeight: - case EMTPObjectPropCodeDuration: - case EMTPObjectPropCodeUseCount: - case EMTPObjectPropCodeSampleRate: - case EMTPObjectPropCodeAudioWAVECodec: - case EMTPObjectPropCodeAudioBitRate: - case EMTPObjectPropCodeVideoFourCCCodec: - case EMTPObjectPropCodeFramesPerThousandSeconds: - case EMTPObjectPropCodeKeyFrameDistance: - { - TMTPTypeUint32 uint32( aElement.Uint32L( CMTPTypeObjectPropListElement::EValue ) ); - responseCode = SetMetaDataToWrapperL( aPropCode, - uint32, - aObject ); - } - break; - - case EMTPObjectPropCodeTrack: - case EMTPObjectPropCodeNumberOfChannels: - case EMTPObjectPropCodeScanType: - case EMTPObjectPropCodeDRMStatus: - { - TMTPTypeUint16 uint16( aElement.Uint16L( CMTPTypeObjectPropListElement::EValue ) ); - responseCode = SetMetaDataToWrapperL( aPropCode, - uint16, - aObject ); - } - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - { - TInt drmStatus = MmMtpDpUtility::GetDrmStatus( aObject.DesC( CMTPObjectMetaData::ESuid ) ); - - if ( drmStatus == EMTPDrmStatusUnknown ) - { - responseCode = EMTPRespCodeAccessDenied; - } - else - { - TMTPTypeUint8 newValue( aElement.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); - - // there's no DB field to remember the value, so return an error - // if there's a mismatch to CAF protection status - if ( ( ( drmStatus == EMTPDrmStatusProtected ) - && ( newValue.Value() == 0 ) ) - || ( ( drmStatus == EMTPDrmStatusNotProtected ) - && ( newValue.Value() == 1 ) ) ) - { - responseCode = EMTPRespCodeAccessDenied; - } - } - } - break; - - default: - { - PRINT( _L( "MM MTP <> Default CASE leaving CMedia...tInfo::SetSpecificObjectPropertyL" ) ); - User::Leave( KErrNotSupported ); - } - break; - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderSendObject::ServiceSpecificObjectPropertyL" ) ); - - return responseCode; - } - -// TODO: Is it necessary? -TInt CMediaMtpDataProviderSendObject::HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& aObject ) - { - PRINT( _L( "MM MTP <> CMediaMtpDataProviderSendObject::HandleSpecificWrapperError" ) ); - TInt err = aError; - - if ( ( err == KErrNotSupported ) - && ( ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeASF ) - || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeMP4Container ) - || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCode3GPContainer ) ) ) - { - // do nothing, handle gracefully - // should only happens for container case where metadata field does not match in different DB - err = KErrNone; - PRINT( _L( "MM MTP <> CMediaMtpDataProviderSendObject::HandleSpecificWrapperError, gracefully dealt with error" ) ); - } - - return err; - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectproplist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: getobjectproplist -* -*/ - - -#include -#include -#include -#include - -#include "cmediamtpdataprovidersetobjectproplist.h" -#include "mediamtpdataproviderconst.h" -#include "mmmtpdplogger.h" -#include "cmmmtpdpmetadataaccesswrapper.h" -#include "mmmtpdputility.h" - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSetObjectPropList::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -MMmRequestProcessor* CMediaMtpDataProviderSetObjectPropList::NewL( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) - { - CMediaMtpDataProviderSetObjectPropList* self = - new ( ELeave ) CMediaMtpDataProviderSetObjectPropList( aFramework, aConnection, aDpConfig ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSetObjectPropList::~CMediaMtpDataProviderSetObjectPropList -// Destructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderSetObjectPropList::~CMediaMtpDataProviderSetObjectPropList() - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSetObjectPropList::CMediaMtpDataProviderSetObjectPropList -// Standard C++ Constructor -// ----------------------------------------------------------------------------- -// -CMediaMtpDataProviderSetObjectPropList::CMediaMtpDataProviderSetObjectPropList( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CSetObjectPropList( aFramework, aConnection, aDpConfig ) - { - - } - -// ----------------------------------------------------------------------------- -// CMediaMtpDataProviderSetObjectPropList::ConstructL -// 2nd Phase Constructor -// ----------------------------------------------------------------------------- -// -void CMediaMtpDataProviderSetObjectPropList::ConstructL() - { - CSetObjectPropList::ConstructL(); - } - -TMTPResponseCode CMediaMtpDataProviderSetObjectPropList::ServiceSpecificObjectPropertyL( TUint16 aPropCode, const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) - { - PRINT( _L( "MM MTP => CMediaMtpDataProviderSetObjectPropList::ServiceSpecificObjectPropertyL" ) ); - TMTPResponseCode responseCode( EMTPRespCodeOK ); - - switch ( aPropCode ) - { - case EMTPObjectPropCodeArtist: - case EMTPObjectPropCodeGenre: - case EMTPObjectPropCodeComposer: - case EMTPObjectPropCodeOriginalReleaseDate: - case EMTPObjectPropCodeAlbumName: - case EMTPObjectPropCodeParentalRating: - case EMTPObjectPropCodeEncodingProfile: - { - CMTPTypeString* stringData = - CMTPTypeString::NewLC( aElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData - - responseCode = ServiceMetaDataToWrapperL( aPropCode, - *stringData, - aObject ); - - CleanupStack::PopAndDestroy( stringData );// - stringData - } - break; - - case EMTPObjectPropCodeVideoBitRate: - { - responseCode = EMTPRespCodeAccessDenied; - } - break; - - case EMTPObjectPropCodeDescription: - { - CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData -// aElement.GetL( CMTPTypeObjectPropListElement::EValue, *desData ); - desData->SetByDesL(aElement.ArrayL(CMTPTypeObjectPropListElement::EValue )); - responseCode = ServiceMetaDataToWrapperL( aPropCode, - *desData, - aObject ); - CleanupStack::PopAndDestroy( desData ); // - desData - } - break; - - case EMTPObjectPropCodeWidth: - case EMTPObjectPropCodeHeight: - case EMTPObjectPropCodeDuration: - case EMTPObjectPropCodeUseCount: - case EMTPObjectPropCodeSampleRate: - case EMTPObjectPropCodeAudioWAVECodec: - case EMTPObjectPropCodeAudioBitRate: - case EMTPObjectPropCodeVideoFourCCCodec: - case EMTPObjectPropCodeFramesPerThousandSeconds: - case EMTPObjectPropCodeKeyFrameDistance: - { - TMTPTypeUint32 uint32( aElement.Uint32L( CMTPTypeObjectPropListElement::EValue ) ); - responseCode = ServiceMetaDataToWrapperL( aPropCode, - uint32, - aObject ); - } - break; - - case EMTPObjectPropCodeTrack: - case EMTPObjectPropCodeNumberOfChannels: - case EMTPObjectPropCodeScanType: - case EMTPObjectPropCodeDRMStatus: - { - TMTPTypeUint16 uint16( aElement.Uint16L( CMTPTypeObjectPropListElement::EValue )); - responseCode = ServiceMetaDataToWrapperL( aPropCode, - uint16, - aObject ); - } - break; - - case EMTPExtObjectPropCodeOmaDrmStatus: - { - TInt drmStatus = MmMtpDpUtility::GetDrmStatus( aObject.DesC( CMTPObjectMetaData::ESuid ) ); - - if (drmStatus == EMTPDrmStatusUnknown) - { - responseCode = EMTPRespCodeAccessDenied; - } - else - { - TMTPTypeUint8 newValue( aElement.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); - - // there's no DB field to remember the value, so return an error - // if there's a mismatch to CAF protection status - if ( ( ( drmStatus == EMTPDrmStatusProtected) && ( newValue.Value() == 0 ) ) || - ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( newValue.Value() == 1 ) ) ) - { - responseCode = EMTPRespCodeAccessDenied; - } - } - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - PRINT( _L( "MM MTP <= CMediaMtpDataProviderSetObjectPropList::ServiceSpecificObjectPropertyL" ) ); - - return responseCode; - } - -TInt CMediaMtpDataProviderSetObjectPropList::HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& aObject) - { - TInt err = aError; - - if ( ( err == KErrNotSupported ) - && ( ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeASF ) - || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeMP4Container ) - || ( aObject.Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCode3GPContainer ) ) ) - { - // do nothing, handle gracefully - // should only happens for container case where metadata field does not match in different DB - err = KErrNone; - PRINT( _L( "MM MTP <> CMediaMtpDataProviderSetObjectPropList::HandleSpecificWrapperError, gracefully dealt with error" ) ); - } - - return err; - } - -// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectpropvalue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectpropvalue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -54,7 +54,7 @@ // void CMediaMtpDataProviderSetObjectPropValue::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -65,9 +65,9 @@ CMediaMtpDataProviderSetObjectPropValue::CMediaMtpDataProviderSetObjectPropValue( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CSetObjectPropValue( aFramework, aConnection, aDpConfig ) + CSetObjectPropValue( aFramework, aConnection, aDpConfig ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -77,7 +77,7 @@ // CMediaMtpDataProviderSetObjectPropValue::~CMediaMtpDataProviderSetObjectPropValue() { - + // Do nothing } TBool CMediaMtpDataProviderSetObjectPropValue::IsSpecificPropCodeReadOnly( TUint16 aPropCode ) const @@ -221,12 +221,10 @@ } else { - TMTPTypeUint8 newValue( iMTPTypeUint8 ); - // there's no DB field to remember the value, so return an error // if there's a mismatch to CAF protection status - if ( ( ( drmStatus == EMTPDrmStatusProtected) && ( newValue.Value() == 0 ) ) || - ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( newValue.Value() == 1 ) ) ) + if ( ( ( drmStatus == EMTPDrmStatusProtected) && ( iMTPTypeUint8.Value() == 0 ) ) || + ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( iMTPTypeUint8.Value() == 1 ) ) ) { responseCode = EMTPRespCodeAccessDenied; } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataprovidercontrollerimp.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataprovidercontrollerimp.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataprovidercontrollerimp.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -26,7 +26,7 @@ // static const TImplementationProxy ImplementationTable[] = { - {{0x10207C4B}, (TProxyNewLPtr) ( CMediaMtpDataProvider::NewL )} + { { 0x10207C4B }, ( TProxyNewLPtr ) ( CMediaMtpDataProvider::NewL ) } }; // ----------------------------------------------------------------------------- @@ -36,7 +36,7 @@ EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); return ImplementationTable; } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataproviderprocessor.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataproviderprocessor.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataproviderprocessor.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -18,54 +18,51 @@ #include -//Include the standard request processor headers #include "crequestunknown.h" - #include "mediamtpdataproviderprocessor.h" +#include "mmmtpdplogger.h" //Include the required header for carrying out the specified request -#include "mmmtpdplogger.h" - #include "cgetobjectpropssupported.h" -#include "cmediamtpdataprovidergetobjectpropdesc.h" -#include "cmediamtpdataprovidergetinterdependentpropdesc.h" +#include "cgetobjectpropdesc.h" +#include "cgetinterdependentpropdesc.h" #include "cgetobject.h" #include "cgetobjectinfo.h" #include "cmediamtpdataprovidergetobjectpropvalue.h" #include "cmediamtpdataprovidergetobjectproplist.h" -#include "cmediamtpdataprovidersendobject.h" +#include "csendobject.h" #include "cmediamtpdataprovidersetobjectpropvalue.h" -#include "cmediamtpdataprovidersetobjectproplist.h" +#include "csetobjectproplist.h" #include "cgetobjectreferences.h" #include "csetobjectreferences.h" #include "cdeleteobject.h" #include "cmediamtpdataprovidercopyobject.h" #include "cmediamtpdataprovidermoveobject.h" #include "cgetpartialobject.h" -#include "cmediamtpdataprovidergetformatcapabilities.h" +#include "cgetformatcapabilities.h" /** A mapping table from the operation code to the request processor factory method */ const TMediaMtpDataProviderRequestProcessorEntry KKMediaMtpDataProviderRequestProcessorTable[] = { - {EMTPOpCodeGetObjectPropsSupported, CGetObjectPropsSupported::NewL}, //Get Supported Props - {EMTPOpCodeGetObjectPropDesc, CMediaMtpDataProviderGetObjectPropDesc::NewL}, //Get Props Description - {EMTPOpCodeGetInterdependentPropDesc, CMediaMtpDataProviderGetInterDependentPropDesc::NewL},//Get Interdependent PropDesc - {EMTPOpCodeGetObjectInfo, CGetObjectInfo::NewL}, //GetObjectInfo - {EMTPOpCodeGetObject, CGetObject::NewL}, //GetObject - {EMTPOpCodeGetObjectPropValue, CMediaMtpDataProviderGetObjectPropValue::NewL}, //Get Props Value - {EMTPOpCodeGetObjectPropList, CMediaMtpDataProviderGetObjectPropList::NewL}, //GetObjectPropList - {EMTPOpCodeSendObjectInfo, CMediaMtpDataProviderSendObject::NewL}, //SendObjectInfo (routed to SendObject) - {EMTPOpCodeSendObject, CMediaMtpDataProviderSendObject::NewL}, //SendObject - {EMTPOpCodeSendObjectPropList, CMediaMtpDataProviderSendObject::NewL}, // SendobjectPropList (routed to SendObject) - {EMTPOpCodeSetObjectPropValue, CMediaMtpDataProviderSetObjectPropValue::NewL}, //Set Props Value - {EMTPOpCodeSetObjectPropList, CMediaMtpDataProviderSetObjectPropList::NewL}, //SetObjectPropList - {EMTPOpCodeDeleteObject, CDeleteObject::NewL}, //DeleteObject - {EMTPOpCodeCopyObject, CMediaMtpDataProviderCopyObject::NewL}, // Copy Object - {EMTPOpCodeMoveObject, CMediaMtpDataProviderMoveObject::NewL}, // Move Object - {EMTPOpCodeGetPartialObject, CGetPartialObject::NewL}, // GetPartialObject - {EMTPOpCodeSetObjectReferences, CSetObjectReferences::NewL}, //Set Object References - {EMTPOpCodeGetObjectReferences, CGetObjectReferences::NewL}, //Get Object References - {EMTPOpCodeGetFormatCapabilities, CMediaMtpDataProviderGetFormatCapabilities::NewL} // GetFormatCapabilities + { EMTPOpCodeGetObjectPropsSupported, CGetObjectPropsSupported::NewL }, //Get Supported Props + { EMTPOpCodeGetObjectPropDesc, CGetObjectPropDesc::NewL }, //Get Props Description + { EMTPOpCodeGetInterdependentPropDesc, CGetInterdependentPropDesc::NewL },//Get Interdependent PropDesc + { EMTPOpCodeGetObjectInfo, CGetObjectInfo::NewL }, //GetObjectInfo + { EMTPOpCodeGetObject, CGetObject::NewL }, //GetObject + { EMTPOpCodeGetObjectPropValue, CMediaMtpDataProviderGetObjectPropValue::NewL }, //Get Props Value + { EMTPOpCodeGetObjectPropList, CMediaMtpDataProviderGetObjectPropList::NewL }, //GetObjectPropList + { EMTPOpCodeSendObjectInfo, CSendObject::NewL }, //SendObjectInfo (routed to SendObject) + { EMTPOpCodeSendObject, CSendObject::NewL }, //SendObject + { EMTPOpCodeSendObjectPropList, CSendObject::NewL }, // SendobjectPropList (routed to SendObject) + { EMTPOpCodeSetObjectPropValue, CMediaMtpDataProviderSetObjectPropValue::NewL }, //Set Props Value + { EMTPOpCodeSetObjectPropList, CSetObjectPropList::NewL }, //SetObjectPropList + { EMTPOpCodeDeleteObject, CDeleteObject::NewL }, //DeleteObject + { EMTPOpCodeCopyObject, CMediaMtpDataProviderCopyObject::NewL }, // Copy Object + { EMTPOpCodeMoveObject, CMediaMtpDataProviderMoveObject::NewL }, // Move Object + { EMTPOpCodeGetPartialObject, CGetPartialObject::NewL }, // GetPartialObject + { EMTPOpCodeSetObjectReferences, CSetObjectReferences::NewL }, //Set Object References + { EMTPOpCodeGetObjectReferences, CGetObjectReferences::NewL }, //Get Object References + { EMTPOpCodeGetFormatCapabilities, CGetFormatCapabilities::NewL } // GetFormatCapabilities }; // ----------------------------------------------------------------------------- diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/bwins/mmmtpdprequestprocessoru.def --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/bwins/mmmtpdprequestprocessoru.def Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/bwins/mmmtpdprequestprocessoru.def Sun Mar 14 13:11:48 2010 +0000 @@ -3,152 +3,158 @@ ?DoHandleResponsePhaseL@CSetObjectPropValue@@MAEHXZ @ 2 NONAME ; int CSetObjectPropValue::DoHandleResponsePhaseL(void) ?NewL@CDeleteObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 3 NONAME ; class MMmRequestProcessor * CDeleteObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) ?StartL@CRenameObject@@QAEXKABVTDesC16@@@Z @ 4 NONAME ; void CRenameObject::StartL(unsigned long, class TDesC16 const &) - ?ConstructL@CGetObjectPropDesc@@IAEXXZ @ 5 NONAME ; void CGetObjectPropDesc::ConstructL(void) - ??1CRequestUnknown@@UAE@XZ @ 6 NONAME ; CRequestUnknown::~CRequestUnknown(void) - ?Release@CRequestProcessor@@MAEXXZ @ 7 NONAME ; void CRequestProcessor::Release(void) - ?HandleRequestL@CRequestProcessor@@MAEHABVTMTPTypeRequest@@W4TMTPTransactionPhase@@@Z @ 8 NONAME ; int CRequestProcessor::HandleRequestL(class TMTPTypeRequest const &, enum TMTPTransactionPhase) + ??1CRequestUnknown@@UAE@XZ @ 5 NONAME ; CRequestUnknown::~CRequestUnknown(void) + ?Release@CRequestProcessor@@MAEXXZ @ 6 NONAME ; void CRequestProcessor::Release(void) + ?HandleRequestL@CRequestProcessor@@MAEHABVTMTPTypeRequest@@W4TMTPTransactionPhase@@@Z @ 7 NONAME ; int CRequestProcessor::HandleRequestL(class TMTPTypeRequest const &, enum TMTPTransactionPhase) + ??1CGetInterdependentPropDesc@@UAE@XZ @ 8 NONAME ; CGetInterdependentPropDesc::~CGetInterdependentPropDesc(void) ?OpenSessionL@CMmMtpDpAccessSingleton@@SAXXZ @ 9 NONAME ; void CMmMtpDpAccessSingleton::OpenSessionL(void) ?ServiceL@CGetPartialObject@@MAEXXZ @ 10 NONAME ; void CGetPartialObject::ServiceL(void) ??0CGetObjectInfo@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 11 NONAME ; CGetObjectInfo::CGetObjectInfo(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) ?DoHandleResponsePhaseL@CRequestProcessor@@MAEHXZ @ 12 NONAME ; int CRequestProcessor::DoHandleResponsePhaseL(void) - ?RunError@CCopyObject@@MAEHH@Z @ 13 NONAME ; int CCopyObject::RunError(int) + ?NewL@CGetObjectPropDesc@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 13 NONAME ; class MMmRequestProcessor * CGetObjectPropDesc::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) ??0CGetObjectPropValue@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 14 NONAME ; CGetObjectPropValue::CGetObjectPropValue(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?ServiceMetaDataToWrapper@CCopyObject@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 15 NONAME ; enum TMTPResponseCode CCopyObject::ServiceMetaDataToWrapper(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) + ?CheckRequestL@CSetObjectPropList@@MAE?AW4TMTPResponseCode@@XZ @ 15 NONAME ; enum TMTPResponseCode CSetObjectPropList::CheckRequestL(void) ?RunL@CRequestProcessor@@MAEXXZ @ 16 NONAME ; void CRequestProcessor::RunL(void) - ?ServiceL@CDeleteObject@@MAEXXZ @ 17 NONAME ; void CDeleteObject::ServiceL(void) - ?DoCancel@CSetObjectPropList@@MAEXXZ @ 18 NONAME ; void CSetObjectPropList::DoCancel(void) - ?CleanupDatabaseL@CMmMtpDpMetadataAccessWrapper@@QAEXXZ @ 19 NONAME ; void CMmMtpDpMetadataAccessWrapper::CleanupDatabaseL(void) - ?ServiceL@CGetObjectPropsSupported@@MAEXXZ @ 20 NONAME ; void CGetObjectPropsSupported::ServiceL(void) - ?NewL@CSetObjectReferences@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 21 NONAME ; class MMmRequestProcessor * CSetObjectReferences::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?ServiceMetaDataToWrapperL@CSetObjectPropList@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 22 NONAME ; enum TMTPResponseCode CSetObjectPropList::ServiceMetaDataToWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) - ??0CGetObjectPropDesc@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 23 NONAME ; CGetObjectPropDesc::CGetObjectPropDesc(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?Release@CMmMtpDpAccessSingleton@@SAXXZ @ 24 NONAME ; void CMmMtpDpAccessSingleton::Release(void) - ?UsbDisconnect@CSendObject@@MAEXXZ @ 25 NONAME ; void CSendObject::UsbDisconnect(void) - ?DoSetObjectReferencesL@CSetObjectReferences@@MAEXAAVCMmMtpDpMetadataAccessWrapper@@GABVTDesC16@@AAVCDesC16Array@@@Z @ 26 NONAME ; void CSetObjectReferences::DoSetObjectReferencesL(class CMmMtpDpMetadataAccessWrapper &, unsigned short, class TDesC16 const &, class CDesC16Array &) - ?ServiceL@CGetFormatCapabilities@@MAEXXZ @ 27 NONAME ; void CGetFormatCapabilities::ServiceL(void) - ?GetAllReferenceL@CMmMtpDpMetadataAccessWrapper@@QAEXPAVCMPXMedia@@AAVCDesC16Array@@@Z @ 28 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetAllReferenceL(class CMPXMedia *, class CDesC16Array &) - ??1CSetObjectPropList@@UAE@XZ @ 29 NONAME ; CSetObjectPropList::~CSetObjectPropList(void) - ?ServiceL@CSetObjectPropList@@MAEXXZ @ 30 NONAME ; void CSetObjectPropList::ServiceL(void) - ??0CMoveObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 31 NONAME ; CMoveObject::CMoveObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ??0CRequestUnknown@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 32 NONAME ; CRequestUnknown::CRequestUnknown(class MMTPDataProviderFramework &, class MMTPConnection &) - ?ConstructL@CGetObjectPropList@@IAEXXZ @ 33 NONAME ; void CGetObjectPropList::ConstructL(void) - ??1CSendObject@@UAE@XZ @ 34 NONAME ; CSendObject::~CSendObject(void) - ?ServiceMetaDataFromWrapperL@CGetObjectPropValue@@IAEXGAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 35 NONAME ; void CGetObjectPropValue::ServiceMetaDataFromWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) - ?NewL@CGetObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 36 NONAME ; class MMmRequestProcessor * CGetObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ??1CGetObjectPropValue@@UAE@XZ @ 37 NONAME ; CGetObjectPropValue::~CGetObjectPropValue(void) - ??1CGetFormatCapabilities@@UAE@XZ @ 38 NONAME ; CGetFormatCapabilities::~CGetFormatCapabilities(void) - ?SetMetaDataToWrapperL@CSendObject@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 39 NONAME ; enum TMTPResponseCode CSendObject::SetMetaDataToWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) - ?ServiceL@CSetObjectReferences@@EAEXXZ @ 40 NONAME ; void CSetObjectReferences::ServiceL(void) - ?DoHandleDataIToRPhaseL@CRequestProcessor@@MAEHXZ @ 41 NONAME ; int CRequestProcessor::DoHandleDataIToRPhaseL(void) - ??0CGetObjectPropList@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 42 NONAME ; CGetObjectPropList::CGetObjectPropList(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?ConstructL@CCopyObject@@IAEXXZ @ 43 NONAME ; void CCopyObject::ConstructL(void) - ?ServiceL@CGetObjectPropValue@@MAEXXZ @ 44 NONAME ; void CGetObjectPropValue::ServiceL(void) - ??1CRenameObject@@UAE@XZ @ 45 NONAME ; CRenameObject::~CRenameObject(void) - ?Match@CRequestProcessor@@MBEHABVTMTPTypeEvent@@AAVMMTPConnection@@@Z @ 46 NONAME ; int CRequestProcessor::Match(class TMTPTypeEvent const &, class MMTPConnection &) const - ?DoHandleCompletingPhaseL@CSendObject@@MAEHXZ @ 47 NONAME ; int CSendObject::DoHandleCompletingPhaseL(void) - ?GetDrmStatus@MmMtpDpUtility@@SAHABVTDesC16@@@Z @ 48 NONAME ; int MmMtpDpUtility::GetDrmStatus(class TDesC16 const &) - ?RunL@CRenameObject@@MAEXXZ @ 49 NONAME ; void CRenameObject::RunL(void) - ??0CSendObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 50 NONAME ; CSendObject::CSendObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ??0CSetObjectReferences@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 51 NONAME ; CSetObjectReferences::CSetObjectReferences(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ??0CRequestProcessor@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@HPBUTMTPRequestElementInfo@@@Z @ 52 NONAME ; CRequestProcessor::CRequestProcessor(class MMTPDataProviderFramework &, class MMTPConnection &, int, struct TMTPRequestElementInfo const *) - ?ServiceL@CSendObject@@MAEXXZ @ 53 NONAME ; void CSendObject::ServiceL(void) - ?Request@CRequestProcessor@@MBEABVTMTPTypeRequest@@XZ @ 54 NONAME ; class TMTPTypeRequest const & CRequestProcessor::Request(void) const - ?CreateL@CMmMtpDpAccessSingleton@@SAXAAVRFs@@AAVMMTPDataProviderFramework@@@Z @ 55 NONAME ; void CMmMtpDpAccessSingleton::CreateL(class RFs &, class MMTPDataProviderFramework &) - ?ServiceMetaDataToWrapper@CMoveObject@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 56 NONAME ; enum TMTPResponseCode CMoveObject::ServiceMetaDataToWrapper(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) - ?CheckRequestL@CGetPartialObject@@MAE?AW4TMTPResponseCode@@XZ @ 57 NONAME ; enum TMTPResponseCode CGetPartialObject::CheckRequestL(void) - ?DoCancel@CRequestProcessor@@MAEXXZ @ 58 NONAME ; void CRequestProcessor::DoCancel(void) - ?ConstructL@CSetObjectPropList@@IAEXXZ @ 59 NONAME ; void CSetObjectPropList::ConstructL(void) - ?NewL@CRequestUnknown@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 60 NONAME ; class MMmRequestProcessor * CRequestUnknown::NewL(class MMTPDataProviderFramework &, class MMTPConnection &) - ?ConstructL@CGetObjectInfo@@AAEXXZ @ 61 NONAME ; void CGetObjectInfo::ConstructL(void) - ?UsbDisconnect@CRequestProcessor@@MAEXXZ @ 62 NONAME ; void CRequestProcessor::UsbDisconnect(void) - ?UpdateMusicCollectionL@CMmMtpDpMetadataAccessWrapper@@QAEXXZ @ 63 NONAME ; void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL(void) - ??1CMoveObject@@UAE@XZ @ 64 NONAME ; CMoveObject::~CMoveObject(void) - ?CheckRequestL@CSendObject@@MAE?AW4TMTPResponseCode@@XZ @ 65 NONAME ; enum TMTPResponseCode CSendObject::CheckRequestL(void) - ??1CRequestProcessor@@MAE@XZ @ 66 NONAME ; CRequestProcessor::~CRequestProcessor(void) - ?DoCancel@CDeleteObject@@MAEXXZ @ 67 NONAME ; void CDeleteObject::DoCancel(void) - ?RunL@CMoveObject@@MAEXXZ @ 68 NONAME ; void CMoveObject::RunL(void) - ??1CGetObject@@UAE@XZ @ 69 NONAME ; CGetObject::~CGetObject(void) - ?DoHandleResponsePhaseL@CSetObjectReferences@@EAEHXZ @ 70 NONAME ; int CSetObjectReferences::DoHandleResponsePhaseL(void) - ?GetPlaylistNameL@CMmMtpDpMetadataAccessWrapper@@QAEXPAVCMPXMedia@@AAVTDes16@@@Z @ 71 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetPlaylistNameL(class CMPXMedia *, class TDes16 &) - ?GetAccessWrapperL@CMmMtpDpAccessSingleton@@SAAAVCMmMtpDpMetadataAccessWrapper@@XZ @ 72 NONAME ; class CMmMtpDpMetadataAccessWrapper & CMmMtpDpAccessSingleton::GetAccessWrapperL(void) - ??1CGetObjectPropsSupported@@UAE@XZ @ 73 NONAME ; CGetObjectPropsSupported::~CGetObjectPropsSupported(void) - ?CheckRequestL@CGetObjectPropList@@MAE?AW4TMTPResponseCode@@XZ @ 74 NONAME ; enum TMTPResponseCode CGetObjectPropList::CheckRequestL(void) - ?HasDataphase@CRequestProcessor@@MBEHXZ @ 75 NONAME ; int CRequestProcessor::HasDataphase(void) const - ?NewL@CGetObjectPropsSupported@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 76 NONAME ; class MMmRequestProcessor * CGetObjectPropsSupported::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?Connection@CRequestProcessor@@MBEAAVMMTPConnection@@XZ @ 77 NONAME ; class MMTPConnection & CRequestProcessor::Connection(void) const - ??1CGetPartialObject@@UAE@XZ @ 78 NONAME ; CGetPartialObject::~CGetPartialObject(void) - ?NewL@CGetObjectInfo@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 79 NONAME ; class MMmRequestProcessor * CGetObjectInfo::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?RunError@CSetObjectPropList@@MAEHH@Z @ 80 NONAME ; int CSetObjectPropList::RunError(int) - ?Match@CRequestUnknown@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 81 NONAME ; int CRequestUnknown::Match(class TMTPTypeRequest const &, class MMTPConnection &) const - ?ServiceL@CMoveObject@@MAEXXZ @ 82 NONAME ; void CMoveObject::ServiceL(void) - ?CreateDummyFile@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 83 NONAME ; void CMmMtpDpMetadataAccessWrapper::CreateDummyFile(class TDesC16 const &) - ?CheckRequestL@CGetObjectPropDesc@@MAE?AW4TMTPResponseCode@@XZ @ 84 NONAME ; enum TMTPResponseCode CGetObjectPropDesc::CheckRequestL(void) - ?DoHandleRToIPhaseL@CRequestProcessor@@MAEHXZ @ 85 NONAME ; int CRequestProcessor::DoHandleRToIPhaseL(void) - ?ServiceMetaDataToWrapperL@CSetObjectPropValue@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 86 NONAME ; enum TMTPResponseCode CSetObjectPropValue::ServiceMetaDataToWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) + ?SetMetaDataToWrapperL@CPropertySettingUtility@@QAE?AW4TMTPResponseCode@@AAVMMmMtpDpConfig@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 17 NONAME ; enum TMTPResponseCode CPropertySettingUtility::SetMetaDataToWrapperL(class MMmMtpDpConfig &, unsigned short, class MMTPType &, class CMTPObjectMetaData const &) + ?ServiceL@CDeleteObject@@MAEXXZ @ 18 NONAME ; void CDeleteObject::ServiceL(void) + ?DoCancel@CSetObjectPropList@@MAEXXZ @ 19 NONAME ; void CSetObjectPropList::DoCancel(void) + ?CleanupDatabaseL@CMmMtpDpMetadataAccessWrapper@@QAEXXZ @ 20 NONAME ; void CMmMtpDpMetadataAccessWrapper::CleanupDatabaseL(void) + ?ServiceL@CGetObjectPropsSupported@@MAEXXZ @ 21 NONAME ; void CGetObjectPropsSupported::ServiceL(void) + ?NewL@CSetObjectReferences@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 22 NONAME ; class MMmRequestProcessor * CSetObjectReferences::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?Release@CMmMtpDpAccessSingleton@@SAXXZ @ 23 NONAME ; void CMmMtpDpAccessSingleton::Release(void) + ?UsbDisconnect@CSendObject@@MAEXXZ @ 24 NONAME ; void CSendObject::UsbDisconnect(void) + ?DoSetObjectReferencesL@CSetObjectReferences@@MAEXAAVCMmMtpDpMetadataAccessWrapper@@GABVTDesC16@@AAVCDesC16Array@@@Z @ 25 NONAME ; void CSetObjectReferences::DoSetObjectReferencesL(class CMmMtpDpMetadataAccessWrapper &, unsigned short, class TDesC16 const &, class CDesC16Array &) + ?ServiceL@CGetFormatCapabilities@@MAEXXZ @ 26 NONAME ; void CGetFormatCapabilities::ServiceL(void) + ?GetAllReferenceL@CMmMtpDpMetadataAccessWrapper@@QAEXPAVCMPXMedia@@AAVCDesC16Array@@@Z @ 27 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetAllReferenceL(class CMPXMedia *, class CDesC16Array &) + ??1CSetObjectPropList@@UAE@XZ @ 28 NONAME ; CSetObjectPropList::~CSetObjectPropList(void) + ?ServiceL@CSetObjectPropList@@MAEXXZ @ 29 NONAME ; void CSetObjectPropList::ServiceL(void) + ??0CMoveObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 30 NONAME ; CMoveObject::CMoveObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??0CRequestUnknown@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 31 NONAME ; CRequestUnknown::CRequestUnknown(class MMTPDataProviderFramework &, class MMTPConnection &) + ?ConstructL@CGetObjectPropList@@IAEXXZ @ 32 NONAME ; void CGetObjectPropList::ConstructL(void) + ??1CSendObject@@UAE@XZ @ 33 NONAME ; CSendObject::~CSendObject(void) + ?ServiceMetaDataFromWrapperL@CGetObjectPropValue@@IAEXGAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 34 NONAME ; void CGetObjectPropValue::ServiceMetaDataFromWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) + ?NewL@CGetObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 35 NONAME ; class MMmRequestProcessor * CGetObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??1CGetObjectPropValue@@UAE@XZ @ 36 NONAME ; CGetObjectPropValue::~CGetObjectPropValue(void) + ??1CGetFormatCapabilities@@UAE@XZ @ 37 NONAME ; CGetFormatCapabilities::~CGetFormatCapabilities(void) + ?ServiceL@CSetObjectReferences@@EAEXXZ @ 38 NONAME ; void CSetObjectReferences::ServiceL(void) + ?DoHandleDataIToRPhaseL@CRequestProcessor@@MAEHXZ @ 39 NONAME ; int CRequestProcessor::DoHandleDataIToRPhaseL(void) + ??0CGetObjectPropList@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 40 NONAME ; CGetObjectPropList::CGetObjectPropList(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?ConstructL@CCopyObject@@IAEXXZ @ 41 NONAME ; void CCopyObject::ConstructL(void) + ?ServiceL@CGetObjectPropValue@@MAEXXZ @ 42 NONAME ; void CGetObjectPropValue::ServiceL(void) + ??1CRenameObject@@UAE@XZ @ 43 NONAME ; CRenameObject::~CRenameObject(void) + ?Match@CRequestProcessor@@MBEHABVTMTPTypeEvent@@AAVMMTPConnection@@@Z @ 44 NONAME ; int CRequestProcessor::Match(class TMTPTypeEvent const &, class MMTPConnection &) const + ?DoHandleCompletingPhaseL@CSendObject@@MAEHXZ @ 45 NONAME ; int CSendObject::DoHandleCompletingPhaseL(void) + ?GetDrmStatus@MmMtpDpUtility@@SAHABVTDesC16@@@Z @ 46 NONAME ; int MmMtpDpUtility::GetDrmStatus(class TDesC16 const &) + ?RunL@CRenameObject@@MAEXXZ @ 47 NONAME ; void CRenameObject::RunL(void) + ??0CSetObjectReferences@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 48 NONAME ; CSetObjectReferences::CSetObjectReferences(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??0CRequestProcessor@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@HPBUTMTPRequestElementInfo@@@Z @ 49 NONAME ; CRequestProcessor::CRequestProcessor(class MMTPDataProviderFramework &, class MMTPConnection &, int, struct TMTPRequestElementInfo const *) + ?ServiceL@CSendObject@@MAEXXZ @ 50 NONAME ; void CSendObject::ServiceL(void) + ?Request@CRequestProcessor@@MBEABVTMTPTypeRequest@@XZ @ 51 NONAME ; class TMTPTypeRequest const & CRequestProcessor::Request(void) const + ?CreateL@CMmMtpDpAccessSingleton@@SAXAAVRFs@@AAVMMTPDataProviderFramework@@@Z @ 52 NONAME ; void CMmMtpDpAccessSingleton::CreateL(class RFs &, class MMTPDataProviderFramework &) + ?DoCancel@CRequestProcessor@@MAEXXZ @ 53 NONAME ; void CRequestProcessor::DoCancel(void) + ?CheckRequestL@CGetPartialObject@@MAE?AW4TMTPResponseCode@@XZ @ 54 NONAME ; enum TMTPResponseCode CGetPartialObject::CheckRequestL(void) + ?NewL@CRequestUnknown@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 55 NONAME ; class MMmRequestProcessor * CRequestUnknown::NewL(class MMTPDataProviderFramework &, class MMTPConnection &) + ??0CGetFormatCapabilities@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 56 NONAME ; CGetFormatCapabilities::CGetFormatCapabilities(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?ConstructL@CGetObjectInfo@@AAEXXZ @ 57 NONAME ; void CGetObjectInfo::ConstructL(void) + ?UsbDisconnect@CRequestProcessor@@MAEXXZ @ 58 NONAME ; void CRequestProcessor::UsbDisconnect(void) + ?UpdateMusicCollectionL@CMmMtpDpMetadataAccessWrapper@@QAEXXZ @ 59 NONAME ; void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL(void) + ??1CMoveObject@@UAE@XZ @ 60 NONAME ; CMoveObject::~CMoveObject(void) + ?CheckRequestL@CSendObject@@MAE?AW4TMTPResponseCode@@XZ @ 61 NONAME ; enum TMTPResponseCode CSendObject::CheckRequestL(void) + ??1CRequestProcessor@@MAE@XZ @ 62 NONAME ; CRequestProcessor::~CRequestProcessor(void) + ?SetAbstractMediaL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@AAVCDesC16Array@@W4TMPXGeneralCategory@@@Z @ 63 NONAME ; void CMmMtpDpMetadataAccessWrapper::SetAbstractMediaL(class TDesC16 const &, class CDesC16Array &, enum TMPXGeneralCategory) + ?DoCancel@CDeleteObject@@MAEXXZ @ 64 NONAME ; void CDeleteObject::DoCancel(void) + ??1CGetObject@@UAE@XZ @ 65 NONAME ; CGetObject::~CGetObject(void) + ?NewL@CGetInterdependentPropDesc@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 66 NONAME ; class MMmRequestProcessor * CGetInterdependentPropDesc::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?DoHandleResponsePhaseL@CSetObjectReferences@@EAEHXZ @ 67 NONAME ; int CSetObjectReferences::DoHandleResponsePhaseL(void) + ?GetAccessWrapperL@CMmMtpDpAccessSingleton@@SAAAVCMmMtpDpMetadataAccessWrapper@@XZ @ 68 NONAME ; class CMmMtpDpMetadataAccessWrapper & CMmMtpDpAccessSingleton::GetAccessWrapperL(void) + ??1CGetObjectPropsSupported@@UAE@XZ @ 69 NONAME ; CGetObjectPropsSupported::~CGetObjectPropsSupported(void) + ?CheckRequestL@CGetObjectPropList@@MAE?AW4TMTPResponseCode@@XZ @ 70 NONAME ; enum TMTPResponseCode CGetObjectPropList::CheckRequestL(void) + ?HasDataphase@CRequestProcessor@@MBEHXZ @ 71 NONAME ; int CRequestProcessor::HasDataphase(void) const + ?NewL@CGetObjectPropsSupported@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 72 NONAME ; class MMmRequestProcessor * CGetObjectPropsSupported::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?Connection@CRequestProcessor@@MBEAAVMMTPConnection@@XZ @ 73 NONAME ; class MMTPConnection & CRequestProcessor::Connection(void) const + ?ConstructL@CGetFormatCapabilities@@AAEXXZ @ 74 NONAME ; void CGetFormatCapabilities::ConstructL(void) + ??1CPropertySettingUtility@@UAE@XZ @ 75 NONAME ; CPropertySettingUtility::~CPropertySettingUtility(void) + ??1CGetPartialObject@@UAE@XZ @ 76 NONAME ; CGetPartialObject::~CGetPartialObject(void) + ?NewL@CGetObjectInfo@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 77 NONAME ; class MMmRequestProcessor * CGetObjectInfo::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?RunError@CSetObjectPropList@@MAEHH@Z @ 78 NONAME ; int CSetObjectPropList::RunError(int) + ?CheckRequestL@CGetInterdependentPropDesc@@MAE?AW4TMTPResponseCode@@XZ @ 79 NONAME ; enum TMTPResponseCode CGetInterdependentPropDesc::CheckRequestL(void) + ?Match@CRequestUnknown@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 80 NONAME ; int CRequestUnknown::Match(class TMTPTypeRequest const &, class MMTPConnection &) const + ?ServiceL@CMoveObject@@MAEXXZ @ 81 NONAME ; void CMoveObject::ServiceL(void) + ?CreateDummyFile@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 82 NONAME ; void CMmMtpDpMetadataAccessWrapper::CreateDummyFile(class TDesC16 const &) + ?CheckRequestL@CGetObjectPropDesc@@MAE?AW4TMTPResponseCode@@XZ @ 83 NONAME ; enum TMTPResponseCode CGetObjectPropDesc::CheckRequestL(void) + ?DoHandleRToIPhaseL@CRequestProcessor@@MAEHXZ @ 84 NONAME ; int CRequestProcessor::DoHandleRToIPhaseL(void) + ?ServiceMetaDataToWrapperL@CSetObjectPropValue@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 85 NONAME ; enum TMTPResponseCode CSetObjectPropValue::ServiceMetaDataToWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) + ?NewCommonObjectPropertyL@CDescriptionUtility@@QAEPAVCMTPTypeObjectPropDesc@@G@Z @ 86 NONAME ; class CMTPTypeObjectPropDesc * CDescriptionUtility::NewCommonObjectPropertyL(unsigned short) ?FormatFromFilename@MmMtpDpUtility@@SA?AW4TMTPFormatCode@@ABVTDesC16@@@Z @ 87 NONAME ; enum TMTPFormatCode MmMtpDpUtility::FormatFromFilename(class TDesC16 const &) ?CheckRequestL@CSetObjectPropValue@@MAE?AW4TMTPResponseCode@@XZ @ 88 NONAME ; enum TMTPResponseCode CSetObjectPropValue::CheckRequestL(void) - ?Match@CRequestProcessor@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 89 NONAME ; int CRequestProcessor::Match(class TMTPTypeRequest const &, class MMTPConnection &) const - ??0CCopyObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 90 NONAME ; CCopyObject::CCopyObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?CheckRequestL@CRequestProcessor@@MAE?AW4TMTPResponseCode@@XZ @ 91 NONAME ; enum TMTPResponseCode CRequestProcessor::CheckRequestL(void) - ?SendResponseL@CRequestProcessor@@IAEXW4TMTPResponseCode@@HPAK@Z @ 92 NONAME ; void CRequestProcessor::SendResponseL(enum TMTPResponseCode, int, unsigned long *) - ??0CGetPartialObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 93 NONAME ; CGetPartialObject::CGetPartialObject(class MMTPDataProviderFramework &, class MMTPConnection &) - ?DoHandleCompletingPhaseL@CRequestProcessor@@MAEHXZ @ 94 NONAME ; int CRequestProcessor::DoHandleCompletingPhaseL(void) - ??0CSetObjectPropList@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 95 NONAME ; CSetObjectPropList::CSetObjectPropList(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??0CPropertySettingUtility@@IAE@XZ @ 89 NONAME ; CPropertySettingUtility::CPropertySettingUtility(void) + ?Match@CRequestProcessor@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 90 NONAME ; int CRequestProcessor::Match(class TMTPTypeRequest const &, class MMTPConnection &) const + ??0CCopyObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 91 NONAME ; CCopyObject::CCopyObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?CheckRequestL@CRequestProcessor@@MAE?AW4TMTPResponseCode@@XZ @ 92 NONAME ; enum TMTPResponseCode CRequestProcessor::CheckRequestL(void) + ?SendResponseL@CRequestProcessor@@IAEXW4TMTPResponseCode@@HPAK@Z @ 93 NONAME ; void CRequestProcessor::SendResponseL(enum TMTPResponseCode, int, unsigned long *) + ??0CGetPartialObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 94 NONAME ; CGetPartialObject::CGetPartialObject(class MMTPDataProviderFramework &, class MMTPConnection &) + ?DoHandleCompletingPhaseL@CRequestProcessor@@MAEHXZ @ 95 NONAME ; int CRequestProcessor::DoHandleCompletingPhaseL(void) ?DeleteDummyFile@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 96 NONAME ; void CMmMtpDpMetadataAccessWrapper::DeleteDummyFile(class TDesC16 const &) ?IsVideoL@MmMtpDpUtility@@SAHABVTDesC16@@@Z @ 97 NONAME ; int MmMtpDpUtility::IsVideoL(class TDesC16 const &) ??1CGetObjectInfo@@UAE@XZ @ 98 NONAME ; CGetObjectInfo::~CGetObjectInfo(void) ?ServiceL@CRequestUnknown@@MAEXXZ @ 99 NONAME ; void CRequestUnknown::ServiceL(void) ?HasDataphase@CSetObjectPropList@@MBEHXZ @ 100 NONAME ; int CSetObjectPropList::HasDataphase(void) const ?NewL@CGetObjectReferences@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 101 NONAME ; class MMmRequestProcessor * CGetObjectReferences::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?ConstructL@CGetFormatCapabilities@@IAEXXZ @ 102 NONAME ; void CGetFormatCapabilities::ConstructL(void) - ?DoCancel@CRenameObject@@MAEXXZ @ 103 NONAME ; void CRenameObject::DoCancel(void) - ??0CGetFormatCapabilities@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 104 NONAME ; CGetFormatCapabilities::CGetFormatCapabilities(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ??1CSetObjectReferences@@UAE@XZ @ 105 NONAME ; CSetObjectReferences::~CSetObjectReferences(void) - ?Match@CSendObject@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 106 NONAME ; int CSendObject::Match(class TMTPTypeRequest const &, class MMTPConnection &) const + ?DoCancel@CRenameObject@@MAEXXZ @ 102 NONAME ; void CRenameObject::DoCancel(void) + ??1CSetObjectReferences@@UAE@XZ @ 103 NONAME ; CSetObjectReferences::~CSetObjectReferences(void) + ?Match@CSendObject@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 104 NONAME ; int CSendObject::Match(class TMTPTypeRequest const &, class MMTPConnection &) const + ?NewL@CSetObjectPropList@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 105 NONAME ; class MMmRequestProcessor * CSetObjectPropList::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?GetAllAbstractMediaL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@PAPAVCMPXMediaArray@@W4TMPXGeneralCategory@@@Z @ 106 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetAllAbstractMediaL(class TDesC16 const &, class CMPXMediaArray * *, enum TMPXGeneralCategory) ??1CCopyObject@@UAE@XZ @ 107 NONAME ; CCopyObject::~CCopyObject(void) - ?RunError@CMoveObject@@MAEHH@Z @ 108 NONAME ; int CMoveObject::RunError(int) - ?ConstructL@CSendObject@@IAEXXZ @ 109 NONAME ; void CSendObject::ConstructL(void) - ?GetModifiedContentL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@AAHAAVCDesC16Array@@@Z @ 110 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetModifiedContentL(class TDesC16 const &, int &, class CDesC16Array &) - ?RunL@CGetObjectPropList@@MAEXXZ @ 111 NONAME ; void CGetObjectPropList::RunL(void) - ?RunL@CCopyObject@@MAEXXZ @ 112 NONAME ; void CCopyObject::RunL(void) - ?RunError@CRequestProcessor@@MAEHH@Z @ 113 NONAME ; int CRequestProcessor::RunError(int) - ?SessionId@CRequestProcessor@@MAEKXZ @ 114 NONAME ; unsigned long CRequestProcessor::SessionId(void) - ?SetPlaylistL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@AAVCDesC16Array@@@Z @ 115 NONAME ; void CMmMtpDpMetadataAccessWrapper::SetPlaylistL(class TDesC16 const &, class CDesC16Array &) - ?HandleEventL@CRequestProcessor@@MAEXABVTMTPTypeEvent@@@Z @ 116 NONAME ; void CRequestProcessor::HandleEventL(class TMTPTypeEvent const &) - ?NewL@CGetPartialObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 117 NONAME ; class MMmRequestProcessor * CGetPartialObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?HasDataphase@CSetObjectReferences@@EBEHXZ @ 118 NONAME ; int CSetObjectReferences::HasDataphase(void) const - ?RenameObjectL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@0@Z @ 119 NONAME ; void CMmMtpDpMetadataAccessWrapper::RenameObjectL(class TDesC16 const &, class TDesC16 const &) - ?RunError@CGetObjectPropList@@MAEHH@Z @ 120 NONAME ; int CGetObjectPropList::RunError(int) - ?DoHandleResponsePhaseL@CSetObjectPropList@@MAEHXZ @ 121 NONAME ; int CSetObjectPropList::DoHandleResponsePhaseL(void) - ??0CDeleteObject@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 122 NONAME ; CDeleteObject::CDeleteObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ?GetAllPlaylistL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@PAPAVCMPXMediaArray@@@Z @ 123 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetAllPlaylistL(class TDesC16 const &, class CMPXMediaArray * *) - ?NewL@CRenameObject@@SAPAV1@AAVMMTPDataProviderFramework@@AAVCMmMtpDpMetadataAccessWrapper@@@Z @ 124 NONAME ; class CRenameObject * CRenameObject::NewL(class MMTPDataProviderFramework &, class CMmMtpDpMetadataAccessWrapper &) - ?GetObjectMetadataValueL@CMmMtpDpMetadataAccessWrapper@@QAEXGAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 125 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) - ?AddDummyFileL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 126 NONAME ; void CMmMtpDpMetadataAccessWrapper::AddDummyFileL(class TDesC16 const &) - ??1CGetObjectPropDesc@@UAE@XZ @ 127 NONAME ; CGetObjectPropDesc::~CGetObjectPropDesc(void) - ?ServiceL@CGetObjectPropDesc@@MAEXXZ @ 128 NONAME ; void CGetObjectPropDesc::ServiceL(void) - ?HasDataphase@CSetObjectPropValue@@MBEHXZ @ 129 NONAME ; int CSetObjectPropValue::HasDataphase(void) const - ?ServiceL@CCopyObject@@MAEXXZ @ 130 NONAME ; void CCopyObject::ServiceL(void) - ?CheckRequestL@CGetObjectPropValue@@MAE?AW4TMTPResponseCode@@XZ @ 131 NONAME ; enum TMTPResponseCode CGetObjectPropValue::CheckRequestL(void) - ?CloseSessionL@CMmMtpDpAccessSingleton@@SAXXZ @ 132 NONAME ; void CMmMtpDpAccessSingleton::CloseSessionL(void) - ?ReceiveDataL@CRequestProcessor@@IAEXAAVMMTPType@@@Z @ 133 NONAME ; void CRequestProcessor::ReceiveDataL(class MMTPType &) - ?ConstructL@CMoveObject@@IAEXXZ @ 134 NONAME ; void CMoveObject::ConstructL(void) - ?RunL@CSetObjectPropList@@MAEXXZ @ 135 NONAME ; void CSetObjectPropList::RunL(void) - ??1CGetObjectReferences@@UAE@XZ @ 136 NONAME ; CGetObjectReferences::~CGetObjectReferences(void) - ?HasDataphase@CSendObject@@MBEHXZ @ 137 NONAME ; int CSendObject::HasDataphase(void) const - ??1CSetObjectPropValue@@UAE@XZ @ 138 NONAME ; CSetObjectPropValue::~CSetObjectPropValue(void) - ?ConstructL@CRenameObject@@IAEXXZ @ 139 NONAME ; void CRenameObject::ConstructL(void) - ?DoHandleResponsePhaseL@CSendObject@@MAEHXZ @ 140 NONAME ; int CSendObject::DoHandleResponsePhaseL(void) - ?SendDataL@CRequestProcessor@@IAEXABVMMTPType@@@Z @ 141 NONAME ; void CRequestProcessor::SendDataL(class MMTPType const &) - ?DoCancel@CGetObjectPropList@@MAEXXZ @ 142 NONAME ; void CGetObjectPropList::DoCancel(void) - ?DoHandleRequestPhaseL@CRequestProcessor@@MAEHXZ @ 143 NONAME ; int CRequestProcessor::DoHandleRequestPhaseL(void) - ?ServiceL@CSetObjectPropValue@@MAEXXZ @ 144 NONAME ; void CSetObjectPropValue::ServiceL(void) - ?RunError@CRenameObject@@MAEHH@Z @ 145 NONAME ; int CRenameObject::RunError(int) - ??1CDeleteObject@@UAE@XZ @ 146 NONAME ; CDeleteObject::~CDeleteObject(void) - ?DoHandleResponsePhaseL@CGetPartialObject@@MAEHXZ @ 147 NONAME ; int CGetPartialObject::DoHandleResponsePhaseL(void) - ?CheckRequestL@CGetFormatCapabilities@@MAE?AW4TMTPResponseCode@@XZ @ 148 NONAME ; enum TMTPResponseCode CGetFormatCapabilities::CheckRequestL(void) - ??0CSetObjectPropValue@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 149 NONAME ; CSetObjectPropValue::CSetObjectPropValue(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) - ??1CGetObjectPropList@@UAE@XZ @ 150 NONAME ; CGetObjectPropList::~CGetObjectPropList(void) - ?ServiceL@CGetObjectPropList@@MAEXXZ @ 151 NONAME ; void CGetObjectPropList::ServiceL(void) - ??0CRenameObject@@IAE@AAVMMTPDataProviderFramework@@AAVCMmMtpDpMetadataAccessWrapper@@@Z @ 152 NONAME ; CRenameObject::CRenameObject(class MMTPDataProviderFramework &, class CMmMtpDpMetadataAccessWrapper &) + ?RunL@CGetObjectPropList@@MAEXXZ @ 108 NONAME ; void CGetObjectPropList::RunL(void) + ?GetModifiedContentL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@AAHAAVCDesC16Array@@@Z @ 109 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetModifiedContentL(class TDesC16 const &, int &, class CDesC16Array &) + ?NewRangeFormDescriptionL@CDescriptionUtility@@QAEPAVCMTPTypeObjectPropDesc@@GKKKH@Z @ 110 NONAME ; class CMTPTypeObjectPropDesc * CDescriptionUtility::NewRangeFormDescriptionL(unsigned short, unsigned long, unsigned long, unsigned long, int) + ?RunError@CRequestProcessor@@MAEHH@Z @ 111 NONAME ; int CRequestProcessor::RunError(int) + ?SessionId@CRequestProcessor@@MAEKXZ @ 112 NONAME ; unsigned long CRequestProcessor::SessionId(void) + ??0CDescriptionUtility@@IAE@XZ @ 113 NONAME ; CDescriptionUtility::CDescriptionUtility(void) + ?HandleEventL@CRequestProcessor@@MAEXABVTMTPTypeEvent@@@Z @ 114 NONAME ; void CRequestProcessor::HandleEventL(class TMTPTypeEvent const &) + ?NewL@CGetPartialObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 115 NONAME ; class MMmRequestProcessor * CGetPartialObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?HasDataphase@CSetObjectReferences@@EBEHXZ @ 116 NONAME ; int CSetObjectReferences::HasDataphase(void) const + ?ConstructL@CGetInterdependentPropDesc@@IAEXXZ @ 117 NONAME ; void CGetInterdependentPropDesc::ConstructL(void) + ?RenameObjectL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@0@Z @ 118 NONAME ; void CMmMtpDpMetadataAccessWrapper::RenameObjectL(class TDesC16 const &, class TDesC16 const &) + ?RunError@CGetObjectPropList@@MAEHH@Z @ 119 NONAME ; int CGetObjectPropList::RunError(int) + ?DoHandleResponsePhaseL@CSetObjectPropList@@MAEHXZ @ 120 NONAME ; int CSetObjectPropList::DoHandleResponsePhaseL(void) + ??0CDeleteObject@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 121 NONAME ; CDeleteObject::CDeleteObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?NewL@CRenameObject@@SAPAV1@AAVMMTPDataProviderFramework@@AAVCMmMtpDpMetadataAccessWrapper@@@Z @ 122 NONAME ; class CRenameObject * CRenameObject::NewL(class MMTPDataProviderFramework &, class CMmMtpDpMetadataAccessWrapper &) + ?GetObjectMetadataValueL@CMmMtpDpMetadataAccessWrapper@@QAEXGAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 123 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &) + ?AddDummyFileL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 124 NONAME ; void CMmMtpDpMetadataAccessWrapper::AddDummyFileL(class TDesC16 const &) + ??0CGetObjectPropDesc@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 125 NONAME ; CGetObjectPropDesc::CGetObjectPropDesc(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?ConstructL@CGetObjectPropDesc@@AAEXXZ @ 126 NONAME ; void CGetObjectPropDesc::ConstructL(void) + ??0CGetInterdependentPropDesc@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 127 NONAME ; CGetInterdependentPropDesc::CGetInterdependentPropDesc(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??1CGetObjectPropDesc@@UAE@XZ @ 128 NONAME ; CGetObjectPropDesc::~CGetObjectPropDesc(void) + ?ServiceL@CGetObjectPropDesc@@MAEXXZ @ 129 NONAME ; void CGetObjectPropDesc::ServiceL(void) + ?HasDataphase@CSetObjectPropValue@@MBEHXZ @ 130 NONAME ; int CSetObjectPropValue::HasDataphase(void) const + ?ServiceL@CCopyObject@@MAEXXZ @ 131 NONAME ; void CCopyObject::ServiceL(void) + ?CheckRequestL@CGetObjectPropValue@@MAE?AW4TMTPResponseCode@@XZ @ 132 NONAME ; enum TMTPResponseCode CGetObjectPropValue::CheckRequestL(void) + ?CloseSessionL@CMmMtpDpAccessSingleton@@SAXXZ @ 133 NONAME ; void CMmMtpDpAccessSingleton::CloseSessionL(void) + ?NewL@CGetFormatCapabilities@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 134 NONAME ; class MMmRequestProcessor * CGetFormatCapabilities::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ?ReceiveDataL@CRequestProcessor@@IAEXAAVMMTPType@@@Z @ 135 NONAME ; void CRequestProcessor::ReceiveDataL(class MMTPType &) + ??1CDescriptionUtility@@UAE@XZ @ 136 NONAME ; CDescriptionUtility::~CDescriptionUtility(void) + ?RunL@CSetObjectPropList@@MAEXXZ @ 137 NONAME ; void CSetObjectPropList::RunL(void) + ?ConstructL@CMoveObject@@IAEXXZ @ 138 NONAME ; void CMoveObject::ConstructL(void) + ?NewL@CSendObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 139 NONAME ; class MMmRequestProcessor * CSendObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??1CGetObjectReferences@@UAE@XZ @ 140 NONAME ; CGetObjectReferences::~CGetObjectReferences(void) + ?HasDataphase@CSendObject@@MBEHXZ @ 141 NONAME ; int CSendObject::HasDataphase(void) const + ??1CSetObjectPropValue@@UAE@XZ @ 142 NONAME ; CSetObjectPropValue::~CSetObjectPropValue(void) + ?ConstructL@CRenameObject@@IAEXXZ @ 143 NONAME ; void CRenameObject::ConstructL(void) + ?SendDataL@CRequestProcessor@@IAEXABVMMTPType@@@Z @ 144 NONAME ; void CRequestProcessor::SendDataL(class MMTPType const &) + ?DoHandleResponsePhaseL@CSendObject@@MAEHXZ @ 145 NONAME ; int CSendObject::DoHandleResponsePhaseL(void) + ?DoCancel@CGetObjectPropList@@MAEXXZ @ 146 NONAME ; void CGetObjectPropList::DoCancel(void) + ?ServiceL@CGetInterdependentPropDesc@@MAEXXZ @ 147 NONAME ; void CGetInterdependentPropDesc::ServiceL(void) + ?DoHandleRequestPhaseL@CRequestProcessor@@MAEHXZ @ 148 NONAME ; int CRequestProcessor::DoHandleRequestPhaseL(void) + ?GetAbstractMediaNameL@CMmMtpDpMetadataAccessWrapper@@QAEPAVHBufC16@@PAVCMPXMedia@@W4TMPXGeneralCategory@@@Z @ 149 NONAME ; class HBufC16 * CMmMtpDpMetadataAccessWrapper::GetAbstractMediaNameL(class CMPXMedia *, enum TMPXGeneralCategory) + ?ServiceL@CSetObjectPropValue@@MAEXXZ @ 150 NONAME ; void CSetObjectPropValue::ServiceL(void) + ?RunError@CRenameObject@@MAEHH@Z @ 151 NONAME ; int CRenameObject::RunError(int) + ??1CDeleteObject@@UAE@XZ @ 152 NONAME ; CDeleteObject::~CDeleteObject(void) + ?DoHandleResponsePhaseL@CGetPartialObject@@MAEHXZ @ 153 NONAME ; int CGetPartialObject::DoHandleResponsePhaseL(void) + ?CheckRequestL@CGetFormatCapabilities@@MAE?AW4TMTPResponseCode@@XZ @ 154 NONAME ; enum TMTPResponseCode CGetFormatCapabilities::CheckRequestL(void) + ??0CSetObjectPropValue@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 155 NONAME ; CSetObjectPropValue::CSetObjectPropValue(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &) + ??1CGetObjectPropList@@UAE@XZ @ 156 NONAME ; CGetObjectPropList::~CGetObjectPropList(void) + ?ServiceL@CGetObjectPropList@@MAEXXZ @ 157 NONAME ; void CGetObjectPropList::ServiceL(void) + ??0CRenameObject@@IAE@AAVMMTPDataProviderFramework@@AAVCMmMtpDpMetadataAccessWrapper@@@Z @ 158 NONAME ; CRenameObject::CRenameObject(class MMTPDataProviderFramework &, class CMmMtpDpMetadataAccessWrapper &) diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/eabi/mmmtpdprequestprocessoru.def --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/eabi/mmmtpdprequestprocessoru.def Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/eabi/mmmtpdprequestprocessoru.def Sun Mar 14 13:11:48 2010 +0000 @@ -4,255 +4,276 @@ _ZN10CGetObjectD1Ev @ 3 NONAME _ZN10CGetObjectD2Ev @ 4 NONAME _ZN11CCopyObject10ConstructLEv @ 5 NONAME - _ZN11CCopyObject24ServiceMetaDataToWrapperEtR8MMTPTypeRK18CMTPObjectMetaData @ 6 NONAME - _ZN11CCopyObject4RunLEv @ 7 NONAME - _ZN11CCopyObject8RunErrorEi @ 8 NONAME - _ZN11CCopyObject8ServiceLEv @ 9 NONAME - _ZN11CCopyObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 10 NONAME - _ZN11CCopyObjectD0Ev @ 11 NONAME - _ZN11CCopyObjectD1Ev @ 12 NONAME - _ZN11CCopyObjectD2Ev @ 13 NONAME - _ZN11CMoveObject10ConstructLEv @ 14 NONAME - _ZN11CMoveObject24ServiceMetaDataToWrapperEtR8MMTPTypeRK18CMTPObjectMetaData @ 15 NONAME - _ZN11CMoveObject4RunLEv @ 16 NONAME - _ZN11CMoveObject8RunErrorEi @ 17 NONAME - _ZN11CMoveObject8ServiceLEv @ 18 NONAME - _ZN11CMoveObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 19 NONAME - _ZN11CMoveObjectD0Ev @ 20 NONAME - _ZN11CMoveObjectD1Ev @ 21 NONAME - _ZN11CMoveObjectD2Ev @ 22 NONAME - _ZN11CSendObject10ConstructLEv @ 23 NONAME - _ZN11CSendObject13CheckRequestLEv @ 24 NONAME - _ZN11CSendObject13UsbDisconnectEv @ 25 NONAME - _ZN11CSendObject21SetMetaDataToWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 26 NONAME - _ZN11CSendObject22DoHandleResponsePhaseLEv @ 27 NONAME - _ZN11CSendObject24DoHandleCompletingPhaseLEv @ 28 NONAME - _ZN11CSendObject8ServiceLEv @ 29 NONAME - _ZN11CSendObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 30 NONAME - _ZN11CSendObjectD0Ev @ 31 NONAME - _ZN11CSendObjectD1Ev @ 32 NONAME - _ZN11CSendObjectD2Ev @ 33 NONAME - _ZN13CDeleteObject4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 34 NONAME - _ZN13CDeleteObject4RunLEv @ 35 NONAME - _ZN13CDeleteObject8DoCancelEv @ 36 NONAME - _ZN13CDeleteObject8ServiceLEv @ 37 NONAME - _ZN13CDeleteObjectD0Ev @ 38 NONAME - _ZN13CDeleteObjectD1Ev @ 39 NONAME - _ZN13CDeleteObjectD2Ev @ 40 NONAME - _ZN13CRenameObject10ConstructLEv @ 41 NONAME - _ZN13CRenameObject4NewLER25MMTPDataProviderFrameworkR29CMmMtpDpMetadataAccessWrapper @ 42 NONAME - _ZN13CRenameObject4RunLEv @ 43 NONAME - _ZN13CRenameObject6StartLEmRK7TDesC16 @ 44 NONAME - _ZN13CRenameObject8DoCancelEv @ 45 NONAME - _ZN13CRenameObject8RunErrorEi @ 46 NONAME - _ZN13CRenameObjectC1ER25MMTPDataProviderFrameworkR29CMmMtpDpMetadataAccessWrapper @ 47 NONAME - _ZN13CRenameObjectC2ER25MMTPDataProviderFrameworkR29CMmMtpDpMetadataAccessWrapper @ 48 NONAME - _ZN13CRenameObjectD0Ev @ 49 NONAME - _ZN13CRenameObjectD1Ev @ 50 NONAME - _ZN13CRenameObjectD2Ev @ 51 NONAME - _ZN14CGetObjectInfo10ConstructLEv @ 52 NONAME - _ZN14CGetObjectInfo4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 53 NONAME - _ZN14CGetObjectInfoD0Ev @ 54 NONAME - _ZN14CGetObjectInfoD1Ev @ 55 NONAME - _ZN14CGetObjectInfoD2Ev @ 56 NONAME - _ZN14MmMtpDpUtility12GetDrmStatusERK7TDesC16 @ 57 NONAME - _ZN14MmMtpDpUtility18FormatFromFilenameERK7TDesC16 @ 58 NONAME - _ZN14MmMtpDpUtility8IsVideoLERK7TDesC16 @ 59 NONAME - _ZN15CRequestUnknown4NewLER25MMTPDataProviderFrameworkR14MMTPConnection @ 60 NONAME - _ZN15CRequestUnknown8ServiceLEv @ 61 NONAME - _ZN15CRequestUnknownC1ER25MMTPDataProviderFrameworkR14MMTPConnection @ 62 NONAME - _ZN15CRequestUnknownC2ER25MMTPDataProviderFrameworkR14MMTPConnection @ 63 NONAME - _ZN15CRequestUnknownD0Ev @ 64 NONAME - _ZN15CRequestUnknownD1Ev @ 65 NONAME - _ZN15CRequestUnknownD2Ev @ 66 NONAME - _ZN17CGetPartialObject13CheckRequestLEv @ 67 NONAME - _ZN17CGetPartialObject22DoHandleResponsePhaseLEv @ 68 NONAME - _ZN17CGetPartialObject4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 69 NONAME - _ZN17CGetPartialObject8ServiceLEv @ 70 NONAME - _ZN17CGetPartialObjectC1ER25MMTPDataProviderFrameworkR14MMTPConnection @ 71 NONAME - _ZN17CGetPartialObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnection @ 72 NONAME - _ZN17CGetPartialObjectD0Ev @ 73 NONAME - _ZN17CGetPartialObjectD1Ev @ 74 NONAME - _ZN17CGetPartialObjectD2Ev @ 75 NONAME - _ZN17CRequestProcessor12HandleEventLERK13TMTPTypeEvent @ 76 NONAME - _ZN17CRequestProcessor12ReceiveDataLER8MMTPType @ 77 NONAME - _ZN17CRequestProcessor13CheckRequestLEv @ 78 NONAME - _ZN17CRequestProcessor13SendResponseLE16TMTPResponseCodeiPm @ 79 NONAME - _ZN17CRequestProcessor13UsbDisconnectEv @ 80 NONAME - _ZN17CRequestProcessor14HandleRequestLERK15TMTPTypeRequest20TMTPTransactionPhase @ 81 NONAME - _ZN17CRequestProcessor18DoHandleRToIPhaseLEv @ 82 NONAME - _ZN17CRequestProcessor21DoHandleRequestPhaseLEv @ 83 NONAME - _ZN17CRequestProcessor22DoHandleDataIToRPhaseLEv @ 84 NONAME - _ZN17CRequestProcessor22DoHandleResponsePhaseLEv @ 85 NONAME - _ZN17CRequestProcessor24DoHandleCompletingPhaseLEv @ 86 NONAME - _ZN17CRequestProcessor4RunLEv @ 87 NONAME - _ZN17CRequestProcessor7ReleaseEv @ 88 NONAME - _ZN17CRequestProcessor8DoCancelEv @ 89 NONAME - _ZN17CRequestProcessor8RunErrorEi @ 90 NONAME - _ZN17CRequestProcessor9SendDataLERK8MMTPType @ 91 NONAME - _ZN17CRequestProcessor9SessionIdEv @ 92 NONAME - _ZN17CRequestProcessorC2ER25MMTPDataProviderFrameworkR14MMTPConnectioniPK22TMTPRequestElementInfo @ 93 NONAME - _ZN17CRequestProcessorD0Ev @ 94 NONAME - _ZN17CRequestProcessorD1Ev @ 95 NONAME - _ZN17CRequestProcessorD2Ev @ 96 NONAME - _ZN18CGetObjectPropDesc10ConstructLEv @ 97 NONAME - _ZN18CGetObjectPropDesc13CheckRequestLEv @ 98 NONAME - _ZN18CGetObjectPropDesc8ServiceLEv @ 99 NONAME - _ZN18CGetObjectPropDescC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 100 NONAME - _ZN18CGetObjectPropDescD0Ev @ 101 NONAME - _ZN18CGetObjectPropDescD1Ev @ 102 NONAME - _ZN18CGetObjectPropDescD2Ev @ 103 NONAME - _ZN18CGetObjectPropList10ConstructLEv @ 104 NONAME - _ZN18CGetObjectPropList13CheckRequestLEv @ 105 NONAME - _ZN18CGetObjectPropList4RunLEv @ 106 NONAME - _ZN18CGetObjectPropList8DoCancelEv @ 107 NONAME - _ZN18CGetObjectPropList8RunErrorEi @ 108 NONAME - _ZN18CGetObjectPropList8ServiceLEv @ 109 NONAME - _ZN18CGetObjectPropListC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 110 NONAME - _ZN18CGetObjectPropListD0Ev @ 111 NONAME - _ZN18CGetObjectPropListD1Ev @ 112 NONAME - _ZN18CGetObjectPropListD2Ev @ 113 NONAME - _ZN18CSetObjectPropList10ConstructLEv @ 114 NONAME - _ZN18CSetObjectPropList22DoHandleResponsePhaseLEv @ 115 NONAME - _ZN18CSetObjectPropList25ServiceMetaDataToWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 116 NONAME - _ZN18CSetObjectPropList4RunLEv @ 117 NONAME - _ZN18CSetObjectPropList8DoCancelEv @ 118 NONAME - _ZN18CSetObjectPropList8RunErrorEi @ 119 NONAME - _ZN18CSetObjectPropList8ServiceLEv @ 120 NONAME - _ZN18CSetObjectPropListC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 121 NONAME - _ZN18CSetObjectPropListD0Ev @ 122 NONAME - _ZN18CSetObjectPropListD1Ev @ 123 NONAME - _ZN18CSetObjectPropListD2Ev @ 124 NONAME - _ZN19CGetObjectPropValue13CheckRequestLEv @ 125 NONAME - _ZN19CGetObjectPropValue27ServiceMetaDataFromWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 126 NONAME - _ZN19CGetObjectPropValue8ServiceLEv @ 127 NONAME - _ZN19CGetObjectPropValueC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 128 NONAME - _ZN19CGetObjectPropValueD0Ev @ 129 NONAME - _ZN19CGetObjectPropValueD1Ev @ 130 NONAME - _ZN19CGetObjectPropValueD2Ev @ 131 NONAME - _ZN19CSetObjectPropValue13CheckRequestLEv @ 132 NONAME - _ZN19CSetObjectPropValue22DoHandleResponsePhaseLEv @ 133 NONAME - _ZN19CSetObjectPropValue25ServiceMetaDataToWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 134 NONAME - _ZN19CSetObjectPropValue8ServiceLEv @ 135 NONAME - _ZN19CSetObjectPropValueC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 136 NONAME - _ZN19CSetObjectPropValueD0Ev @ 137 NONAME - _ZN19CSetObjectPropValueD1Ev @ 138 NONAME - _ZN19CSetObjectPropValueD2Ev @ 139 NONAME - _ZN20CGetObjectReferences4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 140 NONAME - _ZN20CGetObjectReferencesD0Ev @ 141 NONAME - _ZN20CGetObjectReferencesD1Ev @ 142 NONAME - _ZN20CGetObjectReferencesD2Ev @ 143 NONAME - _ZN20CSetObjectReferences22DoHandleResponsePhaseLEv @ 144 NONAME - _ZN20CSetObjectReferences22DoSetObjectReferencesLER29CMmMtpDpMetadataAccessWrappertRK7TDesC16R12CDesC16Array @ 145 NONAME - _ZN20CSetObjectReferences4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 146 NONAME - _ZN20CSetObjectReferences8ServiceLEv @ 147 NONAME - _ZN20CSetObjectReferencesC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 148 NONAME - _ZN20CSetObjectReferencesC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 149 NONAME - _ZN20CSetObjectReferencesD0Ev @ 150 NONAME - _ZN20CSetObjectReferencesD1Ev @ 151 NONAME - _ZN20CSetObjectReferencesD2Ev @ 152 NONAME - _ZN22CGetFormatCapabilities10ConstructLEv @ 153 NONAME - _ZN22CGetFormatCapabilities13CheckRequestLEv @ 154 NONAME + _ZN11CCopyObject8ServiceLEv @ 6 NONAME + _ZN11CCopyObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 7 NONAME + _ZN11CCopyObjectD0Ev @ 8 NONAME + _ZN11CCopyObjectD1Ev @ 9 NONAME + _ZN11CCopyObjectD2Ev @ 10 NONAME + _ZN11CMoveObject10ConstructLEv @ 11 NONAME + _ZN11CMoveObject8ServiceLEv @ 12 NONAME + _ZN11CMoveObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 13 NONAME + _ZN11CMoveObjectD0Ev @ 14 NONAME + _ZN11CMoveObjectD1Ev @ 15 NONAME + _ZN11CMoveObjectD2Ev @ 16 NONAME + _ZN11CSendObject13CheckRequestLEv @ 17 NONAME + _ZN11CSendObject13UsbDisconnectEv @ 18 NONAME + _ZN11CSendObject22DoHandleResponsePhaseLEv @ 19 NONAME + _ZN11CSendObject24DoHandleCompletingPhaseLEv @ 20 NONAME + _ZN11CSendObject4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 21 NONAME + _ZN11CSendObject8ServiceLEv @ 22 NONAME + _ZN11CSendObjectD0Ev @ 23 NONAME + _ZN11CSendObjectD1Ev @ 24 NONAME + _ZN11CSendObjectD2Ev @ 25 NONAME + _ZN13CDeleteObject4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 26 NONAME + _ZN13CDeleteObject4RunLEv @ 27 NONAME + _ZN13CDeleteObject8DoCancelEv @ 28 NONAME + _ZN13CDeleteObject8ServiceLEv @ 29 NONAME + _ZN13CDeleteObjectD0Ev @ 30 NONAME + _ZN13CDeleteObjectD1Ev @ 31 NONAME + _ZN13CDeleteObjectD2Ev @ 32 NONAME + _ZN13CRenameObject10ConstructLEv @ 33 NONAME + _ZN13CRenameObject4NewLER25MMTPDataProviderFrameworkR29CMmMtpDpMetadataAccessWrapper @ 34 NONAME + _ZN13CRenameObject4RunLEv @ 35 NONAME + _ZN13CRenameObject6StartLEmRK7TDesC16 @ 36 NONAME + _ZN13CRenameObject8DoCancelEv @ 37 NONAME + _ZN13CRenameObject8RunErrorEi @ 38 NONAME + _ZN13CRenameObjectC1ER25MMTPDataProviderFrameworkR29CMmMtpDpMetadataAccessWrapper @ 39 NONAME + _ZN13CRenameObjectC2ER25MMTPDataProviderFrameworkR29CMmMtpDpMetadataAccessWrapper @ 40 NONAME + _ZN13CRenameObjectD0Ev @ 41 NONAME + _ZN13CRenameObjectD1Ev @ 42 NONAME + _ZN13CRenameObjectD2Ev @ 43 NONAME + _ZN14CGetObjectInfo10ConstructLEv @ 44 NONAME + _ZN14CGetObjectInfo4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 45 NONAME + _ZN14CGetObjectInfoD0Ev @ 46 NONAME + _ZN14CGetObjectInfoD1Ev @ 47 NONAME + _ZN14CGetObjectInfoD2Ev @ 48 NONAME + _ZN14MmMtpDpUtility12GetDrmStatusERK7TDesC16 @ 49 NONAME + _ZN14MmMtpDpUtility18FormatFromFilenameERK7TDesC16 @ 50 NONAME + _ZN14MmMtpDpUtility8IsVideoLERK7TDesC16 @ 51 NONAME + _ZN15CRequestUnknown4NewLER25MMTPDataProviderFrameworkR14MMTPConnection @ 52 NONAME + _ZN15CRequestUnknown8ServiceLEv @ 53 NONAME + _ZN15CRequestUnknownC1ER25MMTPDataProviderFrameworkR14MMTPConnection @ 54 NONAME + _ZN15CRequestUnknownC2ER25MMTPDataProviderFrameworkR14MMTPConnection @ 55 NONAME + _ZN15CRequestUnknownD0Ev @ 56 NONAME + _ZN15CRequestUnknownD1Ev @ 57 NONAME + _ZN15CRequestUnknownD2Ev @ 58 NONAME + _ZN17CGetPartialObject13CheckRequestLEv @ 59 NONAME + _ZN17CGetPartialObject22DoHandleResponsePhaseLEv @ 60 NONAME + _ZN17CGetPartialObject4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 61 NONAME + _ZN17CGetPartialObject8ServiceLEv @ 62 NONAME + _ZN17CGetPartialObjectC1ER25MMTPDataProviderFrameworkR14MMTPConnection @ 63 NONAME + _ZN17CGetPartialObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnection @ 64 NONAME + _ZN17CGetPartialObjectD0Ev @ 65 NONAME + _ZN17CGetPartialObjectD1Ev @ 66 NONAME + _ZN17CGetPartialObjectD2Ev @ 67 NONAME + _ZN17CRequestProcessor12HandleEventLERK13TMTPTypeEvent @ 68 NONAME + _ZN17CRequestProcessor12ReceiveDataLER8MMTPType @ 69 NONAME + _ZN17CRequestProcessor13CheckRequestLEv @ 70 NONAME + _ZN17CRequestProcessor13SendResponseLE16TMTPResponseCodeiPm @ 71 NONAME + _ZN17CRequestProcessor13UsbDisconnectEv @ 72 NONAME + _ZN17CRequestProcessor14HandleRequestLERK15TMTPTypeRequest20TMTPTransactionPhase @ 73 NONAME + _ZN17CRequestProcessor18DoHandleRToIPhaseLEv @ 74 NONAME + _ZN17CRequestProcessor21DoHandleRequestPhaseLEv @ 75 NONAME + _ZN17CRequestProcessor22DoHandleDataIToRPhaseLEv @ 76 NONAME + _ZN17CRequestProcessor22DoHandleResponsePhaseLEv @ 77 NONAME + _ZN17CRequestProcessor24DoHandleCompletingPhaseLEv @ 78 NONAME + _ZN17CRequestProcessor4RunLEv @ 79 NONAME + _ZN17CRequestProcessor7ReleaseEv @ 80 NONAME + _ZN17CRequestProcessor8DoCancelEv @ 81 NONAME + _ZN17CRequestProcessor8RunErrorEi @ 82 NONAME + _ZN17CRequestProcessor9SendDataLERK8MMTPType @ 83 NONAME + _ZN17CRequestProcessor9SessionIdEv @ 84 NONAME + _ZN17CRequestProcessorC2ER25MMTPDataProviderFrameworkR14MMTPConnectioniPK22TMTPRequestElementInfo @ 85 NONAME + _ZN17CRequestProcessorD0Ev @ 86 NONAME + _ZN17CRequestProcessorD1Ev @ 87 NONAME + _ZN17CRequestProcessorD2Ev @ 88 NONAME + _ZN18CGetObjectPropDesc10ConstructLEv @ 89 NONAME + _ZN18CGetObjectPropDesc13CheckRequestLEv @ 90 NONAME + _ZN18CGetObjectPropDesc4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 91 NONAME + _ZN18CGetObjectPropDesc8ServiceLEv @ 92 NONAME + _ZN18CGetObjectPropDescC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 93 NONAME + _ZN18CGetObjectPropDescC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 94 NONAME + _ZN18CGetObjectPropDescD0Ev @ 95 NONAME + _ZN18CGetObjectPropDescD1Ev @ 96 NONAME + _ZN18CGetObjectPropDescD2Ev @ 97 NONAME + _ZN18CGetObjectPropList10ConstructLEv @ 98 NONAME + _ZN18CGetObjectPropList13CheckRequestLEv @ 99 NONAME + _ZN18CGetObjectPropList4RunLEv @ 100 NONAME + _ZN18CGetObjectPropList8DoCancelEv @ 101 NONAME + _ZN18CGetObjectPropList8RunErrorEi @ 102 NONAME + _ZN18CGetObjectPropList8ServiceLEv @ 103 NONAME + _ZN18CGetObjectPropListC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 104 NONAME + _ZN18CGetObjectPropListD0Ev @ 105 NONAME + _ZN18CGetObjectPropListD1Ev @ 106 NONAME + _ZN18CGetObjectPropListD2Ev @ 107 NONAME + _ZN18CSetObjectPropList13CheckRequestLEv @ 108 NONAME + _ZN18CSetObjectPropList22DoHandleResponsePhaseLEv @ 109 NONAME + _ZN18CSetObjectPropList4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 110 NONAME + _ZN18CSetObjectPropList4RunLEv @ 111 NONAME + _ZN18CSetObjectPropList8DoCancelEv @ 112 NONAME + _ZN18CSetObjectPropList8RunErrorEi @ 113 NONAME + _ZN18CSetObjectPropList8ServiceLEv @ 114 NONAME + _ZN18CSetObjectPropListD0Ev @ 115 NONAME + _ZN18CSetObjectPropListD1Ev @ 116 NONAME + _ZN18CSetObjectPropListD2Ev @ 117 NONAME + _ZN19CDescriptionUtility24NewCommonObjectPropertyLEt @ 118 NONAME + _ZN19CDescriptionUtility24NewRangeFormDescriptionLEtmmmi @ 119 NONAME + _ZN19CDescriptionUtilityC2Ev @ 120 NONAME + _ZN19CDescriptionUtilityD0Ev @ 121 NONAME + _ZN19CDescriptionUtilityD1Ev @ 122 NONAME + _ZN19CDescriptionUtilityD2Ev @ 123 NONAME + _ZN19CGetObjectPropValue13CheckRequestLEv @ 124 NONAME + _ZN19CGetObjectPropValue27ServiceMetaDataFromWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 125 NONAME + _ZN19CGetObjectPropValue8ServiceLEv @ 126 NONAME + _ZN19CGetObjectPropValueC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 127 NONAME + _ZN19CGetObjectPropValueD0Ev @ 128 NONAME + _ZN19CGetObjectPropValueD1Ev @ 129 NONAME + _ZN19CGetObjectPropValueD2Ev @ 130 NONAME + _ZN19CSetObjectPropValue13CheckRequestLEv @ 131 NONAME + _ZN19CSetObjectPropValue22DoHandleResponsePhaseLEv @ 132 NONAME + _ZN19CSetObjectPropValue25ServiceMetaDataToWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 133 NONAME + _ZN19CSetObjectPropValue8ServiceLEv @ 134 NONAME + _ZN19CSetObjectPropValueC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 135 NONAME + _ZN19CSetObjectPropValueD0Ev @ 136 NONAME + _ZN19CSetObjectPropValueD1Ev @ 137 NONAME + _ZN19CSetObjectPropValueD2Ev @ 138 NONAME + _ZN20CGetObjectReferences4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 139 NONAME + _ZN20CGetObjectReferencesD0Ev @ 140 NONAME + _ZN20CGetObjectReferencesD1Ev @ 141 NONAME + _ZN20CGetObjectReferencesD2Ev @ 142 NONAME + _ZN20CSetObjectReferences22DoHandleResponsePhaseLEv @ 143 NONAME + _ZN20CSetObjectReferences22DoSetObjectReferencesLER29CMmMtpDpMetadataAccessWrappertRK7TDesC16R12CDesC16Array @ 144 NONAME + _ZN20CSetObjectReferences4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 145 NONAME + _ZN20CSetObjectReferences8ServiceLEv @ 146 NONAME + _ZN20CSetObjectReferencesC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 147 NONAME + _ZN20CSetObjectReferencesC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 148 NONAME + _ZN20CSetObjectReferencesD0Ev @ 149 NONAME + _ZN20CSetObjectReferencesD1Ev @ 150 NONAME + _ZN20CSetObjectReferencesD2Ev @ 151 NONAME + _ZN22CGetFormatCapabilities10ConstructLEv @ 152 NONAME + _ZN22CGetFormatCapabilities13CheckRequestLEv @ 153 NONAME + _ZN22CGetFormatCapabilities4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 154 NONAME _ZN22CGetFormatCapabilities8ServiceLEv @ 155 NONAME - _ZN22CGetFormatCapabilitiesC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 156 NONAME - _ZN22CGetFormatCapabilitiesD0Ev @ 157 NONAME - _ZN22CGetFormatCapabilitiesD1Ev @ 158 NONAME - _ZN22CGetFormatCapabilitiesD2Ev @ 159 NONAME - _ZN23CMmMtpDpAccessSingleton12OpenSessionLEv @ 160 NONAME - _ZN23CMmMtpDpAccessSingleton13CloseSessionLEv @ 161 NONAME - _ZN23CMmMtpDpAccessSingleton17GetAccessWrapperLEv @ 162 NONAME - _ZN23CMmMtpDpAccessSingleton7CreateLER3RFsR25MMTPDataProviderFramework @ 163 NONAME - _ZN23CMmMtpDpAccessSingleton7ReleaseEv @ 164 NONAME - _ZN24CGetObjectPropsSupported4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 165 NONAME - _ZN24CGetObjectPropsSupported8ServiceLEv @ 166 NONAME - _ZN24CGetObjectPropsSupportedD0Ev @ 167 NONAME - _ZN24CGetObjectPropsSupportedD1Ev @ 168 NONAME - _ZN24CGetObjectPropsSupportedD2Ev @ 169 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper12SetPlaylistLERK7TDesC16R12CDesC16Array @ 170 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper13AddDummyFileLERK7TDesC16 @ 171 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper13RenameObjectLERK7TDesC16S2_ @ 172 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper15CreateDummyFileERK7TDesC16 @ 173 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper15DeleteDummyFileERK7TDesC16 @ 174 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper15GetAllPlaylistLERK7TDesC16PP14CMPXMediaArray @ 175 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper16CleanupDatabaseLEv @ 176 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper16GetAllReferenceLEP9CMPXMediaR12CDesC16Array @ 177 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper16GetPlaylistNameLEP9CMPXMediaR6TDes16 @ 178 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper19GetModifiedContentLERK7TDesC16RiR12CDesC16Array @ 179 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper22UpdateMusicCollectionLEv @ 180 NONAME - _ZN29CMmMtpDpMetadataAccessWrapper23GetObjectMetadataValueLEtR8MMTPTypeRK18CMTPObjectMetaData @ 181 NONAME - _ZNK11CSendObject12HasDataphaseEv @ 182 NONAME - _ZNK11CSendObject5MatchERK15TMTPTypeRequestR14MMTPConnection @ 183 NONAME - _ZNK15CRequestUnknown5MatchERK15TMTPTypeRequestR14MMTPConnection @ 184 NONAME - _ZNK17CRequestProcessor10ConnectionEv @ 185 NONAME - _ZNK17CRequestProcessor12HasDataphaseEv @ 186 NONAME - _ZNK17CRequestProcessor5MatchERK13TMTPTypeEventR14MMTPConnection @ 187 NONAME - _ZNK17CRequestProcessor5MatchERK15TMTPTypeRequestR14MMTPConnection @ 188 NONAME - _ZNK17CRequestProcessor7RequestEv @ 189 NONAME - _ZNK18CSetObjectPropList12HasDataphaseEv @ 190 NONAME - _ZNK19CSetObjectPropValue12HasDataphaseEv @ 191 NONAME - _ZNK20CSetObjectReferences12HasDataphaseEv @ 192 NONAME - _ZTI10CGetObject @ 193 NONAME - _ZTI11CCopyObject @ 194 NONAME - _ZTI11CMoveObject @ 195 NONAME - _ZTI11CSendObject @ 196 NONAME - _ZTI13CDeleteObject @ 197 NONAME - _ZTI13CRenameObject @ 198 NONAME - _ZTI14CGetObjectInfo @ 199 NONAME - _ZTI15CRequestChecker @ 200 NONAME - _ZTI15CRequestUnknown @ 201 NONAME - _ZTI15TMTPTypeFlatBuf @ 202 NONAME - _ZTI17CGetPartialObject @ 203 NONAME - _ZTI17CRequestProcessor @ 204 NONAME - _ZTI18CGetObjectPropDesc @ 205 NONAME - _ZTI18CGetObjectPropList @ 206 NONAME - _ZTI18CHXMetaDataUtility @ 207 NONAME - _ZTI18CSetObjectPropList @ 208 NONAME - _ZTI19CGetObjectPropValue @ 209 NONAME - _ZTI19CSetObjectPropValue @ 210 NONAME - _ZTI20CGetObjectReferences @ 211 NONAME - _ZTI20CSetObjectReferences @ 212 NONAME - _ZTI22CGetFormatCapabilities @ 213 NONAME - _ZTI23CMmMtpDpAccessSingleton @ 214 NONAME - _ZTI24CGetObjectPropsSupported @ 215 NONAME - _ZTI25CMmMtpDpMetadataMpxAccess @ 216 NONAME - _ZTI27CMmMtpDpMetadataVideoAccess @ 217 NONAME - _ZTI29CMmMtpDpMetadataAccessWrapper @ 218 NONAME - _ZTV10CGetObject @ 219 NONAME - _ZTV11CCopyObject @ 220 NONAME - _ZTV11CMoveObject @ 221 NONAME - _ZTV11CSendObject @ 222 NONAME - _ZTV13CDeleteObject @ 223 NONAME - _ZTV13CRenameObject @ 224 NONAME - _ZTV14CGetObjectInfo @ 225 NONAME - _ZTV15CRequestChecker @ 226 NONAME - _ZTV15CRequestUnknown @ 227 NONAME - _ZTV15TMTPTypeFlatBuf @ 228 NONAME - _ZTV17CGetPartialObject @ 229 NONAME - _ZTV17CRequestProcessor @ 230 NONAME - _ZTV18CGetObjectPropDesc @ 231 NONAME - _ZTV18CGetObjectPropList @ 232 NONAME - _ZTV18CHXMetaDataUtility @ 233 NONAME - _ZTV18CSetObjectPropList @ 234 NONAME - _ZTV19CGetObjectPropValue @ 235 NONAME - _ZTV19CSetObjectPropValue @ 236 NONAME - _ZTV20CGetObjectReferences @ 237 NONAME - _ZTV20CSetObjectReferences @ 238 NONAME - _ZTV22CGetFormatCapabilities @ 239 NONAME - _ZTV23CMmMtpDpAccessSingleton @ 240 NONAME - _ZTV24CGetObjectPropsSupported @ 241 NONAME - _ZTV25CMmMtpDpMetadataMpxAccess @ 242 NONAME - _ZTV27CMmMtpDpMetadataVideoAccess @ 243 NONAME - _ZTV29CMmMtpDpMetadataAccessWrapper @ 244 NONAME - _ZThn28_N11CSendObject13UsbDisconnectEv @ 245 NONAME - _ZThn28_N17CRequestProcessor12HandleEventLERK13TMTPTypeEvent @ 246 NONAME - _ZThn28_N17CRequestProcessor13UsbDisconnectEv @ 247 NONAME - _ZThn28_N17CRequestProcessor14HandleRequestLERK15TMTPTypeRequest20TMTPTransactionPhase @ 248 NONAME - _ZThn28_N17CRequestProcessor7ReleaseEv @ 249 NONAME - _ZThn28_N17CRequestProcessor9SessionIdEv @ 250 NONAME - _ZThn28_NK11CSendObject5MatchERK15TMTPTypeRequestR14MMTPConnection @ 251 NONAME - _ZThn28_NK15CRequestUnknown5MatchERK15TMTPTypeRequestR14MMTPConnection @ 252 NONAME - _ZThn28_NK17CRequestProcessor10ConnectionEv @ 253 NONAME - _ZThn28_NK17CRequestProcessor5MatchERK13TMTPTypeEventR14MMTPConnection @ 254 NONAME - _ZThn28_NK17CRequestProcessor5MatchERK15TMTPTypeRequestR14MMTPConnection @ 255 NONAME - _ZThn28_NK17CRequestProcessor7RequestEv @ 256 NONAME + _ZN22CGetFormatCapabilitiesC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 156 NONAME + _ZN22CGetFormatCapabilitiesC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 157 NONAME + _ZN22CGetFormatCapabilitiesD0Ev @ 158 NONAME + _ZN22CGetFormatCapabilitiesD1Ev @ 159 NONAME + _ZN22CGetFormatCapabilitiesD2Ev @ 160 NONAME + _ZN23CMmMtpDpAccessSingleton12OpenSessionLEv @ 161 NONAME + _ZN23CMmMtpDpAccessSingleton13CloseSessionLEv @ 162 NONAME + _ZN23CMmMtpDpAccessSingleton17GetAccessWrapperLEv @ 163 NONAME + _ZN23CMmMtpDpAccessSingleton7CreateLER3RFsR25MMTPDataProviderFramework @ 164 NONAME + _ZN23CMmMtpDpAccessSingleton7ReleaseEv @ 165 NONAME + _ZN23CPropertySettingUtility21SetMetaDataToWrapperLER14MMmMtpDpConfigtR8MMTPTypeRK18CMTPObjectMetaData @ 166 NONAME + _ZN23CPropertySettingUtilityC2Ev @ 167 NONAME + _ZN23CPropertySettingUtilityD0Ev @ 168 NONAME + _ZN23CPropertySettingUtilityD1Ev @ 169 NONAME + _ZN23CPropertySettingUtilityD2Ev @ 170 NONAME + _ZN24CGetObjectPropsSupported4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 171 NONAME + _ZN24CGetObjectPropsSupported8ServiceLEv @ 172 NONAME + _ZN24CGetObjectPropsSupportedD0Ev @ 173 NONAME + _ZN24CGetObjectPropsSupportedD1Ev @ 174 NONAME + _ZN24CGetObjectPropsSupportedD2Ev @ 175 NONAME + _ZN26CGetInterdependentPropDesc10ConstructLEv @ 176 NONAME + _ZN26CGetInterdependentPropDesc13CheckRequestLEv @ 177 NONAME + _ZN26CGetInterdependentPropDesc4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 178 NONAME + _ZN26CGetInterdependentPropDesc8ServiceLEv @ 179 NONAME + _ZN26CGetInterdependentPropDescC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 180 NONAME + _ZN26CGetInterdependentPropDescC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 181 NONAME + _ZN26CGetInterdependentPropDescD0Ev @ 182 NONAME + _ZN26CGetInterdependentPropDescD1Ev @ 183 NONAME + _ZN26CGetInterdependentPropDescD2Ev @ 184 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper13AddDummyFileLERK7TDesC16 @ 185 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper13RenameObjectLERK7TDesC16S2_ @ 186 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper15CreateDummyFileERK7TDesC16 @ 187 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper15DeleteDummyFileERK7TDesC16 @ 188 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper16CleanupDatabaseLEv @ 189 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper16GetAllReferenceLEP9CMPXMediaR12CDesC16Array @ 190 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper17SetAbstractMediaLERK7TDesC16R12CDesC16Array19TMPXGeneralCategory @ 191 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper19GetModifiedContentLERK7TDesC16RiR12CDesC16Array @ 192 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper20GetAllAbstractMediaLERK7TDesC16PP14CMPXMediaArray19TMPXGeneralCategory @ 193 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper21GetAbstractMediaNameLEP9CMPXMedia19TMPXGeneralCategory @ 194 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper22UpdateMusicCollectionLEv @ 195 NONAME + _ZN29CMmMtpDpMetadataAccessWrapper23GetObjectMetadataValueLEtR8MMTPTypeRK18CMTPObjectMetaData @ 196 NONAME + _ZNK11CSendObject12HasDataphaseEv @ 197 NONAME + _ZNK11CSendObject5MatchERK15TMTPTypeRequestR14MMTPConnection @ 198 NONAME + _ZNK15CRequestUnknown5MatchERK15TMTPTypeRequestR14MMTPConnection @ 199 NONAME + _ZNK17CRequestProcessor10ConnectionEv @ 200 NONAME + _ZNK17CRequestProcessor12HasDataphaseEv @ 201 NONAME + _ZNK17CRequestProcessor5MatchERK13TMTPTypeEventR14MMTPConnection @ 202 NONAME + _ZNK17CRequestProcessor5MatchERK15TMTPTypeRequestR14MMTPConnection @ 203 NONAME + _ZNK17CRequestProcessor7RequestEv @ 204 NONAME + _ZNK18CSetObjectPropList12HasDataphaseEv @ 205 NONAME + _ZNK19CSetObjectPropValue12HasDataphaseEv @ 206 NONAME + _ZNK20CSetObjectReferences12HasDataphaseEv @ 207 NONAME + _ZTI10CGetObject @ 208 NONAME + _ZTI11CCopyObject @ 209 NONAME + _ZTI11CMoveObject @ 210 NONAME + _ZTI11CSendObject @ 211 NONAME + _ZTI13CDeleteObject @ 212 NONAME + _ZTI13CRenameObject @ 213 NONAME + _ZTI14CGetObjectInfo @ 214 NONAME + _ZTI15CRequestChecker @ 215 NONAME + _ZTI15CRequestUnknown @ 216 NONAME + _ZTI15TMTPTypeFlatBuf @ 217 NONAME + _ZTI17CGetPartialObject @ 218 NONAME + _ZTI17CRequestProcessor @ 219 NONAME + _ZTI18CGetObjectPropDesc @ 220 NONAME + _ZTI18CGetObjectPropList @ 221 NONAME + _ZTI18CHXMetaDataUtility @ 222 NONAME + _ZTI18CSetObjectPropList @ 223 NONAME + _ZTI19CDescriptionUtility @ 224 NONAME + _ZTI19CGetObjectPropValue @ 225 NONAME + _ZTI19CSetObjectPropValue @ 226 NONAME + _ZTI20CGetObjectReferences @ 227 NONAME + _ZTI20CSetObjectReferences @ 228 NONAME + _ZTI22CGetFormatCapabilities @ 229 NONAME + _ZTI23CMmMtpDpAccessSingleton @ 230 NONAME + _ZTI23CPropertySettingUtility @ 231 NONAME + _ZTI24CGetObjectPropsSupported @ 232 NONAME + _ZTI25CMmMtpDpMetadataMpxAccess @ 233 NONAME + _ZTI26CGetInterdependentPropDesc @ 234 NONAME + _ZTI27CMmMtpDpMetadataVideoAccess @ 235 NONAME + _ZTI29CMmMtpDpMetadataAccessWrapper @ 236 NONAME + _ZTV10CGetObject @ 237 NONAME + _ZTV11CCopyObject @ 238 NONAME + _ZTV11CMoveObject @ 239 NONAME + _ZTV11CSendObject @ 240 NONAME + _ZTV13CDeleteObject @ 241 NONAME + _ZTV13CRenameObject @ 242 NONAME + _ZTV14CGetObjectInfo @ 243 NONAME + _ZTV15CRequestChecker @ 244 NONAME + _ZTV15CRequestUnknown @ 245 NONAME + _ZTV15TMTPTypeFlatBuf @ 246 NONAME + _ZTV17CGetPartialObject @ 247 NONAME + _ZTV17CRequestProcessor @ 248 NONAME + _ZTV18CGetObjectPropDesc @ 249 NONAME + _ZTV18CGetObjectPropList @ 250 NONAME + _ZTV18CHXMetaDataUtility @ 251 NONAME + _ZTV18CSetObjectPropList @ 252 NONAME + _ZTV19CDescriptionUtility @ 253 NONAME + _ZTV19CGetObjectPropValue @ 254 NONAME + _ZTV19CSetObjectPropValue @ 255 NONAME + _ZTV20CGetObjectReferences @ 256 NONAME + _ZTV20CSetObjectReferences @ 257 NONAME + _ZTV22CGetFormatCapabilities @ 258 NONAME + _ZTV23CMmMtpDpAccessSingleton @ 259 NONAME + _ZTV23CPropertySettingUtility @ 260 NONAME + _ZTV24CGetObjectPropsSupported @ 261 NONAME + _ZTV25CMmMtpDpMetadataMpxAccess @ 262 NONAME + _ZTV26CGetInterdependentPropDesc @ 263 NONAME + _ZTV27CMmMtpDpMetadataVideoAccess @ 264 NONAME + _ZTV29CMmMtpDpMetadataAccessWrapper @ 265 NONAME + _ZThn28_N11CSendObject13UsbDisconnectEv @ 266 NONAME + _ZThn28_N17CRequestProcessor12HandleEventLERK13TMTPTypeEvent @ 267 NONAME + _ZThn28_N17CRequestProcessor13UsbDisconnectEv @ 268 NONAME + _ZThn28_N17CRequestProcessor14HandleRequestLERK15TMTPTypeRequest20TMTPTransactionPhase @ 269 NONAME + _ZThn28_N17CRequestProcessor7ReleaseEv @ 270 NONAME + _ZThn28_N17CRequestProcessor9SessionIdEv @ 271 NONAME + _ZThn28_NK11CSendObject5MatchERK15TMTPTypeRequestR14MMTPConnection @ 272 NONAME + _ZThn28_NK15CRequestUnknown5MatchERK15TMTPTypeRequestR14MMTPConnection @ 273 NONAME + _ZThn28_NK17CRequestProcessor10ConnectionEv @ 274 NONAME + _ZThn28_NK17CRequestProcessor5MatchERK13TMTPTypeEventR14MMTPConnection @ 275 NONAME + _ZThn28_NK17CRequestProcessor5MatchERK15TMTPTypeRequestR14MMTPConnection @ 276 NONAME + _ZThn28_NK17CRequestProcessor7RequestEv @ 277 NONAME diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -54,6 +54,9 @@ SOURCE cmoveobject.cpp SOURCE crenameobject.cpp SOURCE cgetformatcapabilities.cpp +SOURCE cgetinterdependentpropdesc.cpp +SOURCE cdescriptionutility.cpp +SOURCE cpropertysettingutility.cpp SOURCEPATH ../../src SOURCE cmmmtpdpmetadatampxaccess.cpp @@ -79,7 +82,6 @@ LIBRARY contentlistingframework.lib LIBRARY caf.lib - #if defined(__WINDOWS_MEDIA) STATICLIBRARY hxmetadatautil.lib #endif @@ -90,4 +92,3 @@ #else DEBUGLIBRARY hal.lib #endif - diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/ccopyobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/ccopyobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/ccopyobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -22,7 +22,6 @@ #include "crequestprocessor.h" class RFs; -class CFileMan; class CMTPObjectMetaData; class CMTPTypeObjectPropList; class CMTPTypeObjectPropListElement; @@ -70,32 +69,10 @@ */ IMPORT_C void ServiceL(); - /** - * Set MetaData to CMetadataAccessWrapper, for internal use - * @param aPropCode, specify property code of aMediaProp - * @param aNewData, object property value which will be get from - * aObjectMetaData - * @param aObjectMetaData, owner of the property which should be - * inserted or updated into database - * @return response code - */ - IMPORT_C TMTPResponseCode ServiceMetaDataToWrapper( const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObject ); - virtual void ServiceGetSpecificObjectPropertyL( TUint16 aPropCode, TUint32 aHandle, const CMTPObjectMetaData& aObjectMetaData ) = 0; - virtual TMTPResponseCode ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) = 0; - - // from CActive - IMPORT_C void RunL(); - - IMPORT_C TInt RunError( TInt aError ); - private: /** * Retrieve the parameters of the request @@ -107,13 +84,13 @@ /** * Copy object operation */ - void CopyObjectL( TUint32& aNewHandle ); + void CopyObjectL(); /** * Check if we can copy the file to the new location */ TMTPResponseCode CanCopyObjectL( const TDesC& aOldName, - const TDesC& aNewName ) const; + const TDesC& aNewName ) const; /** * Save the object properties before doing the copy @@ -132,53 +109,22 @@ */ TUint32 CopyFileL( const TDesC& aNewFileName ); - /* - * Generate the list of handles that need to be copied to the new location. - */ - void GenerateObjectHandleListL( TUint32 aParentHandle ); - - /** - * A helper function of CopyObjectL. - * @param aNewFolderName the new full file folder name after copy. - * @return objecthandle of new copy of the folder. - */ - TUint32 CopyFolderL( const TDesC& aNewFolderName ); - - /** - * Set the object properties in the object property store. - */ - void SetPropertiesL( const TDesC& aOldFileName, - const TDesC& aNewFileName, - const CMTPObjectMetaData& aObject ); - /** * Update object info in the database. */ - TUint32 UpdateObjectInfoL( const TDesC& aOldObjectName, - const TDesC& aNewObjectName); - - /* - * A helper function of CopyObjectL - * Copy a single object and update the database - */ - void CopyAndUpdateL( TUint32 objectHandle ); + TUint32 AddObjectToStoreL( const TDesC& aOldObjectName, + const TDesC& aNewObjectName ); protected: CMTPTypeObjectPropListElement* iPropertyElement; MMmMtpDpConfig& iDpConfig; CMTPTypeObjectPropList* iPropertyList; + private: + TUint32 iStorageId; CMTPObjectMetaData* iObjectInfo; // Not owned - RArray iObjectHandles; - CFileMan* iFileMan; HBufC* iDest; TUint32 iNewParentHandle; - TUint32 iHandle; - TUint32 iStorageId; - TInt iCopyObjectIndex; - TInt iNumberOfObjects; - HBufC* iPathToCopy; - HBufC* iNewRootFolder; TTime iPreviousModifiedTime; }; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdeleteobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdeleteobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdeleteobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -127,6 +127,7 @@ // Accessor of DB MMmMtpDpConfig& iDpConfig; + }; #endif // CDELETEOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdescriptionutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdescriptionutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CDESCRIPTIONUTILITY_H +#define CDESCRIPTIONUTILITY_H + +class CMTPTypeObjectPropDesc; +class CMTPTypeInterdependentPropDesc; +class MMmMtpDpConfig; + +class CDescriptionUtility : public CBase + { +protected: + /** + * + */ + IMPORT_C CDescriptionUtility(); + +public: + /** + * + */ + IMPORT_C virtual ~CDescriptionUtility(); + +public: + /** + * + */ + CMTPTypeObjectPropDesc* NewCommonObjectPropertyL( TUint16 aPropCode ); + + /** + * New RangeForm Description + * @param aMinValue The minimal value + * @param aMaxValue The maximal value + * @param aStepValue The step value + * @return CMTPTypeObjectPropDesc + */ + IMPORT_C CMTPTypeObjectPropDesc* NewRangeFormDescriptionL( TUint16 aPropCode, + TUint32 aMinValue, + TUint32 aMaxValue, + TUint32 aStepValue, + TBool aIsReadOnly = EFalse ); + + /** + * Get group code + * @param aPropCode Specify the property code of which the group code needed + * @return Group code of specified property + */ + TUint32 GetGroupCode( TUint32 aPropCode ); + + /** + * + */ + virtual CMTPTypeInterdependentPropDesc* NewInterdepentPropDescL( MMmMtpDpConfig& aDpConfig, TUint aFormatCode ) = 0; + + /** + * + */ + virtual CMTPTypeObjectPropDesc* NewSpecificPropDescL( TUint aFormatCode, TUint16 aPropCode ) = 0; + +private: + /** + * New a property description of protection status + * @return CMTPTypeObjectPropDesc + */ + CMTPTypeObjectPropDesc* NewProtectionStatusPropDescL(); + + /** + * Get property description of file name + * @return CMTPTypeObjectPropDesc + */ + CMTPTypeObjectPropDesc* NewFileNamePropDescL(); + + /** + * New a property description of nonconsumable + * @return CMTPTypeObjectPropDesc + */ + CMTPTypeObjectPropDesc* NewNonConsumablePropDescL(); + + }; + +#endif // CDESCRIPTIONUTILITY_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetformatcapabilities.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetformatcapabilities.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetformatcapabilities.h Sun Mar 14 13:11:48 2010 +0000 @@ -20,16 +20,11 @@ #include #include "crequestprocessor.h" -#include "mmmtpdplogger.h" -#include "mmmtpdpconfig.h" // forward declaration -class MMTPRequestProcessor; class MMmMtpDpConfig; class CMTPTypeObjectPropDesc; class CMTPTypeInterdependentPropDesc; -class CMTPTypeObjectPropDesc; -class CMTPTypeString; /** Implements the file data provider CMTPGetFormatCapabilities request processor. @@ -39,18 +34,29 @@ { public: /** + * Two-phase construction method + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aDpConfig Configuration of data provider + * @return The pointer to the created request processor object + */ + IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); + + /** * Destructor */ IMPORT_C virtual ~CGetFormatCapabilities(); -protected: +private: /** * Standard c++ constructor * @param aFramework The data provider framework * @param aConnection The connection from which the request comes * @param aDpConfig, The interface of dataprovider configuration */ - IMPORT_C CGetFormatCapabilities( MMTPDataProviderFramework& aFramework, + CGetFormatCapabilities( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ); @@ -58,7 +64,7 @@ * Constructor * Second phase constructor */ - IMPORT_C void ConstructL(); + void ConstructL(); protected: // from CMTPRequestProcessor @@ -74,73 +80,35 @@ */ IMPORT_C TMTPResponseCode CheckRequestL(); -protected: - // new virtuals +private: /** - * Service specific object property - * @param aPropCode, The prop code - * @return MTPType object propdesc - */ - virtual CMTPTypeObjectPropDesc* ServiceSpecificPropertyDescL( TUint16 aPropCode ) = 0; + * Handle one format's capabilities + */ + void ServiceOneFormatCapabilitiesL( TUint aFormatCode ); /** - * Service interdepent propdesc - * @param aFormatCode, The format code - * @return MTPTypeInterdependentPropDesc - */ - virtual void ServiceInterdepentPropDescL() = 0; - -private: - /** - * Get PropDesc via PropCode + * Handle one property description of one format * @param aPropCode The Property Code * @return The MTPTypeObject PropDesc */ - CMTPTypeObjectPropDesc* ServicePropDescL( TUint16 aPropCode ); - - /** - * Get PropDesc with Protection status - * @return The MTPTypeObject PropDesc - */ - CMTPTypeObjectPropDesc* ServiceProtectionStatusL(); - - /** - * Get PropDesc with file name - * @return The MTPTypeObject PropDesc - */ - CMTPTypeObjectPropDesc* ServiceFileNameL(); + CMTPTypeObjectPropDesc* ServiceOnePropDescL( TUint16 aPropCode ); - /** - * Get PropDesc with nonconsumable - * @return The MTPTypeObject PropDesc - */ - CMTPTypeObjectPropDesc* ServiceNonConsumableL(); - - /** - * Get group code - * @param aPropCode Specify the property code of which the group code needed - * @return Group code of specified property - */ - TUint32 GetGroupCode( TUint32 aPropCode ); - -protected: +private: /* * Format code. */ TUint iFormatCode; - CMTPTypeInterdependentPropDesc* iInterdependentPropDesc; + /* + * MMmMtpDpConfig. + */ + MMmMtpDpConfig& iDpConfig; -private: // Owned /* * CMTPTypeCapabilityList dataset. */ CMTPTypeFormatCapabilityList* iCapabilityList; - /* - * MMmMtpDpConfig. - */ - MMmMtpDpConfig& iDpConfig; }; #endif // CMTPGETFORMATCAPABILITLIST_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetinterdependentpropdesc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetinterdependentpropdesc.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GetInterdependentPropDesc operation +* +*/ + +#ifndef CGETINTERDEPENDENTPROPDESC_H +#define CGETINTERDEPENDENTPROPDESC_H + +#include "crequestprocessor.h" + +class MMmMtpDpConfig; +class CMTPTypeInterdependentPropDesc; + +class CGetInterdependentPropDesc : public CRequestProcessor + { +public: + /** + * + */ + IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); + + /** + * Destructor + */ + IMPORT_C virtual ~CGetInterdependentPropDesc(); + +protected: + /** + * Standard C++ Constructor + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aWrapper Medadata access interface + */ + CGetInterdependentPropDesc( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); + + /** + * 2nd Phase Constructor + */ + void ConstructL(); + +protected: + // from CRequestProcessor + IMPORT_C TMTPResponseCode CheckRequestL(); + + IMPORT_C void ServiceL(); + +protected: + MMmMtpDpConfig& iDpConfig; + + CMTPTypeInterdependentPropDesc* iDataset; + + TUint32 iFormatCode; + + }; + +#endif // CGETINTERDEPENDENTPROPDESC_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -87,8 +87,8 @@ // Object Info CMTPObjectMetaData* iObjectInfo; - // TMTPResponseCode iError; + }; #endif // CGETOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectinfo.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectinfo.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectinfo.h Sun Mar 14 13:11:48 2010 +0000 @@ -78,10 +78,10 @@ void BuildObjectInfoL(); private: - CMTPTypeObjectInfo* iObjectInfo; MMmMtpDpConfig& iDpConfig; + }; #endif // CGETOBJECTINFO_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropdesc.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropdesc.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropdesc.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,11 +11,10 @@ * * Contributors: * -* Description: Get object properties descript operation +* Description: Request processor which handle common property description * */ - #ifndef CGETOBJECTPROPDESC_H #define CGETOBJECTPROPDESC_H @@ -32,33 +31,39 @@ { public: /** + * Two-phase construction method + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aDpConfig Configuration of data provider + * @return The pointer to the created request processor object + */ + IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); + + /** * Destructor */ IMPORT_C virtual ~CGetObjectPropDesc(); -protected: +private: /** * Standard c++ constructor * @param aFramework The data provider framework * @param aConnection The connection from which the request comes * @param aWrapper Medadata access interface */ - IMPORT_C CGetObjectPropDesc( MMTPDataProviderFramework& aFramework, + CGetObjectPropDesc( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ); - + /** * Second phase constructor */ - IMPORT_C void ConstructL(); + void ConstructL(); protected: - //from CRequestProcessor - /** - * GetObjectPropDesc request handler - */ - IMPORT_C void ServiceL(); - + // from CRequestProcessor /** * Check the current request * @return EMTPRespCodeOK if the reqeust is good, otherwise, @@ -66,9 +71,10 @@ */ IMPORT_C TMTPResponseCode CheckRequestL(); -protected: - // new virtuals - virtual void ServiceSpecificObjectPropertyL( TUint16 aPropCode ) = 0; + /** + * GetObjectPropDesc request handler + */ + IMPORT_C void ServiceL(); private: /** @@ -85,37 +91,16 @@ */ TMTPResponseCode CheckPropCodeL() const; - /** - * Create list of possible protection status and create new ObjectPropDesc - */ - void ServiceProtectionStatusL(); - - /** - * Create Regular expression for a file name and create new ObjectPropDesc - */ - void ServiceFileNameL(); - - /** - * Create list of possible nonConsumable values and create new ObjectPropDesc - */ - void ServiceNonConsumableL(); - - /* - * Get group code according to property code - * @param aPropCode Specify the property code of which the group code needed - * @return Group code of specified property - */ - TUint32 GetGroupCode( TUint16 aPropCode ); - - -protected: - // Property object to return with the desc value - CMTPTypeObjectPropDesc* iObjectProperty; - - //Format code - TUint32 iFormatCode; +private: + TUint iFormatCode; MMmMtpDpConfig& iDpConfig; + + TUint iPropCode; + + // property description + CMTPTypeObjectPropDesc* iPropertyDesc; + }; #endif // CGETOBJECTPROPDESC_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropssupported.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropssupported.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropssupported.h Sun Mar 14 13:11:48 2010 +0000 @@ -70,6 +70,7 @@ private: CMTPTypeArray* iObjectPropsSupported; MMmMtpDpConfig& iDpConfig; + }; #endif // CGETOBJECTPROPSSUPPORTED_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetpartialobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetpartialobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetpartialobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -22,8 +22,6 @@ #include "crequestprocessor.h" class MMTPDataProviderFramework; -class RFs; -class TMTPTypeFlatBase; class CMTPTypeFile; class CMmMtpDpMetadataAccessWrapper; class MMmMtpDpConfig; @@ -100,16 +98,11 @@ private: MMTPDataProviderFramework& iFramework; - RFs& iFs; - TMTPTypeFlatBase* iPartialData; - HBufC8* iBuffer; - TPtr8 iBufferPtr8; - TInt iOffset; - TInt iPartialDataLength; - TBool iCompleteFile; - CMTPTypeFile* iFileObject; - TBuf iFileSuid; - TUint32 iObjectHandle; + TUint iOffset; + TUint iPartialDataLength; + + CMTPTypeFile* iFileObject; + TUint32 iObjectHandle; }; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cmoveobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cmoveobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cmoveobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -21,7 +21,6 @@ #include "crequestprocessor.h" -class CFileMan; class CMTPObjectMetaData; class CMmMtpDpMetadataAccessWrapper; class CMTPTypeObjectPropList; @@ -35,18 +34,6 @@ { public: /** - * Two-phase construction method - * @param aFramework The data provider framework - * @param aConnection The connection from which the request comes - * @param aWrapper medadata access interface - * @return a pointer to the created request processor object - */ - //IMPORT_C static MMmRequestProcessor* NewL( - // MMTPDataProviderFramework& aFramework, - // MMTPConnection& aConnection, - // CMmMtpDpMetadataAccessWrapper& aWrapper ); - - /** * Destructor */ IMPORT_C virtual ~CMoveObject(); @@ -56,8 +43,8 @@ * Standard c++ constructor */ IMPORT_C CMoveObject( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ); + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); /** * Second phase constructor @@ -71,34 +58,18 @@ */ IMPORT_C void ServiceL(); - // from CActive - IMPORT_C void RunL(); - - IMPORT_C TInt RunError( TInt aError ); - - protected: // new virtuals /** * Set MetaData to CMetadataAccessWrapper, for internal use - * @param aPropCode, specify property code of aMediaProp - * @param aNewData, object property value which will be get from - * aObjectMetaData - * @param aObjectMetaData, owner of the property which should be + * @param aPropCode, specify property code of an object + * @param aHandle, object handles of which the properties are needed + * @param aObject, owner of the properties which should be * inserted or updated into database - * @return response code */ - IMPORT_C TMTPResponseCode ServiceMetaDataToWrapper( const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObject ); - virtual void ServiceGetSpecificObjectPropertyL( TUint16 aPropCode, - TUint32 aHandle, - const CMTPObjectMetaData& aObject ) = 0; - - virtual TMTPResponseCode ServiceSetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) = 0; + TUint32 aHandle, + const CMTPObjectMetaData& aObject ) = 0; private: /** @@ -115,13 +86,13 @@ * move object operations * @return A valid MTP response code. */ - TMTPResponseCode MoveObjectL(); + void MoveObjectL(); /** * Check if we can move the file to the new location */ TMTPResponseCode CanMoveObjectL( const TDesC& aOldName, - const TDesC& aNewName ) const; + const TDesC& aNewName ) const; /** * Save the object properties before moving @@ -131,8 +102,7 @@ /** * Set the object properties after moving */ - - void SetPreviousPropertiesL( const CMTPObjectMetaData& aObject ); + void SetPreviousPropertiesL(); /** * A helper function of MoveObjectL. * @param aNewFileName the new file name after the object is moved. @@ -140,32 +110,10 @@ void MoveFileL( const TDesC& aNewFileName ); /** - * A helper function of MoveObjectL - */ - void MoveFolderL(); - - /* Move the objects through iterations of RunL. It currently move 20 objects - * at a time and the number can be adjusted by changing - * "KMoveObjectGranularity" - */ - TBool MoveOwnedObjectsL(); - - /** * Set the object properties in the object property store. */ void SetPropertiesL( const TDesC& aOldFileName, - const TDesC& aNewFileName, - const CMTPObjectMetaData& aNewObject ); - - /* - * This function will actually delete the orginal folders from the file system. - */ - TMTPResponseCode FinalPhaseMove(); - - /* - * Generate the list of handles that need to be moved to the new location. - */ - void GenerateObjectHandleListL( TUint32 aParentHandle ); + const TDesC& aNewFileName ); /* * Move a single object and update the database @@ -179,17 +127,12 @@ CMTPTypeObjectPropList* iPropertyList; private: TBool iSameStorage; - CFileMan* iFileMan; - CMTPObjectMetaData* iObjectInfo; //Not owned. + CMTPObjectMetaData* iObjectInfo; // Not owned HBufC* iDest; - HBufC* iNewRootFolder; TUint32 iNewParentHandle; TUint32 iStorageId; TTime iPreviousModifiedTime; - HBufC* iPathToMove; - RArray iObjectHandles; - TInt iMoveObjectIndex; - TInt iNumberOfObjects; + }; #endif // CMOVEOBJCT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cpropertysettingutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cpropertysettingutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPROPERTYSETTINGUTILITY_H +#define CPROPERTYSETTINGUTILITY_H + +#include // TMTPResponseCode + +class MMmMtpDpConfig; +class MMTPType; +class CMTPObjectMetaData; +class CMTPTypeObjectPropListElement; + +class CPropertySettingUtility : public CBase + { +protected: + IMPORT_C CPropertySettingUtility(); + +public: + IMPORT_C virtual ~CPropertySettingUtility(); + +public: + /** + * Set metadata to database for processors which need set common property list + * @param aDpConfig, handler to get db access wrapper + * @param aPropCode, specify property code of aMediaProp + * @param aNewData, object property value which will be get from + * aObjectMetaData + * @param aObjectMetaData, owner of the property which should be + * inserted or updated into database + * @return response code + */ + IMPORT_C TMTPResponseCode SetMetaDataToWrapperL( MMmMtpDpConfig& aDpConfig, + const TUint16 aPropCode, + MMTPType& aNewData, + const CMTPObjectMetaData& aObjectMetaData ); + + /** + * Interface to set metadata to database for dp specific objectproplist + * @param aDpConfig, handler to get db access wrapper + * @param aPropCode, specify property code of aMediaProp + * @param aObjectMetaData, owner of the property which should be + * inserted or updated into database + * @param aElement, property list element + */ + virtual TMTPResponseCode SetSpecificObjectPropertyL( MMmMtpDpConfig& aDpConfig, + TUint16 aPropCode, + const CMTPObjectMetaData& aObject, + const CMTPTypeObjectPropListElement& aElement ) = 0; + + }; + +#endif // CPROPERTYSETTINGUTILITY_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crenameobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crenameobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crenameobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -92,6 +92,7 @@ private: CActiveSchedulerWait* iRenameWaiter; TUint32 iParentHandle; + }; #endif // CRENAMEOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestprocessor.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestprocessor.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestprocessor.h Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -100,8 +100,8 @@ /* * Get the session id associated with current request object - * This interface was added to avoid the case that the data member iRequest - * was sometimes invalid in session close phase, and getting session id from + * This interface was added to avoid the case that the data member iRequest + * was sometimes invalid in session close phase, and getting session id from * request would cause panic * @return session id */ @@ -237,8 +237,8 @@ /* * Get the session id associated with current request object - * This interface was added to avoid the case that the data member iRequest - * was sometimes invalid in session close phase, and getting session id from + * This interface was added to avoid the case that the data member iRequest + * was sometimes invalid in session close phase, and getting session id from * request would cause panic * @return session id */ diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h Sun Mar 14 13:11:48 2010 +0000 @@ -40,25 +40,37 @@ { public: /** + * Two-phase construction method + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aDpConfig Configuration of data provider + * @return The pointer to the created request processor object + */ + IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); + + /** * Destructor */ IMPORT_C virtual ~CSendObject(); protected: /** - * Standard C++ Constructor - * @param aFramework The data provider framework - * @param aConnection The connection from which the request comes - * @param aWrapper Medadata access interface + * Standard C++ construction method + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aDpConfig Configuration of data provider + * @return The pointer to the created request processor object */ - IMPORT_C CSendObject( MMTPDataProviderFramework& aFramework, + CSendObject( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ); /** * 2nd Phase Constructor */ - IMPORT_C void ConstructL(); + void ConstructL(); protected: // from CRequestProcessor @@ -104,31 +116,6 @@ */ IMPORT_C void UsbDisconnect(); - // new protected function - /** - * Called by dp derived processor - */ - IMPORT_C TMTPResponseCode SetMetaDataToWrapperL( const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObjectMetaData ); - -protected: - // new virtual functions - /** - * - */ - virtual TMTPResponseCode SetSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) = 0; - - /** - * Check datatypes for DP specific PropCodes - */ - virtual TMTPResponseCode CheckSepecificPropType( TUint16 aPropCode, TUint16 aDataType ) = 0; - - virtual TInt HandleSpecificWrapperError(TInt aError, - const CMTPObjectMetaData& aObject) = 0; - private: /** * Verify if the SendObject request comes after SendObjectInfo request @@ -197,7 +184,7 @@ * Check if the object is too large * @return ETrue if yes, otherwise EFalse */ - TBool IsTooLarge( TUint32 aObjectSize ) const; + TBool IsTooLarge( TUint64 aObjectSize ) const; /** * Check if we can store the file on the storage @@ -299,6 +286,7 @@ TUint32 iPreviousTransactionID; TUint32 iPreviousOperation; + }; #endif // CSENDOBJECT_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectproplist.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectproplist.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectproplist.h Sun Mar 14 13:11:48 2010 +0000 @@ -36,39 +36,47 @@ public: /** * Two-phase construction method - * @param aFramework, The data provider framework - * @param aConnection, The connection from which the request comes - * @param aWrapper medadata access interface - * @return a pointer to the created request processor object + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aDpConfig Configuration of data provider + * @return The pointer to the created request processor object */ - //IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, - // MMTPConnection& aConnection, - // CMmMtpDpMetadataAccessWrapper& aWrapper ); + IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ); /** * Destructor */ IMPORT_C virtual ~CSetObjectPropList(); -protected: +private: /** * Standard c++ constructor - * @param aFramework The data provider framework - * @param aConnection The connection from which the request comes - * @param aWrapper medadata access interface + * @param aFramework The data provider framework + * @param aConnection The connection from which the request comes + * @param aDpConfig Configuration of data provider + * @return The pointer to the created request processor object */ - IMPORT_C CSetObjectPropList( MMTPDataProviderFramework& aFramework, + CSetObjectPropList( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ); /** * 2nd Phase Constructor */ - IMPORT_C void ConstructL(); + void ConstructL(); protected: // from CRequestProcessor /** + * Verify the reqeust + * @return EMTPRespCodeOK if request is verified, otherwise one of + * the error response codes + */ + IMPORT_C TMTPResponseCode CheckRequestL(); + + /** * SetObjectPropList request handler */ IMPORT_C void ServiceL(); @@ -100,28 +108,6 @@ */ IMPORT_C TInt RunError( TInt aError ); -protected: - // new virtuals - /** - * Set MetaData to CMetadataAccessWrapper, for internal use - * @param aPropCode, specify property code of aMediaProp - * @param aNewData, object property value which will be get from - * aObjectMetaData - * @param aObjectMetaData, owner of the property which should be - * inserted or updated into database - * @return response code - */ - IMPORT_C TMTPResponseCode ServiceMetaDataToWrapperL( const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObjectMetaData ); - - virtual TMTPResponseCode ServiceSpecificObjectPropertyL( TUint16 aPropCode, - const CMTPObjectMetaData& aObject, - const CMTPTypeObjectPropListElement& aElement ) = 0; - - virtual TInt HandleSpecificWrapperError( TInt aError, - const CMTPObjectMetaData& aObject) = 0; - private: /* * Handle response phase of SetObjectPropListL operation diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectpropvalue.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectpropvalue.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectpropvalue.h Sun Mar 14 13:11:48 2010 +0000 @@ -30,6 +30,7 @@ class CMTPObjectMetaData; class MMTPObjectMgr; class MMmMtpDpConfig; +class RFs; /** * Defines SetObjectPropValue request processor for common @@ -127,6 +128,7 @@ CMTPObjectMetaData* iObjectInfo; MMTPObjectMgr& iObjectMgr; MMmMtpDpConfig& iDpConfig; + RFs& iFs; }; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/ccopyobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/ccopyobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/ccopyobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -1,20 +1,19 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implement the operation: CopyObject -* -*/ - + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implement the operation: CopyObject + * + */ #include @@ -33,16 +32,17 @@ #include "mmmtpdputility.h" #include "mmmtpdpconfig.h" #include "cmmmtpdpmetadataaccesswrapper.h" +#include "cpropertysettingutility.h" /** -* Verification data for the CopyObject request -*/ + * Verification data for the CopyObject request + */ const TMTPRequestElementInfo KMTPCopyObjectPolicy[] = { { TMTPTypeRequest::ERequestParameter1, EMTPElementTypeObjectHandle, - EMTPElementAttrFileOrDir, + EMTPElementAttrFile, 0, 0, 0 @@ -75,13 +75,10 @@ Cancel(); delete iDest; - delete iFileMan; - iObjectHandles.Close(); + if ( iPropertyElement ) delete iPropertyElement; delete iPropertyList; - delete iPathToCopy; - delete iNewRootFolder; } // ----------------------------------------------------------------------------- @@ -92,17 +89,30 @@ EXPORT_C CCopyObject::CCopyObject( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CRequestProcessor( aFramework, - aConnection, - sizeof ( KMTPCopyObjectPolicy ) / sizeof(TMTPRequestElementInfo), - KMTPCopyObjectPolicy ), - iDpConfig( aDpConfig ), - iObjectHandles( KMmMtpRArrayGranularity ) + CRequestProcessor( aFramework, + aConnection, + sizeof( KMTPCopyObjectPolicy ) / sizeof( TMTPRequestElementInfo ), + KMTPCopyObjectPolicy ), + iDpConfig( aDpConfig ) { PRINT( _L( "Operation: CopyObject(0x101A)" ) ); } // ----------------------------------------------------------------------------- +// CCopyObject::ConstructL +// Second phase constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C void CCopyObject::ConstructL() + { + iPropertyList = CMTPTypeObjectPropList::NewL(); + + // Set the CenRep value of MTP status, + // also need to do in other processors which related to MPX + SetPSStatus(); + } + +// ----------------------------------------------------------------------------- // CCopyObject::ServiceL // CopyObject request handler // ----------------------------------------------------------------------------- @@ -110,223 +120,52 @@ EXPORT_C void CCopyObject::ServiceL() { PRINT( _L( "MM MTP => CCopyObject::ServiceL" ) ); - iHandle = KMTPHandleNone; - CopyObjectL( iHandle ); + CopyObjectL(); PRINT( _L( "MM MTP <= CCopyObject::ServiceL" ) ); } // ----------------------------------------------------------------------------- -// CCopyObject::ConstructL -// Second phase constructor -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCopyObject::ConstructL() - { - CActiveScheduler::Add( this ); - - iPropertyList = CMTPTypeObjectPropList::NewL(); - - // Set the CenRep value of MTP status, - // also need to do in other processors which related to MPX - SetPSStatus(); - } - -// ----------------------------------------------------------------------------- -// CCopyObject::RunL -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCopyObject::RunL() - { - PRINT( _L( "MM MTP => CCopyObject::RunL" ) ); - - if ( iCopyObjectIndex < iNumberOfObjects ) - { - CopyAndUpdateL( iObjectHandles[iCopyObjectIndex++] ); - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, iStatus.Int() ); - SetActive(); - } - else - { - PRINT1( _L( "MM MTP <> CCopyObject::RunL iHandle = 0x%x" ), iHandle ); - SendResponseL( EMTPRespCodeOK, 1, &iHandle ); - } - - PRINT( _L( "MM MTP <= CCopyObject::RunL" ) ); - } - -// ----------------------------------------------------------------------------- -// CCopyObject::CopyFileL -// A helper function of CopyObjectL -// ----------------------------------------------------------------------------- -// -TUint32 CCopyObject::CopyFileL( const TDesC& aNewFileName ) - { - const TDesC& suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); - PRINT2( _L( "MM MTP => CCopyObject::CopyFileL old name = %S, aNewFileName = %S" ), - &suid, - &aNewFileName ); - - GetPreviousPropertiesL( *iObjectInfo ); - User::LeaveIfError( iFileMan->Copy( suid, aNewFileName ) ); // iDest just folder - User::LeaveIfError( iFramework.Fs().SetModified( aNewFileName, iPreviousModifiedTime ) ); - TUint32 handle = UpdateObjectInfoL( suid, aNewFileName ); - - PRINT1( _L( "MM MTP <= CCopyObject::CopyFileL handle = 0x%x" ), handle ); - - return handle; - } - -// ----------------------------------------------------------------------------- -// CCopyObject::GenerateObjectHandleListL -// Generate the list of handles that need to be copied to the new location -// ----------------------------------------------------------------------------- -// -void CCopyObject::GenerateObjectHandleListL( TUint32 aParentHandle ) - { - PRINT1( _L( "MM MTP => CCopyObject::GenerateObjectHandleListL aParentHandle = 0x%x" ), - aParentHandle ); - RMTPObjectMgrQueryContext context; - RArray handles; - CleanupClosePushL( context ); // + context - CleanupClosePushL( handles ); // + handles - - TMTPObjectMgrQueryParams params( KMTPStorageAll, KMTPFormatsAll, - aParentHandle ); - do - { - iFramework.ObjectMgr().GetObjectHandlesL( params, context, handles ); - - TInt numberOfObjects = handles.Count(); - for ( TInt i = 0; i < numberOfObjects; i++ ) - { - if ( iFramework.ObjectMgr().ObjectOwnerId( handles[i] ) == iFramework.DataProviderId() ) - { - iObjectHandles.AppendL( handles[i] ); - continue; - } - - // Folder - if ( iFramework.ObjectMgr().ObjectOwnerId( handles[i] ) == 0 ) // We know that the device dp id is always 0, otherwise the whole MTP won't work. - { - GenerateObjectHandleListL( handles[i] ); - } - } - } - while ( !context.QueryComplete() ); - - CleanupStack::PopAndDestroy( &handles ); // - handles - CleanupStack::PopAndDestroy( &context ); // - context - PRINT( _L( "MM MTP <= CCopyObject::GenerateObjectHandleListL" ) ); - } - -// ----------------------------------------------------------------------------- -// CCopyObject::CopyFolderL -// A helper function of CopyObjectL -// ----------------------------------------------------------------------------- -// -TUint32 CCopyObject::CopyFolderL( const TDesC& aNewFolderName ) - { - PRINT1( _L( "MM MTP => CCopyObject::CopyFolderL aNewFolderName = %S" ), &aNewFolderName ); - TUint32 handle = iFramework.ObjectMgr().HandleL( aNewFolderName ); // just get it - - GenerateObjectHandleListL( iObjectInfo->Uint( CMTPObjectMetaData::EHandle ) ); - iCopyObjectIndex = 0; - iNumberOfObjects = iObjectHandles.Count(); - PRINT1( _L( "MM MTP <> CCopyObject::CopyFolderL iNumberOfObjects = %d" ), iNumberOfObjects ); - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, iStatus.Int() ); - SetActive(); - - PRINT1( _L( "MM MTP <= CCopyObject::CopyFolderL handle = 0x%x" ), handle ); - return handle; - } - -// ----------------------------------------------------------------------------- // CCopyObject::CopyObjectL // Copy object operation // ----------------------------------------------------------------------------- // -void CCopyObject::CopyObjectL( TUint32& aNewHandle ) +void CCopyObject::CopyObjectL() { PRINT( _L( "MM MTP => CCopyObject::CopyObjectL" ) ); + TMTPResponseCode responseCode = EMTPRespCodeOK; - aNewHandle = KMTPHandleNone; GetParametersL(); RBuf newObjectName; + newObjectName.CreateL( KMaxFileName ); newObjectName.CleanupClosePushL(); // + newObjectName - newObjectName.CreateL( KMaxFileName ); newObjectName = *iDest; const TDesC& suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); TParsePtrC fileNameParser( suid ); - - // Check if the object is a folder or a file. - TBool isFolder = EFalse; - User::LeaveIfError( BaflUtils::IsFolder( iFramework.Fs(), suid, isFolder ) ); - - if ( !isFolder ) - { - if ( ( newObjectName.Length() + fileNameParser.NameAndExt().Length() ) <= newObjectName.MaxLength() ) - { - newObjectName.Append( fileNameParser.NameAndExt() ); - } - responseCode = CanCopyObjectL( suid, newObjectName ); - } - else // It is a folder. + if ( ( newObjectName.Length() + fileNameParser.NameAndExt().Length() ) + <= newObjectName.MaxLength() ) { - TFileName rightMostFolderName; - User::LeaveIfError( BaflUtils::MostSignificantPartOfFullName( suid, - rightMostFolderName ) ); - if ( ( newObjectName.Length() + rightMostFolderName.Length() + 1 ) <= newObjectName.MaxLength() ) - { - newObjectName.Append( rightMostFolderName ); - // Add backslash. - _LIT( KBackSlash, "\\" ); - newObjectName.Append( KBackSlash ); - } + newObjectName.Append( fileNameParser.NameAndExt() ); } + responseCode = CanCopyObjectL( suid, newObjectName ); - delete iNewRootFolder; - iNewRootFolder = NULL; - iNewRootFolder = newObjectName.AllocL(); - + TUint32 newHandle = KMTPHandleNone; if ( responseCode == EMTPRespCodeOK ) { - delete iFileMan; - iFileMan = NULL; - iFileMan = CFileMan::NewL( iFramework.Fs() ); - - if ( !isFolder ) // It is a file. - { - aNewHandle = CopyFileL( newObjectName ); -// if ( responseCode == EMTPRespCodeOK ) - SendResponseL( EMTPRespCodeOK, 1, &aNewHandle ); -// else -// SendResponseL( responseCode ); - } - else // It is a folder. - { - delete iPathToCopy; - iPathToCopy = NULL; - iPathToCopy = suid.AllocL(); - PRINT1( _L( "MM MTP <> CCopyObject::CopyObjectL iPathToCopy = %S" ), iPathToCopy ); - aNewHandle = CopyFolderL( newObjectName ); - } + newHandle = CopyFileL( newObjectName ); + SendResponseL( EMTPRespCodeOK, 1, &newHandle ); } else SendResponseL( responseCode ); CleanupStack::PopAndDestroy( &newObjectName ); // - newObjectName PRINT2( _L( "MM MTP <= CCopyObject::CopyObjectL responseCode = 0x%x, aNewHandle = 0x%x" ), - responseCode, aNewHandle ); + responseCode, + newHandle ); } // ----------------------------------------------------------------------------- @@ -337,30 +176,34 @@ void CCopyObject::GetParametersL() { PRINT( _L( "MM MTP => CCopyObject::GetParametersL" ) ); + __ASSERT_DEBUG( iRequestChecker, Panic( EMmMTPDpRequestCheckNull ) ); TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); iStorageId = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); - TUint32 parentObjectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter3 ); - PRINT3( _L( "MM MTP <> CCopyObject::GetParametersL Object Hanlde = 0x%x, StorageId = 0x%x, Parent Handle = 0x%x" ), - objectHandle, iStorageId, parentObjectHandle ); + iNewParentHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter3 ); + PRINT3( _L( "MM MTP <> CCopyObject::GetParametersL Object Handle = 0x%x, StorageId = 0x%x, Parent Handle = 0x%x" ), + objectHandle, + iStorageId, + iNewParentHandle ); // not taking owernship iObjectInfo = iRequestChecker->GetObjectInfo( objectHandle ); __ASSERT_DEBUG( iObjectInfo, Panic( EMmMTPDpObjectNull ) ); - if ( parentObjectHandle == 0 ) + if ( iNewParentHandle == KMTPHandleNone ) { SetDefaultParentObjectL(); } else { - CMTPObjectMetaData* parentObjectInfo = iRequestChecker->GetObjectInfo( parentObjectHandle ); - __ASSERT_DEBUG( parentObjectInfo, Panic( EMmMTPDpObjectNull ) ); + CMTPObjectMetaData* parentObject = iRequestChecker->GetObjectInfo( iNewParentHandle ); + __ASSERT_DEBUG( parentObject, Panic( EMmMTPDpObjectNull ) ); + delete iDest; iDest = NULL; - iDest = parentObjectInfo->DesC( CMTPObjectMetaData::ESuid ).AllocL(); - iNewParentHandle = parentObjectHandle; + iDest = parentObject->DesC( CMTPObjectMetaData::ESuid ).AllocL(); + PRINT1( _L( "MM MTP <> CMoveObject::GetParametersL iDest = %S" ), iDest ); } PRINT( _L( "MM MTP <= CCopyObject::GetParametersL" ) ); } @@ -376,11 +219,11 @@ delete iDest; iDest = NULL; - iDest = ( iFramework.StorageMgr().StorageL( iStorageId ).DesC( - CMTPStorageMetaData::EStorageSuid ) ).AllocL(); - PRINT1( _L( "MM MTP <> CCopyObject::SetDefaultParentObjectL Destination location is %S" ), iDest ); + iDest = iFramework.StorageMgr().StorageL( iStorageId ).DesC( CMTPStorageMetaData::EStorageSuid ).AllocL(); + iNewParentHandle = KMTPHandleNoParent; - PRINT( _L( "MM MTP <= CCopyObject::SetDefaultParentObjectL" ) ); + + PRINT1( _L( "MM MTP <= CCopyObject::SetDefaultParentObjectL, iDest = %S" ), iDest ); } // ----------------------------------------------------------------------------- @@ -392,17 +235,18 @@ const TDesC& aNewName ) const { PRINT2( _L( "MM MTP => CCopyObject::CanCopyObjectL aOldName = %S, aNewName = %S" ), - &aOldName, &aNewName ); + &aOldName, + &aNewName ); TMTPResponseCode result = EMTPRespCodeOK; TEntry fileEntry; User::LeaveIfError( iFramework.Fs().Entry( aOldName, fileEntry ) ); - TDriveNumber drive( static_cast( iFramework.StorageMgr().DriveNumber( iStorageId ) ) ); + TInt drive = iFramework.StorageMgr().DriveNumber( iStorageId ); User::LeaveIfError( drive ); TVolumeInfo volumeInfo; User::LeaveIfError( iFramework.Fs().Volume( volumeInfo, drive ) ); - if ( volumeInfo.iFree < fileEntry.iSize ) + if ( volumeInfo.iFree < fileEntry.FileSize() ) { result = EMTPRespCodeStoreFull; } @@ -445,6 +289,37 @@ } // ----------------------------------------------------------------------------- +// CCopyObject::CopyFileL +// A helper function of CopyFileL +// ----------------------------------------------------------------------------- +// +TUint32 CCopyObject::CopyFileL( const TDesC& aNewFileName ) + { + const TDesC& suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); + PRINT2( _L( "MM MTP => CCopyObject::CopyFileL old name = %S, aNewFileName = %S" ), + &suid, + &aNewFileName ); + + GetPreviousPropertiesL( *iObjectInfo ); + + TUint32 handle = AddObjectToStoreL( suid, aNewFileName ); + + SetPreviousPropertiesL( *iObjectInfo ); + + CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() ); + User::LeaveIfError( fileMan->Copy( suid, aNewFileName ) ); + delete fileMan; + fileMan = NULL; + + User::LeaveIfError( iFramework.Fs().SetModified( aNewFileName, + iPreviousModifiedTime ) ); + + PRINT1( _L( "MM MTP <= CCopyObject::CopyFileL handle = 0x%x" ), handle ); + + return handle; + } + +// ----------------------------------------------------------------------------- // CCopyObject::GetPreviousPropertiesL // Save the object properties before doing the copy // ----------------------------------------------------------------------------- @@ -454,29 +329,27 @@ PRINT( _L( "MM MTP => CCopyObject::GetPreviousPropertiesL" ) ); const TDesC& suid( aObject.DesC( CMTPObjectMetaData::ESuid ) ); - User::LeaveIfError( iFramework.Fs().Modified( suid, iPreviousModifiedTime ) ); TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode ); const RArray* properties = iDpConfig.GetSupportedPropertiesL( formatCode ); TInt count = properties->Count(); - CMTPTypeString* textData = NULL; TInt err = KErrNone; TUint16 propCode; - TUint32 handle = aObject.Uint( CMTPObjectMetaData::EHandle ) ; + TUint32 handle = aObject.Uint( CMTPObjectMetaData::EHandle ); - if ( iPropertyElement ) + if ( iPropertyElement != NULL ) { delete iPropertyElement; iPropertyElement = NULL; } - + for ( TInt i = 0; i < count; i++ ) { - propCode = (*properties)[i]; + propCode = ( *properties )[i]; - switch( propCode ) + switch ( propCode ) { case EMTPObjectPropCodeStorageID: case EMTPObjectPropCodeObjectFormat: @@ -485,31 +358,35 @@ case EMTPObjectPropCodeObjectFileName: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: break; + case EMTPObjectPropCodeNonConsumable: + iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) ); + iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue, + aObject.Uint( CMTPObjectMetaData::ENonConsumable ) ); + break; + case EMTPObjectPropCodeName: case EMTPObjectPropCodeDateAdded: if ( ( propCode == EMTPObjectPropCodeName ) - || ( ( !MmMtpDpUtility::IsVideoL( aObject.DesC( CMTPObjectMetaData::ESuid ), iFramework ) ) + || ( !MmMtpDpUtility::IsVideoL( aObject.DesC( CMTPObjectMetaData::ESuid ), iFramework ) && ( propCode == EMTPObjectPropCodeDateAdded ) ) ) { - textData = CMTPTypeString::NewLC(); // + textData + CMTPTypeString* textData = CMTPTypeString::NewLC(); // + textData TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( propCode, *textData, aObject ) ); - PRINT1( _L( "MM MTP <> CCopyObject::GetPreviousPropertiesL::ServiceSpecificObjectPropertyL err = %d" ), err ); + PRINT1( _L( "MM MTP <> CCopyObject::GetPreviousPropertiesL err = %d" ), err ); if ( err == KErrNone ) { - iPropertyElement = &(iPropertyList->ReservePropElemL(handle, propCode)); - iPropertyElement->SetStringL(CMTPTypeObjectPropListElement::EValue, textData->StringChars()); -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( -// handle, propCode, *textData ); + iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) ); + iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, + textData->StringChars() ); } else if ( err == KErrNotFound ) { @@ -531,7 +408,7 @@ break; } - if ( iPropertyElement ) + if ( iPropertyElement != NULL ) { iPropertyList->CommitPropElemL( *iPropertyElement ); iPropertyElement = NULL; @@ -542,54 +419,6 @@ } // ----------------------------------------------------------------------------- -// CCopyObject::ServiceMetaDataToWrapper -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TMTPResponseCode CCopyObject::ServiceMetaDataToWrapper( - const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObject ) - { - TMTPResponseCode resCode = EMTPRespCodeOK; - - TRAPD( err, iDpConfig.GetWrapperL().SetObjectMetadataValueL( aPropCode, - aNewData, - aObject ) ); - - PRINT1( _L("MM MTP <> CCopyObject::ServiceMetaDataToWrapper err = %d"), err); - - if ( err == KErrNone ) - { - resCode = EMTPRespCodeOK; - } - else if ( err == KErrTooBig ) - // according to the codes of S60 - { - resCode = EMTPRespCodeInvalidDataset; - } - else if ( err == KErrPermissionDenied ) - { - resCode = EMTPRespCodeAccessDenied; - } - else if ( err == KErrNotFound ) - { - if ( MmMtpDpUtility::HasMetadata( aObject.Uint( CMTPObjectMetaData::EFormatCode ) ) ) - resCode = EMTPRespCodeAccessDenied; - else - resCode = EMTPRespCodeOK; - } - else - { - resCode = EMTPRespCodeGeneralError; - } - - PRINT1( _L("MM MTP <= CCopyObject::ServiceMetaDataToWrapper resCode = 0x%x"), resCode); - - return resCode; - } - -// ----------------------------------------------------------------------------- // CCopyObject::SetPreviousPropertiesL // Set the object properties after doing the copy // ----------------------------------------------------------------------------- @@ -597,23 +426,22 @@ void CCopyObject::SetPreviousPropertiesL( const CMTPObjectMetaData& aObject ) { PRINT( _L( "MM MTP => CCopyObject::SetPreviousPropertiesL" ) ); - const TInt count( iPropertyList->NumberOfElements() ); - PRINT1( _L( "MM MTP <> CCopyObject::SetPreviousPropertiesL count = %d" ), count ); + TMTPResponseCode respcode = EMTPRespCodeOK; - CMTPTypeString* stringData = NULL; + iPropertyList->ResetCursor(); + const TInt count = iPropertyList->NumberOfElements(); for ( TInt i = 0; i < count; i++ ) { CMTPTypeObjectPropListElement& element = iPropertyList->GetNextElementL(); - TUint32 handle = element.Uint32L( - CMTPTypeObjectPropListElement::EObjectHandle ); - TUint16 propertyCode = element.Uint16L( - CMTPTypeObjectPropListElement::EPropertyCode ); - TUint16 dataType = element.Uint16L( - CMTPTypeObjectPropListElement::EDatatype ); + TUint32 handle = element.Uint32L( CMTPTypeObjectPropListElement::EObjectHandle ); + TUint16 propertyCode = element.Uint16L( CMTPTypeObjectPropListElement::EPropertyCode ); + TUint16 dataType = element.Uint16L( CMTPTypeObjectPropListElement::EDatatype ); PRINT3( _L( "MM MTP <> CCopyObject::SetPreviousPropertiesL = 0x%x, propertyCode = 0x%x, dataType = 0x%x" ), - handle, propertyCode, dataType ); + handle, + propertyCode, + dataType ); switch ( propertyCode ) { @@ -624,19 +452,26 @@ case EMTPObjectPropCodeObjectFileName: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: case EMTPObjectPropCodeDateAdded: break; + case EMTPObjectPropCodeNonConsumable: + iObjectInfo->SetUint( CMTPObjectMetaData::ENonConsumable, + element.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); + // TODO: need to reconsider, + // should wait all property setting finished then insert object, or not? + // need to investigate if it will affect performance result + iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo ); + break; + case EMTPObjectPropCodeName: { - stringData = CMTPTypeString::NewLC( - element.StringL( - CMTPTypeObjectPropListElement::EValue)); // + stringData + CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData - respcode = ServiceMetaDataToWrapper( propertyCode, + respcode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapperL( iDpConfig, + propertyCode, *stringData, aObject ); @@ -646,18 +481,16 @@ default: { - respcode = ServiceSetSpecificObjectPropertyL( propertyCode, - aObject, - element ); + respcode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig, + propertyCode, + aObject, + element ); } break; } } // end of for loop - if( respcode == EMTPRespCodeOK ) - { - // do nothing, ignore warning - } + // ignore errors PRINT1( _L( "MM MTP <= CCopyObject::SetPreviousPropertiesL respcode = 0x%x" ), respcode ); } @@ -667,168 +500,43 @@ // Update object info in the database // ----------------------------------------------------------------------------- // -TUint32 CCopyObject::UpdateObjectInfoL( const TDesC& aOldObjectName, const TDesC& aNewObjectName ) +TUint32 CCopyObject::AddObjectToStoreL( const TDesC& aOldObjectName, + const TDesC& aNewObjectName ) { - PRINT2( _L( "MM MTP => CCopyObject::UpdateObjectInfoL aOldObjectName = %S, aNewObjectName = %S" ), - &aOldObjectName, &aNewObjectName ); - // We should not modify this object's handle, so just get a "copy". + PRINT2( _L( "MM MTP => CCopyObject::AddObjectToStoreL aOldObjectName = %S, aNewObjectName = %S" ), + &aOldObjectName, + &aNewObjectName ); + CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC(); // + objectInfo - const TMTPTypeUint32 objectHandle( iObjectInfo->Uint( CMTPObjectMetaData::EHandle ) ); - if ( iFramework.ObjectMgr().ObjectL( objectHandle, *objectInfo) ) + + // 1. Add new object into objectMgr db + objectInfo->SetUint( CMTPObjectMetaData::EDataProviderId, iObjectInfo->Uint( CMTPObjectMetaData::EDataProviderId ) ); + TUint formatCode = iObjectInfo->Uint( CMTPObjectMetaData::EFormatCode ); + objectInfo->SetUint( CMTPObjectMetaData::EFormatCode, formatCode ); + TUint subFormatCode = iObjectInfo->Uint( CMTPObjectMetaData::EFormatSubCode ); + objectInfo->SetUint( CMTPObjectMetaData::EFormatSubCode, subFormatCode ); + objectInfo->SetUint( CMTPObjectMetaData::EParentHandle, iNewParentHandle ); + objectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId ); + objectInfo->SetDesCL( CMTPObjectMetaData::ESuid, aNewObjectName ); + iFramework.ObjectMgr().InsertObjectL( *objectInfo ); + + // 2. Add new object into MPX db + iDpConfig.GetWrapperL().AddObjectL( aNewObjectName, formatCode, subFormatCode ); + + // 3. Set references into references db + if ( formatCode == EMTPFormatCodeM3UPlaylist ) { - objectInfo->SetDesCL( CMTPObjectMetaData::ESuid, aNewObjectName ); - objectInfo->SetUint( CMTPObjectMetaData::EParentHandle, - iNewParentHandle ); - // Modify storage Id. - objectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId ); - iFramework.ObjectMgr().InsertObjectL( *objectInfo ); - } - else - { - User::Leave( KErrCorrupt ); + MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr(); + CDesCArray* references = referenceMgr.ReferencesLC( aOldObjectName ); // + references + referenceMgr.SetReferencesL( aNewObjectName, *references ); + CleanupStack::PopAndDestroy( references ); // - references } TUint32 handle = objectInfo->Uint( CMTPObjectMetaData::EHandle ); - PRINT1( _L( "MM MTP <> CCopyObject::UpdateObjectInfoL handle = 0x%x" ), handle ); - SetPropertiesL( aOldObjectName, aNewObjectName, *objectInfo ); CleanupStack::PopAndDestroy( objectInfo ); // - objectInfo - PRINT( _L( "MM MTP <= CCopyObject::UpdateObjectInfoL" ) ); + + PRINT1( _L( "MM MTP <= CCopyObject::AddObjectToStoreL handle = 0x%x" ), handle ); return handle; } -// ----------------------------------------------------------------------------- -// CCopyObject::CopyAndUpdateL -// Move a single object and update the database -// ----------------------------------------------------------------------------- -// -void CCopyObject::CopyAndUpdateL( TUint32 aObjectHandle ) - { - PRINT1( _L( "MM MTP => CopyObject::CopyAndUpdateL aObjectHanlde = 0x%x" ), aObjectHandle ); - CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC(); // + objectInfo - - if ( iFramework.ObjectMgr().ObjectL( aObjectHandle, *objectInfo ) ) - { - // This is used to keep the same behavior in mass storage and device file manager. - if ( objectInfo->Uint( CMTPObjectMetaData::EFormatCode ) - == EMTPFormatCodeAbstractAudioVideoPlaylist ) - { - PRINT( _L( "MM MTP <> CopyObject::CopyAndUpdateL Playlist file don't to be copieds" ) ); - CleanupStack::PopAndDestroy( objectInfo ); // - objectInfo - return; - } - - RBuf fileName; // This is the source object name. - fileName.CleanupClosePushL(); // + fileName - fileName.CreateL( KMaxFileName ); - - RBuf oldFileName; - oldFileName.CleanupClosePushL(); // + oldFileName - oldFileName.CreateL( KMaxFileName ); - - RBuf rightPartName; - rightPartName.CleanupClosePushL(); // + rightPartName - rightPartName.CreateL( KMaxFileName ); - - fileName = objectInfo->DesC( CMTPObjectMetaData::ESuid ); - oldFileName = fileName; - - rightPartName = fileName.Right( fileName.Length() - - iPathToCopy->Length() ); - - if ( ( iNewRootFolder->Length() + rightPartName.Length() ) > fileName.MaxLength() ) - { - User::Leave( KErrCorrupt ); - } - - fileName.Zero(); - fileName.Append( *iNewRootFolder ); - fileName.Append( rightPartName ); - PRINT1( _L( "MM MTP <> CopyAndUpdateL fileName = %S" ), &fileName ); - - if ( objectInfo->Uint( CMTPObjectMetaData::EDataProviderId ) - == iFramework.DataProviderId() ) - { - // should copy before the set metadata DB - GetPreviousPropertiesL( *objectInfo ); - TInt err = iFileMan->Copy( oldFileName, fileName ); - PRINT1( _L( "MM MTP <> CCopyObject::CopyAndUpdateL err = %d" ), err ); - User::LeaveIfError( err ); - User::LeaveIfError( iFramework.Fs().SetModified( fileName, - iPreviousModifiedTime ) ); - - // Modify Suid - objectInfo->SetDesCL( CMTPObjectMetaData::ESuid, fileName ); - - // Modify parentHandle - TParsePtrC parentSuid( fileName ); - PRINT1( _L( "MM MTP <> CCopyObject::CopyAndUpdateL parentSuid = %S" ), &(parentSuid.DriveAndPath()) ); - - TUint32 parentHandle = iFramework.ObjectMgr().HandleL( parentSuid.DriveAndPath() ); - objectInfo->SetUint( CMTPObjectMetaData::EParentHandle, parentHandle ); - PRINT1( _L( "MM MTP <> CCopyObject::CopyAndUpdateL parentHandle = 0x%x" ), parentHandle ); - - // Modify storage Id. - objectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId ); - TRAP( err, iFramework.ObjectMgr().InsertObjectL( *objectInfo ) ); - if ( err != KErrNone ) - PRINT1( _L( "MM MTP <> CCopyObject::CopyAndUpdateL err = %d" ), err ); - // Set the properties of the new object - SetPropertiesL( oldFileName, fileName, *objectInfo ); - } - // Else this is not the owner of this object, so don't update the object store. - - CleanupStack::PopAndDestroy( &rightPartName ); // - rightPartName - CleanupStack::PopAndDestroy( &oldFileName ); // - oldFileName - CleanupStack::PopAndDestroy( &fileName ); // - fileName - } - else - { - User::Leave( KErrCorrupt ); - } - - CleanupStack::PopAndDestroy( objectInfo ); // - objectInfo - - PRINT( _L( "MM MTP <= CopyObject::CopyAndUpdateL" ) ); - } - -// ----------------------------------------------------------------------------- -// CCopyObject::SetPropertiesL -// Set the object properties in the object property store -// ----------------------------------------------------------------------------- -// -void CCopyObject::SetPropertiesL( const TDesC& aOldFileName, - const TDesC& aNewFileName, - const CMTPObjectMetaData& aObject ) - { - PRINT( _L( "MM MTP => CCopyObject::SetPropertiesL" ) ); - // won't leave with KErrAlreadyExist - iDpConfig.GetWrapperL().AddObjectL( aNewFileName ); - - TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode ); - if ( formatCode == EMTPFormatCodeM3UPlaylist ) - { - MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr(); - CDesCArray* references = referenceMgr.ReferencesLC( aOldFileName ); // + references - referenceMgr.SetReferencesL( aNewFileName, *references ); - CleanupStack::PopAndDestroy( references ); // - references - } - - SetPreviousPropertiesL( aObject ); - PRINT( _L( "MM MTP <= CCopyObject::SetPropertiesL" ) ); - } - -// ----------------------------------------------------------------------------- -// CCopyObject::RunError -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CCopyObject::RunError( TInt aError ) - { - if ( aError != KErrNone ) - PRINT1( _L( "MM MTP <> CCopyObject::RunError aError = %d" ), aError ); - - TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) ); - return KErrNone; - } - // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -18,12 +18,14 @@ #include #include +#include #include #include "cdeleteobject.h" #include "mmmtpdplogger.h" #include "mmmtpdpconfig.h" #include "cmmmtpdpmetadataaccesswrapper.h" +#include "mmmtpdputility.h" // static const TInt KMTPDriveGranularity = 5; @@ -91,7 +93,7 @@ KMTPDeleteObjectPolicy ), iObjectMgr( aFramework.ObjectMgr() ), iFs( aFramework.Fs() ), - iObjectsToDelete( KMmMtpRArrayGranularity ), + iObjectsToDelete( KMmMtpRArrayGranularity ), iDeleteError( KErrNone ), iDpConfig( aDpConfig ) { @@ -264,6 +266,10 @@ // 3. Delete object from framework db iObjectMgr.RemoveObjectL( aObjectInfo.Uint( CMTPObjectMetaData::EHandle ) ); + // 4. If the object has references, Delete references from reference manager + if ( MmMtpDpUtility::HasReference( aObjectInfo.Uint( CMTPObjectMetaData::EFormatCode ) ) ) + iFramework.ReferenceMgr().RemoveReferencesL( aObjectInfo.DesC( CMTPObjectMetaData::ESuid ) ); + PRINT( _L( "MM MTP <= CDeleteObject::DeleteObjectL" ) ); } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdescriptionutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdescriptionutility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include + +#include "cdescriptionutility.h" +#include "tobjectdescription.h" + +#include "mmmtpdplogger.h" + + +_LIT( KMtpObjDescObjFileName, + "[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 7}\\.[[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 2}]?" ); +// RegEx is [a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~][a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~ ]{0, 7}\.[[a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~][a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~ ]{0, 2}]? + +EXPORT_C CDescriptionUtility::CDescriptionUtility() + { + // Do nothing + } + +EXPORT_C CDescriptionUtility::~CDescriptionUtility() + { + // Do nothing + } + +EXPORT_C CMTPTypeObjectPropDesc* CDescriptionUtility::NewCommonObjectPropertyL( TUint16 aPropCode ) + { + CMTPTypeObjectPropDesc* propertyDesc = NULL; + + switch ( aPropCode ) + { + case EMTPObjectPropCodeStorageID: + case EMTPObjectPropCodeObjectFormat: + case EMTPObjectPropCodeObjectSize: + case EMTPObjectPropCodeParentObject: + case EMTPObjectPropCodePersistentUniqueObjectIdentifier: + case EMTPObjectPropCodeName: + case EMTPObjectPropCodeDateAdded: + propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode ); + break; + + // Protection Status (m) + case EMTPObjectPropCodeProtectionStatus: + propertyDesc = NewProtectionStatusPropDescL(); + break; + + // FileName + case EMTPObjectPropCodeObjectFileName: + propertyDesc = NewFileNamePropDescL(); + break; + + // Consumable (m) + case EMTPObjectPropCodeNonConsumable: + propertyDesc = NewNonConsumablePropDescL(); + break; + + case EMTPObjectPropCodeDateModified: // Date Modified + case EMTPObjectPropCodeDateCreated: // Date Created + { + CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; + propertyInfo.iDataType = EMTPTypeString; + propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EDateTimeForm; + propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly; + propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode, + propertyInfo, + NULL ); + } + break; + + default: + break; + } + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CDescriptionUtility::NewRangeFormDescriptionL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMTPTypeObjectPropDesc* CDescriptionUtility::NewRangeFormDescriptionL( TUint16 aPropertyCode, + TUint32 aMinValue, + TUint32 aMaxValue, + TUint32 aStepValue, + TBool aIsReadOnly ) + { + PRINT1( _L( "MM MTP => CDescriptionUtility::NewRangeFormDescriptionL, aPropertyCode = 0x%x" ), + aPropertyCode ); + CMTPTypeObjectPropDescRangeForm* form = + CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form + + // Set expected values + form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, aMinValue ); + form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, aMaxValue ); + form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, aStepValue ); + + CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; + propertyInfo.iDataType = EMTPTypeUINT32; + propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm; + propertyInfo.iGetSet = !aIsReadOnly; + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropertyCode, + propertyInfo, + form ); // + propertyDesc + + CleanupStack::PopAndDestroy( form ); // - form + PRINT( _L( "MM MTP <= CDescriptionUtility::NewRangeFormDescriptionL" ) ); + + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CDescriptionUtility::GetGroupCode +// Get MTPTypeObjectPropDesc according to property code +// ----------------------------------------------------------------------------- +// +TUint32 CDescriptionUtility::GetGroupCode( TUint32 aPropCode ) + { + TInt count = sizeof( KPropGroupMapTable ) / sizeof( KPropGroupMapTable[0] ); + // TODO: if need to refine the search approach to improve performance + for( TInt i = 0; i < count; i++ ) + { + if ( aPropCode == KPropGroupMapTable[i].iPropCode ) + return KPropGroupMapTable[i].iGroupCode; + } + return EGroupCodeNotDefined; + } + +// ----------------------------------------------------------------------------- +// CDescriptionUtility::NewProtectionStatusPropDescL +// New MTPTypeObjectPropDesc protection status +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CDescriptionUtility::NewProtectionStatusPropDescL() + { + PRINT( _L( "MM MTP => CDescriptionUtility::NewProtectionStatusPropDescL" ) ); + + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm + + TUint16 values[] = + { + EMTPProtectionNoProtection, + EMTPProtectionReadOnly + }; + + TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint16 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeProtectionStatus, *expectedForm ); + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CDescriptionUtility::NewProtectionStatusPropDescL" ) ); + return propertyDesc; + } + +// ----------------------------------------------------------------------------- +// CDescriptionUtility::NewFileNamePropDescL +// Get MTPTypeObjectPropDesc New file name +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CDescriptionUtility::NewFileNamePropDescL() + { + PRINT( _L( "MM MTP => CDescriptionUtility::NewFileNamePropDescL" ) ); + CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName ); // + form + + CMTPTypeObjectPropDesc* ret = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeObjectFileName, + CMTPTypeObjectPropDesc::ERegularExpressionForm, + form ); + + CleanupStack::PopAndDestroy( form ); // - form + PRINT( _L( "MM MTP <= CDescriptionUtility::NewFileNamePropDescL" ) ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CDescriptionUtility::NewFileNamePropDescL +// Get MTPTypeObjectPropDesc New file name +// ----------------------------------------------------------------------------- +// +CMTPTypeObjectPropDesc* CDescriptionUtility::NewNonConsumablePropDescL() + { + PRINT( _L( "MM MTP => CDescriptionUtility::NewNonConsumablePropDescL" ) ); + CMTPTypeObjectPropDescEnumerationForm* expectedForm = + CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT8 ); // + expectedForm + TUint8 values[] = + { + EMTPConsumable, + EMTPNonConsumable + }; + + TInt numValues = sizeof ( values ) / sizeof ( values[0] ); + for ( TInt i = 0; i < numValues; i++ ) + { + TMTPTypeUint8 data( values[i] ); + expectedForm->AppendSupportedValueL( data ); + } + + CMTPTypeObjectPropDesc* ret = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNonConsumable, + CMTPTypeObjectPropDesc::EEnumerationForm, + expectedForm ); + CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm + + PRINT( _L( "MM MTP <= CDescriptionUtility::NewNonConsumablePropDescL" ) ); + return ret; + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetformatcapabilities.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetformatcapabilities.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetformatcapabilities.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -11,23 +11,35 @@ * * Contributors: * -* Description: +* Description: * */ #include #include -#include -#include -#include - #include "cgetformatcapabilities.h" -#include "mmmtpdplogger.h" +#include "cdescriptionutility.h" #include "mmmtpdpconfig.h" -#include "tobjectdescription.h" +#include "mmmtpdplogger.h" -_LIT( KMtpObjDescObjFileName, "[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 7}\\.[[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 2}]?" ); +// ----------------------------------------------------------------------------- +// CGetFormatCapabilities::NewL +// Constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C MMmRequestProcessor* CGetFormatCapabilities::NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) + { + CGetFormatCapabilities* self = new ( ELeave ) CGetFormatCapabilities( aFramework, aConnection, aDpConfig ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } // ----------------------------------------------------------------------------- // CGetFormatCapabilities::CGetFormatCapabilities @@ -35,26 +47,27 @@ // ----------------------------------------------------------------------------- // EXPORT_C CGetFormatCapabilities::CGetFormatCapabilities( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) : - CRequestProcessor( aFramework, aConnection, 0, NULL ), - iDpConfig( aDpConfig ) + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) : + CRequestProcessor( aFramework, aConnection, 0, NULL ), + iDpConfig( aDpConfig ) { PRINT( _L( "Operation: CGetFormatCapabilities(0x930A)" ) ); } // ----------------------------------------------------------------------------- // CGetFormatCapabilities::ConstructL -// Second phase constructor +// The second phase constructor // ----------------------------------------------------------------------------- // EXPORT_C void CGetFormatCapabilities::ConstructL() { + // Do nothing } // ----------------------------------------------------------------------------- // CGetFormatCapabilities::~CGetFormatCapabilities -// Second phase constructor +// Destructor // ----------------------------------------------------------------------------- // EXPORT_C CGetFormatCapabilities::~CGetFormatCapabilities() @@ -91,7 +104,7 @@ } } - PRINT1( _L( "MM MTP <= CGetFormatCapabilities::CheckRequestL, response = 0x%X" ), response ); + PRINT1( _L( "MM MTP <= CGetFormatCapabilities::CheckRequestL, response = 0x%x" ), response ); return response; } @@ -108,7 +121,6 @@ iCapabilityList = NULL; iCapabilityList = CMTPTypeFormatCapabilityList::NewL(); - iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); if ( KMTPFormatsAll == iFormatCode ) { @@ -117,102 +129,55 @@ for( TInt i = 0; i < count; i++ ) { PRINT( _L( "MM MTP <> CGetFormatCapabilities::ServiceL, KMTPFormatsAll!!!" ) ); + iFormatCode = ( *formatArray )[i]; - ServiceInterdepentPropDescL(); - CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewL( iFormatCode, iInterdependentPropDesc ); - const RArray* propertiesArray = iDpConfig.GetSupportedPropertiesL( iFormatCode ); - TInt num = propertiesArray->Count(); - for( TInt j = 0;j < num; j++ ) - { - CMTPTypeObjectPropDesc* propertyDesc = ServicePropDescL( (*propertiesArray)[j] ); - if ( propertyDesc != NULL ) - { - frmCap->AppendL( propertyDesc ); - } - }//end for j - iCapabilityList->AppendL( frmCap ); - }//end for i - }//end if + ServiceOneFormatCapabilitiesL( iFormatCode ); + } + } else - { - ServiceInterdepentPropDescL(); - PRINT1( _L( "MM MTP <> CGetFormatCapabilities::ServiceL, ONLY one Format!!! formatCode = 0x%X" ), iFormatCode ); - - CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewL( iFormatCode, iInterdependentPropDesc ); - const RArray* propertiesArray = iDpConfig.GetSupportedPropertiesL( iFormatCode ); - TInt num = propertiesArray->Count(); - for( TInt j = 0;j < num; j++ ) - { - CMTPTypeObjectPropDesc* propertyDesc = ServicePropDescL( ( *propertiesArray )[j] ); - if ( propertyDesc != NULL ) - { - frmCap->AppendL( propertyDesc ); - } - }//end for j - iCapabilityList->AppendL( frmCap ); - } + ServiceOneFormatCapabilitiesL( iFormatCode ); SendDataL( *iCapabilityList ); PRINT( _L( "MM MTP <= CGetFormatCapabilities::ServiceL" ) ); } +void CGetFormatCapabilities::ServiceOneFormatCapabilitiesL( TUint aFormatCode ) + { + CMTPTypeInterdependentPropDesc* interdependentPropDesc = iDpConfig.DescriptionUtility()->NewInterdepentPropDescL( iDpConfig, aFormatCode ); + CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewL( aFormatCode, interdependentPropDesc ); + + const RArray* properties = iDpConfig.GetSupportedPropertiesL( aFormatCode ); + TInt num = properties->Count(); + for ( TInt i = 0; i < num; i++ ) + { + CMTPTypeObjectPropDesc* propertyDesc = ServiceOnePropDescL( ( *properties )[i] ); + if ( propertyDesc != NULL ) + { + frmCap->AppendL( propertyDesc ); + } + } + iCapabilityList->AppendL( frmCap ); + } + // ----------------------------------------------------------------------------- // CGetFormatCapabilities::ServicePropDescL // Get MTPTypeObjectPropDesc according to property code // ----------------------------------------------------------------------------- // -CMTPTypeObjectPropDesc* CGetFormatCapabilities::ServicePropDescL( TUint16 aPropCode ) +CMTPTypeObjectPropDesc* CGetFormatCapabilities::ServiceOnePropDescL( TUint16 aPropCode ) { - PRINT1( _L( "MM MTP => CGetFormatCapabilities::ServicePropDescL, aPropCode = 0x%X" ), aPropCode ); - // implement just like what we did in CGetpropertyDescc::ServiceL - CMTPTypeObjectPropDesc* propertyDesc; - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - - /* Create new PropDesc object to return to device - m - signals only limited supported values - hence these requests require the expected form - variable to be passed into the NewL contstuctor as well */ - switch( aPropCode ) - { - case EMTPObjectPropCodeStorageID: // Storage ID - case EMTPObjectPropCodeObjectFormat: // Format Code - case EMTPObjectPropCodeObjectSize: // Object Size - case EMTPObjectPropCodeParentObject: // Parent Object - case EMTPObjectPropCodePersistentUniqueObjectIdentifier: // Unique Object Identifier - case EMTPObjectPropCodeName: // Name - case EMTPObjectPropCodeDateAdded: // Date Added - propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode ); - break; + PRINT1( _L( "MM MTP => CGetFormatCapabilities::ServicePropDescL, aPropCode = 0x%x" ), aPropCode ); - // Protection Status (m) - case EMTPObjectPropCodeProtectionStatus: - propertyDesc = ServiceProtectionStatusL(); - break; - - // FileName - case EMTPObjectPropCodeObjectFileName: - propertyDesc = ServiceFileNameL(); - break; + // implement just like what we did in CGetpropertyDescc::ServiceL + CMTPTypeObjectPropDesc* propertyDesc = + iDpConfig.DescriptionUtility()->NewCommonObjectPropertyL( aPropCode ); - // Consumable (m) - case EMTPObjectPropCodeNonConsumable: - propertyDesc = ServiceNonConsumableL(); - break; + if ( propertyDesc == NULL ) + propertyDesc = iDpConfig.DescriptionUtility()->NewSpecificPropDescL( iFormatCode, aPropCode ); - case EMTPObjectPropCodeDateModified: // Date Modified - case EMTPObjectPropCodeDateCreated: // Date Created - propertyInfo.iDataType = EMTPTypeString; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EDateTimeForm; - propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly; - propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode, propertyInfo, NULL); - break; - - default: - propertyDesc = ServiceSpecificPropertyDescL( aPropCode ); - break; - } if ( propertyDesc != NULL ) { - TUint32 groupCode = GetGroupCode( aPropCode ); + TUint32 groupCode = iDpConfig.DescriptionUtility()->GetGroupCode( aPropCode ); propertyDesc->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, groupCode ); } @@ -221,108 +186,4 @@ return propertyDesc; } -// ----------------------------------------------------------------------------- -// CGetFormatCapabilities::GetGroupCode -// Get MTPTypeObjectPropDesc according to property code -// ----------------------------------------------------------------------------- -// -TUint32 CGetFormatCapabilities::GetGroupCode( TUint32 aPropCode ) - { - TInt count = sizeof( KPropGroupMapTable ); - // TODO: if need to refine the search approach to improve performance - for( TInt i = 0; i < count; i++ ) - { - if ( aPropCode == KPropGroupMapTable[i].iPropCode ) - return KPropGroupMapTable[i].iGroupCode; - } - return EGroupCodeNotDefined; - } - -// ----------------------------------------------------------------------------- -// CGetFormatCapabilities::ServiceProtectionStatusL -// Get MTPTypeObjectPropDesc protection status -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CGetFormatCapabilities::ServiceProtectionStatusL() - { - PRINT( _L( "MM MTP => CGetFormatCapabilities::ServiceProtectionStatusL" ) ); - - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm - - TUint16 values[] = - { - EMTPProtectionNoProtection, - EMTPProtectionReadOnly - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeProtectionStatus, *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CGetFormatCapabilities::ServiceProtectionStatusL" ) ); - return propertyDesc; - } - -// ----------------------------------------------------------------------------- -// CGetFormatCapabilities::ServiceFileNameL -// Get MTPTypeObjectPropDesc service file name -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CGetFormatCapabilities::ServiceFileNameL() - { - PRINT( _L( "MM MTP => CGetFormatCapabilities::ServiceFileNameL" ) ); - CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName ); // + form - - CMTPTypeObjectPropDesc* ret = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeObjectFileName, - CMTPTypeObjectPropDesc::ERegularExpressionForm, - form ); - - CleanupStack::PopAndDestroy( form ); // - form - PRINT( _L( "MM MTP <= CGetFormatCapabilities::ServiceFileNameL" ) ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CGetFormatCapabilities::ServiceFileNameL -// Get MTPTypeObjectPropDesc service file name -// ----------------------------------------------------------------------------- -// -CMTPTypeObjectPropDesc* CGetFormatCapabilities::ServiceNonConsumableL() - { - PRINT( _L( "MM MTP => CGetFormatCapabilities::ServiceNonConsumableL" ) ); - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT8 ); // + expectedForm - TUint8 values[] = - { - EMTPConsumable, - EMTPNonConsumable - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ); - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint8 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeUINT8; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly; - CMTPTypeObjectPropDesc* ret = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNonConsumable, - propertyInfo, - expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - - PRINT( _L( "MM MTP <= CGetFormatCapabilities::ServiceNonConsumableL" ) ); - return ret; - } - // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetinterdependentpropdesc.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetinterdependentpropdesc.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implement the operation: GetInterdenpendentPropDesc +* +*/ + +#include + +#include "cgetinterdependentpropdesc.h" +#include "mmmtpdplogger.h" +#include "mmmtpdpconfig.h" +#include "cdescriptionutility.h" + +// ----------------------------------------------------------------------------- +// CGetInterdependentPropDesc::NewL +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C MMmRequestProcessor* CGetInterdependentPropDesc::NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) + { + CGetInterdependentPropDesc* self = new ( ELeave ) CGetInterdependentPropDesc( aFramework, aConnection, aDpConfig ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// CGetInterdependentPropDesc::~CGetInterdependentPropDesc +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CGetInterdependentPropDesc::~CGetInterdependentPropDesc() + { + delete iDataset; + iDataset = NULL; + } + +// ----------------------------------------------------------------------------- +// CMTPGetInterDependentPropDesc::CMTPGetInterDependentPropDesc +// Standard c++ constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CGetInterdependentPropDesc::CGetInterdependentPropDesc( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) : + CRequestProcessor( aFramework, aConnection, 0, NULL ), + iDpConfig( aDpConfig ) + { + PRINT( _L( "Operation: GetInterdependentPropDesc(0x9807)" ) ); + } + +// ----------------------------------------------------------------------------- +// CMediaDpMtpGetInterDependentPropDesc::ConstructL +// Two-phase construction method +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGetInterdependentPropDesc::ConstructL() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CGetInterdependentPropDesc::CheckRequestL +// Verify the reqeust and returns it +// ----------------------------------------------------------------------------- +// +EXPORT_C TMTPResponseCode CGetInterdependentPropDesc::CheckRequestL() + { + PRINT( _L( "MM MTP => CGetInterdependentPropDesc::CheckRequestL" ) ); + + TMTPResponseCode responseCode = CRequestProcessor::CheckRequestL(); + iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); + + // check if it is what dp supported + responseCode = EMTPRespCodeInvalidObjectFormatCode; + + const RArray* format = iDpConfig.GetSupportedFormat(); + TInt count = format->Count(); + + for ( TInt i = 0; i < count; i++ ) + { + if ( iFormatCode == ( *format )[i] ) + { + responseCode = EMTPRespCodeOK; + break; + } + } + + // Clear the data set. + delete iDataset; + iDataset = NULL; + + PRINT2( _L( "MM MTP <= CGetInterdependentPropDesc::CheckRequestL, iFormatCode = 0x%x, responseCode = 0x%x" ), + iFormatCode, + responseCode ); + + return responseCode; + } + +// ----------------------------------------------------------------------------- +// CGetInterdependentPropDesc::ServiceL +// service a request at request phase +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGetInterdependentPropDesc::ServiceL() + { + PRINT( _L( "MM MTP => CGetInterdependentPropDesc::ServiceL" ) ); + + iDataset = iDpConfig.DescriptionUtility()->NewInterdepentPropDescL( iDpConfig, iFormatCode ); + + // Send the dataset. + SendDataL( *iDataset ); + PRINT( _L( "MM MTP <= CGetInterdependentPropDesc::ServiceL" ) ); + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -84,12 +84,12 @@ // CGetObject::CGetObject( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection ) : - CRequestProcessor( aFramework, - aConnection, - sizeof( KMTPGetObjectPolicy ) / sizeof( TMTPRequestElementInfo ), - KMTPGetObjectPolicy ), - iFs( iFramework.Fs() ), - iError( EMTPRespCodeOK ) + CRequestProcessor( aFramework, + aConnection, + sizeof( KMTPGetObjectPolicy ) / sizeof( TMTPRequestElementInfo ), + KMTPGetObjectPolicy ), + iFs( iFramework.Fs() ), + iError( EMTPRespCodeOK ) { PRINT( _L( "Operation: GetObject(0x1009)" ) ); } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropdesc.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropdesc.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropdesc.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -11,22 +11,35 @@ * * Contributors: * -* Description: Implement operation: GetObjectPropDesc +* Description: Request processor which handle common property description * */ - #include -#include #include "cgetobjectpropdesc.h" +#include "cdescriptionutility.h" +#include "mmmtpdpconfig.h" #include "tmmmtpdppanic.h" #include "mmmtpdplogger.h" -#include "tobjectdescription.h" -#include "mmmtpdpconfig.h" -_LIT( KMtpObjDescObjFileName, "[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 7}\\.[[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 2}]?" ); -// RegEx is [a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~][a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~ ]{0, 7}\.[[a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~][a-zA-Z!#\$%&'\(\)\-0-9@\^_\`\{\}\~ ]{0, 2}]? +// ----------------------------------------------------------------------------- +// CGetObjectPropDesc::NewL +// Constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C MMmRequestProcessor* CGetObjectPropDesc::NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) + { + CGetObjectPropDesc* self = new ( ELeave ) CGetObjectPropDesc( aFramework, aConnection, aDpConfig ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } // ----------------------------------------------------------------------------- // CGetObjectPropDesc::~CGetObjectPropDesc @@ -35,7 +48,8 @@ // EXPORT_C CGetObjectPropDesc::~CGetObjectPropDesc() { - delete iObjectProperty; + delete iPropertyDesc; + iPropertyDesc = NULL; } // ----------------------------------------------------------------------------- @@ -46,21 +60,21 @@ EXPORT_C CGetObjectPropDesc::CGetObjectPropDesc( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CRequestProcessor( aFramework, aConnection, 0, NULL ), - iObjectProperty( NULL ), - iDpConfig( aDpConfig ) + CRequestProcessor( aFramework, aConnection, 0, NULL ), + iDpConfig( aDpConfig ), + iPropertyDesc( NULL ) { PRINT( _L( "Operation: GetObjectPropDesc(0x9802)" ) ); } // ----------------------------------------------------------------------------- // CGetObjectPropDesc::ConstructL -// Second phase constructor +// The second phase constructor // ----------------------------------------------------------------------------- // EXPORT_C void CGetObjectPropDesc::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -72,6 +86,12 @@ { TMTPResponseCode response = CRequestProcessor::CheckRequestL(); + iPropCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); + iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); + PRINT2( _L( "MM MTP <> CGetObjectPropDesc::CheckPropCode, propCode = 0x%x, iFormatCode = 0x%x" ), + iPropCode, + iFormatCode ); + if ( response == EMTPRespCodeOK ) { response = CheckFormatL(); @@ -87,203 +107,22 @@ } // ----------------------------------------------------------------------------- -// CGetObjectPropDesc::ServiceL -// GetObjectPropDesc request handler -// ----------------------------------------------------------------------------- -// -EXPORT_C void CGetObjectPropDesc::ServiceL() - { - PRINT( _L( "MM MTP => CGetObjectPropDesc::ServiceL" ) ); - delete iObjectProperty; - iObjectProperty = NULL; - - TUint32 propCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); - iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); - PRINT2( _L( "MM MTP <> CGetObjectPropDesc::ServiceL propCode = 0x%x, iFormatCode = 0x%x" ), - propCode, - iFormatCode ); - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - - /* Create new PropDesc object to return to device - m - signals only limited supported values - hence these requests require the expected form - variable to be passed into the NewL contstuctor as well */ - switch ( propCode ) - { - case EMTPObjectPropCodeStorageID: // Storage ID - case EMTPObjectPropCodeObjectFormat: // Format Code - case EMTPObjectPropCodeObjectSize: // Object Size - case EMTPObjectPropCodeParentObject: // Parent Object - case EMTPObjectPropCodePersistentUniqueObjectIdentifier: // Unique Object Identifier - case EMTPObjectPropCodeName: // Name - case EMTPObjectPropCodeDateAdded: // Date Added - iObjectProperty = CMTPTypeObjectPropDesc::NewL( propCode ); - break; - - // Protection Status (m) - case EMTPObjectPropCodeProtectionStatus: - ServiceProtectionStatusL(); - break; - - // FileName - case EMTPObjectPropCodeObjectFileName: - ServiceFileNameL(); - break; - - // Consumable (m) - case EMTPObjectPropCodeNonConsumable: - ServiceNonConsumableL(); - break; - - case EMTPObjectPropCodeDateModified: // Date Modified - case EMTPObjectPropCodeDateCreated: // Date Created - propertyInfo.iDataType = EMTPTypeString; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EDateTimeForm; - propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly; - iObjectProperty = CMTPTypeObjectPropDesc::NewL( propCode, propertyInfo, NULL); - break; - - // Error - Should be caught by CheckRequestL - default: - ServiceSpecificObjectPropertyL( propCode ); - break; - } - - // Set group code - TUint32 groupCode = GetGroupCode( propCode ); - PRINT1( _L("MM MTP <> CGetObjectPropDesc::ServiceL, groupCode = 0x%x"), groupCode ); - iObjectProperty->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, groupCode ); - - __ASSERT_DEBUG( iObjectProperty, Panic( EMmMTPDpObjectPropertyNull ) ); - - SendDataL( *iObjectProperty ); - - PRINT( _L( "MM MTP <= CGetObjectPropDesc::ServiceL" ) ); - } - -// ----------------------------------------------------------------------------- -// CGetObjectPropDesc::ServiceProtectionStatusL -// Create list of possible protection status and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CGetObjectPropDesc::ServiceProtectionStatusL() - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT16 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - - TUint16 values[] = - { - EMTPProtectionNoProtection, - EMTPProtectionReadOnly - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ) ; - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint16 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeProtectionStatus, *expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - -// ----------------------------------------------------------------------------- -// CGetObjectPropDesc::ServiceFileNameL() -// Create Regular expression for a file name and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CGetObjectPropDesc::ServiceFileNameL() - { - CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName ); // + form - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeObjectFileName, - CMTPTypeObjectPropDesc::ERegularExpressionForm, - form ); - - CleanupStack::PopAndDestroy( form ); // - form - } - -// ----------------------------------------------------------------------------- -// CGetObjectPropDesc::ServiceNonConsumableL -// Create list of possible nonConsumable values and create new ObjectPropDesc -// ----------------------------------------------------------------------------- -// -void CGetObjectPropDesc::ServiceNonConsumableL() - { - CMTPTypeObjectPropDescEnumerationForm* expectedForm = - CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT8 ); - CleanupStack::PushL( expectedForm ); // + expectedForm - TUint8 values[] = - { - EMTPConsumable, - EMTPNonConsumable - }; - - TInt numValues = sizeof ( values ) / sizeof ( values[0] ); - for ( TInt i = 0; i < numValues; i++ ) - { - TMTPTypeUint8 data( values[i] ); - expectedForm->AppendSupportedValueL( data ); - } - - // Althrough iObjectProperty is released in ServiceL(), - // release it here maybe a more safer way :) - if ( iObjectProperty != NULL ) - { - delete iObjectProperty; - iObjectProperty = NULL; - } - - CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; - propertyInfo.iDataType = EMTPTypeUINT8; - propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; - propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly; - iObjectProperty = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNonConsumable, - propertyInfo, - expectedForm ); - CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm - } - -// ----------------------------------------------------------------------------- // CGetObjectPropList::CheckFormatL -// Ensures the object format operation parameter is valid +// Ensure the object format operation parameter is valid // ----------------------------------------------------------------------------- // TMTPResponseCode CGetObjectPropDesc::CheckFormatL() const { - TMTPResponseCode response = EMTPRespCodeOK; - - TUint32 formatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); - PRINT1( _L( "MM MTP <> CGetObjectPropDesc::CheckFormatL formatCode = 0x%x" ), formatCode ); + TMTPResponseCode response = EMTPRespCodeInvalidObjectFormatCode; - if( formatCode != 0) + if( iFormatCode != KMTPFormatsAll ) { - response = EMTPRespCodeInvalidObjectFormatCode; - const RArray* format = iDpConfig.GetSupportedFormat(); TInt count = format->Count(); for ( TInt i = 0; i < count; i++ ) { - if ( formatCode == (*format)[i] ) + if ( iFormatCode == (*format)[i] ) { response = EMTPRespCodeOK; break; @@ -296,60 +135,59 @@ // ----------------------------------------------------------------------------- // CGetObjectPropDesc::CheckPropCodeL -// Ensures the object prop code operation parameter is valid +// Ensure the object prop code operation parameter is valid // ----------------------------------------------------------------------------- // TMTPResponseCode CGetObjectPropDesc::CheckPropCodeL() const { - TMTPResponseCode response = EMTPRespCodeOK; + TMTPResponseCode response = EMTPRespCodeInvalidObjectPropCode; - TUint32 propCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); - PRINT1( _L( "MM MTP <> CGetObjectPropDesc::CheckPropCode, propCode = 0x%x" ), propCode ); - - if ( propCode == 0 ) + if ( iPropCode != KMTPNotSpecified32 && iPropCode != KMTPObjectPropCodeAll ) { - // A propCode of 0 means specification by group (which is not supported) - response = EMTPRespCodeSpecificationByGroupUnsupported; - } - else - { - TUint32 formatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); - - const RArray* properties = NULL; - if ( formatCode == KMTPFormatsAll ) - properties= iDpConfig.GetAllSupportedProperties(); - else - properties = iDpConfig.GetSupportedPropertiesL( formatCode ); + const RArray* properties = iDpConfig.GetSupportedPropertiesL( iFormatCode ); const TInt count = properties->Count(); - TInt i = 0; - for( i = 0; i < count; i++ ) + for( TInt i = 0; i < count; i++ ) { - if ( (*properties)[i] == propCode ) + if ( (*properties)[i] == iPropCode ) { + response = EMTPRespCodeOK; break; } } - - if ( i == count ) - { - response = EMTPRespCodeInvalidObjectPropCode; - } } return response; } -TUint32 CGetObjectPropDesc::GetGroupCode( TUint16 aPropCode ) +// ----------------------------------------------------------------------------- +// CGetObjectPropDesc::ServiceL +// GetObjectPropDesc request handler +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGetObjectPropDesc::ServiceL() { - TInt count = sizeof( KPropGroupMapTable ); - // TODO: if need to refine the search approach to improve performance - for( TInt i = 0; i < count; i++ ) - { - if ( aPropCode == KPropGroupMapTable[i].iPropCode ) - return KPropGroupMapTable[i].iGroupCode; - } - return EGroupCodeNotDefined; + PRINT( _L( "MM MTP => CGetObjectPropDesc::ServiceL" ) ); + + delete iPropertyDesc; + iPropertyDesc = NULL; + + iPropertyDesc = iDpConfig.DescriptionUtility()->NewCommonObjectPropertyL( iPropCode ); + + // if iPropertyDesc == NULL, iPropCode is not common property but dp specific one. + if( iPropertyDesc == NULL ) + iPropertyDesc = iDpConfig.DescriptionUtility()->NewSpecificPropDescL( iFormatCode, iPropCode ); + + __ASSERT_DEBUG( iPropertyDesc, Panic( EMmMTPDpObjectPropertyNull ) ); + + // Set group code + TUint32 groupCode = iDpConfig.DescriptionUtility()->GetGroupCode( iPropCode ); + PRINT1( _L("MM MTP <> CGetObjectPropDesc::ServiceL, groupCode = 0x%x"), groupCode ); + iPropertyDesc->SetUint32L( CMTPTypeObjectPropDesc::EGroupCode, groupCode ); + + SendDataL( *iPropertyDesc ); + + PRINT( _L( "MM MTP <= CGetObjectPropDesc::ServiceL" ) ); } // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -82,13 +82,13 @@ EXPORT_C CGetObjectPropList::CGetObjectPropList( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CRequestProcessor( aFramework, - aConnection, - sizeof ( KMTPGetObjectPropListPolicy ) / sizeof( TMTPRequestElementInfo ), - KMTPGetObjectPropListPolicy ), - iHandles ( KMmMtpRArrayGranularity ), - iDpConfig( aDpConfig ), - iPropertyArray( KMmMtpRArrayGranularity ) + CRequestProcessor( aFramework, + aConnection, + sizeof ( KMTPGetObjectPropListPolicy ) / sizeof( TMTPRequestElementInfo ), + KMTPGetObjectPropListPolicy ), + iHandles ( KMmMtpRArrayGranularity ), + iDpConfig( aDpConfig ), + iPropertyArray( KMmMtpRArrayGranularity ) { PRINT( _L( "Operation: GetObjectPropList(0x9805)" ) ); } @@ -144,7 +144,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::ServiceL -// service a request at request phase +// GetObjectPropList request handler // ----------------------------------------------------------------------------- // EXPORT_C void CGetObjectPropList::ServiceL() @@ -167,7 +167,7 @@ TInt err = KErrNone; for ( TInt i = 0; i < numOfObjects; i++ ) { - TUint32 handle = iHandles[i ]; + TUint32 handle = iHandles[i]; if ( iFramework.ObjectMgr().ObjectOwnerId( handle ) == iFramework.DataProviderId() ) @@ -187,9 +187,14 @@ } } PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceL, one property was queried, Send data to PC! err = %d" ), err ); - if ( err == KErrNone || err == KErrNotSupported ) + if ( err == KErrNone + || ( err == KErrNotSupported && 0 < iPropertyList->NumberOfElements() ) ) + // Make sure the dataset which is returned to pc is valid SendDataL( *iPropertyList ); - else if ( err == KErrNotFound ) + else if ( err == KErrNotFound || err == KErrNotSupported ) + // The object entry is not in db + // or the ONLY required metadata is not in db. + // The second case is the same with GetObjectPropValue and device has nothing to return. SendResponseL( EMTPRespCodeAccessDenied ); else SendResponseL( EMTPRespCodeGeneralError ); @@ -200,7 +205,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::CheckFormatL -// Ensures the object format operation parameter is valid +// Ensure the object format operation parameter is valid // ----------------------------------------------------------------------------- // TMTPResponseCode CGetObjectPropList::CheckFormatL() const @@ -223,7 +228,7 @@ for ( TInt i = 0; i < count; i++ ) { - if ( formatCode == (*format)[i ] ) + if ( formatCode == (*format)[i] ) { response = EMTPRespCodeOK; break; @@ -238,7 +243,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::CheckPropCodeL -// Ensures the object prop code operation parameter is valid +// Ensure the object prop code operation parameter is valid // ----------------------------------------------------------------------------- // TMTPResponseCode CGetObjectPropList::CheckPropCodeL() const @@ -259,8 +264,7 @@ PRINT1( _L( "MM MTP <> CGetObjectPropList::CheckPropCode, Group Code = 0x%x" ), groupCode ); // check if groupCode is supported - TInt count = sizeof ( KSupportedGroupCode ) - / sizeof ( KSupportedGroupCode[0] ); + TInt count = sizeof ( KSupportedGroupCode ) / sizeof ( KSupportedGroupCode[0] ); TInt i = 0; for ( ; i < count; i++ ) { @@ -275,15 +279,12 @@ { PRINT1( _L( "MM MTP <> CGetObjectPropList::CheckPropCode, Property(0x%x) was queried." ), iPropCode ); - TInt err = KErrNone; const RArray* properties = NULL; if ( formatCode == KMTPFormatsAll ) properties = iDpConfig.GetAllSupportedProperties(); else properties = iDpConfig.GetSupportedPropertiesL( formatCode ); - User::LeaveIfError( err ); - const TInt count = properties->Count(); TInt i = 0; for ( i = 0; i < count; i++ ) @@ -312,7 +313,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::CheckDepth -// Ensures the depth operation parameter is valid +// Ensure the depth operation parameter is valid // ----------------------------------------------------------------------------- // TMTPResponseCode CGetObjectPropList::CheckDepth() const @@ -341,7 +342,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::GetObjectHandlesL -// Gets the handles for the objects that we want the properties for +// Get the handles for the objects that we want the properties for // ----------------------------------------------------------------------------- // void CGetObjectPropList::GetObjectHandlesL() @@ -383,7 +384,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::GetObjectHandlesL -// Gets all object handles (for GetObjectHandlesL) +// Get all object handles (for GetObjectHandlesL) // ----------------------------------------------------------------------------- // void CGetObjectPropList::GetObjectHandlesL( TUint32 aStorageId, @@ -512,20 +513,34 @@ const TInt count = properties->Count(); TInt err = KErrNone; + TBool successQuery = EFalse; for ( TInt i = 0; i < count; i++ ) { - // no need to do the trap anymore, this is being handle internally in Media DP's ServiceSpecificObjectPropertyL, also, this base class should not know too much of different handling between different formats + // no need to do the trap anymore, this is being handle internally in Media DP's ServiceSpecificObjectPropertyL, + // also, this base class should not know too much of different handling between different formats err = ServiceOneObjectPropertyL( aHandle, (*properties)[i] ); - if ( err == KErrNotSupported ) // Skip + if ( err == KErrNone ) + successQuery = ETrue; + if ( err == KErrNotSupported || err == KErrNotFound ) // Skip err = KErrNone; if ( err != KErrNone ) break; } + // In PC Suite combined mode, a file that was found at the beginning could be deleted by PC Suite protocol + // Need to fail it here. + if ( successQuery == EFalse ) + err = KErrNotFound; + PRINT1( _L( "MM MTP <= CGetObjectPropList::ServiceAllPropertiesL err = %d" ), err ); return err; } +// ----------------------------------------------------------------------------- +// CGetObjectPropList::ServiceGroupPropertiesL +// Get the grouped object properties for specific object +// ----------------------------------------------------------------------------- +// TInt CGetObjectPropList::ServiceGroupPropertiesL( TUint32 aHandle ) { PRINT1( _L( "MM MTP => CGetObjectPropList::ServiceGroupPropertiesL aHandle = 0x%x" ), aHandle ); @@ -545,15 +560,23 @@ const TInt count = iPropertyArray.Count(); TInt err = KErrNone; + TBool successQuery = EFalse; for ( TInt i = 0; i < count; i++ ) { err = ServiceOneObjectPropertyL( aHandle, iPropertyArray[i] ); - if ( err == KErrNotSupported ) // Skip + if ( err == KErrNone ) + successQuery = ETrue; + if ( err == KErrNotSupported || err == KErrNotFound ) // Skip err = KErrNone; if ( err != KErrNone ) break; } + // In PC Suite combined mode, a file that was found at the beginning could be deleted by PC Suite protocol + // Need to fail it here. + if ( successQuery == EFalse ) + err = KErrNotFound; + PRINT1( _L( "MM MTP <= CGetObjectPropList::ServiceGroupPropertiesL err = %d" ), err ); return err; @@ -561,7 +584,7 @@ // ----------------------------------------------------------------------------- // CGetObjectPropList::ServiceOneObjectPropertyL -// Gets the object property information for the required object +// Get the object property information for the required object // ----------------------------------------------------------------------------- // TInt CGetObjectPropList::ServiceOneObjectPropertyL( TUint32 aHandle, @@ -585,8 +608,8 @@ case EMTPObjectPropCodeStorageID: { TMTPTypeUint32 storageId( iObject->Uint( CMTPObjectMetaData::EStorageId ) ); - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint32L(CMTPTypeObjectPropListElement::EValue, storageId.Value()); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, storageId.Value() ); } break; @@ -594,8 +617,8 @@ case EMTPObjectPropCodeObjectFormat: { TMTPTypeUint16 objectFormat( iObject->Uint( CMTPObjectMetaData::EFormatCode ) ); - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint16L(CMTPTypeObjectPropListElement::EValue, objectFormat.Value()); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, objectFormat.Value() ); } break; @@ -604,8 +627,8 @@ { TMTPTypeUint16 protectionStatus( MmMtpDpUtility::GetProtectionStatusL( iFramework.Fs(), iObject->DesC( CMTPObjectMetaData::ESuid ) ) ); - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint16L(CMTPTypeObjectPropListElement::EValue, protectionStatus.Value()); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, protectionStatus.Value() ); } break; @@ -630,8 +653,8 @@ #endif // _DEBUG TParsePtrC parse( iObject->DesC( CMTPObjectMetaData::ESuid ) ); textData = CMTPTypeString::NewLC( parse.NameAndExt() ); // + textData - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetStringL(CMTPTypeObjectPropListElement::EValue, textData->StringChars()); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode) ); + iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() ); CleanupStack::PopAndDestroy( textData ); // - textData } break; @@ -639,8 +662,8 @@ // Parent Object case EMTPObjectPropCodeParentObject: { - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint32L(CMTPTypeObjectPropListElement::EValue, iObject->Uint( CMTPObjectMetaData::EParentHandle )); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, iObject->Uint( CMTPObjectMetaData::EParentHandle ) ); } break; @@ -648,8 +671,8 @@ case EMTPObjectPropCodePersistentUniqueObjectIdentifier: { TMTPTypeUint128 puid = iFramework.ObjectMgr().PuidL( aHandle ); - iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint128L(CMTPTypeObjectPropListElement::EValue,puid.UpperValue(), puid.LowerValue() ); + iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); + iPropertyElement->SetUint128L( CMTPTypeObjectPropListElement::EValue,puid.UpperValue(), puid.LowerValue() ); } break; @@ -671,13 +694,16 @@ if ( err == KErrNone ) { iPropertyElement = &(iPropertyList->ReservePropElemL( aHandle, aPropCode ) ); - iPropertyElement->SetStringL(CMTPTypeObjectPropListElement::EValue, textData->StringChars()); + iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() ); } CleanupStack::PopAndDestroy( textData ); // - textData + break; } + // Else, video DB does not support DateAdded field, use the file system date! + // It's the same behavior with DateCreated and DateModified. + // Fall through intentional. } - break; case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: @@ -701,12 +727,15 @@ case EMTPObjectPropCodeNonConsumable: { iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode)); - iPropertyElement->SetUint8L(CMTPTypeObjectPropListElement::EValue,0); + iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue, + iObject->Uint( CMTPObjectMetaData::ENonConsumable ) ); } break; default: { + // "err == KErrNotFound" means the object entry does not exist in DB, + // "err == KErrNotSupported" means the entry is there but this metadata not. err = ServiceSpecificObjectPropertyL( aPropCode, aHandle ); } break; @@ -773,7 +802,8 @@ } else // all handles processed, can send data { - PRINT( _L( "MM MTP <> CGetObjectPropList::RunL, Finished, Send data to PC!" ) ); + PRINT1( _L( "MM MTP <> CGetObjectPropList::RunL, Finished, Send data to PC!, iPropertyList->NumberOfElements() = %d" ), + iPropertyList->NumberOfElements() ); SendDataL( *iPropertyList ); } } @@ -798,8 +828,6 @@ // EXPORT_C void CGetObjectPropList::DoCancel() { - // TODO: need to send the data here? - // SendDataL( *iPropertyList ); } void CGetObjectPropList::GetPropertiesL( RArray& aPropArray, diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -240,6 +240,9 @@ ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo ); break; } + // Else, video DB does not support DateAdded field, use the file system date! + // It's the same behavior with DateCreated and DateModified. + // Fall through intentional. } //lint -fallthrough case EMTPObjectPropCodeDateCreated: @@ -260,7 +263,7 @@ // Consumable case EMTPObjectPropCodeNonConsumable: { - iMTPTypeUint8.Set( 0 ); + iMTPTypeUint8.Set( iObjectInfo->Uint( CMTPObjectMetaData::ENonConsumable ) ); SendDataL( iMTPTypeUint8 ); } break; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetpartialobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetpartialobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetpartialobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -23,7 +23,6 @@ #include "cgetpartialobject.h" #include "mmmtpdplogger.h" #include "tmmmtpdppanic.h" -#include "ttypeflatbuf.h" #include "mmmtpdpconfig.h" /** @@ -41,7 +40,7 @@ // EXPORT_C MMmRequestProcessor* CGetPartialObject::NewL( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig ) + MMmMtpDpConfig& /*aDpConfig*/ ) { CGetPartialObject* self = new (ELeave) CGetPartialObject( aFramework, aConnection ); CleanupStack::PushL( self ); @@ -57,8 +56,6 @@ // EXPORT_C CGetPartialObject::~CGetPartialObject() { - delete iBuffer; - delete iPartialData; delete iFileObject; } @@ -69,18 +66,26 @@ // EXPORT_C CGetPartialObject::CGetPartialObject( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection ) : - CRequestProcessor( aFramework, - aConnection, - sizeof( KMTPGetPartialObjectPolicy ) / sizeof( TMTPRequestElementInfo ), - KMTPGetPartialObjectPolicy ), - iFramework ( aFramework ), - iFs( iFramework.Fs() ), - iBufferPtr8( NULL, 0 ) + CRequestProcessor( aFramework, + aConnection, + sizeof( KMTPGetPartialObjectPolicy ) / sizeof( TMTPRequestElementInfo ), + KMTPGetPartialObjectPolicy ), + iFramework ( aFramework ) { PRINT( _L( "Operation: GetPartialObject(0x101B)" ) ); } // ----------------------------------------------------------------------------- +// CGetPartialObject::ConstructL() +// Second-phase construction +// ----------------------------------------------------------------------------- +// +void CGetPartialObject::ConstructL() + { + SetPSStatus(); + } + +// ----------------------------------------------------------------------------- // CGetPartialObject::CheckRequestL // Check the GetPartialObject reqeust // ----------------------------------------------------------------------------- @@ -106,14 +111,17 @@ TBool CGetPartialObject::VerifyParametersL() { PRINT( _L( "MM MTP => CGetPartialObject::VerifyParametersL" ) ); + __ASSERT_DEBUG( iRequestChecker, Panic( EMmMTPDpRequestCheckNull ) ); TBool result = EFalse; iObjectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); - PRINT1( _L( "MM MTP <> CGetPartialObject::VerifyParametersL iObjectHandle = 0x%x" ), iObjectHandle ); iOffset = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); - PRINT1( _L( "MM MTP <> CGetPartialObject::VerifyParametersL iOffset = %d" ), iOffset ); - TUint32 maxLength = Request().Uint32( TMTPTypeRequest::ERequestParameter3 ); - PRINT1( _L( "MM MTP <> CGetPartialObject::VerifyParametersL maxLength = %d" ), maxLength ); + iPartialDataLength = Request().Uint32( TMTPTypeRequest::ERequestParameter3 ); + + PRINT3( _L( "MM MTP <> CGetPartialObject::VerifyParametersL iObjectHandle = 0x%x, iOffset = 0x%x, iMaxLength = 0x%x " ), + iObjectHandle, + iOffset, + iPartialDataLength ); //get object info, but do not have the ownship of the object CMTPObjectMetaData* objectInfo = iRequestChecker->GetObjectInfo( iObjectHandle ); @@ -122,28 +130,12 @@ const TDesC& suid( objectInfo->DesC( CMTPObjectMetaData::ESuid ) ); PRINT1( _L( "MM MTP <> CGetPartialObject::VerifyParametersL suid = %S" ), &suid ); - if ( objectInfo->Uint( CMTPObjectMetaData::EDataProviderId ) - == iFramework.DataProviderId() ) - result = ETrue; - TEntry fileEntry; - User::LeaveIfError( iFs.Entry( suid, fileEntry ) ); - TInt64 fileSize = fileEntry.iSize; - if( ( iOffset < fileEntry.iSize ) && result ) + User::LeaveIfError( iFramework.Fs().Entry( suid, fileEntry ) ); + if ( iOffset < fileEntry.FileSize() ) { - if ( maxLength == fileSize ) - { - iCompleteFile = ETrue; - } - - if( iOffset + maxLength > fileSize ) - { - maxLength = fileSize - iOffset; - } - iPartialDataLength = maxLength; result = ETrue; } - PRINT1( _L( "MM MTP <> CGetPartialObject::VerifyParametersL iPartialDataLength = %d" ), iPartialDataLength ); PRINT1( _L( "MM MTP <= CGetPartialObject::VerifyParametersL result = %d" ), result ); return result; @@ -157,29 +149,21 @@ EXPORT_C void CGetPartialObject::ServiceL() { PRINT( _L( "MM MTP => CGetPartialObject::ServiceL" ) ); + // Get file information CMTPObjectMetaData* objectInfo = iRequestChecker->GetObjectInfo( iObjectHandle ); __ASSERT_DEBUG( objectInfo, Panic( EMmMTPDpObjectNull ) ); - iFileSuid.SetLength( 0 ); - iFileSuid.Append( objectInfo->DesC( CMTPObjectMetaData::ESuid ) ); + TBuf fileSuid; + fileSuid.Append( objectInfo->DesC( CMTPObjectMetaData::ESuid ) ); - if ( iCompleteFile ) - { - // Pass the complete file back to the host - delete iFileObject; - iFileObject = NULL; - iFileObject = CMTPTypeFile::NewL( iFramework.Fs(), iFileSuid, EFileRead ); - SendDataL( *iFileObject ); - } - else - { - // Send partial file fragment back. - BuildPartialDataL(); - delete iPartialData; - iPartialData = NULL; - iPartialData = new (ELeave) TMTPTypeFlatBuf( iBufferPtr8 ); - SendDataL( *iPartialData ); - } + iFileObject = CMTPTypeFile::NewL( iFramework.Fs(), + fileSuid, + ( TFileMode ) ( EFileRead | EFileShareReadersOnly ), + iPartialDataLength, + iOffset ); + + SendDataL( *iFileObject ); + PRINT( _L( "MM MTP <= CGetPartialObject::ServiceL" ) ); } @@ -191,50 +175,12 @@ EXPORT_C TBool CGetPartialObject::DoHandleResponsePhaseL() { PRINT( _L( "MM MTP => CGetPartialObject::DoHandleResponsePhaseL" ) ); - TUint32 dataLength = iPartialDataLength; - PRINT1( _L( "MM MTP <> CGetPartialObject::DoHandleResponsePhaseL dataLength = %d" ), dataLength ); + + TUint32 dataLength = iFileObject->GetByteSent(); SendResponseL( EMTPRespCodeOK, 1, &dataLength ); - PRINT( _L( "MM MTP <= CGetPartialObject::DoHandleResponsePhaseL" ) ); + + PRINT1( _L( "MM MTP <= CGetPartialObject::DoHandleResponsePhaseL dataLength = %d" ), dataLength ); return EFalse; } -// ----------------------------------------------------------------------------- -// CGetPartialObject::ConstructL() -// Second-phase construction -// ----------------------------------------------------------------------------- -// -void CGetPartialObject::ConstructL() - { - SetPSStatus(); - } - -// ----------------------------------------------------------------------------- -// CGetPartialObject::BuildPartialDataL() -// Populate the partial data object -// ----------------------------------------------------------------------------- -// -void CGetPartialObject::BuildPartialDataL() - { - PRINT( _L( "MM MTP => CGetPartialObject::BuildPartialDataL" ) ); - __ASSERT_DEBUG( iRequestChecker, Panic( EMmMTPDpRequestCheckNull ) ); - - if ( iBuffer ) - { - delete iBuffer; - iBuffer = NULL; - } - - // We might fail if we have insufficient memory... - iBuffer = HBufC8::NewL( iPartialDataLength ); - iBuffer->Des().Zero(); - iBufferPtr8.Set( iBuffer->Des() ); - - RFile file; - User::LeaveIfError( file.Open( iFs, iFileSuid, EFileRead ) ); - CleanupClosePushL( file ); // + file - User::LeaveIfError( file.Read( iOffset, iBufferPtr8, iPartialDataLength ) ); - CleanupStack::PopAndDestroy( &file ); // - file - PRINT( _L( "MM MTP <= CGetPartialObject::BuildPartialDataL" ) ); - } - // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cmoveobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cmoveobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cmoveobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include "mmmtpdputility.h" #include "cmmmtpdpmetadataaccesswrapper.h" #include "mmmtpdpconfig.h" +#include "cpropertysettingutility.h" /** * Verification data for the MoveObject request @@ -39,37 +39,32 @@ const TMTPRequestElementInfo KMTPMoveObjectPolicy[] = { { - TMTPTypeRequest::ERequestParameter1, EMTPElementTypeObjectHandle, - EMTPElementAttrFileOrDir | EMTPElementAttrWrite, 0, 0, 0 + TMTPTypeRequest::ERequestParameter1, + EMTPElementTypeObjectHandle, + EMTPElementAttrFile | EMTPElementAttrWrite, + 0, + 0, + 0 }, { - TMTPTypeRequest::ERequestParameter2, EMTPElementTypeStorageId, - EMTPElementAttrWrite, 0, 0, 0 + TMTPTypeRequest::ERequestParameter2, + EMTPElementTypeStorageId, + EMTPElementAttrWrite, + 0, + 0, + 0 }, { - TMTPTypeRequest::ERequestParameter3, EMTPElementTypeObjectHandle, - EMTPElementAttrDir | EMTPElementAttrWrite, 1, 0, 0 + TMTPTypeRequest::ERequestParameter3, + EMTPElementTypeObjectHandle, + EMTPElementAttrDir | EMTPElementAttrWrite, + 1, + 0, + 0 } }; // ----------------------------------------------------------------------------- -// CMoveObject::NewL -// Two-phase construction method -// ----------------------------------------------------------------------------- -// -//EXPORT_C MMmRequestProcessor* CMoveObject::NewL( MMTPDataProviderFramework& aFramework, -// MMTPConnection& aConnection, -// CMmMtpDpMetadataAccessWrapper& aWrapper ) -// { -// CMoveObject* self = new (ELeave) CMoveObject( aFramework, aConnection, aWrapper ); -// CleanupStack::PushL( self ); -// self->ConstructL(); -// CleanupStack::Pop( self ); -// -// return self; -// } - -// ----------------------------------------------------------------------------- // CMoveObject::~CMoveObject // Destructor // ----------------------------------------------------------------------------- @@ -79,12 +74,10 @@ Cancel(); delete iDest; - delete iFileMan; - delete iPathToMove; - delete iNewRootFolder; - iObjectHandles.Close(); + if ( iPropertyElement ) delete iPropertyElement; + delete iPropertyList; } @@ -94,18 +87,32 @@ // ----------------------------------------------------------------------------- // EXPORT_C CMoveObject::CMoveObject( MMTPDataProviderFramework& aFramework, - MMTPConnection& aConnection, - MMmMtpDpConfig& aDpConfig) : - CRequestProcessor( aFramework, aConnection, sizeof( KMTPMoveObjectPolicy ) - /sizeof( TMTPRequestElementInfo ), KMTPMoveObjectPolicy), - iDpConfig( aDpConfig ), - iObjectHandles( KMmMtpRArrayGranularity ), - iMoveObjectIndex( 0 ) + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) : + CRequestProcessor( aFramework, + aConnection, + sizeof( KMTPMoveObjectPolicy ) / sizeof( TMTPRequestElementInfo ), + KMTPMoveObjectPolicy ), + iDpConfig( aDpConfig ) { PRINT( _L( "Operation: MoveObject(0x1019)" ) ); } // ----------------------------------------------------------------------------- +// CMoveObject::ConstructL +// Second phase constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMoveObject::ConstructL() + { + iPropertyList = CMTPTypeObjectPropList::NewL(); + + // Set the CenRep value of MTP status, + // also need to do in other processors which related to MPX + SetPSStatus(); + } + +// ----------------------------------------------------------------------------- // CMoveObject::ServiceL // MoveObject request handler // ----------------------------------------------------------------------------- @@ -113,156 +120,18 @@ EXPORT_C void CMoveObject::ServiceL() { PRINT( _L( "MM MTP => CMoveObject::ServiceL" ) ); - TMTPResponseCode ret = MoveObjectL(); - PRINT1( _L( "MM MTP <> CMoveObject::ServiceL ret = 0x%x" ), ret ); - if ( EMTPRespCodeOK != ret ) - { - SendResponseL( ret ); - } + + MoveObjectL(); + PRINT( _L( "MM MTP <= CMoveObject::ServiceL" ) ); } // ----------------------------------------------------------------------------- -// CMoveObject::ConstructL -// Second phase constructor -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMoveObject::ConstructL() - { - CActiveScheduler::Add( this ); - - iPropertyList = CMTPTypeObjectPropList::NewL(); - SetPSStatus(); - } - -// ----------------------------------------------------------------------------- -// CMoveObject::RunL -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMoveObject::RunL() - { - PRINT( _L( "MM MTP => CMoveObject::RunL" ) ); - if ( MoveOwnedObjectsL() ) - { - // Reset iMoveObjectIndex count since move completed - iMoveObjectIndex = 0; - - TMTPResponseCode ret = EMTPRespCodeOK; - // Delete the original folders in the device dp. - if ( iObjectInfo->Uint( CMTPObjectMetaData::EDataProviderId ) - == iFramework.DataProviderId() ) - { - ret = FinalPhaseMove(); - } - PRINT1( _L("MM MTP <> CMoveObject::RunL ret = 0x%x"), ret ); - SendResponseL( ret ); - } - PRINT( _L( "MM MTP <= CMoveObject::RunL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMoveObject::RunError -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMoveObject::RunError( TInt aError ) - { - if ( aError != KErrNone ) - PRINT1( _L( "MM MTP <> CMoveObject::RunError aError = %d" ), aError ); - TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) ); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CMoveObject::MoveFileL -// A helper function of MoveObjectL +// CMoveObject::MoveObjectL +// Move object operation // ----------------------------------------------------------------------------- // -void CMoveObject::MoveFileL( const TDesC& aNewFileName ) - { - PRINT1( _L( "MM MTP => CMoveObject::MoveFileL aNewFileName = %S" ), &aNewFileName ); - const TDesC& suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); - TFileName oldFileName( suid ); // save the old file name, the suid will be modified - PRINT1( _L( "MM MTP <> CMoveObject::MoveFileL oldFileName = %S" ), &suid ); - - if ( iStorageId == iObjectInfo->Uint( CMTPObjectMetaData::EStorageId ) ) - iSameStorage = ETrue; - else - iSameStorage = EFalse; - GetPreviousPropertiesL( *iObjectInfo ); - User::LeaveIfError( iFileMan->Move( suid, aNewFileName ) ); // iDest just Folder - User::LeaveIfError( iFramework.Fs().SetModified( aNewFileName, iPreviousModifiedTime ) ); - - iObjectInfo->SetDesCL( CMTPObjectMetaData::ESuid, aNewFileName ); - iObjectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId ); - iObjectInfo->SetUint( CMTPObjectMetaData::EParentHandle, iNewParentHandle ); - iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo ); - SetPropertiesL( oldFileName, aNewFileName, *iObjectInfo ); - PRINT( _L( "MM MTP <= CMoveObject::MoveFileL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMoveObject::MoveOwnedObjectsL -// Move the objects through iterations of RunL -// ----------------------------------------------------------------------------- -// -TBool CMoveObject::MoveOwnedObjectsL() - { - PRINT( _L( "MM MTP => CMoveObject::MoveOwnedObjectsL" ) ); - TBool ret = EFalse; - - if ( iMoveObjectIndex < iNumberOfObjects ) - { - MoveAndUpdateL( iObjectHandles[iMoveObjectIndex++] ); - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, iStatus.Int() ); - SetActive(); - } - else - { - ret = ETrue; - } - - PRINT1( _L( "MM MTP <= CMoveObject::MoveOwnedObjectsL ret = %d" ), ret ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CMoveObject::MoveFolderL -// A helper function of MoveObjectL -// ----------------------------------------------------------------------------- -// -void CMoveObject::MoveFolderL() - { - PRINT( _L( "MM MTP => CMoveObject::MoveFolderL" ) ); - RBuf oldFolderName; - oldFolderName.CreateL( KMaxFileName ); - oldFolderName.CleanupClosePushL(); // + oldFileName - oldFolderName = iObjectInfo->DesC( CMTPObjectMetaData::ESuid ); - PRINT1( _L( "MM MTP <> CMoveObject::MoveFolderL oldFolderName = %S" ), &oldFolderName ); - iPathToMove = oldFolderName.AllocL(); - CleanupStack::PopAndDestroy( &oldFolderName ); // - oldFolderName - - GenerateObjectHandleListL( iObjectInfo->Uint( CMTPObjectMetaData::EHandle ) ); - - iNumberOfObjects = iObjectHandles.Count(); - PRINT1( _L( "MM MTP <> CMoveObject::MoveFolderL iNumberOfObjects = %d" ), iNumberOfObjects ); - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, iStatus.Int() ); - SetActive(); - - PRINT( _L( "MM MTP <= CMoveObject::MoveFolderL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMoveObject::MoveObjectL -// move object operations -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CMoveObject::MoveObjectL() +void CMoveObject::MoveObjectL() { PRINT( _L( "MM MTP => CMoveObject::MoveObjectL" ) ); TMTPResponseCode responseCode = EMTPRespCodeOK; @@ -276,55 +145,21 @@ const TDesC& suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); TParsePtrC fileNameParser( suid ); - - // Check if the object is a folder or a file. - TBool isFolder = EFalse; - User::LeaveIfError( BaflUtils::IsFolder( iFramework.Fs(), suid, isFolder ) ); - - if ( !isFolder ) + if ( ( newObjectName.Length() + fileNameParser.NameAndExt().Length() ) + <= newObjectName.MaxLength() ) { - if ( ( newObjectName.Length() + fileNameParser.NameAndExt().Length() ) <= newObjectName.MaxLength() ) - { - newObjectName.Append( fileNameParser.NameAndExt() ); - } - responseCode = CanMoveObjectL( suid, newObjectName ); + newObjectName.Append( fileNameParser.NameAndExt() ); } - else // It is a folder. - { - TFileName rightMostFolderName; - User::LeaveIfError( BaflUtils::MostSignificantPartOfFullName( suid, - rightMostFolderName ) ); - if ( ( newObjectName.Length() + rightMostFolderName.Length() + 1 ) <= newObjectName.MaxLength() ) - { - newObjectName.Append( rightMostFolderName ); - // Add backslash. - _LIT( KBackSlash, "\\" ); - newObjectName.Append( KBackSlash ); - } - } - - iNewRootFolder = newObjectName.AllocL(); + responseCode = CanMoveObjectL( suid, newObjectName ); if ( responseCode == EMTPRespCodeOK ) - { - delete iFileMan; - iFileMan = NULL; - iFileMan = CFileMan::NewL( iFramework.Fs() ); + MoveFileL( newObjectName ); - if ( !isFolder ) - { - MoveFileL( newObjectName ); - SendResponseL( responseCode ); - } - else - { - MoveFolderL(); - } - } - CleanupStack::PopAndDestroy( &newObjectName ); // - newObjectName. + SendResponseL( responseCode ); + + CleanupStack::PopAndDestroy( &newObjectName ); // - newObjectName PRINT1( _L( "MM MTP <= CMoveObject::MoveObjectL responseCode = 0x%x" ), responseCode ); - return responseCode; } // ----------------------------------------------------------------------------- @@ -335,30 +170,33 @@ void CMoveObject::GetParametersL() { PRINT( _L( "MM MTP => CMoveObject::GetParametersL" ) ); + __ASSERT_DEBUG( iRequestChecker, Panic( EMmMTPDpRequestCheckNull ) ); TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); iStorageId = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); iNewParentHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter3 ); - PRINT3( _L( "MM MTP <> objectHandle = 0x%x, iStoargeId = 0x%x, iNewParentHandle = 0x%x" ), - objectHandle, iStorageId, iNewParentHandle ); + PRINT3( _L( "MM MTP <> objectHandle = 0x%x, iStorageId = 0x%x, iNewParentHandle = 0x%x" ), + objectHandle, + iStorageId, + iNewParentHandle ); // not taking owernship iObjectInfo = iRequestChecker->GetObjectInfo( objectHandle ); __ASSERT_DEBUG( iObjectInfo, Panic( EMmMTPDpObjectNull ) ); - if ( iNewParentHandle == 0 ) + if ( iNewParentHandle == KMTPHandleNone ) { SetDefaultParentObjectL(); } else { - CMTPObjectMetaData* parentObjectInfo = - iRequestChecker->GetObjectInfo( iNewParentHandle ); - __ASSERT_DEBUG( parentObjectInfo, Panic( EMmMTPDpObjectNull ) ); + CMTPObjectMetaData* parentObject = iRequestChecker->GetObjectInfo( iNewParentHandle ); + __ASSERT_DEBUG( parentObject, Panic( EMmMTPDpObjectNull ) ); + delete iDest; iDest = NULL; - iDest = parentObjectInfo->DesC( CMTPObjectMetaData::ESuid ).AllocL(); + iDest = parentObject->DesC( CMTPObjectMetaData::ESuid ).AllocL(); PRINT1( _L( "MM MTP <> CMoveObject::GetParametersL iDest = %S" ), iDest ); } PRINT( _L( "MM MTP <= CMoveObject::GetParametersL" ) ); @@ -375,11 +213,10 @@ delete iDest; iDest = NULL; - iDest = ( iFramework.StorageMgr().StorageL( iStorageId ).DesC( - CMTPStorageMetaData::EStorageSuid ) ).AllocL(); - PRINT1( _L( "MM MTP <> CMoveObject::SetDefaultParentObjectL iDest = %S" ), iDest ); + iDest = iFramework.StorageMgr().StorageL( iStorageId ).DesC( CMTPStorageMetaData::EStorageSuid ).AllocL(); iNewParentHandle = KMTPHandleNoParent; - PRINT( _L( "MM MTP <= CMoveObject::SetDefaultParentObjectL" ) ); + + PRINT1( _L( "MM MTP <= CMoveObject::SetDefaultParentObjectL, iDest = %S" ), iDest ); } // ----------------------------------------------------------------------------- @@ -388,19 +225,21 @@ // ----------------------------------------------------------------------------- // TMTPResponseCode CMoveObject::CanMoveObjectL( const TDesC& aOldName, - const TDesC& aNewName ) const + const TDesC& aNewName ) const { - PRINT( _L( "MM MTP => CMoveObject::CanMoveObjectL" ) ); + PRINT2( _L( "MM MTP => CMoveObject::CanMoveObjectL aOldName = %S, aNewName = %S" ), + &aOldName, + &aNewName ); TMTPResponseCode result = EMTPRespCodeOK; TEntry fileEntry; User::LeaveIfError( iFramework.Fs().Entry( aOldName, fileEntry ) ); - TDriveNumber drive( static_cast( iFramework.StorageMgr().DriveNumber( iStorageId ) ) ); + TInt drive = iFramework.StorageMgr().DriveNumber( iStorageId ); User::LeaveIfError( drive ); TVolumeInfo volumeInfo; User::LeaveIfError( iFramework.Fs().Volume( volumeInfo, drive ) ); - if ( volumeInfo.iFree < fileEntry.iSize ) + if ( volumeInfo.iFree < fileEntry.FileSize() ) { result = EMTPRespCodeStoreFull; } @@ -435,6 +274,36 @@ } // ----------------------------------------------------------------------------- +// CMoveObject::MoveFileL +// A helper function of MoveObjectL +// ----------------------------------------------------------------------------- +// +void CMoveObject::MoveFileL( const TDesC& aNewFileName ) + { + TFileName oldFileName = iObjectInfo->DesC( CMTPObjectMetaData::ESuid ); + PRINT2( _L( "MM MTP => CMoveObject::MoveFileL old name = %S, aNewFileName = %S" ), + &oldFileName, + &aNewFileName ); + + if ( iStorageId == iObjectInfo->Uint( CMTPObjectMetaData::EStorageId ) ) + iSameStorage = ETrue; + else + iSameStorage = EFalse; + GetPreviousPropertiesL( *iObjectInfo ); + SetPropertiesL( oldFileName, aNewFileName ); + + CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() ); + CleanupStack::PushL( fileMan ); + User::LeaveIfError( fileMan->Move( oldFileName, aNewFileName ) ); + CleanupStack::PopAndDestroy( fileMan ); + + User::LeaveIfError( iFramework.Fs().SetModified( aNewFileName, + iPreviousModifiedTime ) ); + + PRINT( _L( "MM MTP <= CMoveObject::MoveFileL" ) ); + } + +// ----------------------------------------------------------------------------- // CMoveObject::GetPreviousPropertiesL // Save the object properties before doing the move // ----------------------------------------------------------------------------- @@ -444,7 +313,6 @@ PRINT( _L( "MM MTP => CMoveObject::GetPreviousPropertiesL" ) ); const TDesC& suid( aObject.DesC( CMTPObjectMetaData::ESuid ) ); - User::LeaveIfError( iFramework.Fs().Modified( suid, iPreviousModifiedTime ) ); // same storage, not necessary to get the properties @@ -454,12 +322,11 @@ TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode ); const RArray* properties = iDpConfig.GetSupportedPropertiesL( formatCode ); TInt count = properties->Count(); - CMTPTypeString* textData = NULL; TInt err = KErrNone; TUint16 propCode; - TUint32 handle = aObject.Uint( CMTPObjectMetaData::EHandle ) ; + TUint32 handle = aObject.Uint( CMTPObjectMetaData::EHandle ); - if ( iPropertyElement ) + if ( iPropertyElement != NULL ) { delete iPropertyElement; iPropertyElement = NULL; @@ -467,8 +334,9 @@ for ( TInt i = 0; i < count; i++ ) { - propCode = (*properties)[i]; - switch( propCode ) + propCode = ( *properties )[i]; + + switch ( propCode ) { case EMTPObjectPropCodeStorageID: case EMTPObjectPropCodeObjectFormat: @@ -477,40 +345,44 @@ case EMTPObjectPropCodeObjectFileName: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: break; + case EMTPObjectPropCodeNonConsumable: + iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) ); + iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue, + aObject.Uint( CMTPObjectMetaData::ENonConsumable ) ); + break; + case EMTPObjectPropCodeName: case EMTPObjectPropCodeDateAdded: if ( ( propCode == EMTPObjectPropCodeName ) - || ( ( !MmMtpDpUtility::IsVideoL( aObject.DesC( CMTPObjectMetaData::ESuid ), iFramework ) ) + || ( !MmMtpDpUtility::IsVideoL( aObject.DesC( CMTPObjectMetaData::ESuid ), iFramework ) && ( propCode == EMTPObjectPropCodeDateAdded ) ) ) { - textData = CMTPTypeString::NewLC(); // + textData + CMTPTypeString* textData = CMTPTypeString::NewLC(); // + textData TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( propCode, *textData, aObject ) ); - PRINT1( _L( "MM MTP <> CMoveObject::GetPreviousPropertiesL::ServiceSpecificObjectPropertyL err = %d" ), err ); + PRINT1( _L( "MM MTP <> CMoveObject::GetPreviousPropertiesL err = %d" ), err ); if ( err == KErrNone ) { - iPropertyElement = &(iPropertyList->ReservePropElemL(handle, propCode)); - iPropertyElement->SetStringL(CMTPTypeObjectPropListElement::EValue, textData->StringChars()); -// iPropertyElement = CMTPTypeObjectPropListElement::NewL( -// handle, propCode, *textData ); + iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) ); + iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, + textData->StringChars() ); } else if ( err == KErrNotFound ) { iPropertyElement = NULL; } else - { - User::Leave( err ); - } + { + User::Leave( err ); + } CleanupStack::PopAndDestroy( textData ); // - textData } @@ -523,92 +395,40 @@ break; } - if ( iPropertyElement ) + if ( iPropertyElement != NULL ) { iPropertyList->CommitPropElemL( *iPropertyElement ); - iPropertyElement = NULL; } - } // end of for loop PRINT1( _L( "MM MTP <= CMoveObject::GetPreviousPropertiesL err = %d" ), err ); } // ----------------------------------------------------------------------------- -// CMoveObject::ServiceMetaDataToWrapper -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TMTPResponseCode CMoveObject::ServiceMetaDataToWrapper( - const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObject ) - { - TMTPResponseCode resCode = EMTPRespCodeOK; - - TRAPD( err, iDpConfig.GetWrapperL().SetObjectMetadataValueL( aPropCode, - aNewData, - aObject ) ); - - PRINT1( _L("MM MTP <> CMoveObject::ServiceMetaDataToWrapper err = %d"), err); - - if ( err == KErrNone ) - { - resCode = EMTPRespCodeOK; - } - else if ( err == KErrTooBig ) - // according to the codes of S60 - { - resCode = EMTPRespCodeInvalidDataset; - } - else if ( err == KErrPermissionDenied ) - { - resCode = EMTPRespCodeAccessDenied; - } - else if ( err == KErrNotFound ) - { - if ( MmMtpDpUtility::HasMetadata( aObject.Uint( CMTPObjectMetaData::EFormatCode ) ) ) - resCode = EMTPRespCodeAccessDenied; - else - resCode = EMTPRespCodeOK; - } - else - { - resCode = EMTPRespCodeGeneralError; - } - - PRINT1( _L("MM MTP <= CMoveObject::ServiceMetaDataToWrapper resCode = 0x%x"), resCode); - - return resCode; - } - -// ----------------------------------------------------------------------------- // CMoveObject::SetPreviousPropertiesL // Set the object properties after doing the move // ----------------------------------------------------------------------------- // -void CMoveObject::SetPreviousPropertiesL( const CMTPObjectMetaData& aObject ) +void CMoveObject::SetPreviousPropertiesL() { PRINT( _L( "MM MTP => CMoveObject::SetPreviousPropertiesL" ) ); - const TInt count( iPropertyList->NumberOfElements() ); - PRINT1( _L( "MM MTP <> CMoveObject::SetPreviousPropertiesL count = %d" ), count ); + TMTPResponseCode respcode = EMTPRespCodeOK; - CMTPTypeString* stringData = NULL; + iPropertyList->ResetCursor(); - + const TInt count = iPropertyList->NumberOfElements(); for ( TInt i = 0; i < count; i++ ) { - CMTPTypeObjectPropListElement& element = iPropertyList->GetNextElementL( ); + CMTPTypeObjectPropListElement& element = iPropertyList->GetNextElementL(); - TUint32 handle = element.Uint32L( - CMTPTypeObjectPropListElement::EObjectHandle ); - TUint16 propertyCode = element.Uint16L( - CMTPTypeObjectPropListElement::EPropertyCode ); - TUint16 dataType = element.Uint16L( - CMTPTypeObjectPropListElement::EDatatype ); - PRINT3( _L( "MM MTP <> CMoveObject::SetPreviousPropertiesL = 0x%x, propertyCode = 0x%x, dataType = 0x%x" ), - handle, propertyCode, dataType ); + TUint32 handle = element.Uint32L( CMTPTypeObjectPropListElement::EObjectHandle ); + TUint16 propertyCode = element.Uint16L( CMTPTypeObjectPropListElement::EPropertyCode ); + TUint16 dataType = element.Uint16L( CMTPTypeObjectPropListElement::EDatatype ); + PRINT3( _L( "MM MTP <> CCopyObject::SetPreviousPropertiesL = 0x%x, propertyCode = 0x%x, dataType = 0x%x" ), + handle, + propertyCode, + dataType ); switch ( propertyCode ) { @@ -619,20 +439,24 @@ case EMTPObjectPropCodeObjectFileName: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: case EMTPObjectPropCodeDateAdded: break; + case EMTPObjectPropCodeNonConsumable: + iObjectInfo->SetUint( CMTPObjectMetaData::ENonConsumable, + element.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); + break; + case EMTPObjectPropCodeName: { - stringData = CMTPTypeString::NewLC( - element.StringL(CMTPTypeObjectPropListElement::EValue)); // + stringData + CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData - respcode = ServiceMetaDataToWrapper( propertyCode, + respcode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapperL( iDpConfig, + propertyCode, *stringData, - aObject ); + *iObjectInfo ); CleanupStack::PopAndDestroy( stringData ); // - stringData } @@ -640,18 +464,16 @@ default: { - respcode = ServiceSetSpecificObjectPropertyL( propertyCode, - aObject, - element ); + respcode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig, + propertyCode, + *iObjectInfo, + element ); } break; } } // end of for loop - if( respcode == EMTPRespCodeOK ) - { - // do nothing, ignore warning - } + // ignore errors PRINT1( _L( "MM MTP <= CMoveObject::SetPreviousPropertiesL respcode = 0x%x" ), respcode ); } @@ -661,189 +483,46 @@ // Set the object properties in the object property store. // ----------------------------------------------------------------------------- // -void CMoveObject::SetPropertiesL( const TDesC& aOldFileName, const TDesC& aNewFileName, - const CMTPObjectMetaData& aNewObject ) +void CMoveObject::SetPropertiesL( const TDesC& aOldFileName, + const TDesC& aNewFileName ) { PRINT2( _L( "MM MTP => CMoveObject::SetPropertiesL aOldFileName = %S, aNewFileName = %S" ), - &aOldFileName, &aNewFileName ); + &aOldFileName, + &aNewFileName ); + + iObjectInfo->SetDesCL( CMTPObjectMetaData::ESuid, aNewFileName ); + iObjectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId ); + iObjectInfo->SetUint( CMTPObjectMetaData::EParentHandle, iNewParentHandle ); - TUint32 formatCode = aNewObject.Uint( CMTPObjectMetaData::EFormatCode ); - // This is used to keep the same behavior in mass storage and device file manager. + TUint32 formatCode = iObjectInfo->Uint( CMTPObjectMetaData::EFormatCode ); if ( formatCode == EMTPFormatCodeAbstractAudioVideoPlaylist ) { + // This is used to keep the same behavior in mass storage and device file manager. PRINT( _L( "MM MTP <> CMoveObject::SetPropertiesL Playlist file do not update the MPX DB" ) ); } else { - // if the two object in different stoarge, we should delete the old one and insert new one if ( iSameStorage ) iDpConfig.GetWrapperL().RenameObjectL( aOldFileName, aNewFileName ); + // if the two object in different storage, we should delete the old one and insert new one else { iDpConfig.GetWrapperL().DeleteObjectL( aOldFileName, formatCode ); - iDpConfig.GetWrapperL().AddObjectL( aNewFileName ); - SetPreviousPropertiesL( aNewObject ); + + TUint32 subFormatCode = iObjectInfo->Uint( CMTPObjectMetaData::EFormatSubCode ); + iDpConfig.GetWrapperL().AddObjectL( aNewFileName, + formatCode, + subFormatCode ); + + SetPreviousPropertiesL(); } } - // Reference DB is used PUID -// if ( formatCode == EMTPFormatCodeAbstractAudioVideoPlaylist -// || formatCode == EMTPFormatCodeM3UPlaylist ) -// { -// MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr(); -// CDesCArray* references = referenceMgr.ReferencesLC( aOldFileName ); // + references -// referenceMgr.SetReferencesL( aNewFileName, *references ); -// CleanupStack::PopAndDestroy( references ); // - references -// // delete the old references -// referenceMgr.RemoveReferencesL( aOldFileName ); -// } + iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo ); + // It's not necessary to change references of playlists since Reference DB is used PUID PRINT( _L( "MM MTP <= CMoveObject::SetPropertiesL" ) ); } -// ----------------------------------------------------------------------------- -// CMoveObject::FinalPhaseMove -// This function will actually delete the orginal folders from the file system -// ----------------------------------------------------------------------------- -// -TMTPResponseCode CMoveObject::FinalPhaseMove() - { - PRINT( _L( "MM MTP => CMoveObject::FinalPhaseMove" ) ); - TMTPResponseCode ret = EMTPRespCodeOK; - - TInt rel = iFileMan->RmDir( *iPathToMove ); - PRINT1( _L( "MM MTP <> CMoveObject::FinalPhaseMove rel = %d" ), rel ); - - if ( rel != KErrNone ) - { - ret = EMTPRespCodeGeneralError; - } - - PRINT1( _L( "MM MTP <= CMoveObject::FinalPhaseMove ret = 0x%x" ), ret ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CMoveObject::GenerateObjectHandleListL -// Generate the list of handles that need to be moved to the new location -// ----------------------------------------------------------------------------- -// -void CMoveObject::GenerateObjectHandleListL( TUint32 aParentHandle ) - { - PRINT1( _L( "MM MTP => CMoveObject::GenerateObjectHandleListL aParentHandle = 0x%x" ), aParentHandle ); - RMTPObjectMgrQueryContext context; - RArray handles; - TMTPObjectMgrQueryParams params( KMTPStorageAll, KMTPFormatsAll, - aParentHandle ); - CleanupClosePushL( context ); // + context - CleanupClosePushL( handles ); // - handles - - do - { - iFramework.ObjectMgr().GetObjectHandlesL( params, context, handles ); - - TInt numberOfObjects = handles.Count(); - for ( TInt i = 0; i < numberOfObjects; i++ ) - { - if ( iFramework.ObjectMgr().ObjectOwnerId( handles[i] ) == iFramework.DataProviderId() ) - { - iObjectHandles.AppendL( handles[i] ); - continue; - } - - // Folder - if ( iFramework.ObjectMgr().ObjectOwnerId( handles[i] ) == 0 ) // We know that the device dp id is always 0, otherwise the whole MTP won't work. - { - GenerateObjectHandleListL( handles[i] ); - } - } - } - while ( !context.QueryComplete() ); - - CleanupStack::PopAndDestroy( &handles ); // - handles - CleanupStack::PopAndDestroy( &context ); // - contect - - PRINT( _L( "MM MTP <= CMoveObject::GenerateObjectHandleListL" ) ); - } - -// ----------------------------------------------------------------------------- -// CMoveObject::MoveAndUpdateL -// Move a single object and update the database -// ----------------------------------------------------------------------------- -// -void CMoveObject::MoveAndUpdateL( TUint32 aObjectHandle ) - { - PRINT1( _L( "MM MTP => CMoveObject::MoveAndUpdateL aObjectHanlde = 0x%x" ), aObjectHandle ); - - CMTPObjectMetaData* objectInfo( CMTPObjectMetaData::NewLC() ); // + objectInfo - - RBuf fileName; - fileName.CreateL( KMaxFileName ); - fileName.CleanupClosePushL(); // + fileName - - RBuf rightPartName; - rightPartName.CreateL( KMaxFileName ); - rightPartName.CleanupClosePushL(); // + rightPartName - - RBuf oldName; - oldName.CreateL( KMaxFileName ); - oldName.CleanupClosePushL(); // + oldName - - if ( iFramework.ObjectMgr().ObjectL( TMTPTypeUint32( aObjectHandle ), *objectInfo ) ) - { - fileName = objectInfo->DesC( CMTPObjectMetaData::ESuid ); - oldName = fileName; - - if ( objectInfo->Uint( CMTPObjectMetaData::EDataProviderId ) - == iFramework.DataProviderId() ) - { - rightPartName = fileName.Right( fileName.Length() - iPathToMove->Length() ); - - if ( ( iNewRootFolder->Length() + rightPartName.Length() ) > fileName.MaxLength() ) - { - User::Leave( KErrCorrupt ); - } - - fileName.Zero(); - fileName.Append( *iNewRootFolder ); - fileName.Append( rightPartName ); - PRINT1( _L( "MM MTP <> MoveAndUpdateL fileName = %S" ), &fileName ); - - if ( iStorageId == objectInfo->Uint( CMTPObjectMetaData::EStorageId ) ) - iSameStorage = ETrue; - else - iSameStorage = EFalse; - GetPreviousPropertiesL( *objectInfo ); - TInt err = iFileMan->Move( oldName, fileName ); - PRINT1( _L( "MM MTP <> CMoveObject::MoveAndUpdateL Move error code = %d" ), err ); - User::LeaveIfError( err ); - User::LeaveIfError( iFramework.Fs().SetModified( fileName, iPreviousModifiedTime ) ); - - objectInfo->SetDesCL( CMTPObjectMetaData::ESuid, fileName ); - objectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId ); - TParsePtrC parentSuid( fileName ); - TUint32 parentHandle = iFramework.ObjectMgr().HandleL( parentSuid.DriveAndPath() ); - objectInfo->SetUint( CMTPObjectMetaData::EParentHandle, parentHandle ); - - //TUint32 parentHandle = iFramework.ObjectMgr().HandleL( parentSuid.DriveAndPath() ); - PRINT1( _L( "MM MTP <> CMoveObject::MoveAndUpdateL parentHandle = 0x%x" ), parentHandle ); - - iFramework.ObjectMgr().ModifyObjectL( *objectInfo ); - - SetPropertiesL( oldName, fileName, *objectInfo ); - } - } - else - { - User::Leave( KErrCorrupt ); - } - - CleanupStack::PopAndDestroy( &oldName ); // - oldName - CleanupStack::PopAndDestroy( &rightPartName ); // - rightPartName - CleanupStack::PopAndDestroy( &fileName ); // - fileName - CleanupStack::PopAndDestroy( objectInfo ); // - objectInfo - PRINT( _L( "MM MTP <= CMoveObject::MoveAndUpdateL" ) ); - } - // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cpropertysettingutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cpropertysettingutility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "cpropertysettingutility.h" +#include "cmmmtpdpmetadataaccesswrapper.h" +#include "mmmtpdpconfig.h" +#include "mmmtpdputility.h" +#include "mmmtpdplogger.h" + +EXPORT_C CPropertySettingUtility::CPropertySettingUtility() + { + // Do nothing + } + +EXPORT_C CPropertySettingUtility::~CPropertySettingUtility() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CPropertySettingUtility::SetMetaDataToWrapperL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TMTPResponseCode CPropertySettingUtility::SetMetaDataToWrapperL( MMmMtpDpConfig& aDpConfig, + const TUint16 aPropCode, + MMTPType& aNewData, + const CMTPObjectMetaData& aObjectMetaData ) + { + TMTPResponseCode responseCode = EMTPRespCodeOK; + TRAPD( err, aDpConfig.GetWrapperL().SetObjectMetadataValueL( aPropCode, + aNewData, + aObjectMetaData ) ); + + PRINT1( _L("MM MTP <> CPropertySettingUtility::SetMetaDataToWrapperL err = %d"), err); + + if ( err == KErrNone ) + responseCode = EMTPRespCodeOK; + else // Other errors are not SetMetaDataToWrapperL related, should be respond before this calling + responseCode = EMTPRespCodeGeneralError; + + PRINT1( _L( "MM MTP <= CPropertySettingUtility::SetMetaDataToWrapperL resCode = 0x%x" ), responseCode ); + + return responseCode; + } + +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -34,7 +34,7 @@ // ----------------------------------------------------------------------------- // EXPORT_C CRenameObject* CRenameObject::NewL( MMTPDataProviderFramework& aFramework, - CMmMtpDpMetadataAccessWrapper& aWrapper ) + CMmMtpDpMetadataAccessWrapper& aWrapper ) { PRINT( _L( "MM MTP => CRenameObject::NewL" ) ); @@ -59,6 +59,7 @@ iObjectHandles( KMmMtpRArrayGranularity ), iWrapper ( aWrapper ) { + // Do nothing } // ----------------------------------------------------------------------------- @@ -121,7 +122,7 @@ // EXPORT_C void CRenameObject::DoCancel() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -220,8 +221,7 @@ CleanupClosePushL( context ); // + context CleanupClosePushL( handles ); // + handles - TMTPObjectMgrQueryParams params( KMTPStorageAll, KMTPFormatsAll, - aParentHandle ); + TMTPObjectMgrQueryParams params( KMTPStorageAll, KMTPFormatsAll, aParentHandle ); do { iFramework.ObjectMgr().GetObjectHandlesL( params, context, handles ); @@ -232,14 +232,8 @@ if ( iFramework.ObjectMgr().ObjectOwnerId( handles[i] ) == iFramework.DataProviderId() ) { iObjectHandles.AppendL( handles[i] ); - continue; - } + // NOTE: Fw changed the mechanism of notification, no need to iterate - // Folder - // TODO: need to modify, should not know device dp id - if ( iFramework.ObjectMgr().ObjectOwnerId( handles[i] ) == 0 ) // We know that the device dp id is always 0, otherwise the whole MTP won't work. - { - GenerateObjectHandleListL( handles[i] ); } } } @@ -260,7 +254,8 @@ const TDesC& aFolderName ) { PRINT2( _L( "MM MTP => CRenameObject::GetParentSuidL aHandle(0x%x), aFolderName(%S)" ), - aHandle, &aFolderName ); + aHandle, + &aFolderName ); CMTPObjectMetaData* objectInfo( CMTPObjectMetaData::NewLC() ); // + objectInfo // get the old folder suid if ( iFramework .ObjectMgr().ObjectL( aHandle, *objectInfo ) ) @@ -268,15 +263,10 @@ iNewFolderName.Zero(); iNewFolderName = objectInfo->DesC( CMTPObjectMetaData::ESuid ); PRINT1( _L( "MM MTP <> CRenameObject::GetParentSuidL new folder full file name(%S)" ), &iNewFolderName ); - const TInt length = iNewFolderName.Length(); - - TParsePtrC parentSuid( iNewFolderName.Left( length - 1 ) ); iOldFolderFullName.Zero(); - iOldFolderFullName.Append( parentSuid.DriveAndPath() ); iOldFolderFullName.Append( aFolderName ); // just name not suid - _LIT( KBackSlash, "\\" ); - iOldFolderFullName.Append( KBackSlash ); + PRINT1( _L( "MM MTP <> CRenameObject::GetParentSuidL = %S" ), &iOldFolderFullName ); } else diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestchecker.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestchecker.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestchecker.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -54,7 +54,7 @@ iHandles( KMTPRequestCheckerHandleGranularity ), iObjectArray( KMTPRequestCheckerHandleGranularity ) { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -64,7 +64,7 @@ // void CRequestChecker::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -84,8 +84,8 @@ // ----------------------------------------------------------------------------- // TMTPResponseCode CRequestChecker::VerifyRequestL( const TMTPTypeRequest& aRequest, - TInt aCount, - const TMTPRequestElementInfo* aElementInfo ) + TInt aCount, + const TMTPRequestElementInfo* aElementInfo ) { TMTPResponseCode result = EMTPRespCodeOK; iHandles.Close(); @@ -96,9 +96,11 @@ for ( TInt i = 0; i < aCount && EMTPRespCodeOK == result; i++ ) { TUint32 parameter = aRequest.Uint32( aElementInfo[i].iElementIndex ); - PRINT3( _L( "MM MTP <> CRequestChecker parameter %d/%d = %d" ), - i + 1, aCount, parameter ); - + PRINT3( _L( "MM MTP <> CRequestChecker parameter %d/%d = %d" ), + i + 1, + aCount, + parameter ); + if ( !IsSpecialValue( parameter, aElementInfo[i] ) ) { switch ( aElementInfo[i].iElementType ) @@ -198,7 +200,7 @@ ret = EMTPRespCodeSessionNotOpen; } } - + return ret; } @@ -224,7 +226,7 @@ { ret = EMTPRespCodeInvalidParameter; } - + return ret; } @@ -252,7 +254,7 @@ const TDesC& suid( object->DesC( CMTPObjectMetaData::ESuid ) ); TEntry entry; TInt err = iFramework.Fs().Entry( suid, entry ); - + if ( object->Uint( CMTPObjectMetaData::EFormatCode ) == EMTPFormatCodeAssociation ) // && ( object->Uint( CMTPObjectMetaData::EFormatSubCode ) == EMTPAssociationTypeGenericFolder ) ) { @@ -262,7 +264,7 @@ else { User::LeaveIfError( err ); - + if ( iFramework.ObjectMgr().ObjectOwnerId( aHandle ) != iFramework.DataProviderId() ) { PRINT( _L(" ewrwe ret = EMTPRespCodeInvalidObjectHandle;")); @@ -306,7 +308,7 @@ ret = EMTPRespCodeInvalidObjectHandle; } PRINT1( _L( "MM MTP <= CRequestChecker::VerifyObjectHandleL ret = 0x%x" ), ret ); - + return ret; } @@ -357,7 +359,7 @@ } } } - + return ret; } @@ -395,7 +397,7 @@ } PRINT1( _L( "MM MTP => CRequestChecker::VerifyFormatCode ret = 0x%x" ), ret ); - + return ret; } @@ -413,16 +415,16 @@ case 1: result = ( aParameter == aElementInfo.iValue1 ); break; - + case 2: result = ( aParameter == aElementInfo.iValue1 || aParameter == aElementInfo.iValue2 ); break; - + default: break; } - + return result; } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestprocessor.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestprocessor.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestprocessor.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "crequestprocessor.h" #include "crequestchecker.h" @@ -39,13 +39,15 @@ EXPORT_C CRequestProcessor::CRequestProcessor( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, TInt aElementCount, - const TMTPRequestElementInfo* aElements ): - CActive( EPriorityStandard ), - iFramework( aFramework ), - iConnection( aConnection ), - iElementCount( aElementCount ), - iElements( aElements ) + const TMTPRequestElementInfo* aElements ) : + CActive( EPriorityStandard ), + iFramework( aFramework ), + iConnection( aConnection ), + iElementCount( aElementCount ), + iElements( aElements ) { + // Note: It has been moved to specific operation handler + // Some operations don't need add into active scheduler // CActiveScheduler::Add( this ); } @@ -56,7 +58,9 @@ // EXPORT_C CRequestProcessor::~CRequestProcessor() { -// Cancel(); + // Note: It has been moved to specific operation handler + // Some operations don't need add into active scheduler + // Cancel(); iNullBuffer.Close(); delete iRequestChecker; } @@ -390,7 +394,7 @@ // EXPORT_C void CRequestProcessor::RunL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -400,7 +404,7 @@ // EXPORT_C void CRequestProcessor::DoCancel() { - + // Do nothing } // ----------------------------------------------------------------------------- diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestunknown.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestunknown.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestunknown.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -42,7 +42,7 @@ // void CRequestUnknown::ConstructL() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -52,7 +52,7 @@ // EXPORT_C CRequestUnknown::~CRequestUnknown() { - + // Do nothing } // ----------------------------------------------------------------------------- @@ -62,7 +62,7 @@ // EXPORT_C CRequestUnknown::CRequestUnknown( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection ) : - CRequestProcessor( aFramework, aConnection, 0, NULL ) + CRequestProcessor( aFramework, aConnection, 0, NULL ) { PRINT( _L( "Operation: Unknown" ) ); } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include "mmmtpdputility.h" #include "tmmmtpdppanic.h" #include "mmmtpdplogger.h" +#include "cpropertysettingutility.h" #include "cmmmtpdpmetadataaccesswrapper.h" // Verification data for the SendObjectInfo request @@ -57,6 +57,24 @@ }; // ----------------------------------------------------------------------------- +// CSendObject::NewL +// Two-phase construction method +// ----------------------------------------------------------------------------- +// +EXPORT_C MMmRequestProcessor* CSendObject::NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) + { + CSendObject* self = new ( ELeave ) CSendObject( aFramework, aConnection, aDpConfig ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- // CSendObject::~CSendObject // Destructor // ----------------------------------------------------------------------------- @@ -88,7 +106,7 @@ // Standard C++ Constructor // ----------------------------------------------------------------------------- // -EXPORT_C CSendObject::CSendObject( MMTPDataProviderFramework& aFramework, +CSendObject::CSendObject( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : CRequestProcessor( aFramework, aConnection, 0, NULL), @@ -104,7 +122,7 @@ // 2nd Phase Constructor // ----------------------------------------------------------------------------- // -EXPORT_C void CSendObject::ConstructL() +void CSendObject::ConstructL() { PRINT( _L( "MM MTP => CSendObject::ConstructL" ) ); @@ -568,12 +586,12 @@ TEntry fileEntry; User::LeaveIfError( iFs.Entry( iFullPath, fileEntry ) ); - if ( fileEntry.iSize != iObjectSize ) + if ( fileEntry.FileSize() != iObjectSize ) { iFs.Delete( iFullPath ); iObjectMgr.UnreserveObjectHandleL( *iReceivedObjectInfo ); TMTPResponseCode responseCode = EMTPRespCodeObjectTooLarge; - if ( fileEntry.iSize < iObjectSize ) + if ( fileEntry.FileSize() < iObjectSize ) { responseCode = EMTPRespCodeIncompleteTransfer; } @@ -684,7 +702,7 @@ } } - PRINT1( _L( "MM MTP <= CSendObject::VerifyObjectPropListL, responseCode = 0x%X" ), responseCode ); + PRINT1( _L( "MM MTP <= CSendObject::VerifyObjectPropListL, responseCode = 0x%x" ), responseCode ); return responseCode; } @@ -703,7 +721,7 @@ const RArray* properties = iDpConfig.GetSupportedPropertiesL( iObjectFormat ); TUint16 propCode = aElement.Uint16L( CMTPTypeObjectPropListElement::EPropertyCode ); TUint16 dataType = aElement.Uint16L( CMTPTypeObjectPropListElement::EDatatype ); - PRINT2( _L( "MM MTP => CSendObject::CheckPropCodeL propCode = 0x%X, dataType = 0x%X" ), propCode, dataType ); + PRINT2( _L( "MM MTP => CSendObject::CheckPropCodeL propCode = 0x%x, dataType = 0x%x" ), propCode, dataType ); responseCode = EMTPRespCodeInvalidObjectPropCode; const TInt count = properties->Count(); @@ -785,7 +803,6 @@ break; case EMTPObjectPropCodeDateCreated: - // TODO: this property is read-only, should response EMTPRespCodeAccessDenied or set nothing? case EMTPObjectPropCodeDateModified: case EMTPObjectPropCodeObjectFileName: case EMTPObjectPropCodeName: @@ -805,11 +822,15 @@ default: // check types of DP specific properties // TODO: Is there anything except datatype need to be checked? - responseCode = CheckSepecificPropType( propCode, dataType ); + responseCode = MmMtpDpUtility::CheckPropType( propCode, dataType ); + if ( responseCode == EMTPRespCodeAccessDenied ) + { + responseCode = EMTPRespCodeOK; + } break; } - PRINT1( _L( "MM MTP <= CSendObject::CheckPropCode, responseCode = 0x%X" ), responseCode ); + PRINT1( _L( "MM MTP <= CSendObject::CheckPropCode, responseCode = 0x%x" ), responseCode ); return responseCode; } @@ -858,7 +879,7 @@ break; } - PRINT1( _L( "MM MTP <= CSendObject::ExtractPropertyL, responseCode = 0x%X" ), responseCode ); + PRINT1( _L( "MM MTP <= CSendObject::ExtractPropertyL, responseCode = 0x%x" ), responseCode ); return responseCode; } @@ -888,7 +909,6 @@ { case EMTPObjectPropCodeStorageID: case EMTPObjectPropCodeObjectFormat: - case EMTPObjectPropCodeProtectionStatus: case EMTPObjectPropCodeObjectSize: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: @@ -896,6 +916,10 @@ break; case EMTPObjectPropCodeNonConsumable: + iReceivedObjectInfo->SetUint( CMTPObjectMetaData::ENonConsumable, + element.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); + break; + case EMTPObjectPropCodeDateAdded: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: @@ -908,11 +932,16 @@ */ break; + case EMTPObjectPropCodeProtectionStatus: + SetProtectionStatusL(); + break; + case EMTPObjectPropCodeName: { CMTPTypeString* stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData - responseCode = SetMetaDataToWrapperL( propertyCode, + responseCode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapperL( iDpConfig, + propertyCode, *stringData, *iReceivedObjectInfo ); @@ -922,7 +951,8 @@ default: { - responseCode = SetSpecificObjectPropertyL( propertyCode, + responseCode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig, + propertyCode, *iReceivedObjectInfo, element ); } @@ -935,53 +965,6 @@ } // ----------------------------------------------------------------------------- -// CSendObject::SetMetaDataToWrapperL -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TMTPResponseCode CSendObject::SetMetaDataToWrapperL( const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObjectMetaData ) - { - TMTPResponseCode resCode = EMTPRespCodeOK; - TRAPD( err, iDpConfig.GetWrapperL().SetObjectMetadataValueL( aPropCode, - aNewData, - aObjectMetaData ) ); - - PRINT1( _L("MM MTP <> CSendObject::SetMetaDataToWrapperL err = %d"), err); - - if ( err == KErrNone ) - { - resCode = EMTPRespCodeOK; - } - else if ( err == KErrTooBig ) - // according to the codes of S60 - { - resCode = EMTPRespCodeInvalidDataset; - } - else if ( err == KErrPermissionDenied ) - { - resCode = EMTPRespCodeAccessDenied; - } - else if ( err == KErrNotFound ) - { - if ( MmMtpDpUtility::HasMetadata( aObjectMetaData.Uint( CMTPObjectMetaData::EFormatCode ) ) ) - SendResponseL( EMTPRespCodeAccessDenied ); - } - else - { - err = HandleSpecificWrapperError( err, aObjectMetaData ); - - if ( err != KErrNone ) - resCode = EMTPRespCodeGeneralError; - } - - PRINT1( _L( "MM MTP <= CSendObject::SetMetaDataToWrapperL resCode = 0x%x" ), resCode ); - - return resCode; - } - -// ----------------------------------------------------------------------------- // CSendObject::MatchStoreAndParentL // ----------------------------------------------------------------------------- // @@ -991,14 +974,14 @@ iStorageId = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); iParentHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); - PRINT2( _L( "MM MTP <> CSendObject::MatchStoreAndParentL, iStorageId = 0x%X, iParentHandle = 0x%X" ), + PRINT2( _L( "MM MTP <> CSendObject::MatchStoreAndParentL, iStorageId = 0x%x, iParentHandle = 0x%x" ), iStorageId, iParentHandle ); if ( iStorageId == KMTPStorageDefault ) { iStorageId = iDpConfig.GetDefaultStorageIdL(); - PRINT1( _L( "MM MTP <> CSendObject::GetDefaultStorageIdL, iStorageId = 0x%X" ), iStorageId ); + PRINT1( _L( "MM MTP <> CSendObject::GetDefaultStorageIdL, iStorageId = 0x%x" ), iStorageId ); } delete iParentSuid; @@ -1046,10 +1029,11 @@ // @return ETrue if yes, otherwise EFalse // ----------------------------------------------------------------------------- // -TBool CSendObject::IsTooLarge( TUint32 aObjectSize ) const +TBool CSendObject::IsTooLarge( TUint64 aObjectSize ) const { - TBool ret = ( aObjectSize > KMaxTInt ); - PRINT2( _L( "MM MTP <> CSendObject::IsTooLarge aObjectSize = %d, ret = %d" ), aObjectSize, ret ); + const TUint64 KMaxSupportedFileSize = 0xFFFFFFFF; //Maximal file size supported (4GB-1) + TBool ret = ( aObjectSize > KMaxSupportedFileSize ); + PRINT2( _L( "MM MTP <> CSendObject::IsTooLarge aObjectSize = 0x%Lx, ret = %d" ), aObjectSize, ret ); return ret; } @@ -1180,6 +1164,7 @@ if ( iObjectSize == 0 ) { SaveEmptyFileL(); + SetObjectPropListL( *iObjectPropList ); iObjectMgr.CommitReservedObjectHandleL( *iReceivedObjectInfo ); } @@ -1211,11 +1196,11 @@ TInt err = KErrNone; if ( iProtectionStatus == EMTPProtectionNoProtection ) { - iFs.SetAtt( iFullPath, KEntryAttNormal, KEntryAttReadOnly ); + err = iFs.SetAtt( iFullPath, KEntryAttNormal, KEntryAttReadOnly ); } else { - iFs.SetAtt( iFullPath, KEntryAttReadOnly, KEntryAttNormal ); + err = iFs.SetAtt( iFullPath, KEntryAttReadOnly, KEntryAttNormal ); } User::LeaveIfError( err ); } @@ -1240,7 +1225,7 @@ // add playlist to MPX DB TParsePtrC parse( iFullPath ); iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() ); - iDpConfig.GetWrapperL().AddObjectL( iFullPath ); + iDpConfig.GetWrapperL().AddObjectL( iFullPath, iObjectFormat, EMTPSubFormatCodeUnknown ); if ( EMTPFormatCodeAbstractAudioVideoPlaylist == iObjectFormat ) { @@ -1266,13 +1251,13 @@ PRINT( _L( "MM MTP => CSendObject::AddMediaToStoreL" ) ); TBool isVideo = EFalse; + TMmMtpSubFormatCode subFormatCode; switch ( iObjectFormat ) { case EMTPFormatCode3GPContainer: case EMTPFormatCodeMP4Container: case EMTPFormatCodeASF: { - TMmMtpSubFormatCode subFormatCode; if ( MmMtpDpUtility::IsVideoL( iFullPath ) ) { @@ -1306,7 +1291,7 @@ PRINT1( _L( "MM MTP <> CSendObject::AddMediaToStoreL suid = %S" ), &suid ); TParsePtrC parse( suid ); iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() ); - iDpConfig.GetWrapperL().AddObjectL( iFullPath, isVideo ); + iDpConfig.GetWrapperL().AddObjectL( iFullPath, iObjectFormat, subFormatCode ); if ( isVideo ) { @@ -1342,8 +1327,12 @@ if ( iProgress == ESendObjectInProgress ) { PRINT1( _L( "MM MTP <> CSendObject::Rollback ROLLBACK_FILE %S" ), &iFullPath ); + // Close the interrupted transfer file by delete iFileReceived object + delete iFileReceived; + iFileReceived = NULL; + iFramework.Fs().Delete( iFullPath ); - TRAP_IGNORE( iFramework.ObjectMgr().UnreserveObjectHandleL( *iReceivedObjectInfo ) ); + TRAP_IGNORE( iFramework.ObjectMgr().UnreserveObjectHandleL( *iReceivedObjectInfo ) ); iProgress = EObjectNone; } } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectproplist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectproplist.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -27,38 +27,39 @@ #include "mmmtpdputility.h" #include "mmmtpdplogger.h" #include "mmmtpdpconfig.h" +#include "cpropertysettingutility.h" // ----------------------------------------------------------------------------- -// CSetObjectPropList::NewL +// CSendObject::NewL // Two-phase construction method // ----------------------------------------------------------------------------- // -//EXPORT_C MMmRequestProcessor* CSetObjectPropList::NewL( MMTPDataProviderFramework& aFramework, -// MMTPConnection& aConnection, -// CMmMtpDpMetadataAccessWrapper& aWrapper ) -// { -// CSetObjectPropList* self = new ( ELeave ) CSetObjectPropList( aFramework, -// aConnection, -// aWrapper ); -// CleanupStack::PushL( self ); -// self->ConstructL(); -// CleanupStack::Pop( self ); -// return self; -// } +EXPORT_C MMmRequestProcessor* CSetObjectPropList::NewL( MMTPDataProviderFramework& aFramework, + MMTPConnection& aConnection, + MMmMtpDpConfig& aDpConfig ) + { + CSetObjectPropList* self = new ( ELeave ) CSetObjectPropList( aFramework, aConnection, aDpConfig ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } // ----------------------------------------------------------------------------- // CSetObjectPropList::CSetObjectPropList // Standard c++ constructor // ----------------------------------------------------------------------------- // -EXPORT_C CSetObjectPropList::CSetObjectPropList( MMTPDataProviderFramework& aFramework, +CSetObjectPropList::CSetObjectPropList( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, MMmMtpDpConfig& aDpConfig ) : - CRequestProcessor( aFramework, aConnection, 0, NULL), - iObjectMgr( aFramework.ObjectMgr() ), - iFs( aFramework.Fs() ), - iDpConfig( aDpConfig ), - iUnprocessedIndex ( 0 ) + CRequestProcessor( aFramework, aConnection, 0, NULL), + iObjectMgr( aFramework.ObjectMgr() ), + iFs( aFramework.Fs() ), + iDpConfig( aDpConfig ), + iUnprocessedIndex ( 0 ) { PRINT( _L( "Operation: SetObjectPropList(0x9806)" ) ); } @@ -68,7 +69,7 @@ // 2nd Phase Constructor // ----------------------------------------------------------------------------- // -EXPORT_C void CSetObjectPropList::ConstructL() +void CSetObjectPropList::ConstructL() { CActiveScheduler::Add( this ); @@ -88,6 +89,26 @@ } // ----------------------------------------------------------------------------- +// CSetObjectPropList::CheckRequestL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TMTPResponseCode CSetObjectPropList::CheckRequestL() + { + PRINT( _L( "MM MTP => CSetObjectPropList::CheckRequestL" ) ); + + TMTPResponseCode result = CRequestProcessor::CheckRequestL(); + if ( result == EMTPRespCodeObjectWriteProtected ) + { + // Return AccessDenied for P4S pass rate, instead of EMTPRespCodeObjectWriteProtected + result = EMTPRespCodeAccessDenied; + } + + PRINT( _L( "MM MTP <= CSetObjectPropList::CheckRequestL" ) ); + return result; + } + +// ----------------------------------------------------------------------------- // CSetObjectPropList::ServiceL // SetObjectPropList request handler // ----------------------------------------------------------------------------- @@ -132,22 +153,23 @@ // Set object proplist // ----------------------------------------------------------------------------- // -TMTPResponseCode CSetObjectPropList::SetObjectPropListL( - const CMTPTypeObjectPropListElement& aPropListElement ) +TMTPResponseCode CSetObjectPropList::SetObjectPropListL( const CMTPTypeObjectPropListElement& aPropListElement ) { PRINT( _L( "MM MTP => CSetObjectPropList::SetObjectPropListL" ) ); - TMTPTypeUint16 protectionStatus( EMTPProtectionNoProtection ); TMTPResponseCode responseCode( EMTPRespCodeOK ); TUint32 handle = aPropListElement.Uint32L( CMTPTypeObjectPropListElement::EObjectHandle ); TUint16 propertyCode = aPropListElement.Uint16L( CMTPTypeObjectPropListElement::EPropertyCode ); TUint16 dataType = aPropListElement.Uint16L( CMTPTypeObjectPropListElement::EDatatype ); PRINT3( _L( "MM MTP <> handle = 0x%x, propertyCode = 0x%x, dataType = 0x%x" ), - handle, propertyCode, dataType ); + handle, + propertyCode, + dataType ); responseCode = MmMtpDpUtility::CheckPropType( propertyCode, dataType ); PRINT1( _L( "MM MTP <> CheckPropType response code is 0x%x" ), responseCode ); + if( responseCode != EMTPRespCodeOK ) return responseCode; @@ -155,12 +177,16 @@ == iFramework.DataProviderId() ) { PRINT( _L( "MM MTP => CSetObjectPropList::SetObjectPropListL enter" ) ); + CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); // + object iFramework.ObjectMgr().ObjectL( handle, *object ); - if ( protectionStatus.Value() != EMTPProtectionNoProtection ) + // Check the file attribution first. If it is Read-Only, nothing should be set into db which is inlined with P4S cases. + TUint16 protectionStatus = EMTPProtectionNoProtection; + protectionStatus = MmMtpDpUtility::GetProtectionStatusL( iFs, object->DesC( CMTPObjectMetaData::ESuid ) ); + if ( protectionStatus != EMTPProtectionNoProtection ) { - //for some reason, P4S expects Access Denied response instead of write protected + // NOTE: P4S expects AccessDenied response instead of ObjectWriteProtected return EMTPRespCodeAccessDenied; // EMTPRespCodeObjectWriteProtected; } @@ -172,7 +198,6 @@ case EMTPObjectPropCodeObjectSize: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeDateAdded: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: @@ -181,13 +206,22 @@ } break; + case EMTPObjectPropCodeNonConsumable: + object->SetUint( CMTPObjectMetaData::ENonConsumable, + aPropListElement.Uint8L( CMTPTypeObjectPropListElement::EValue ) ); + // TODO: need to reconsider, + // if propList comprise both non-consumable and objectFileName, + // ModifyObjectL would be called twice, need to investigate if it won't affect + // performance + iFramework.ObjectMgr().ModifyObjectL( *object ); + break; + case EMTPObjectPropCodeObjectFileName: { TPtrC suid( object->DesC( CMTPObjectMetaData::ESuid ) ); TBuf newSuid( aPropListElement.StringL( CMTPTypeObjectPropListElement::EValue ) ); - TInt err = KErrNone; - err = MmMtpDpUtility::UpdateObjectFileName( iFramework.Fs(), suid, newSuid ); + TInt err = MmMtpDpUtility::UpdateObjectFileName( iFramework.Fs(), suid, newSuid ); PRINT1( _L( "MM MTP <> Update object file name err = %d" ), err ); if ( KErrOverflow == err ) // full path name is too long { @@ -200,7 +234,9 @@ // it is ok if file is not found in DB, following S60 solution if ( KErrNotFound == err ) { - TRAP( err, iDpConfig.GetWrapperL().AddObjectL( newSuid ) ); + TUint formatCode = object->Uint( CMTPObjectMetaData::EFormatCode ); + TUint subFormatCode = object->Uint( CMTPObjectMetaData::EFormatSubCode ); + TRAP( err, iDpConfig.GetWrapperL().AddObjectL( newSuid, formatCode, subFormatCode ) ); PRINT1( _L( "MM MTP <> Add Object err = %d" ), err ); } @@ -220,11 +256,12 @@ case EMTPObjectPropCodeName: { CMTPTypeString* stringData = CMTPTypeString::NewLC( - aPropListElement.StringL( - CMTPTypeObjectPropListElement::EValue ) );// + stringData + aPropListElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData - responseCode = ServiceMetaDataToWrapperL( propertyCode, - *stringData, *object ); + responseCode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapperL( iDpConfig, + propertyCode, + *stringData, + *object ); CleanupStack::PopAndDestroy( stringData );// - stringData } @@ -232,15 +269,9 @@ default: { - /*// trap and handle with response code here, so correct fail index should report - TRAPD( err, responseCode = ServiceSpecificObjectPropertyL( propertyCode, *object, aPropListElement ) ); - PRINT1( _L("MM MTP <> CSetObjectPropList::SetObjectPropListL, ServiceSpecificObjectPropertyL, err = %d"), err ); - - if ( err == KErrNotSupported ) - { - responseCode = EMTPRespCodeAccessDenied; - }*/ - responseCode = ServiceSpecificObjectPropertyL( propertyCode, *object, + responseCode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig, + propertyCode, + *object, aPropListElement ); } break; @@ -264,56 +295,6 @@ } // ----------------------------------------------------------------------------- -// CSetObjectPropList::ServiceMetaDataToWrapperL -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TMTPResponseCode CSetObjectPropList::ServiceMetaDataToWrapperL( - const TUint16 aPropCode, - MMTPType& aNewData, - const CMTPObjectMetaData& aObjectMetaData ) - { - TMTPResponseCode resCode = EMTPRespCodeOK; - - TRAPD( err, iDpConfig.GetWrapperL().SetObjectMetadataValueL( aPropCode, - aNewData, - aObjectMetaData ) ); - - PRINT1( _L("MM MTP <> CSetObjectPropList::ServiceMetaDataToWrapperL err = %d"), err); - - if ( err == KErrNone ) - { - resCode = EMTPRespCodeOK; - } - else if ( err == KErrTooBig ) - // according to the codes of S60 - { - resCode = EMTPRespCodeInvalidDataset; - } - else if ( err == KErrPermissionDenied ) - { - resCode = EMTPRespCodeAccessDenied; - } - else if ( err == KErrNotFound ) - { - if( MmMtpDpUtility::HasMetadata( aObjectMetaData.Uint( CMTPObjectMetaData::EFormatCode ) ) ) - SendResponseL( EMTPRespCodeAccessDenied ); - } - else - { - // add new virtual call to see if the above condition can be handle probably - err = HandleSpecificWrapperError( err, aObjectMetaData ); - - if ( err != KErrNone ) - resCode = EMTPRespCodeGeneralError; - } - - PRINT1( _L( "MM MTP <= CSetObjectPropList::ServiceMetaDataToWrapperL resCode = 0x%x" ), resCode ); - - return resCode; - } - -// ----------------------------------------------------------------------------- // CSetObjectPropList::RunL // // ----------------------------------------------------------------------------- @@ -351,15 +332,8 @@ // EXPORT_C TInt CSetObjectPropList::RunError( TInt aError ) { - PRINT1( _L( "MM MTP <> CSetObjectPropList::RunError with error %d" ), aError ); + PRINT1( _L( "MM MTP <> CGetObjectPropList::RunError aError = %d" ), aError ); - // Reschedule ourselves - // TODO: go to next index or increase? - // iUnprocessedIndex++ -// TRequestStatus* status = &iStatus; -// User::RequestComplete( status, aError ); -// SetActive(); - PRINT1( _L( "MM MTP <> CGetObjectPropList::RunError aError = %d" ), aError ); TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) ); return KErrNone; @@ -372,7 +346,6 @@ // EXPORT_C void CSetObjectPropList::DoCancel() { - } // end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectpropvalue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectpropvalue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -72,7 +72,8 @@ sizeof(KMTPSetObjectPropValuePolicy) / sizeof(TMTPRequestElementInfo), KMTPSetObjectPropValuePolicy ), iObjectMgr( aFramework.ObjectMgr() ), - iDpConfig( aDpConfig ) + iDpConfig( aDpConfig ), + iFs( aFramework.Fs() ) { SetPSStatus(); PRINT( _L( "Operation: SetObjectPropValue(0x9804)" ) ); @@ -107,13 +108,15 @@ case EMTPObjectPropCodeObjectSize: case EMTPObjectPropCodeParentObject: case EMTPObjectPropCodePersistentUniqueObjectIdentifier: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeDateAdded: case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: //case EMTPObjectPropCodeVideoBitRate: // move to specific dp returnCode = ETrue; break; + case EMTPObjectPropCodeNonConsumable: + // It's settable, return EFalse here. + break; default: returnCode = IsSpecificPropCodeReadOnly(aPropCode); @@ -133,43 +136,46 @@ PRINT( _L( "MM MTP => CSetObjectPropValue::CheckRequestL" ) ); TMTPResponseCode result = CRequestProcessor::CheckRequestL(); + if ( result == EMTPRespCodeObjectWriteProtected ) + { + // Return AccessDenied for P4S pass rate, instead of EMTPRespCodeObjectWriteProtected + result = EMTPRespCodeAccessDenied; + } // Check if property is supported if ( result == EMTPRespCodeOK ) { iPropCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); PRINT1( _L( "MM MTP <> CSetObjectPropValue::CheckRequestL iPropCode = 0x%x" ), iPropCode ); - result = EMTPRespCodeInvalidObjectPropCode; TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); CMTPObjectMetaData* objectInfo = iRequestChecker->GetObjectInfo( objectHandle ); - - if (!objectInfo) + if ( objectInfo == NULL ) { - PRINT(_L("MM MTP <> CGetObjectPropValue::CheckRequestL, objectInfo is NULL")); + PRINT( _L("MM MTP <> CGetObjectPropValue::CheckRequestL, objectInfo is NULL" ) ); return EMTPRespCodeInvalidObjectHandle; } - TFileName fileName = objectInfo->DesC(CMTPObjectMetaData::ESuid); - TUint32 formatCode = objectInfo->Uint(CMTPObjectMetaData::EFormatCode); - + TFileName fileName = objectInfo->DesC( CMTPObjectMetaData::ESuid ); + TUint32 formatCode = objectInfo->Uint( CMTPObjectMetaData::EFormatCode ); PRINT3( _L( "MM MTP <> CGetObjectPropValue::CheckRequestL, handle = 0x%x, filename = %S, formatCode = 0x%x" ), - objectHandle, - &fileName, - formatCode ); + objectHandle, + &fileName, + formatCode ); const RArray* properties = iDpConfig.GetSupportedPropertiesL( formatCode ); TInt count = properties->Count(); + + result = EMTPRespCodeInvalidObjectPropCode; for ( TInt i = 0; i < count; i++ ) { // Object property code is supported, but can not be set which is read only. - if ( (*properties)[i] == iPropCode - && IsPropCodeReadonly( iPropCode ) ) + if ( ( *properties )[i] == iPropCode && IsPropCodeReadonly( iPropCode ) ) { result = EMTPRespCodeAccessDenied; break; } // Object property code is supported and can be set. - else if ( iPropCode == (*properties)[i] ) + else if ( iPropCode == ( *properties )[i] ) { result = EMTPRespCodeOK; break; @@ -212,13 +218,16 @@ case EMTPObjectPropCodeDateAdded: // 0xDC4E case EMTPObjectPropCodeDateCreated: // Date Created(0xDC08) case EMTPObjectPropCodeDateModified: // Modified Date(0xDC09) - case EMTPObjectPropCodeNonConsumable: // Non Consumable(0xDC4F) case EMTPObjectPropCodeVideoBitRate: // 0xDE9C { SendResponseL( EMTPRespCodeAccessDenied ); } break; + case EMTPObjectPropCodeNonConsumable: // Non Consumable(0xDC4F) + ReceiveDataL( iMTPTypeUint8 ); + break; + // Get Data for String objects case EMTPObjectPropCodeObjectFileName: // 0xDC07 case EMTPObjectPropCodeName: // 0xDC44 @@ -252,6 +261,11 @@ switch ( iPropCode ) { + case EMTPObjectPropCodeNonConsumable: + iObjectInfo->SetUint( CMTPObjectMetaData::ENonConsumable, iMTPTypeUint8.Value() ); + iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo ); + break; + case EMTPObjectPropCodeObjectFileName: { TPtrC suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); @@ -273,7 +287,9 @@ // it is ok if file is not found in DB, following S60 solution if ( KErrNotFound == err ) { - TRAP( err, iDpConfig.GetWrapperL().AddObjectL( newSuid ) ); + TUint formatCode = iObjectInfo->Uint( CMTPObjectMetaData::EFormatCode ); + TUint subFormatCode = iObjectInfo->Uint( CMTPObjectMetaData::EFormatSubCode ); + TRAP( err, iDpConfig.GetWrapperL().AddObjectL( newSuid, formatCode, subFormatCode ) ); PRINT1( _L( "MM MTP <> Add MPX object file name err = %d" ), err ); } @@ -343,12 +359,8 @@ } else if ( err == KErrNotFound ) { -// TMTPFormatCode formatCode = -// MmMtpDpUtility::FormatFromFilename( aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ) ); if( MmMtpDpUtility::HasMetadata( aObjectMetaData.Uint( CMTPObjectMetaData::EFormatCode ) ) ) SendResponseL( EMTPRespCodeAccessDenied ); - else - SendDataL( aNewData ); } else { diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp --- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -16,11 +16,12 @@ */ +#include +#include #include #include -#include #include -#include +#include #include "cmmmtpdpmetadataaccesswrapper.h" #include "cmmmtpdpmetadatampxaccess.h" @@ -30,23 +31,23 @@ const TInt KMMMTPDummyFileArrayGranularity = 5; -CMmMtpDpMetadataAccessWrapper* CMmMtpDpMetadataAccessWrapper::NewL( RFs& aRfs, +CMmMtpDpMetadataAccessWrapper* CMmMtpDpMetadataAccessWrapper::NewL( RFs& aRfs, MMTPDataProviderFramework& aFramework ) { CMmMtpDpMetadataAccessWrapper* me = new (ELeave) CMmMtpDpMetadataAccessWrapper( aRfs, aFramework ); CleanupStack::PushL( me ); me->ConstructL(); CleanupStack::Pop( me ); - + return me; } -CMmMtpDpMetadataAccessWrapper::CMmMtpDpMetadataAccessWrapper( RFs& aRfs, +CMmMtpDpMetadataAccessWrapper::CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework ) : iRfs( aRfs ), iFramework( aFramework ) { - + // Do nothing } // --------------------------------------------------------------------------- @@ -61,16 +62,16 @@ iMmMtpDpMetadataMpxAccess = CMmMtpDpMetadataMpxAccess::NewL( iRfs, iFramework ); iMmMtpDpMetadataVideoAccess = CMmMtpDpMetadataVideoAccess::NewL( iRfs ); - - iPlaylistArray = new ( ELeave ) CDesCArrayFlat( KMMMTPDummyFileArrayGranularity ); - + + iAbstractMediaArray = new ( ELeave ) CDesCArrayFlat( KMMMTPDummyFileArrayGranularity ); + // Create the PS key to notify subscribers that MTP mode is activated _LIT_SECURITY_POLICY_C1(KKeyReadPolicy, ECapabilityReadUserData); _LIT_SECURITY_POLICY_C1(KKeyWritePolicy, ECapabilityWriteUserData); - RProperty::Define( KMtpPSUid, - KMtpPSStatus, - RProperty::EInt, - KKeyReadPolicy, + RProperty::Define( KMtpPSUid, + KMtpPSStatus, + RProperty::EInt, + KKeyReadPolicy, KKeyWritePolicy); PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::ConstructL" ) ); @@ -86,37 +87,39 @@ PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::~CMmMtpDpMetadataAccessWrapper" ) ); RemoveDummyFiles(); - delete iPlaylistArray; + delete iAbstractMediaArray; delete iMmMtpDpMetadataVideoAccess; delete iMmMtpDpMetadataMpxAccess; - + // unblock MPX - RProperty::Set( KMtpPSUid, - KMtpPSStatus, - EMtpPSStatusUninitialized); + RProperty::Set( KMtpPSUid, + KMtpPSStatus, + EMtpPSStatusUninitialized ); PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::~CMmMtpDpMetadataAccessWrapper" ) ); } // ----------------------------------------------------------------------------- -// CMmMtpDpMetadataAccessWrapper::SetPlaylist -// Set playlist to DB +// CMmMtpDpMetadataAccessWrapper::SetAbstractMediaL +// Set abstract media to DB // ----------------------------------------------------------------------------- // -EXPORT_C void CMmMtpDpMetadataAccessWrapper::SetPlaylistL( const TDesC& aPlaylistFileName, CDesCArray& aRefFileArray ) +EXPORT_C void CMmMtpDpMetadataAccessWrapper::SetAbstractMediaL( const TDesC& aAbstractMediaFileName, + CDesCArray& aRefFileArray, + TMPXGeneralCategory aCategory ) { - PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetPlaylistL aPlaylistFileName = %S" ), &aPlaylistFileName ); + PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetAbstractMediaL aAbstractMediaFileName = %S" ), &aAbstractMediaFileName ); - if ( !MmMtpDpUtility::IsVideoL( aPlaylistFileName, iFramework ) ) + if ( !MmMtpDpUtility::IsVideoL( aAbstractMediaFileName, iFramework ) ) { - iMmMtpDpMetadataMpxAccess->SetPlaylistL( aPlaylistFileName, aRefFileArray ); + iMmMtpDpMetadataMpxAccess->SetAbstractMediaL( aAbstractMediaFileName, aRefFileArray, aCategory ); } - PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetPlaylistL" ) ); + PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetAbstractMediaL" ) ); } // --------------------------------------------------------------------------- -// CMmMtpDpMetadataAccessWrapper::AddMediaL +// CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL // Gets a piece of metadata from the collection // --------------------------------------------------------------------------- // @@ -154,8 +157,15 @@ { PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetObjectMetadataValueL" ) ); - TPtrC fullFileName( aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ) ); - if ( MmMtpDpUtility::IsVideoL( fullFileName, iFramework ) ) + // In SendObjectPropList, formatCode has already know, but object handle has not been committed into db + // In that case, format couldn't be get from object manager + TUint formatCode = aObjectMetaData.Uint( CMTPObjectMetaData::EFormatCode ); + TUint formatSubCode = aObjectMetaData.Uint( CMTPObjectMetaData::EFormatSubCode ); + + TBool isVideo = EFalse; + isVideo = MmMtpDpUtility::IsVideoL( formatCode, formatSubCode ); + + if ( isVideo ) { iMmMtpDpMetadataVideoAccess->SetObjectMetadataValueL( aPropCode, aNewData, @@ -168,7 +178,6 @@ aObjectMetaData ); } - PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetObjectMetadataValueL" ) ); } @@ -183,22 +192,19 @@ PRINT2( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::RenameObjectL old = %S, new = %S" ), &aOldFileName, &aNewFileName ); - - TMTPFormatCode formatCode = MmMtpDpUtility::FormatFromFilename( aOldFileName ); - if ( formatCode == EMTPFormatCodeWMV ) + + if ( MmMtpDpUtility::IsVideoL( aOldFileName, iFramework ) ) { iMmMtpDpMetadataVideoAccess->RenameRecordL( aOldFileName, aNewFileName ); } else { - if ( !MmMtpDpUtility::IsVideoL( aNewFileName , iFramework ) ) - { - iMmMtpDpMetadataMpxAccess->RenameObjectL( aOldFileName, aNewFileName, formatCode ); - } - else - { - iMmMtpDpMetadataVideoAccess->RenameRecordL( aOldFileName, aNewFileName ); - } + CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); + iFramework.ObjectMgr().ObjectL( aOldFileName, *object ); + iMmMtpDpMetadataMpxAccess->RenameObjectL( aOldFileName, + aNewFileName, + object->Uint( CMTPObjectMetaData::EFormatCode ) ); + CleanupStack::PopAndDestroy( object ); } PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::RenameObjectL" ) ); @@ -215,8 +221,8 @@ PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::DeleteObjectL" ) ); TMPXGeneralCategory category = Category( aFormatCode ); - - // Have to do this. File might not be in file system anymore, have to + + // Have to do this. File might not be in file system anymore, have to // reply on ObjectManager if ( ( aFormatCode == EMTPFormatCodeMP4Container ) || ( aFormatCode == EMTPFormatCode3GPContainer ) @@ -231,7 +237,7 @@ category = EMPXSong; } } - + switch ( category ) { case EMPXPlaylist: @@ -300,7 +306,7 @@ iMmMtpDpMetadataVideoAccess->GetImageObjPropL( aFullFileName, aWidth, aHeight ); } } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper::OpenSessionL // Called when the MTP session is initialised // ----------------------------------------------------------------------------- @@ -370,79 +376,70 @@ } // --------------------------------------------------------------------------- -// CMmMtpDpMetadataAccessWrapper::GetAllPlaylistL -// +// CMmMtpDpMetadataAccessWrapper::GetAllAbstractMediaL +// // --------------------------------------------------------------------------- -EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetAllPlaylistL( const TDesC& aStoreRoot, CMPXMediaArray** aPlaylists ) +EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetAllAbstractMediaL( const TDesC& aStoreRoot, CMPXMediaArray** aAbstractMedias, TMPXGeneralCategory aCategory ) { - iMmMtpDpMetadataMpxAccess->GetAllPlaylistL( aStoreRoot, aPlaylists ); + iMmMtpDpMetadataMpxAccess->GetAllAbstractMediaL( aStoreRoot, aAbstractMedias, aCategory ); } // --------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper::GetAllReferenceL -// +// // --------------------------------------------------------------------------- -//s -EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetAllReferenceL( CMPXMedia* aPlaylist, CDesCArray& aReferences ) +// +EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetAllReferenceL( CMPXMedia* aAbstractMedia, CDesCArray& aReferences ) { - iMmMtpDpMetadataMpxAccess->GetAllReferenceL( aPlaylist, aReferences ); + iMmMtpDpMetadataMpxAccess->GetAllReferenceL( aAbstractMedia, aReferences ); } // --------------------------------------------------------------------------- -// CMmMtpDpMetadataAccessWrapper::GetPlaylistNameL -// +// CMmMtpDpMetadataAccessWrapper::GetAbstractMediaNameL +// // --------------------------------------------------------------------------- // -EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetPlaylistNameL( CMPXMedia* aPlaylist, TDes& aPlaylistName ) +EXPORT_C HBufC* CMmMtpDpMetadataAccessWrapper::GetAbstractMediaNameL( CMPXMedia* aAbstractMedia, TMPXGeneralCategory aCategory ) { - iMmMtpDpMetadataMpxAccess->GetPlaylistNameL( aPlaylist, aPlaylistName ); + return iMmMtpDpMetadataMpxAccess->GetAbstractMediaNameL( aAbstractMedia, aCategory ); } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper::AddObjectL -// Add object (music, video and playlist) info to DB +// Add object (music, video, playlist and abstract media) info to DB // ----------------------------------------------------------------------------- // -void CMmMtpDpMetadataAccessWrapper::AddObjectL( const TDesC& aFullFileName, TBool aIsVideo /*= EFalse */ ) +void CMmMtpDpMetadataAccessWrapper::AddObjectL( const TDesC& aFullFileName, TUint aFormatCode, TUint aSubFormatCode ) { PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL aFullFileName = %S" ), &aFullFileName ); - if ( aFullFileName.Length() <= 0) + if ( aFullFileName.Length() <= 0 ) { User::Leave( KErrArgument ); } - if ( aIsVideo ) + if ( MmMtpDpUtility::IsVideoL( aFormatCode, aSubFormatCode ) ) { PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL Addvideo" ) ); iMmMtpDpMetadataVideoAccess->AddVideoL( aFullFileName ); } else { - if ( MmMtpDpUtility::IsVideoL( aFullFileName, iFramework ) ) + if ( aFormatCode == EMTPFormatCodeM3UPlaylist + || aFormatCode == EMTPFormatCodeMPLPlaylist + || aFormatCode == EMTPFormatCodeAbstractAudioVideoPlaylist + || aFormatCode == EMTPFormatCodeAbstractAudioPlaylist + || aFormatCode == EMTPFormatCodeAbstractVideoPlaylist + || aFormatCode == EMTPFormatCodeASXPlaylist + || aFormatCode == EMTPFormatCodePLSPlaylist ) { - PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL Addvideo" ) ); - iMmMtpDpMetadataVideoAccess->AddVideoL( aFullFileName ); + PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL AddPlaylist" ) ); + iMmMtpDpMetadataMpxAccess->AddAbstractMediaL( aFullFileName, + EMPXPlaylist ); } else { - TMTPFormatCode formatCode = MmMtpDpUtility::FormatFromFilename( aFullFileName ); - - if ( formatCode == EMTPFormatCodeM3UPlaylist - || formatCode == EMTPFormatCodeMPLPlaylist - || formatCode == EMTPFormatCodeAbstractAudioVideoPlaylist - || formatCode == EMTPFormatCodeAbstractAudioPlaylist - || formatCode == EMTPFormatCodeAbstractVideoPlaylist - || formatCode == EMTPFormatCodeASXPlaylist - || formatCode == EMTPFormatCodePLSPlaylist ) - { - PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL AddPlaylist" ) ); - iMmMtpDpMetadataMpxAccess->AddPlaylistL( aFullFileName ); - } - else - { - PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL AddSong" ) ); - iMmMtpDpMetadataMpxAccess->AddSongL( aFullFileName ); - } + PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL AddSong" ) ); + iMmMtpDpMetadataMpxAccess->AddSongL( aFullFileName ); } } @@ -454,8 +451,8 @@ // Get Modified content // --------------------------------------------------------------------------- // -EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetModifiedContentL( const TDesC& aStorageRoot, - TInt& arrayCount, +EXPORT_C void CMmMtpDpMetadataAccessWrapper::GetModifiedContentL( const TDesC& aStorageRoot, + TInt& arrayCount, CDesCArray& aModifiedcontent ) { iMmMtpDpMetadataMpxAccess->SetStorageRootL( aStorageRoot ); @@ -479,7 +476,7 @@ return iMmMtpDpMetadataMpxAccess->IsExistL( aSuid ); } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper::AddDummyFile // Add one dummy file to dummy files array // ----------------------------------------------------------------------------- @@ -487,10 +484,10 @@ EXPORT_C void CMmMtpDpMetadataAccessWrapper::AddDummyFileL( const TDesC& aDummyFileName ) { PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::AddDummyFile aDummyFileName(%S)" ), &aDummyFileName ); - iPlaylistArray->AppendL( aDummyFileName ); + iAbstractMediaArray->AppendL( aDummyFileName ); } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // CMmMtpDpMetadataAccessWrapper::DeleteDummyFile // Delete one dummy file from dummy files array // ----------------------------------------------------------------------------- @@ -499,12 +496,12 @@ { PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::DeleteDummyFile aDummyFileName(%S)" ), &aDummyFileName ); TInt pos = 0; - if ( iPlaylistArray->Count() > 0 ) + if ( iAbstractMediaArray->Count() > 0 ) { - if ( 0 == iPlaylistArray->Find( aDummyFileName, pos ) ) + if ( 0 == iAbstractMediaArray->Find( aDummyFileName, pos ) ) { PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::DeleteDummyFile pos = %d" ), pos ); - iPlaylistArray->Delete( pos ); + iAbstractMediaArray->Delete( pos ); } } } @@ -549,26 +546,26 @@ void CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles() { PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles" ) ); - - TInt count = iPlaylistArray->Count(); + + TInt count = iAbstractMediaArray->Count(); // Check if playlist file is a dummy file or an imported file for ( TInt i = 0; i < count; i++ ) { - if ( MmMtpDpUtility::FormatFromFilename( (*iPlaylistArray)[i] ) != + if ( MmMtpDpUtility::FormatFromFilename( (*iAbstractMediaArray)[i] ) != EMTPFormatCodeM3UPlaylist ) { // delete the virtual playlist // iFramework has release don't use iFramework.FS() - TInt err = iRfs.Delete( (*iPlaylistArray)[i] ); + TInt err = iRfs.Delete( ( *iAbstractMediaArray )[i] ); PRINT2( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile filename = %S, err %d" ), - &( (*iPlaylistArray)[i] ), + &( (*iAbstractMediaArray)[i] ), err ); } else { // leave the Imported playlist in the file system - PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile, Don't delete m3u file [%S]" ), &( (*iPlaylistArray)[i] ) ); + PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile, Don't delete m3u file [%S]" ), &( (*iAbstractMediaArray)[i] ) ); } } PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles" ) ); @@ -579,7 +576,7 @@ // Update Music collection // --------------------------------------------------------------------------- // -EXPORT_C void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL() +EXPORT_C void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL() { iMmMtpDpMetadataMpxAccess->UpdateMusicCollectionL( ); } diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp --- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -56,6 +56,19 @@ _LIT( KMtpDateTimeConnector, "T" ); _LIT( KEmptyText, "" ); +#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) +_LIT( KMpxCollectionNewL, "MpxCollectionNewL" ); +_LIT( KMpxCollectionAddL, "MpxCollectionAddL" ); +_LIT( KMpxCollectionGetL, "MpxCollectionGetL" ); +_LIT( KMpxCollectionSetL, "MpxCollectionSetL" ); +_LIT( KMpxCollectionSetReferenceL, "MpxCollectionSetReferenceL" ); +_LIT( KMpxCollectionGetAbstractMedia, "MpxCollectionGetAbstractMedia" ); +_LIT( KMpxCollectionGetReference, "MpxCollectionGetReference" ); +_LIT( KMpxCollectionFindAllLValidate, "MpxCollectionValidate" ); +_LIT( KMpxCollectionFindAllLBeforeAdd, "MpxCollectionFindAllLBeforeAdd" ); +_LIT( KSetMetadataValue, "SetMetadataValueL" ); +#endif + #ifdef _DEBUG _LIT( KMtpMpxPanic, "CMmMtpDpMetadataMpxAccess" ); #endif @@ -76,7 +89,7 @@ iRfs( aRfs ), iFramework( aFramework ) { - + // Do nothing } // --------------------------------------------------------------------------- @@ -134,7 +147,7 @@ CleanupStack::PopAndDestroy( suid ); // - suid - TMPXAttributeData attrib( MpxAttribFromPropL( media, aPropCode ) ); + TMPXAttributeData attrib( MpxAttribFromPropL( aPropCode ) ); TBool isSupported = media.IsSupported( attrib ); PRINT1(_L( "MM MTP <> CMmMtpDpMetadataMpxAccess::GetObjectMetadataValueL isSupported = %d" ), isSupported); @@ -346,9 +359,9 @@ // as a General Error if ( iCollectionHelper == NULL ) { - PERFLOGSTART(KMpxCollectionNewL); + PERFLOGSTART( KMpxCollectionNewL ); iCollectionHelper = CMPXCollectionHelperFactory::NewCollectionCachedHelperL(); - PERFLOGSTOP(KMpxCollectionNewL); + PERFLOGSTOP( KMpxCollectionNewL ); // Do a search for a song ID that does not exist // This is to validate the presence of the media database. @@ -543,9 +556,9 @@ KMPXMediaGeneralModified, EFalse ); // Update the song's metadata with the media object - PERFLOGSTART(KMpxCollectionSetL); + PERFLOGSTART( KMpxCollectionSetL ); CollectionHelperL()->SetL( media ); - PERFLOGSTOP(KMpxCollectionSetL); + PERFLOGSTOP( KMpxCollectionSetL ); CleanupStack::PopAndDestroy( media ); // - media } @@ -596,7 +609,8 @@ TUint aFormatCode ) { PRINT2( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::RenameObjectL aOldFileName = %S, aNewFileName = %S" ), - &aOldFileName, &aNewFileName ); + &aOldFileName, + &aNewFileName ); TInt err = KErrNone; @@ -604,10 +618,7 @@ || ( aFormatCode == EMTPFormatCodeM3UPlaylist ) ) { PRINT( _L( "MM MTP <> Playlist" ) ); - TRAP( err, CollectionHelperL()->RenameL( - aOldFileName, - aNewFileName, - EMPXPlaylist ) ); + TRAP( err, CollectionHelperL()->RenameL( aOldFileName, aNewFileName, EMPXPlaylist ) ); } else // Not a playlist { @@ -703,14 +714,13 @@ if ( ( format == EMTPFormatCodeAbstractAudioVideoPlaylist ) || ( format == EMTPFormatCodeM3UPlaylist ) ) { - PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL format is playlist" ) ); + PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL format is abstract media" ) ); contentIDs.AppendL( KMPXMediaIdGeneral ); media = CMPXMedia::NewL( contentIDs.Array() ); CleanupStack::PushL( media ); // + media - media->SetTObjectValueL( - KMPXMediaGeneralCategory, + media->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist ); } else @@ -739,12 +749,14 @@ media->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() ); CleanupStack::PopAndDestroy( suid ); // - suid + PERFLOGSTART( KSetMetadataValue ); SetMetadataValueL( aPropCode, aNewData, *media ); + PERFLOGSTOP( KSetMetadataValue ); // Update the song's metadata with the media object - PERFLOGSTART(KMpxCollectionSetL); + PERFLOGSTART( KMpxCollectionSetL ); CollectionHelperL()->SetL( media ); - PERFLOGSTOP(KMpxCollectionSetL); + PERFLOGSTOP( KMpxCollectionSetL ); CleanupStack::PopAndDestroy( 2, &contentIDs ); // - media, contentIDs @@ -765,7 +777,7 @@ TMTPTypeUint16 uint16Data; TMTPTypeUint32 uint32Data; - TMPXAttributeData attrib( MpxAttribFromPropL( aMediaProp, aPropCode ) ); + TMPXAttributeData attrib( MpxAttribFromPropL( aPropCode ) ); switch ( aPropCode ) { @@ -906,7 +918,7 @@ case EMTPObjectPropCodeDescription: { #ifdef __MUSIC_ID_SUPPORT - //WriteMusicIdsL(*longString); + // WriteMusicIdsL(*longString); #else desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData MMTPType::CopyL( aNewData, *desData ); @@ -970,9 +982,7 @@ CleanupStack::PushL( searchMedia ); // + searchMedia searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); - searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong ); - searchMedia->SetTextValueL( KMPXMediaGeneralUri, aFullFileName ); RArray songAttributes; @@ -981,11 +991,10 @@ PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::AddSongL searchMedia setup with no problems" ) ); - PERFLOGSTART(KMpxCollectionFindAllLBeforeAdd); - CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( - *searchMedia, + PERFLOGSTART( KMpxCollectionFindAllLBeforeAdd ); + CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia, songAttributes.Array() ); - PERFLOGSTOP(KMpxCollectionFindAllLBeforeAdd); + PERFLOGSTOP( KMpxCollectionFindAllLBeforeAdd ); CleanupStack::PopAndDestroy( &songAttributes ); // - songAttributes CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia @@ -1022,11 +1031,9 @@ CleanupStack::PushL( media ); // + media // MPXMedia default types - media->SetTObjectValueL( - KMPXMediaGeneralType, + media->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); - media->SetTObjectValueL( - KMPXMediaGeneralCategory, + media->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong ); // File Path // @@ -1050,17 +1057,17 @@ if ( foundItemCount == 0 ) { - PERFLOGSTART(KMpxCollectionAddL); + PERFLOGSTART( KMpxCollectionAddL ); CollectionHelperL()->AddL( media ); - PERFLOGSTOP(KMpxCollectionAddL); + PERFLOGSTOP( KMpxCollectionAddL ); PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::AddSongL Media added into collection" ) ); } else { - PERFLOGSTART(KMpxCollectionSetL); + PERFLOGSTART( KMpxCollectionSetL ); CollectionHelperL()->SetL( media ); - PERFLOGSTOP(KMpxCollectionSetL); + PERFLOGSTOP( KMpxCollectionSetL ); PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::AddSongL Media metadata updated in collection" ) ); } @@ -1074,15 +1081,15 @@ } // ----------------------------------------------------------------------------- -// CMmMtpDpMetadataMpxAccess::AddPlaylistL -// Adds Playlist to Mpx DB +// CMmMtpDpMetadataMpxAccess::AddAbstractMediaL +// Adds abstract media to Mpx DB // ----------------------------------------------------------------------------- // -void CMmMtpDpMetadataMpxAccess::AddPlaylistL( const TDesC& aFullFileName ) +void CMmMtpDpMetadataMpxAccess::AddAbstractMediaL( const TDesC& aFullFileName, TMPXGeneralCategory aCategory ) { - PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::AddPlaylistL aFullFileName = %S" ), &aFullFileName ); + PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::AddAbstractMediaL aFullFileName = %S" ), &aFullFileName ); - // Does a record already exist for this playlist? + // Does a record already exist for this AbstractMedia? RArray contentIDs; CleanupClosePushL( contentIDs ); // + contentIDs contentIDs.AppendL( KMPXMediaIdGeneral ); @@ -1092,21 +1099,24 @@ CleanupStack::PushL( searchMedia ); // + searchMedia searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); - searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist ); + searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory ); searchMedia->SetTextValueL( KMPXMediaGeneralUri, aFullFileName ); - RArray playlistAttributes; - CleanupClosePushL( playlistAttributes ); // + playlistAttributes - playlistAttributes.AppendL( KMPXMediaGeneralId ); - playlistAttributes.AppendL( KMPXMediaGeneralTitle ); - playlistAttributes.AppendL( KMPXMediaGeneralUri ); + RArray abstractMediaAttributes; + CleanupClosePushL( abstractMediaAttributes ); // + abstractMediaAttributes + abstractMediaAttributes.AppendL( KMPXMediaGeneralId ); + abstractMediaAttributes.AppendL( KMPXMediaGeneralTitle ); + if ( aCategory == EMPXPlaylist ) + { + abstractMediaAttributes.AppendL( KMPXMediaGeneralUri ); + } - PERFLOGSTART(KMpxCollectionFindAllLBeforeAdd); + PERFLOGSTART( KMpxCollectionFindAllLBeforeAdd ); CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia, - playlistAttributes.Array() ); - PERFLOGSTOP(KMpxCollectionFindAllLBeforeAdd); + abstractMediaAttributes.Array() ); + PERFLOGSTOP( KMpxCollectionFindAllLBeforeAdd ); - CleanupStack::PopAndDestroy( &playlistAttributes ); // - playlistAttributes + CleanupStack::PopAndDestroy( &abstractMediaAttributes ); // - abstractMediaAttributes CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia CleanupStack::PushL( foundMedia ); // + foundMedia @@ -1117,12 +1127,12 @@ if ( foundItemCount != 0 ) { - PRINT( _L( "MM MTP <> Playlist Media already exists in the collection" ) ); + PRINT( _L( "MM MTP <> Abstract Media already exists in the collection" ) ); } else { - // Creat media properties for the playlist - PRINT( _L( "MM MTP <> Create playlist media properties" ) ); + // Creat media properties for the abstractMedia + PRINT( _L( "MM MTP <> Create abstract media properties" ) ); RArray contentIDs; CleanupClosePushL( contentIDs ); // + contentIDs contentIDs.AppendL( KMPXMediaIdGeneral ); @@ -1131,14 +1141,14 @@ CleanupStack::PopAndDestroy( &contentIDs ); // - contentIDs CleanupStack::PushL( media ); // + media - CMPXMediaArray* playlistArray = CMPXMediaArray::NewL(); - CleanupStack::PushL( playlistArray ); // + playlistArray; + CMPXMediaArray* abstractMediaArray = CMPXMediaArray::NewL(); + CleanupStack::PushL( abstractMediaArray ); // + abstractMediaArray; // MPXMedia default types media->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); media->SetTObjectValueL( KMPXMediaGeneralCategory, - EMPXPlaylist ); + aCategory ); // File Path // media->SetTextValueL( KMPXMediaGeneralUri, aFullFileName ); @@ -1146,37 +1156,40 @@ TParsePtrC parse( aFullFileName ); media->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() ); - media->SetTextValueL( KMPXMediaGeneralTitle, parse.Name() ); + if ( aCategory == EMPXPlaylist ) + { + media->SetTextValueL( KMPXMediaGeneralTitle, parse.Name() ); + } media->SetTObjectValueL( KMPXMediaGeneralSynchronized, ETrue ); - media->SetCObjectValueL( KMPXMediaArrayContents, playlistArray ); - media->SetTObjectValueL( KMPXMediaArrayCount, playlistArray->Count() ); + media->SetCObjectValueL( KMPXMediaArrayContents, abstractMediaArray ); + media->SetTObjectValueL( KMPXMediaArrayCount, abstractMediaArray->Count() ); - PERFLOGSTART(KMpxCollectionAddL); + PERFLOGSTART( KMpxCollectionAddL ); CollectionHelperL()->AddL( media ); - PERFLOGSTOP(KMpxCollectionAddL); + PERFLOGSTOP( KMpxCollectionAddL ); // Clear the array - CleanupStack::PopAndDestroy( playlistArray ); // - playlistArray + CleanupStack::PopAndDestroy( abstractMediaArray ); // - abstractMediaArray CleanupStack::PopAndDestroy( media ); // - media } CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia - PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::AddPlaylistL" ) ); + PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::AddAbstractMediaL" ) ); } // ----------------------------------------------------------------------------- -// CMmMtpDpMetadataMpxAccess::SetPlaylistL -// Set playlist to DB +// CMmMtpDpMetadataMpxAccess::SetAbstractMediaL +// Set abstract media to DB // ----------------------------------------------------------------------------- // -void CMmMtpDpMetadataMpxAccess::SetPlaylistL( const TDesC& aPlaylistFileName, - CDesCArray& aRefFileArray ) +void CMmMtpDpMetadataMpxAccess::SetAbstractMediaL( const TDesC& aAbstractMediaFileName, + CDesCArray& aRefFileArray, TMPXGeneralCategory aCategory ) { - PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetPlaylistL" ) ); - CMPXMediaArray* playlistArray = CMPXMediaArray::NewL(); - CleanupStack::PushL( playlistArray ); // + playlistArray + PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetAbstractMediaL" ) ); + CMPXMediaArray* abstractMediaArray = CMPXMediaArray::NewL(); + CleanupStack::PushL( abstractMediaArray ); // + abstractMediaArray TUint count = aRefFileArray.Count(); for ( TUint j = 0; j < count; j++ ) @@ -1211,7 +1224,7 @@ media->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() ); // Add media into array contents - playlistArray->AppendL( media ); + abstractMediaArray->AppendL( media ); CleanupStack::Pop( media ); // - media } @@ -1220,35 +1233,35 @@ CleanupClosePushL( contentIDs ); // + contentIDs contentIDs.AppendL( KMPXMediaIdGeneral ); - CMPXMedia* playlistMedia = CMPXMedia::NewL( contentIDs.Array() ); + CMPXMedia* abstractMedia = CMPXMedia::NewL( contentIDs.Array() ); CleanupStack::PopAndDestroy( &contentIDs ); // - contentIDs - CleanupStack::PushL( playlistMedia ); // + playlistMedia + CleanupStack::PushL( abstractMedia ); // + abstractMedia - playlistMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); + abstractMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); - playlistMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist ); + abstractMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory ); - playlistMedia->SetTextValueL( KMPXMediaGeneralUri, aPlaylistFileName ); + abstractMedia->SetTextValueL( KMPXMediaGeneralUri, aAbstractMediaFileName ); - TParsePtrC parse( aPlaylistFileName ); - playlistMedia->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() ); - playlistMedia->SetTObjectValueL( KMPXMediaGeneralSynchronized, + TParsePtrC parse( aAbstractMediaFileName ); + abstractMedia->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() ); + abstractMedia->SetTObjectValueL( KMPXMediaGeneralSynchronized, ETrue ); - playlistMedia->SetCObjectValueL( KMPXMediaArrayContents, playlistArray ); - playlistMedia->SetTObjectValueL( KMPXMediaArrayCount, - playlistArray->Count() ); + abstractMedia->SetCObjectValueL( KMPXMediaArrayContents, abstractMediaArray ); + abstractMedia->SetTObjectValueL( KMPXMediaArrayCount, + abstractMediaArray->Count() ); - // Update the duplicate playlist(s) with the new playlist array - PERFLOGSTART(KMpxCollectionSetL); - CollectionHelperL()->SetL( playlistMedia ); - PERFLOGSTOP(KMpxCollectionSetL); + // Update the duplicate abstractMedia(s) with the new abstractMedia array + PERFLOGSTART( KMpxCollectionSetReferenceL ); + CollectionHelperL()->SetL( abstractMedia ); + PERFLOGSTOP( KMpxCollectionSetReferenceL ); - CleanupStack::PopAndDestroy( playlistMedia ); // - playlistMedia + CleanupStack::PopAndDestroy( abstractMedia ); // - abstractMedia // Clear the array - CleanupStack::PopAndDestroy( playlistArray ); // - playlistArray + CleanupStack::PopAndDestroy( abstractMediaArray ); // - abstractMediaArray - PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetPlaylistL" ) ); + PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetAbstractMediaL" ) ); } // --------------------------------------------------------------------------- @@ -1303,32 +1316,50 @@ aMediaProp.SetTextValueL( KMPXMediaMusicAlbumArtFileName, KNullDesC ); // URL aMediaProp.SetTextValueL( KMPXMediaMusicURL, KNullDesC ); + + // add below for P4S failed case, that get metadata from cached CMPXMedia object + // DateAdded + TTime time; + time.HomeTime(); + aMediaProp.SetTObjectValueL( KMPXMediaGeneralDate, time.Int64() ); + // SampleRate + aMediaProp.SetTObjectValueL( KMPXMediaAudioSamplerate, 0 ); + // AudioBitrate + aMediaProp.SetTObjectValueL( KMPXMediaAudioBitrate, 0 ); + // Duration + aMediaProp.SetTObjectValueL( KMPXMediaGeneralDuration, 0 ); + // DrmStatus + aMediaProp.SetTObjectValueL( KMPXMediaMTPDrmStatus, 0 ); + // NumberOfChannels + aMediaProp.SetTObjectValueL( KMPXMediaAudioNumberOfChannels, 0 ); + // AudioCodec + aMediaProp.SetTObjectValueL( KMPXMediaAudioAudioCodec, 0 ); + PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetDefaultL" ) ); } -TMPXAttributeData CMmMtpDpMetadataMpxAccess::MpxAttribFromPropL( const CMPXMedia& aMedia, - const TUint16 aPropCode ) +TMPXAttributeData CMmMtpDpMetadataMpxAccess::MpxAttribFromPropL( const TUint16 aPropCode ) { const TMetadataTable KMetadataTable[] = - { - { EMTPObjectPropCodeName, KMPXMediaGeneralTitle }, - { EMTPObjectPropCodeArtist, KMPXMediaMusicArtist }, - { EMTPObjectPropCodeAlbumName, KMPXMediaMusicAlbum }, - { EMTPObjectPropCodeDateModified, KMPXMediaGeneralDate }, - { EMTPObjectPropCodeDateAdded, KMPXMediaGeneralDate }, - { EMTPObjectPropCodeDuration, KMPXMediaGeneralDuration }, - { EMTPObjectPropCodeTrack, KMPXMediaMusicAlbumTrack }, - { EMTPObjectPropCodeComposer, KMPXMediaMusicComposer }, - { EMTPObjectPropCodeOriginalReleaseDate, KMPXMediaMusicYear }, - { EMTPObjectPropCodeGenre, KMPXMediaMusicGenre }, - { EMTPObjectPropCodeDRMStatus, KMPXMediaMTPDrmStatus }, - { EMTPObjectPropCodeDescription, KMPXMediaGeneralComment }, - { EMTPObjectPropCodeNumberOfChannels, KMPXMediaAudioNumberOfChannels }, - { EMTPObjectPropCodeAudioBitRate, KMPXMediaAudioBitrate }, - { EMTPObjectPropCodeSampleRate, KMPXMediaAudioSamplerate }, - { EMTPObjectPropCodeAudioWAVECodec, KMPXMediaAudioAudioCodec }, - { EMTPObjectPropCodeAlbumArtist, KMPXMediaMusicArtist } - }; + { + { EMTPObjectPropCodeName, KMPXMediaGeneralTitle }, + { EMTPObjectPropCodeArtist, KMPXMediaMusicArtist }, + { EMTPObjectPropCodeAlbumName, KMPXMediaMusicAlbum }, + { EMTPObjectPropCodeDateModified, KMPXMediaGeneralDate }, + { EMTPObjectPropCodeDateAdded, KMPXMediaGeneralDate }, + { EMTPObjectPropCodeDuration, KMPXMediaGeneralDuration }, + { EMTPObjectPropCodeTrack, KMPXMediaMusicAlbumTrack }, + { EMTPObjectPropCodeComposer, KMPXMediaMusicComposer }, + { EMTPObjectPropCodeOriginalReleaseDate, KMPXMediaMusicYear }, + { EMTPObjectPropCodeGenre, KMPXMediaMusicGenre }, + { EMTPObjectPropCodeDRMStatus, KMPXMediaMTPDrmStatus }, + { EMTPObjectPropCodeDescription, KMPXMediaGeneralComment }, + { EMTPObjectPropCodeNumberOfChannels, KMPXMediaAudioNumberOfChannels }, + { EMTPObjectPropCodeAudioBitRate, KMPXMediaAudioBitrate }, + { EMTPObjectPropCodeSampleRate, KMPXMediaAudioSamplerate }, + { EMTPObjectPropCodeAudioWAVECodec, KMPXMediaAudioAudioCodec }, + { EMTPObjectPropCodeAlbumArtist, KMPXMediaMusicArtist } + }; TInt i = 0; TInt count = sizeof( KMetadataTable ) / sizeof( KMetadataTable[0] ); @@ -1349,14 +1380,14 @@ } // --------------------------------------------------------------------------- -// CMmMtpDpMetadataMpxAccess::GetAllPlaylistL -// Get all playlists from MPX database in the assigned store +// CMmMtpDpMetadataMpxAccess::GetAllAbstractMediaL +// Get all abstract medias from MPX database in the assigned store // --------------------------------------------------------------------------- // -void CMmMtpDpMetadataMpxAccess::GetAllPlaylistL( const TDesC& aStoreRoot, - CMPXMediaArray** aPlaylists ) +void CMmMtpDpMetadataMpxAccess::GetAllAbstractMediaL( const TDesC& aStoreRoot, + CMPXMediaArray** aAbstractMedias, TMPXGeneralCategory aCategory ) { - PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetAllPlaylistL" ) ); + PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetAllAbstractMediaL" ) ); SetStorageRootL( aStoreRoot ); @@ -1369,21 +1400,24 @@ CleanupStack::PushL( searchMedia ); // + searchMedia searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem ); - searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist ); + searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory ); searchMedia->SetTextValueL( KMPXMediaGeneralDrive, iStoreRoot ); - RArray playlistAttributes; - CleanupClosePushL( playlistAttributes ); // + playlistAttributes - playlistAttributes.AppendL( KMPXMediaGeneralId ); - playlistAttributes.AppendL( KMPXMediaGeneralTitle ); - playlistAttributes.AppendL( KMPXMediaGeneralUri ); + RArray abstractMediaAttributes; + CleanupClosePushL( abstractMediaAttributes ); // + abstractMediaAttributes + abstractMediaAttributes.AppendL( KMPXMediaGeneralId ); + abstractMediaAttributes.AppendL( KMPXMediaGeneralTitle ); + if ( aCategory == EMPXPlaylist ) + { + abstractMediaAttributes.AppendL( KMPXMediaGeneralUri ); + } - PERFLOGSTART(KMpxCollectionGetPlaylist); + PERFLOGSTART( KMpxCollectionGetAbstractMedia ); CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia, - playlistAttributes.Array() ); - PERFLOGSTOP(KMpxCollectionGetPlaylist); + abstractMediaAttributes.Array() ); + PERFLOGSTOP( KMpxCollectionGetAbstractMedia ); - CleanupStack::PopAndDestroy( &playlistAttributes ); // - playlistAttributes + CleanupStack::PopAndDestroy( &abstractMediaAttributes ); // - abstractMediaAttributes CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia CleanupStack::PushL( foundMedia ); // + foundMedia @@ -1392,9 +1426,9 @@ User::Leave( KErrNotSupported ); } - TInt count = *foundMedia->Value ( KMPXMediaArrayCount ); + TInt count = *foundMedia->Value( KMPXMediaArrayCount ); - PRINT1( _L("MM MTP <> CMmMtpDpMetadataMpxAccess::GetAllPlaylistL [%d] playlists found in Playlist Database"), count ); + PRINT1( _L("MM MTP <> CMmMtpDpMetadataMpxAccess::GetAllAbstractMediaL [%d] abstractMedias found in Database"), count ); if ( count > 0 ) { @@ -1403,13 +1437,13 @@ User::Leave( KErrNotSupported ); } - *aPlaylists = CMPXMediaArray::NewL( *( foundMedia->Value ( - KMPXMediaArrayContents ) ) ); + *aAbstractMedias = + CMPXMediaArray::NewL( *( foundMedia->Value ( KMPXMediaArrayContents ) ) ); } CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia - PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::GetAllPlaylistL" ) ); + PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::GetAllAbstractMediaL" ) ); } // --------------------------------------------------------------------------- @@ -1417,15 +1451,15 @@ // Get all references of specified playlist // --------------------------------------------------------------------------- // -void CMmMtpDpMetadataMpxAccess::GetAllReferenceL( CMPXMedia* aPlaylist, - CDesCArray& aReferences ) +void CMmMtpDpMetadataMpxAccess::GetAllReferenceL( CMPXMedia* aAbstractMedia, + CDesCArray& aReferences ) { PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetAllReferenceL" ) ); - __ASSERT_DEBUG( aPlaylist, User::Panic( KMtpMpxPanic, KErrArgument ) ); + __ASSERT_DEBUG( aAbstractMedia, User::Panic( KMtpMpxPanic, KErrArgument ) ); // Extract the playlist id from the found object - TUint32 playlistId = *(*aPlaylist).Value ( KMPXMediaGeneralId ); + TUint32 abstractMediaId = *( *aAbstractMedia ).Value( KMPXMediaGeneralId ); // find the media object that contains a list of songs in the playlist RArray contentIDs; @@ -1438,17 +1472,17 @@ searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup ); searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong ); - searchMedia->SetTObjectValueL ( KMPXMediaGeneralId, playlistId ); + searchMedia->SetTObjectValueL( KMPXMediaGeneralId, abstractMediaId ); RArray songAttributes; CleanupClosePushL( songAttributes ); // + songAttributes songAttributes.AppendL( KMPXMediaGeneralId ); songAttributes.AppendL( KMPXMediaGeneralUri ); - PERFLOGSTART(KMpxCollectionGetReference); + PERFLOGSTART( KMpxCollectionGetReference ); CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia, songAttributes.Array() ); - PERFLOGSTOP(KMpxCollectionGetReference); + PERFLOGSTOP( KMpxCollectionGetReference ); CleanupStack::PopAndDestroy( &songAttributes ); // - songAttributes CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia @@ -1498,23 +1532,30 @@ } // --------------------------------------------------------------------------- -// CMmMtpDpMetadataMpxAccess::GetPlaylistNameL +// CMmMtpDpMetadataMpxAccess::GetAbstractMediaNameL // // --------------------------------------------------------------------------- // -void CMmMtpDpMetadataMpxAccess::GetPlaylistNameL( CMPXMedia* aPlaylist, - TDes& aPlaylistName ) +HBufC* CMmMtpDpMetadataMpxAccess::GetAbstractMediaNameL( CMPXMedia* aAbstractMedia, + TMPXGeneralCategory aCategory ) { - PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetPlaylistNameL" ) ); - - if ( !aPlaylist->IsSupported( KMPXMediaGeneralUri ) ) + PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetAbstractMediaNameL" ) ); + HBufC* name = NULL; + if ( aCategory == EMPXPlaylist ) + { + if( !aAbstractMedia->IsSupported( KMPXMediaGeneralUri ) ) + { + User::Leave( KErrNotSupported ); + } + name = aAbstractMedia->ValueText( KMPXMediaGeneralUri ).AllocL(); + } + else { User::Leave( KErrNotSupported ); } - aPlaylistName.Copy( aPlaylist->ValueText( KMPXMediaGeneralUri ) ); - - PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::GetPlaylistNameL" ) ); + PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::GetAbstractMediaNameL" ) ); + return name; } // --------------------------------------------------------------------------- @@ -1523,7 +1564,7 @@ // --------------------------------------------------------------------------- // void CMmMtpDpMetadataMpxAccess::GetModifiedContentL( TInt& arrayCount, - CDesCArray& aModifiedcontent ) + CDesCArray& aModifiedcontent ) { PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetModifiedContentL" ) ); CMPXMedia* foundMedia; diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp --- a/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -36,6 +36,7 @@ #include "mmmtpdputility.h" #include "mmmtpdpfiledefs.h" +#include "tobjectdescription.h" #include "mmmtpdplogger.h" using namespace ContentAccess; @@ -68,23 +69,26 @@ if ( file.Ext().CompareF( KTxtExtensionWMA ) == 0 ) return EMTPFormatCodeWMA; #endif // __WINDOWS_MEDIA - - if ( ( file.Ext().CompareF( KTxtExtensionMP4 ) == 0 ) || ( file.Ext().CompareF( KTxtExtensionM4A ) == 0 ) ) + + if ( ( file.Ext().CompareF( KTxtExtensionMP4 ) == 0 ) + || ( file.Ext().CompareF( KTxtExtensionM4A ) == 0 ) ) return EMTPFormatCodeMP4Container; - if ( ( file.Ext().CompareF( KTxtExtension3GP ) == 0 ) || ( file.Ext().CompareF( KTxtExtensionO4A ) == 0 ) || ( file.Ext().CompareF( KTxtExtensionO4V ) == 0 ) ) + if ( ( file.Ext().CompareF( KTxtExtension3GP ) == 0 ) + || ( file.Ext().CompareF( KTxtExtensionO4A ) == 0 ) + || ( file.Ext().CompareF( KTxtExtensionO4V ) == 0 ) ) return EMTPFormatCode3GPContainer; if ( file.Ext().CompareF( KTxtExtensionAAC ) == 0 ) return EMTPFormatCodeAAC; - + if ( file.Ext().CompareF( KTxtExtensionWAV ) == 0 ) return EMTPFormatCodeWAV; - + #ifdef __WINDOWS_MEDIA if ( file.Ext().CompareF( KTxtExtensionWMV ) == 0 ) return EMTPFormatCodeWMV; - + if ( file.Ext().CompareF( KTxtExtensionASF ) == 0 ) return EMTPFormatCodeASF; @@ -144,6 +148,21 @@ } // ----------------------------------------------------------------------------- +// MmMtpDpUtility::HasReference +// Utility function to decide if there is any reference +// ----------------------------------------------------------------------------- +// +TBool MmMtpDpUtility::HasReference( TUint16 aObjFormatCode ) + { + if ( aObjFormatCode == EMTPFormatCodeAbstractAudioAlbum + || aObjFormatCode == EMTPFormatCodeAbstractAudioVideoPlaylist + || aObjFormatCode == EMTPFormatCodeM3UPlaylist ) + return ETrue; + else + return EFalse; + } + +// ----------------------------------------------------------------------------- // MmMtpDpUtility::IsVideoL (Slow Version) // Utility function to determine whether a format is Video or not // ----------------------------------------------------------------------------- @@ -170,28 +189,28 @@ } else if ( ext.CompareF( KTxtExtensionMP4 ) == 0 || ext.CompareF( KTxtExtension3GP ) == 0 - || ext.CompareF( KTxtExtensionODF ) == 0 + || ext.CompareF( KTxtExtensionODF ) == 0 || ext.CompareF( KTxtExtensionASF ) == 0 ) - { - HBufC8* mimetype = ContainerMimeType( aFullFileName ); - User::LeaveIfNull( mimetype ); + { + HBufC8* mimetype = ContainerMimeType( aFullFileName ); + User::LeaveIfNull( mimetype ); - CleanupStack::PushL( mimetype ); // + mimetype + CleanupStack::PushL( mimetype ); // + mimetype - TMmMtpSubFormatCode subFormatCode; + TMmMtpSubFormatCode subFormatCode; - User::LeaveIfError( SubFormatCodeFromMime( *mimetype, subFormatCode ) ); - CleanupStack::PopAndDestroy( mimetype ); // - mimetype + User::LeaveIfError( SubFormatCodeFromMime( *mimetype, subFormatCode ) ); + CleanupStack::PopAndDestroy( mimetype ); // - mimetype - if ( subFormatCode == EMTPSubFormatCodeVideo ) - { - return ETrue; - } - else - { - return EFalse; - } + if ( subFormatCode == EMTPSubFormatCodeVideo ) + { + return ETrue; } + else + { + return EFalse; + } + } else if ( ext.CompareF( KTxtExtensionO4V ) == 0 ) return ETrue; @@ -204,11 +223,11 @@ // Utility function to determine whether a format is Video or not // ----------------------------------------------------------------------------- // -TBool MmMtpDpUtility::IsVideoL( const TDesC& aFullFileName, +TBool MmMtpDpUtility::IsVideoL( const TDesC& aFullFileName, const MMTPDataProviderFramework& aFramework ) { PRINT1( _L( "MM MTP => MmMtpDpUtility::IsVideoL (Fast Version) aFullFileName = %S" ), &aFullFileName ); - + CMTPObjectMetaData* info = CMTPObjectMetaData::NewLC(); // + info aFramework.ObjectMgr().ObjectL( aFullFileName, *info ); @@ -216,20 +235,33 @@ TUint subFormatCode = info->Uint( CMTPObjectMetaData::EFormatSubCode ); CleanupStack::PopAndDestroy( info ); // - info - - if ( formatCode == EMTPFormatCodeWMV ) + + return MmMtpDpUtility::IsVideoL( formatCode, subFormatCode ); + } + +// ----------------------------------------------------------------------------- +// MmMtpDpUtility::IsVideoL (Fast Version) +// Utility function to determine whether a format is Video or not +// ----------------------------------------------------------------------------- +// +TBool MmMtpDpUtility::IsVideoL( TUint aFormatCode, TUint aSubFormatCode ) + { + if ( aFormatCode == KMTPFormatsAll ) + User::Leave( KErrArgument ); + + if ( aFormatCode == EMTPFormatCodeWMV ) { return ETrue; } - else if ( ( formatCode == EMTPFormatCodeMP4Container ) - || ( formatCode == EMTPFormatCode3GPContainer ) - || ( formatCode == EMTPFormatCodeASF ) ) + else if ( ( aFormatCode == EMTPFormatCodeMP4Container ) + || ( aFormatCode == EMTPFormatCode3GPContainer ) + || ( aFormatCode == EMTPFormatCodeASF ) ) { - if ( subFormatCode == EMTPSubFormatCodeAudio ) + if ( aSubFormatCode == EMTPSubFormatCodeAudio ) { return EFalse; } - else if ( subFormatCode == EMTPSubFormatCodeVideo ) + else if ( aSubFormatCode == EMTPSubFormatCodeVideo ) { return ETrue; } @@ -269,7 +301,7 @@ TEntry fileInfo; // Shouldn't leave User::LeaveIfError( aFs.Entry( aFileName, fileInfo ) ); - return fileInfo.iSize; + return fileInfo.FileSize(); } // ----------------------------------------------------------------------------- @@ -306,6 +338,10 @@ protectionStatus = EMTPProtectionReadOnly; } + PRINT2( _L( "MM MTP <> MmMtpDpUtility::GetProtectionStatusL aFullFileName = %S, protectionStatus = 0x%x" ), + &aFullFileName, + protectionStatus ); + return protectionStatus; } @@ -316,8 +352,8 @@ // TMTPResponseCode MmMtpDpUtility::CheckPropType(TUint16 aPropertyCode, TUint16 aDataType) { - PRINT2( _L( "MM MTP => MmMtpDpUtility::CheckPropCode aPropertyCode = 0x%x, aDataType = 0x%x" ), - aPropertyCode, + PRINT2( _L( "MM MTP => MmMtpDpUtility::CheckPropCode aPropertyCode = 0x%x, aDataType = 0x%x" ), + aPropertyCode, aDataType ); TMTPResponseCode responseCode = EMTPRespCodeOK; @@ -333,7 +369,6 @@ case EMTPObjectPropCodeDateCreated: case EMTPObjectPropCodeDateModified: case EMTPObjectPropCodeDateAdded: - case EMTPObjectPropCodeNonConsumable: case EMTPObjectPropCodeVideoBitRate: { responseCode = EMTPRespCodeAccessDenied; @@ -399,13 +434,24 @@ } break; + // Uint8 properties + case EMTPObjectPropCodeNonConsumable: + case EMTPExtObjectPropCodeOmaDrmStatus: // 0xDB01 + { + if ( aDataType != EMTPTypeUINT8 ) + { + responseCode = EMTPRespCodeInvalidObjectPropFormat; + } + } + break; + default: { responseCode = EMTPRespCodeInvalidObjectPropCode; } break; } - PRINT1( _L( "MM MTP <= MmMtpDpUtility::CheckPropCode responseCode = 0x%x" ), + PRINT1( _L( "MM MTP <= MmMtpDpUtility::CheckPropCode responseCode = 0x%x" ), responseCode ); return responseCode; } @@ -435,7 +481,7 @@ return aFs.Rename( aFullFileName, aNewName ); } - + // ----------------------------------------------------------------------------- // MetadataAccessWrapper::ContainerMimeType // Get mime type from file @@ -484,7 +530,7 @@ PRINT1( _L("MM MTP <> MmMtpDpUtility::ContainerMimeType, AsfMimeTypeL err = %d"), err ); } #endif - + PRINT( _L( "MM MTP <= MmMtpDpUtility::ContainerMimeType" ) ); return mimebuf; } @@ -499,7 +545,7 @@ PRINT( _L( "MM MTP => MmMtpDpUtility::Mp4MimeTypeL" ) ); HBufC8* mimebuf = NULL; TParsePtrC file( aFullPath ); - + if ( file.Ext().CompareF( KTxtExtensionMP4 ) == 0 || file.Ext().CompareF( KTxtExtension3GP ) == 0 ) { @@ -573,7 +619,7 @@ { User::Leave( KErrNotSupported ); } - + if ( mimebuf == NULL ) { User::Leave( KErrNotFound ); @@ -591,38 +637,38 @@ { PRINT( _L( "MM MTP => MmMtpDpUtility::OdfMimeTypeL" ) ); HBufC8* mimebuf = NULL; - + TParsePtrC file( aFullPath ); - + if ( file.Ext().CompareF( KTxtExtensionODF ) == 0 ) - { + { CContent* content = CContent::NewL( aFullPath ); CleanupStack::PushL( content ); // + content - + HBufC* buffer = HBufC::NewL( KMimeTypeMaxLength ); CleanupStack::PushL( buffer ); // + buffer - + TPtr data = buffer->Des(); TInt err = content->GetStringAttribute( EMimeType, data ); - + if ( err == KErrNone ) { mimebuf = HBufC8::New( buffer->Length() ); - + if (mimebuf == NULL) { User::LeaveIfError( KErrNotFound ); } - + mimebuf->Des().Copy( *buffer ); } - + // leave if NULL if ( mimebuf == NULL ) { User::Leave( KErrNotFound ); } - + CleanupStack::PopAndDestroy( buffer ); // - buffer CleanupStack::PopAndDestroy( content ); // - content } @@ -630,7 +676,7 @@ { User::Leave( KErrNotSupported ); } - + PRINT( _L( "MM MTP <= MmMtpDpUtility::OdfMimeTypeL" ) ); return mimebuf; } @@ -643,32 +689,32 @@ HBufC8* MmMtpDpUtility::AsfMimeTypeL( const TDesC& aFullPath ) { PRINT( _L( "MM MTP => MmMtpDpUtility::AsfMimeTypeL" ) ); - + HBufC8* mimebuf = NULL; - + #ifdef __WINDOWS_MEDIA TParsePtrC file( aFullPath ); - + if ( file.Ext().CompareF( KTxtExtensionASF ) == 0 ) { CHXMetaDataUtility *hxUtility = CHXMetaDataUtility::NewL(); CleanupStack::PushL( hxUtility ); - + hxUtility->OpenFileL( aFullPath ); - + HXMetaDataKeys::EHXMetaDataId id; TUint count = 0; TBool isAudio = EFalse; hxUtility->GetMetaDataCount( count ); for ( TUint i = 0; i < count; i++ ) - { + { HBufC* buf = NULL; - hxUtility->GetMetaDataAt( i, id, buf ); + hxUtility->GetMetaDataAt( i, id, buf ); if ( id == HXMetaDataKeys::EHXMimeType ) { TPtr des = buf->Des(); - + if ( des.Find( KHxMimeTypeWma() ) != KErrNotFound ) { isAudio = ETrue; @@ -695,7 +741,7 @@ } hxUtility->ResetL(); - CleanupStack::PopAndDestroy( hxUtility ); + CleanupStack::PopAndDestroy( hxUtility ); } else { @@ -705,7 +751,7 @@ #else User::Leave( KErrNotSupported ); #endif - + PRINT( _L( "MM MTP <= MmMtpDpUtility::AsfMimeTypeL" ) ); return mimebuf; } @@ -715,7 +761,7 @@ // Get subformat code from mime string // ----------------------------------------------------------------------------- // -TInt MmMtpDpUtility::SubFormatCodeFromMime( const TDesC8& aMimeType, +TInt MmMtpDpUtility::SubFormatCodeFromMime( const TDesC8& aMimeType, TMmMtpSubFormatCode& aSubFormatCode ) { PRINT( _L( "MM MTP => MmMtpDpUtility::SubFormatCodeFromMime" ) ); @@ -791,8 +837,8 @@ } PRINT1( _L( "MM MTP <= MmMtpDpUtility::GetDrmStatus, drmStatus: %d" ), drmStatus ); - + return drmStatus; } -//end of file +// end of file diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/playbackhelper/group/playbackhelper.mmp --- a/mmappcomponents/playbackhelper/group/playbackhelper.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/playbackhelper/group/playbackhelper.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,9 +15,7 @@ * */ -// Version : %version: 5 % - - +// Version : %version: 6 % #include @@ -47,16 +45,15 @@ LIBRARY apmime.lib LIBRARY charconv.lib LIBRARY mmfcontrollerframework.lib -LIBRARY flogger.lib -LIBRARY mmfdevsound.lib +LIBRARY mmfdevsound.lib #ifdef __WINDOWS_MEDIA LIBRARY asxparser.lib #endif #if defined(ARMCC) -deffile ../eabi/ +deffile ../eabi/ #elif defined(WINSCW) -deffile ../bwinscw/ +deffile ../bwinscw/ #endif diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/playbackhelper/inc/playbackhelper_log.h --- a/mmappcomponents/playbackhelper/inc/playbackhelper_log.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/playbackhelper/inc/playbackhelper_log.h Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,9 +15,7 @@ * */ -// Version : %version: 4 % - - +// Version : %version: 5 % #ifndef PLAYBACKHELPER_LOG_H @@ -26,21 +24,6 @@ // INCLUDES #include #include -#include - - - -// #define _PLAYBACKHELPER_FILE_LOGGING_ - -#ifdef _DEBUG - #define PLAYBACKHELPER_DEBUG RDebug::Print -#else - #ifdef _PLAYBACKHELPER_FILE_LOGGING_ - #define PLAYBACKHELPER_DEBUG PlaybackHelperDebug::FileLog - #else - #define PLAYBACKHELPER_DEBUG RDebug::Print - #endif -#endif class PlaybackHelperDebug @@ -49,18 +32,15 @@ inline static void NullLog( TRefByValue /*aFmt*/, ... ) { } +}; - inline static void FileLog( TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat( _L("PlaybackHelper"), - _L("playbackhelper.log"), - EFileLoggingModeAppend, - aFmt, - list ); - } -}; + +#ifdef _DEBUG + #define PLAYBACKHELPER_DEBUG RDebug::Print +#else + #define PLAYBACKHELPER_DEBUG PlaybackHelperDebug::NullLog +#endif + #endif // PLAYBACKHELPER_LOG_H diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/videoplaylistutility/group/videoplaylistutility.mmp --- a/mmappcomponents/videoplaylistutility/group/videoplaylistutility.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/videoplaylistutility/group/videoplaylistutility.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,9 +15,7 @@ * */ -// Version : %version: 3 % - - +// Version : %version: 4 % #include @@ -43,8 +41,7 @@ LIBRARY sysutil.lib LIBRARY apmime.lib LIBRARY charconv.lib -LIBRARY flogger.lib -LIBRARY playbackhelper.lib +LIBRARY playbackhelper.lib LIBRARY mpxcommon.lib LIBRARY estor.lib diff -r 5529f24b6aaf -r da1f3efa404b mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h --- a/mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h Sun Mar 14 13:11:48 2010 +0000 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,130 +15,106 @@ * */ -// Version : %version: 2 % - - +// Version : %version: 3 % #ifndef VIDEOPLAYLISTUTILITY_LOG_H #define VIDEOPLAYLISTUTILITY_LOG_H + // INCLUDES #include #include #include #include -#include #include - -// #define _VPU_FILE_LOGGING_ - +// +// MACROS +// #ifdef _DEBUG - #define VPU_DEBUG RDebug::Print + #define VIDEOPLAYLISTUTILITY_DEBUG TVideoPlaylistUtilityLog::VideoPlaylistUtilityLog + #define VIDEOPLAYLISTUTILITY_ENTER_EXIT TEnterExitLog _s #else - #ifdef _VPU_FILE_LOGGING_ - #define VPU_DEBUG VideoPlaylistUtilityDebug::FileLog - #else - #define VPU_DEBUG RDebug::Print - #endif -#endif + #define VIDEOPLAYLISTUTILITY_DEBUG TVideoPlaylistUtilityLog::NullLog + #define VIDEOPLAYLISTUTILITY_ENTER_EXIT TVideoPlaylistUtilityLog::NullLog +#endif -class VideoPlaylistUtilityDebug +class TVideoPlaylistUtilityLog : public TDes16Overflow { public: + inline static void NullLog( TRefByValue /*aFmt*/, ... ) { } - inline static void FileLog( TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat( _L("VideoPlaylistUtility"), - _L("videoplaylistutility.log"), - EFileLoggingModeAppend, - aFmt, - list ); - } -}; - - - -// MACROS -#define VIDEOPLAYLISTUTILITY_DEBUG TVideoPlaylistUtilityLog::VideoPlaylistUtilityLog -#define VIDEOPLAYLISTUTILITY_ENTER_EXIT TEnterExitLog _s - -class TVideoPlaylistUtilityLog : public TDes16Overflow -{ - public: - inline static void VideoPlaylistUtilityLog( TRefByValue aFmt, ... ) { TBuf< 512 > buffer; - + VA_LIST list; VA_START( list, aFmt ); buffer.AppendFormatList( aFmt, list ); VA_END(list); - - VPU_DEBUG(_L("#VideoPlaylistUtility# %S"), &buffer ); + + RDebug::Print(_L("#VideoPlaylistUtility# %S"), &buffer ); } }; class TEnterExitLog : public TDes16Overflow { public: - + void Overflow(TDes16& /*aDes*/) { - VPU_DEBUG(_L("%S Logging Overflow"), &iFunctionName); + RDebug::Print(_L("%S Logging Overflow"), &iFunctionName); } TEnterExitLog( TRefByValue aFunctionName, TRefByValue aFmt, ... ) { iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); - + if ( iFunctionName ) { iFunctionName->Des().Copy(aFunctionName); } - + TBuf< 512 > buffer; - + VA_LIST list; VA_START( list, aFmt ); buffer.AppendFormatList( aFmt, list, this ); VA_END(list); - - VPU_DEBUG(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer ); + + RDebug::Print(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer ); } - + TEnterExitLog( TRefByValue aFunctionName ) { iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); - + if ( iFunctionName ) { iFunctionName->Des().Copy(aFunctionName); } - - VPU_DEBUG(_L("#VideoPlaylistUtility# --> %S"), iFunctionName ); + + RDebug::Print(_L("#VideoPlaylistUtility# --> %S"), iFunctionName ); } - + ~TEnterExitLog() { - VPU_DEBUG(_L("#VideoPlaylistUtility# <-- %S"), iFunctionName ); + RDebug::Print(_L("#VideoPlaylistUtility# <-- %S"), iFunctionName ); delete iFunctionName; } - + private: HBufC* iFunctionName; }; + _LIT(_KVPUErrorInfo, "#VideoPlaylistUtility# Error : error %d file %s line %d"); #define VIDEOPLAYLISTUTILITY_S(a) _S(a) diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/group/bld.inf --- a/mmappfw_plat/group/bld.inf Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/group/bld.inf Sun Mar 14 13:11:48 2010 +0000 @@ -13,13 +13,13 @@ * * Description: Includes all the Domain API specific bld.inf files, which * export files. -* Version : %version: 1.1.4.1.3.3.4 % +* Version : %version: da1ido#1.1.4.1.3.3.5 % * */ #include -#include "../inc/mmappfwbldvariant.hrh" +#include "../../inc/mmappfwbldvariant.hrh" #include "../collection_helper_api/group/bld.inf" #include "../harvester_collection_mediator_api/group/bld.inf" @@ -27,6 +27,7 @@ #include "../harvester_server_api/group/bld.inf" #include "../harvester_utility_api/group/bld.inf" #include "../playlist_engine_api/group/bld.inf" +#include "../mtp_keys_api/group/bld.inf" #include "../mpx_collection_common_definition_api/group/bld.inf" #include "../mpx_collection_utility_api/group/bld.inf" #include "../mpx_common_api/group/bld.inf" diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/harvester_server_api/group/bld.inf --- a/mmappfw_plat/harvester_server_api/group/bld.inf Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/harvester_server_api/group/bld.inf Sun Mar 14 13:11:48 2010 +0000 @@ -26,3 +26,4 @@ ../inc/mpxharvestercommon.h MW_LAYER_PLATFORM_EXPORT_PATH(mpxharvestercommon.h) ../inc/mpxharvesterserverdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(mpxharvesterserverdefs.h) +../inc/mpxharvestercrkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(mpxharvestercrkeys.h) diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/harvester_server_api/inc/mpxharvestercrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/harvester_server_api/inc/mpxharvestercrkeys.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MPX Harvester CenRep keys. +* +*/ + + +#ifndef MPXHARVESTERCRKEYS_H +#define MPXHARVESTERCRKEYS_H + + +// MPX Harvester Features Uid +const TUid KCRUIDMpxHarvesterFeatures = { 0x101FFCD2 }; + +// List of scan paths for the harvester +const TInt KMpxHarvesterScanPathKey = 1; + +// List of blocked paths for the harvester +const TInt KMpxHarvesterBlockPathKey = 2; + +// List of container types +const TInt KMpxHarvesterContainerKey = 3; + +// List of folders to monitor for file changes +const TInt KMpxHarvesterAutoScanDirectoryKey = 4; + +// Disable the podcasting feature in harvester 1=disabled 0=enabled +const TInt KMpxHarvesterDisablePodcasting = 5; + +// Enable the Ram Drive feature. +const TInt KMpxHarvesterEnableRamDisk = 6; + +// Minimum disk space in Mb on Ram Drive to allow copying of Harvester databases to the Ram Disk. +const TInt KMpxHarvesterMaxAllowedRamDiskSpace = 7; + +#endif // MPXHARVESTERCRKEYS_H + +// End of file diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mpx_common_api/inc/mpxclientlist.h --- a/mmappfw_plat/mpx_common_api/inc/mpxclientlist.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/mpx_common_api/inc/mpxclientlist.h Sun Mar 14 13:11:48 2010 +0000 @@ -258,6 +258,26 @@ */ inline void SendMsgL(TInt aIndex, const TMPXMessage& aMsg); + + /** + * Sets the primary client + * + * @since S60 9.2 + * @return system error + */ + IMPORT_C TInt SetPrimaryClient(CMPXMessageQueue& aMsgQueue); + + + + /** + * Send a sync message to the primary client + * + * @since S60 9.2 + * @return system error + */ + IMPORT_C TInt SendSyncMsg(const CMPXMessage* aMsg); + + private: /** * Encapsulates a client: all the information associated with a client of @@ -433,6 +453,7 @@ RPointerArray iClients; RArray iClientProcesses; MMPXClientlistObserver* iObserver; + CMPXMessageQueue* iPrimaryClient; }; #include "mpxclientlist.inl" diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mpx_common_api/inc/mpxmessagequeue.h --- a/mmappfw_plat/mpx_common_api/inc/mpxmessagequeue.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/mpx_common_api/inc/mpxmessagequeue.h Sun Mar 14 13:11:48 2010 +0000 @@ -73,6 +73,14 @@ */ IMPORT_C void Reset(); + /** + * Adds a message into the top of the queue and sends the message if slot is available. + * + * @since S60 9.2 + * @param aMessage message object, ownership not transferred. + * @return system error + */ + IMPORT_C TInt AddFirst(const CMPXMessage* aMessage, TInt aError); private: /** * C++ constructor. diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackcommanddefs.h --- a/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackcommanddefs.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackcommanddefs.h Sun Mar 14 13:11:48 2010 +0000 @@ -99,6 +99,7 @@ EPbCmdDisableEffect, EPbCmdSetVolume, // 25 Set volume to the value specified by aData EPbCmdSetAutoResume, // 26 Set autoresume value (true/false) + EPbCmdSyncMsgComplete, //27 Synchronous message is complete EPbCmdEnd // Mark for the end of command }; diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackframeworkdefs.h --- a/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackframeworkdefs.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackframeworkdefs.h Sun Mar 14 13:11:48 2010 +0000 @@ -247,6 +247,7 @@ EPbsInitFromFile64, // 42 EPbsInitStreamingFromFile64, // 43 EPbsGetFile64, // 44 + EPbsSetPrimaryClient, //45 set primary client EPbsServerOpEnd // End of operation }; diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackpluginobserver.h --- a/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackpluginobserver.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackpluginobserver.h Sun Mar 14 13:11:48 2010 +0000 @@ -110,6 +110,18 @@ */ virtual void HandlePlaybackMessage(CMPXMessage* /*aMsg*/, TInt /*aErr*/) {} + + + /** + * Handle message from plug-in. + * + * @since S60 9.2 + * @param aMsg message from the plug-in + * @return system error + */ + virtual TInt HandlePlaybackSyncMessage (const CMPXMessage& /*aMsg*/) {return KErrNotSupported;} + + }; #endif // MMPXMPLAYBACKPLUGINOBSERVER_H diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mpx_playback_utility_api/inc/mpxplaybackutility.h --- a/mmappfw_plat/mpx_playback_utility_api/inc/mpxplaybackutility.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/mpx_playback_utility_api/inc/mpxplaybackutility.h Sun Mar 14 13:11:48 2010 +0000 @@ -413,6 +413,16 @@ */ virtual void InitStreaming64L(RFile64& /*aShareableFile*/, const TInt /*aAccessPoint*/) {}; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + + /** + * Sets the primary client + * + * @since S60 9.2 + * @return system error + */ + virtual TInt SetPrimaryClientL() {return KErrNotSupported; }; + + }; /** diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mtp_keys_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/mtp_keys_api/group/bld.inf Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: MTP Keys API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/MtpPrivatePSKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(MtpPrivatePSKeys.h) diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mtp_keys_api/inc/MtpPrivatePSKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/mtp_keys_api/inc/MtpPrivatePSKeys.h Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header Information for MTP Private Publish & Subsribe Keys +* +*/ + + +#ifndef MTPPRIVATEPSKEYS_H +#define MTPPRIVATEPSKEYS_H + +// Security Code UI Originator API +const TUid KMtpPSUid = {0x101FFC51}; // Mtp Key UID +const TInt KMtpPSStatus = 1; // Mtp UID + +enum TMtpPSStatus + { + EMtpPSStatusUninitialized = 0, + EMtpPSStatusActive, + EMtpPSStatusReadyToSync + }; + +#endif // MTPPRIVATEPSKEYS_H diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/mtp_keys_api/mtp_keys_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/mtp_keys_api/mtp_keys_api.metaxml Sun Mar 14 13:11:48 2010 +0000 @@ -0,0 +1,17 @@ + + + MTP Keys API + This API defines the Central Repository and Publish & Subscribe keys defined by MTP. + c++ + mtp + + + + + + + + no + no + + diff -r 5529f24b6aaf -r da1f3efa404b mmappfw_plat/videoplaylist_utility_api/tsrc/videoplaylistutilitytest/group/videoplaylistutilitytest.mmp --- a/mmappfw_plat/videoplaylist_utility_api/tsrc/videoplaylistutilitytest/group/videoplaylistutilitytest.mmp Mon Mar 08 21:44:04 2010 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/videoplaylistutilitytest/group/videoplaylistutilitytest.mmp Sun Mar 14 13:11:48 2010 +0000 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % #include @@ -49,7 +49,6 @@ LIBRARY libglib.lib LIBRARY libpthread.lib LIBRARY efsrv.lib -LIBRARY flogger.lib LIBRARY ServiceHandler.lib LIBRARY ecom.lib LIBRARY estor.lib diff -r 5529f24b6aaf -r da1f3efa404b mpx/Conf/mpx.confml Binary file mpx/Conf/mpx.confml has changed diff -r 5529f24b6aaf -r da1f3efa404b mpx/Conf/mpx_101FFCD2.crml Binary file mpx/Conf/mpx_101FFCD2.crml has changed diff -r 5529f24b6aaf -r da1f3efa404b mpx/cenrep/101FFCD2.txt Binary file mpx/cenrep/101FFCD2.txt has changed diff -r 5529f24b6aaf -r da1f3efa404b mpx/commonframework/common/bwinscw/mpxcommonU.DEF --- a/mpx/commonframework/common/bwinscw/mpxcommonU.DEF Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/commonframework/common/bwinscw/mpxcommonU.DEF Sun Mar 14 13:11:48 2010 +0000 @@ -284,4 +284,7 @@ ?AddClientL@CMPXClientList@@QAEXVTThreadId@@HPAVCMPXMessageQueue@@H@Z @ 283 NONAME ; void CMPXClientList::AddClientL(class TThreadId, int, class CMPXMessageQueue *, int) ?ClientCategory@CMPXClientList@@QBEHH@Z @ 284 NONAME ; int CMPXClientList::ClientCategory(int) const ?SelectPlugin64L@CMPXPluginHandlerBase@@UAEXABVRFile64@@@Z @ 285 NONAME ; void CMPXPluginHandlerBase::SelectPlugin64L(class RFile64 const &) + ?SendSyncMsg@CMPXClientList@@QAEHPBVCMPXMedia@@@Z @ 286 NONAME ; int CMPXClientList::SendSyncMsg(class CMPXMedia const *) + ?AddFirst@CMPXMessageQueue@@QAEHPBVCMPXMedia@@H@Z @ 287 NONAME ; int CMPXMessageQueue::AddFirst(class CMPXMedia const *, int) + ?SetPrimaryClient@CMPXClientList@@QAEHAAVCMPXMessageQueue@@@Z @ 288 NONAME ; int CMPXClientList::SetPrimaryClient(class CMPXMessageQueue &) diff -r 5529f24b6aaf -r da1f3efa404b mpx/commonframework/common/eabi/mpxcommonU.DEF --- a/mpx/commonframework/common/eabi/mpxcommonU.DEF Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/commonframework/common/eabi/mpxcommonU.DEF Sun Mar 14 13:11:48 2010 +0000 @@ -361,4 +361,7 @@ _ZN14CMPXClientList10AddClientLE9TThreadIdiP16CMPXMessageQueuei @ 360 NONAME _ZNK14CMPXClientList14ClientCategoryEi @ 361 NONAME _ZN21CMPXPluginHandlerBase15SelectPlugin64LERK7RFile64 @ 362 NONAME + _ZN14CMPXClientList11SendSyncMsgEPK9CMPXMedia @ 363 NONAME + _ZN14CMPXClientList16SetPrimaryClientER16CMPXMessageQueue @ 364 NONAME + _ZN16CMPXMessageQueue8AddFirstEPK9CMPXMediai @ 365 NONAME diff -r 5529f24b6aaf -r da1f3efa404b mpx/commonframework/common/src/mpxclientlist.cpp --- a/mpx/commonframework/common/src/mpxclientlist.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/commonframework/common/src/mpxclientlist.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -46,7 +46,8 @@ // CMPXClientList::CMPXClientList(MMPXClientlistObserver* aObserver) : iIdentity(CMPXClientList::ClientsMatch), - iObserver(aObserver) + iObserver(aObserver), + iPrimaryClient(NULL) {} // ---------------------------------------------------------------------------- @@ -155,7 +156,15 @@ CClientId* id( iClients[aIndex] ); iClients.Remove(aIndex); - CClientId removeId( id->iPid ); + //set primary client to NULL if primary client is removed + if (iPrimaryClient != NULL) + { + if (aIndex == Find(*iPrimaryClient)) + { + iPrimaryClient = NULL; + } + } + CClientId removeId( id->iPid ); if ( iClients.Find( &removeId, iIdentity ) == KErrNotFound ) // // There's no other client from the same process, so @@ -601,4 +610,46 @@ iSubscriptions.ResetAndDestroy(); } +// ----------------------------------------------------------------------------- +// CMPClientList::SetPrimaryClient +// Set the primary client +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMPXClientList::SetPrimaryClient(CMPXMessageQueue& aMsgQueue) + { + MPX_FUNC("CMPXClientList::SetPrimaryClient"); + TInt index = Find(aMsgQueue); + MPX_DEBUG2("CMPXClientList::SetPrimaryClient, index = %d", index); + if (index >= 0) + { + iPrimaryClient = &aMsgQueue; + return KErrNone; + } + return index; + } +// ----------------------------------------------------------------------------- +// CMPClientList::SendSyncMsg +// Send a sync message to the primary client +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMPXClientList::SendSyncMsg(const CMPXMessage* aMsg) + { + MPX_FUNC("CMPXClientList::SendSyncMsg"); + TInt err = KErrNone; + if (iPrimaryClient == NULL) + { + return KErrNotFound; + } + TInt index = Find(*iPrimaryClient); + MPX_DEBUG2("CMPXClientList::SendSyncMsg, index = %d", index); + if (index >= 0) + { + err = iClients[index]->iMsgQueue->AddFirst(aMsg, KErrNone); + } + else + { + err = KErrNotFound; + } + return err; + } // End of File diff -r 5529f24b6aaf -r da1f3efa404b mpx/commonframework/common/src/mpxmessagequeue.cpp --- a/mpx/commonframework/common/src/mpxmessagequeue.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/commonframework/common/src/mpxmessagequeue.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -302,4 +302,36 @@ this, data, err, ret); } +// ---------------------------------------------------------------------------- +// Adds a message into the top of the queue and sends the message if slot is available +// ---------------------------------------------------------------------------- +// +EXPORT_C TInt CMPXMessageQueue::AddFirst(const CMPXMessage* aMessage, TInt aError) + { + // aMessage should not be NULL and aError is KErrNone + MPX_ASSERT(aMessage || aError); + MPX_FUNC_EX("CMPXMessageQueue::AddFirst()"); + CMPXMessageItem* item(NULL); + TRAPD(err, item = CMPXMessageItem::NewL(aMessage, aError)); + if (KErrNone==err) + { + iMsgs.AddFirst(*item); +#ifdef _DEBUG + MPX_DEBUG3("CMPXMessageQueue::AddFirst 0x%08x, items %d", this, ++iCount); +#endif + }//else failed to create message item. + else + { + MPX_DEBUG2("CMPXMessageQueue::AddFirst Failed to create message item %d", err); + } + if (KErrNone!=err && KErrNone==iFailure) + { // Set the failure code + iFailure = err; + } + if (!iMsgRequest.IsNull()) + { // outstanding request + Send(); + } // else client has not finished current message yet + return err; + } // End of file diff -r 5529f24b6aaf -r da1f3efa404b mpx/playbackframework/playbackengine/inc/mpxplaybackengine.h --- a/mpx/playbackframework/playbackengine/inc/mpxplaybackengine.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/playbackframework/playbackengine/inc/mpxplaybackengine.h Sun Mar 14 13:11:48 2010 +0000 @@ -924,6 +924,34 @@ */ void Init64L(RFile64* aFile, TInt aAccessPoint=0); #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + /** + * Callback for sync message timer + * + * @since 9.2 + * @param this + * @return systme error + */ + static TInt SyncMsgTimerCallback(TAny* aPtr); + /** + * Cancel the sync message timer + * + * @since 9.2 + */ + void CancelSyncMsgTimer(); + /** + * Stop the wait loop + * + * @since 9.2 + */ + void StopWaitLoop(); + /** + * Handle a synchronous message + * + * @since 9.2 + * @param aMsg, message + * @return system error + */ + TInt HandlePlaybackSyncMessage (const CMPXMessage& aMsg); private: friend class TCallbackReflector; @@ -992,6 +1020,8 @@ TBool iInitVolume; // Initialize volume on first creation // the index which be firstly saved when request media TInt iFirstRequestMediaIndex; + CPeriodic* iSyncMsgTimer; //timer for sync message + CActiveSchedulerWait* iSyncMsgWait; // wait loop use to sync message #if defined(__HIGH_RESOLUTION_VOLUME) // flag to indicate whether the volume setting has been rounded up last // used to adjust volume up button setting diff -r 5529f24b6aaf -r da1f3efa404b mpx/playbackframework/playbackengine/src/mpxplaybackengine.cpp --- a/mpx/playbackframework/playbackengine/src/mpxplaybackengine.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/playbackframework/playbackengine/src/mpxplaybackengine.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -47,6 +47,7 @@ const TInt KMPXSmallVolumeIncrement = 5; const TInt KMPXLargeVolumeIncrement = 10; const TInt KPercentMultiplier = 100; +const TInt KMPXSyncMsgTimer = 3000000; // 3 seconds _LIT(KWmaExtension, ".wma"); _LIT(KRaExtension, ".ra"); @@ -186,6 +187,8 @@ iVolRoundedUp = EFalse; #endif iPluginHandler->Plugin()->PropertyL( EPbPropertyVolume ); + iSyncMsgTimer = CPeriodic::NewL( CActive::EPriorityIdle ); + iSyncMsgWait = new (ELeave) CActiveSchedulerWait; } // ---------------------------------------------------------------------------- @@ -232,6 +235,12 @@ #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API iFile64.Close(); #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + delete iSyncMsgTimer; + if (iSyncMsgWait && iSyncMsgWait->IsStarted() ) + { + iSyncMsgWait->AsyncStop(); + } + delete iSyncMsgWait; } // ---------------------------------------------------------------------------- @@ -2175,6 +2184,11 @@ iAutoResumeHandler->SetAutoResume( aData ); break; } + case EPbCmdSyncMsgComplete: + { + StopWaitLoop(); + break; + } default: ASSERT(0); } @@ -3859,4 +3873,71 @@ } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API +// ---------------------------------------------------------------------------- +// Cancel timer. +// ---------------------------------------------------------------------------- +void CMPXPlaybackEngine::CancelSyncMsgTimer() + { + MPX_FUNC("CMPXPlaybackEngine::CancelSyncMsgTimer()"); + // Cancel timer. + if ( iSyncMsgTimer && iSyncMsgTimer->IsActive() ) + { + MPX_DEBUG1("CMPXPlaybackEngine::CancelSyncMsgTimer(): Timer active, cancelling"); + iSyncMsgTimer->Cancel(); + } + } +// ---------------------------------------------------------------------------- +// Callback for timer. +// ---------------------------------------------------------------------------- +TInt CMPXPlaybackEngine::SyncMsgTimerCallback(TAny* aPtr) + { + MPX_FUNC("CMPXPlaybackEngine::SyncMsgTimerCallback()"); + CMPXPlaybackEngine* ptr = + static_cast(aPtr); + ptr->StopWaitLoop(); + return KErrNone; + } +// ---------------------------------------------------------------------------- +// Handle a synchronous message +// ---------------------------------------------------------------------------- +// +TInt CMPXPlaybackEngine::HandlePlaybackSyncMessage (const CMPXMessage& aMsg) + { + MPX_FUNC("CMPXPlaybackEngine::HandlePlaybackSyncMessage()"); + TInt err = iClientList->SendSyncMsg(&aMsg); + if (err != KErrNone) + { + return err; + } + // Cancel timer. + CancelSyncMsgTimer(); + // Start timer in case there is no callback from primary client. + iSyncMsgTimer->Start( + KMPXSyncMsgTimer, + KMPXSyncMsgTimer, + TCallBack(SyncMsgTimerCallback, this )); + + // Start wait loop until we get a callback from primary client + if ( !iSyncMsgWait->IsStarted() ) + { + iSyncMsgWait->Start(); + } + return KErrNone; + } +// ---------------------------------------------------------------------------- +// Stop the wait loop. +// ---------------------------------------------------------------------------- +void CMPXPlaybackEngine::StopWaitLoop() + { + MPX_FUNC("CMPXPlaybackEngine::StopWaitLoop()"); + // Cancel timer + CancelSyncMsgTimer(); + + // Stop wait loop to unblock. + if ( iSyncMsgWait->IsStarted() ) + { + MPX_DEBUG1("CMPXPlaybackEngine::StopWaitLoop(): Stopping the wait loop."); + iSyncMsgWait->AsyncStop(); + } + } // End of file diff -r 5529f24b6aaf -r da1f3efa404b mpx/playbackframework/playbackserver/src/mpxplaybackserversession.cpp --- a/mpx/playbackframework/playbackserver/src/mpxplaybackserversession.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/playbackframework/playbackserver/src/mpxplaybackserversession.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -515,6 +515,13 @@ break; } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + case EPbsSetPrimaryClient: + { + TInt error = iPlayer->ClientList()->SetPrimaryClient(*iMessageQueue); + TPckgC handle(error); + aMessage.Write(0, handle); + break; + } default: { PanicClient(aMessage,KErrNotSupported); diff -r 5529f24b6aaf -r da1f3efa404b mpx/playbackframework/playbackutility/inc/mpxplaybackutilityimpl.h --- a/mpx/playbackframework/playbackutility/inc/mpxplaybackutilityimpl.h Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/playbackframework/playbackutility/inc/mpxplaybackutilityimpl.h Sun Mar 14 13:11:48 2010 +0000 @@ -583,6 +583,13 @@ virtual void InitStreaming64L(RFile64& aShareableFile, const TInt aAccessPoint); #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + /** + * Sets the primary client + * + * @since S60 9.2 + * @return system error + */ + TInt SetPrimaryClientL(); private: diff -r 5529f24b6aaf -r da1f3efa404b mpx/playbackframework/playbackutility/src/mpxplaybackutilityimpl.cpp --- a/mpx/playbackframework/playbackutility/src/mpxplaybackutilityimpl.cpp Mon Mar 08 21:44:04 2010 +0000 +++ b/mpx/playbackframework/playbackutility/src/mpxplaybackutilityimpl.cpp Sun Mar 14 13:11:48 2010 +0000 @@ -1337,4 +1337,13 @@ #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API +// ---------------------------------------------------------------------------- +// Set primary client +// ---------------------------------------------------------------------------- +// +TInt CMPXPlaybackUtility::SetPrimaryClientL() + { + MPX_FUNC("CMPXPlaybackUtility::SetPrimaryClientL"); + return iPbs.SendReceiveL(EPbsSetPrimaryClient); + } // End of file