--- a/inc/mmappfwbldvariant.hrh Fri Apr 16 15:28:14 2010 +0300
+++ b/inc/mmappfwbldvariant.hrh Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/asxparser/group/asxparser.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/asxparser/group/asxparser.mmp Mon May 03 12:58:40 2010 +0300
@@ -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.3 %
+// Version : %version: 9.1.4 %
#include <platform_paths.hrh>
--- a/mmappcomponents/asxparser/inc/AsxParser_debug.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/asxparser/inc/AsxParser_debug.h Mon May 03 12:58:40 2010 +0300
@@ -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,7 +15,7 @@
*
*/
-// Version : %version: 4.1.2 %
+// Version : %version: 4.1.3 %
#ifndef __MP_DEBUG_H__
--- a/mmappcomponents/asxparser/src/asxparser.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/asxparser/src/asxparser.cpp Mon May 03 12:58:40 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10.1.5 %
+// Version : %version: 10.1.5.1.1 %
@@ -299,7 +299,8 @@
CleanupStack::PopAndDestroy(); //attributeList
}
- while( nodelist2.HasNext() )
+ TBool urlIsSet = EFalse;
+ while( !urlIsSet && nodelist2.HasNext() )
{
element = nodelist2.Next();
@@ -326,6 +327,8 @@
TPtrC8 attrData = attr.Value();
asxItem->url = attrData.AllocL();
iAsxArray.Append(asxItem);
+ urlIsSet = ETrue;
+ break;
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/asxparser/test/AsxFiles/multiURL.asx Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,25 @@
+<ASX version = "3.0">
+ <ABSTRACT>Unknown Abstract Info</ABSTRACT>
+ <TITLE>Unknown Title</TITLE>
+ <AUTHOR>Unknown Author</AUTHOR>
+ <COPYRIGHT>2008 by Nokia</COPYRIGHT>
+ <MOREINFO HREF = "rtsp://195.134.224.240:554/t3.3gp" />
+ <ENTRY>
+ <TITLE>Link 1</TITLE>
+ <COPYRIGHT>2008 Nokia</COPYRIGHT>
+ <MOREINFO HREF = "http://www.microsoft.com/windows/windowsmedia"></MOREINFO>
+ <REF HREF = "http://10.48.2.56:443/WMTest/256k_WMV9_QCIF_WMA9_30fps.wmv" />
+ </ENTRY>
+ <ENTRY>
+ <TITLE>Link 2</TITLE>
+ <COPYRIGHT>2008 Nokia</COPYRIGHT>
+ <MOREINFO HREF = "http://www.microsoft.com/windows/windowsmedia"></MOREINFO>
+ <REF HREF = "http://10.48.2.56:443/WMTest/KennyRogers-LoveLiftedMe.wma" />
+ </ENTRY>
+ <ENTRY>
+ <TITLE>Link 3</TITLE>
+ <COPYRIGHT>2008 Nokia</COPYRIGHT>
+ <MOREINFO HREF = "http://www.microsoft.com/windows/windowsmedia"></MOREINFO>
+ <REF HREF = "http://10.48.2.56:443/WMTest/Kill_Kevin_01_US_s.wmv" />
+ </ENTRY>
+</ASX>
--- a/mmappcomponents/asxparser/test/test.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/asxparser/test/test.cpp Mon May 03 12:58:40 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 7 %
+// Version : %version: 8 %
#include <e32base.h>
#include <e32cons.h>
--- a/mmappcomponents/asxparser/test/test.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/asxparser/test/test.mmp Mon May 03 12:58:40 2010 +0300
@@ -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,7 +15,8 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
+
#include <platform_paths.hrh>
--- a/mmappcomponents/audiofetcher/inc/audiofetcherdialog.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/audiofetcher/inc/audiofetcherdialog.h Mon May 03 12:58:40 2010 +0300
@@ -133,6 +133,13 @@
CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName,
TInt aFileIndex, TInt aFileMaskIndex);
+ CGulIcon* ColorIconL( const TAknsItemID& aId,
+ const TDesC& aFileName,
+ TInt aFilexIndex,
+ TInt aFileMaskIndex,
+ const TAknsItemID& aColorId,
+ TInt aColorIndex );
+
void UpdateListBoxL();
/**
--- a/mmappcomponents/audiofetcher/src/audiofetcherdialog.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/audiofetcher/src/audiofetcherdialog.cpp Mon May 03 12:58:40 2010 +0300
@@ -286,7 +286,6 @@
iListBox->View()->SetListEmptyTextL( *iEmptyListText );
iStatusPaneHandler->SetTitleL( iTitle );
- iStatusPaneHandler->SetNaviPaneTitleL( KNullDesC );
CEikButtonGroupContainer& dialogCba = ButtonGroupContainer();
dialogCba.MakeCommandVisible(EAknSoftkeySelect, EFalse);
@@ -389,14 +388,18 @@
EMbmAudiofetcherQgn_prop_sml_sync_off_mask ) );
// memory card icon
- icons->AppendL( IconL( KAknsIIDQgnIndiMmcAdd, iIconFileName,
+ icons->AppendL( ColorIconL( KAknsIIDQgnIndiMmcAdd, iIconFileName,
EMbmAudiofetcherQgn_indi_mmc_add,
- EMbmAudiofetcherQgn_indi_mmc_add_mask ) );
+ EMbmAudiofetcherQgn_indi_mmc_add_mask,
+ KAknsIIDQsnIconColors,
+ EAknsCIQsnIconColorsCG26 ) );
// mass storage icon
- icons->AppendL( IconL( KAknsIIDQgnPropLinkEmbdSmall, iIconFileName,
+ icons->AppendL( ColorIconL( KAknsIIDQgnPropLinkEmbdSmall, iIconFileName,
EMbmAudiofetcherQgn_indi_fmgr_ms_add,
- EMbmAudiofetcherQgn_indi_fmgr_ms_add_mask ) );
+ EMbmAudiofetcherQgn_indi_fmgr_ms_add_mask,
+ KAknsIIDQsnIconColors,
+ EAknsCIQsnIconColorsCG26 ) );
// empty icon
icons->AppendL( IconL( KAknsIIDQgnPropEmpty, KAvkonBitmapFile,
@@ -456,6 +459,45 @@
return icon;
}
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ColorIconL
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAudioFetcherDialog::ColorIconL( const TAknsItemID& aId,
+ const TDesC& aFileName,
+ TInt aFilexIndex,
+ TInt aFileMaskIndex,
+ const TAknsItemID& aColorId,
+ TInt aColorIndex )
+ {
+ WLOG("CAudioFetcherDialog::ColorIconL");
+
+ CFbsBitmap* bitmap( NULL );
+ CFbsBitmap* mask( NULL );
+
+ if ( aColorId == KAknsIIDNone )
+ {
+ // do not use theme color, use the default color from the file
+ AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), aId,
+ bitmap, mask, aFileName, aFilexIndex, aFileMaskIndex );
+ }
+ else
+ {
+ // use theme color
+ AknsUtils::CreateColorIconLC( AknsUtils::SkinInstance(), aId, aColorId, aColorIndex,
+ bitmap, mask, aFileName, aFilexIndex, aFileMaskIndex, KRgbBlack );
+ }
+
+ CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+ icon->SetBitmapsOwnedExternally( EFalse );
+
+ // icon now owns the bitmaps, no need to keep on cleanup stack.
+ CleanupStack::Pop( 2 ); // mask, bitmap
+
+ return icon;
+ }
+
// -----------------------------------------------------------------------------
// CMediaFileDialog::UpdateListBoxL
@@ -469,13 +511,7 @@
{
return;
}
-
- TInt resultCount = iFileHandler->ResultCount();
-
- if(resultCount > 0){
- CEikButtonGroupContainer& dialogCba = ButtonGroupContainer();
- dialogCba.MakeCommandVisible(EAknSoftkeySelect, ETrue);
- }
+
iListBox->HandleItemAdditionL();
iListBox->SetCurrentItemIndex( 0 );
DrawNow();
@@ -564,7 +600,7 @@
switch ( aEventType )
{
- case EEventItemDoubleClicked: // fallthrough
+ case EEventItemSingleClicked: // fallthrough
case EEventEnterKeyPressed:
{
TBool closeDialog = HandleListSelectionL();
@@ -876,7 +912,6 @@
AknLayoutUtils::EMainPane, mainPaneRect );
SetRect( mainPaneRect );
TRAP_IGNORE( iStatusPaneHandler->SetTitleL( iTitle ) );
- TRAP_IGNORE( iStatusPaneHandler->SetNaviPaneTitleL( KNullDesC ) );
DrawDeferred();
}
--- a/mmappcomponents/collectionhelper/group/mpxcollectionhelper.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/collectionhelper/group/mpxcollectionhelper.mmp Mon May 03 12:58:40 2010 +0300
@@ -29,6 +29,8 @@
MACRO RD_MPX_TNM_INTEGRATION
#define RD_MPX_TNM_INTEGRATION
+MACRO ABSTRACTAUDIOALBUM_INCLUDED
+#define ABSTRACTAUDIOALBUM_INCLUDED
//MACRO RD_MPX_COLLECTION_CACHE
SOURCEPATH ../src
SOURCE mpxcollectionhelperfactory.cpp
--- a/mmappcomponents/collectionhelper/inc/mpxcollectionuihelperimp.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/collectionhelper/inc/mpxcollectionuihelperimp.h Mon May 03 12:58:40 2010 +0300
@@ -649,6 +649,16 @@
void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError);
/**
+ * From MMPXCollectionObserver
+ * Handles completion of a asynchronous command.
+ *
+ * @param aCommandResult result of the command, NULL if error
+ * @param aError error code
+ */
+ virtual void HandleCommandComplete(CMPXCommand* aCommandResult,
+ TInt aError);
+
+ /**
* From MMPXMoveItemObserver
* @param aErr, error for the operation
*/
@@ -848,6 +858,7 @@
TInt iEmbeddedPluginInfo;
TBool iInitialized; // collection db merging
TBool iIncAdding; // Incremental adding guard
+ TInt iRefCount;
};
#endif // CMPX_COLLECTION_UI_HELPER_H
--- a/mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp Mon May 03 12:58:40 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: Extended collection helper with an internal caching array
-* Version : %version: da1mmcf#27.1.12 %
+* Version : %version: da1mmcf#27.1.12.3.1 %
*
*/
@@ -157,9 +157,24 @@
{
Commit();
}
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ TBool extract = ETrue;
+ if( aMedia->IsSupported( KMPXMediaMTPSampleDataFlag ) )
+ {
+
+ extract = aMedia->ValueTObjectL<TBool>( KMPXMediaMTPSampleDataFlag );
+ MPX_DEBUG2("CMPXCollectionCachedHelper::AddL KMPXMediaMTPSampleDataFlag is set. extract=%d", extract );
+ }
+ if( extract )
+ {
+ // Extract album art from the file
+ iMetadataExtractor->ExtractAlbumArtL( aMedia );
+ }
+#else
// Extract album art from the file
iMetadataExtractor->ExtractAlbumArtL( aMedia );
+#endif
CMPXMedia* copy = CMPXMedia::NewL( *aMedia );
CleanupStack::PushL( copy );
@@ -332,7 +347,20 @@
void CMPXCollectionCachedHelper::SetL( CMPXMedia*& aMedia )
{
MPX_DEBUG1("CMPXCollectionCachedHelper::::SetL <--");
-
+
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ if( aMedia->IsSupported( KMPXMediaMTPSampleDataFlag ) )
+ {
+ TBool flag = aMedia->ValueTObjectL<TBool>( KMPXMediaMTPSampleDataFlag );
+ MPX_DEBUG2("CMPXCollectionCachedHelper::SetL KMPXMediaMTPSampleDataFlag is set. flag=%d", flag );
+ if( flag )
+ {
+ iMetadataExtractor->ExtractAlbumArtL( aMedia );
+ }
+ return;
+ }
+#endif
+
const TDesC& newUri = aMedia->ValueText( KMPXMediaGeneralUri );
TInt count( iCache->Count() );
@@ -719,7 +747,11 @@
MPX_DEBUG1("CMPXCollectionCachedHelper::GetL <--");
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ if (aItemCat != EMPXSong && aItemCat != EMPXPlaylist && aItemCat != EMPXAbstractAlbum)
+#else
if (aItemCat != EMPXSong && aItemCat != EMPXPlaylist)
+#endif
{
User::Leave(KErrArgument);
}
@@ -751,11 +783,20 @@
EMPXMediaGeneralTitle | EMPXMediaGeneralDate |
EMPXMediaGeneralDuration | EMPXMediaGeneralComment |
EMPXMediaGeneralUri ));
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
attributes.AppendL(
TMPXAttribute(KMPXMediaIdMusic,
EMPXMediaMusicArtist | EMPXMediaMusicAlbum |
EMPXMediaMusicAlbumTrack | EMPXMediaMusicComposer |
- EMPXMediaMusicYear | EMPXMediaMusicGenre));
+ EMPXMediaMusicYear | EMPXMediaMusicGenre |
+ EMPXMediaMusicAlbumArtist));
+#else
+ attributes.AppendL(
+ TMPXAttribute(KMPXMediaIdMusic,
+ EMPXMediaMusicArtist | EMPXMediaMusicAlbum |
+ EMPXMediaMusicAlbumTrack | EMPXMediaMusicComposer |
+ EMPXMediaMusicYear | EMPXMediaMusicGenre));
+#endif
attributes.AppendL(KMPXMediaAudioAudioAll);
attributes.AppendL(KMPXMediaMTPAll);
@@ -997,6 +1038,14 @@
aSrc.ValueTObjectL<TInt>( KMPXMediaMusicRating )
);
}
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ if( atts&EMPXMediaMusicAlbumArtist ) // Text
+ {
+ aDestination.SetTextValueL( KMPXMediaMusicAlbumArtist,
+ aSrc.ValueText(KMPXMediaMusicAlbumArtist )
+ );
+ }
+#endif
MPX_DEBUG1("CMPXCollectionCachedHelper::DoAppendMusicL -->");
}
--- a/mmappcomponents/collectionhelper/src/mpxcollectionhelperimp.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/collectionhelper/src/mpxcollectionhelperimp.cpp Mon May 03 12:58:40 2010 +0300
@@ -168,8 +168,14 @@
// generic way of resolving collections aside from using file extension
// or UID.
//
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ if ( aMedia->ValueTObjectL<TMPXGeneralType>(KMPXMediaGeneralType) == EMPXItem &&
+ (aMedia->ValueTObjectL<TMPXGeneralCategory>(KMPXMediaGeneralCategory) == EMPXPlaylist ||
+ aMedia->ValueTObjectL<TMPXGeneralCategory>(KMPXMediaGeneralCategory) == EMPXAbstractAlbum))
+#else
if ( aMedia->ValueTObjectL<TMPXGeneralType>(KMPXMediaGeneralType) == EMPXItem &&
aMedia->ValueTObjectL<TMPXGeneralCategory>(KMPXMediaGeneralCategory) == EMPXPlaylist )
+#endif
{
aMedia->SetTObjectValueL<TUid>( KMPXMediaGeneralCollectionId,
iMusicCollectionId );
@@ -348,9 +354,13 @@
//
TMPXGeneralCategory category =
aMedia->ValueTObjectL<TMPXGeneralCategory>(KMPXMediaGeneralCategory);
-
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ if ((aMedia->ValueTObjectL<TMPXGeneralType>(KMPXMediaGeneralType) != EMPXItem) ||
+ (category != EMPXSong && category != EMPXPlaylist && category != EMPXAbstractAlbum))
+#else
if ((aMedia->ValueTObjectL<TMPXGeneralType>(KMPXMediaGeneralType) != EMPXItem) ||
(category != EMPXSong && category != EMPXPlaylist))
+#endif
{
User::Leave( KErrArgument );
}
@@ -466,8 +476,11 @@
{
MPX_FUNC("CMPXCollectionHelperImp::GetL");
MPX_DEBUG2("aFile %S", &aFile);
-
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ if (aItemCat != EMPXSong && aItemCat != EMPXPlaylist && aItemCat != EMPXAbstractAlbum)
+#else
if (aItemCat != EMPXSong && aItemCat != EMPXPlaylist)
+#endif
{
User::Leave(KErrArgument);
}
--- a/mmappcomponents/collectionhelper/src/mpxcollectionuihelperimp.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/collectionhelper/src/mpxcollectionuihelperimp.cpp Mon May 03 12:58:40 2010 +0300
@@ -82,6 +82,8 @@
iChunkNumber = 0;
iChunkSize = 0;
iArrayIndex = 0;
+ iRefCount = 1;
+
}
@@ -103,10 +105,34 @@
//
CMPXCollectionUiHelperImp* CMPXCollectionUiHelperImp::NewLC(const TUid& aModeId)
{
- CMPXCollectionUiHelperImp* self = new( ELeave ) CMPXCollectionUiHelperImp();
- CleanupStack::PushL( self );
- self->ConstructL(aModeId);
- return self;
+
+ CMPXCollectionUiHelperImp* self(NULL);
+
+ if ( aModeId == KMcModeDefault )
+ {
+ self = reinterpret_cast<CMPXCollectionUiHelperImp*>(Dll::Tls());
+ if ( !self )
+ {
+ self = new( ELeave ) CMPXCollectionUiHelperImp();
+ CleanupStack::PushL( self );
+ self->ConstructL(aModeId);
+ Dll::SetTls( self );
+ }
+ else
+ {
+ self->iRefCount++;
+ CleanupStack::PushL( self );
+ }
+
+ return self;
+ }
+ else
+ {
+ self = new( ELeave ) CMPXCollectionUiHelperImp();
+ CleanupStack::PushL( self );
+ self->ConstructL(aModeId);
+ return self;
+ }
}
// ---------------------------------------------------------------------------
@@ -1001,6 +1027,12 @@
// currently only used by incremental add
iTaskQueue->CancelRequests();
+ if( iTask == ETaskIncAddMedia || iTask == ETaskIncAppendMedia )
+ {
+ // complete task from scheduler
+ iTaskQueue->CompleteTask();
+ }
+
// clean up iInputMedia
if( iInputMedia )
{
@@ -1016,7 +1048,21 @@
//
void CMPXCollectionUiHelperImp::Close()
{
- delete this;
+
+ ASSERT( iRefCount > 0 );
+ if ( --iRefCount == 0 )
+ {
+ // last client released
+ CMPXCollectionUiHelperImp* s = reinterpret_cast<CMPXCollectionUiHelperImp*>( Dll::Tls() );
+ if ( s )
+ {
+ if ( s == this )
+ {
+ delete this;
+ Dll::SetTls( NULL );
+ }
+ }
+ }
}
// ---------------------------------------------------------------------------
@@ -1213,6 +1259,62 @@
ASSERT(0);
}
+// ---------------------------------------------------------------------------
+// From MMPXCollectionObserver
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionUiHelperImp::HandleCommandComplete(CMPXCommand* aCommandResult, TInt aError)
+ {
+ MPX_DEBUG3("CMPXCollectionUiHelperImp::HandleCommandComplete iTask=%d, aError=%d",
+ iTask, aError);
+
+ if( iTask == ETaskIncAddMedia && iInputMedia )
+ {
+ if ( iChunkNumber == 0 )
+ {
+ // save playlistId in input media & use it for subsequent appending operations
+ if( aCommandResult )
+ {
+ TMPXItemId playlistId =
+ aCommandResult->ValueTObjectL<TMPXItemId>(KMPXCommandColAddRtnId);
+
+ iInputMedia->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, playlistId);
+ }
+
+ iChunkNumber++; // move on to next chunk
+
+ CompleteTask(iTask, aError);
+ }
+ else if ( iChunkNumber == iTotalChunkNumber-1 ) // last chunk
+ {
+ CompleteTask(ETaskIncFinish, aError); // finish inc task
+ }
+ else // intermedia chunks
+ {
+ iChunkNumber++; // move on to next chunk
+
+ CompleteTask(iTask, aError);
+ }
+ }
+ else if( iTask == ETaskIncAppendMedia && iInputMedia )
+ {
+ // last chunk
+ // for the case that there is only one chunk (first & last chunk at the same
+ // time), Inc Add is not used
+ if( iChunkNumber == iTotalChunkNumber-1 )
+ {
+ // update input media as well
+ FillInPlaylistDetailsL(*iInputMedia);
+ CompleteTask(ETaskIncFinish, aError);
+ }
+ else // intermediate chunks, including first chunk
+ {
+ iChunkNumber++;
+ CompleteTask(iTask, aError);
+ }
+ }
+ }
+
// ----------------------------------------------------------------------------
// Handles completion of moving an object, just a proxy
// ----------------------------------------------------------------------------
@@ -1641,7 +1743,8 @@
void CMPXCollectionUiHelperImp::DoIncAddMediaL()
{
/***** include only aSize/iChunkSize number of songs *****/
-
+ MPX_DEBUG5("CMPXCollectionUiHelperImp::DoIncAddMediaL (%d, %d, %d, %d)",
+ iChunkNumber, iChunkSize, iTotalChunkNumber, iRemainder);
// copy media
CMPXMedia* media = CMPXMedia::CopyL(*iInputMedia);
CleanupStack::PushL(media);
@@ -1699,15 +1802,7 @@
CleanupStack::PopAndDestroy(playlistExtension);
- iMediator->AddItemL( media ); // this creates the new playlist
-
- // save playlistId in input media & use it for subsequent appending operations
- TMPXItemId playlistId = media->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
- iInputMedia->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, playlistId);
-
- iChunkNumber++; // move on to next chunk
-
- CompleteTask(iTask, KErrNone);
+ iMediator->AddItemAsyncL( media ); // this creates the new playlist
}
else if ( iChunkNumber == iTotalChunkNumber-1 ) // last chunk
{
@@ -1719,9 +1814,7 @@
TMPXItemId playlistId = iInputMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, playlistId);
- iMediator->AddItemL( media );
-
- CompleteTask(ETaskIncFinish, KErrNone); // finish inc task
+ iMediator->AddItemAsyncL( media );
}
else // intermedia chunks
{
@@ -1733,11 +1826,7 @@
TMPXItemId playlistId = iInputMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, playlistId);
- iMediator->AddItemL( media );
-
- iChunkNumber++; // move on to next chunk
-
- CompleteTask(iTask, KErrNone);
+ iMediator->AddItemAsyncL( media );
}
CleanupStack::PopAndDestroy(cArray);
@@ -1790,23 +1879,8 @@
// update media then append to playlist
FillInPlaylistDetailsL(*media);
- iMediator->AddItemL( media );
+ iMediator->AddItemAsyncL( media );
- // last chunk
- // for the case that there is only one chunk (first & last chunk at the same
- // time), Inc Add is not used
- if( iChunkNumber == iTotalChunkNumber-1 )
- {
- // update input media as well
- FillInPlaylistDetailsL(*iInputMedia);
- CompleteTask(ETaskIncFinish, KErrNone);
- }
- else // intermediate chunks, including first chunk
- {
- iChunkNumber++;
- CompleteTask(iTask, KErrNone);
- }
-
CleanupStack::PopAndDestroy(cArray);
CleanupStack::PopAndDestroy(media);
}
--- a/mmappcomponents/harvester/collectionmediator/bwinscw/mpxcollectionmediatorU.DEF Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/collectionmediator/bwinscw/mpxcollectionmediatorU.DEF Mon May 03 12:58:40 2010 +0300
@@ -15,4 +15,5 @@
?SetItemL@CMPXCollectionMediator@@QAEXAAPAVCMPXMedia@@@Z @ 14 NONAME ; void CMPXCollectionMediator::SetItemL(class CMPXMedia * &)
?SetItemL@CMPXCollectionMediator@@QAEXAAV?$TArray@PAVCMPXMedia@@@@AAVCMPXCollectionPath@@AAV?$RArray@H@@@Z @ 15 NONAME ; void CMPXCollectionMediator::SetItemL(class TArray<class CMPXMedia *> &, class CMPXCollectionPath &, class RArray<int> &)
?SetItemL@CMPXCollectionMediator@@QAEXAAVCMPXMediaArray@@@Z @ 16 NONAME ; void CMPXCollectionMediator::SetItemL(class CMPXMediaArray &)
+ ?AddItemAsyncL@CMPXCollectionMediator@@QAEXAAPAVCMPXMedia@@@Z @ 17 NONAME ; void CMPXCollectionMediator::AddItemAsyncL(class CMPXMedia * &)
--- a/mmappcomponents/harvester/collectionmediator/eabi/mpxcollectionmediatorU.DEF Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/collectionmediator/eabi/mpxcollectionmediatorU.DEF Mon May 03 12:58:40 2010 +0300
@@ -19,4 +19,5 @@
_ZTI22CMPXCollectionMediator @ 18 NONAME ; #<TI>#
_ZTV18CMPXMoveItemHelper @ 19 NONAME ; #<VT>#
_ZTV22CMPXCollectionMediator @ 20 NONAME ; #<VT>#
+ _ZN22CMPXCollectionMediator13AddItemAsyncLERP9CMPXMedia @ 21 NONAME
--- a/mmappcomponents/harvester/collectionmediator/src/mpxcollectionmediator.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/collectionmediator/src/mpxcollectionmediator.cpp Mon May 03 12:58:40 2010 +0300
@@ -226,6 +226,42 @@
}
// ---------------------------------------------------------------------------
+// CMPXCollectionMediator::AddItemAsyncL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPXCollectionMediator::AddItemAsyncL( CMPXMedia*& aMedia )
+ {
+ ASSERT( iColUtil );
+
+ // If this is a podcast, change the collection id
+ if( IsPodcastL( *aMedia ) )
+ {
+ UpdatePathToPodcastL( *aMedia );
+ }
+
+ // Add it to the collection
+ CMPXCommand* cmd = CMPXMedia::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionAdd );
+ cmd->SetCObjectValueL(KMPXCommandColAddMedia, aMedia); // copied
+
+ if (aMedia->IsSupported(KMPXMediaGeneralCollectionId))
+ {
+ TUid collectionId = aMedia->ValueTObjectL<TUid>(KMPXMediaGeneralCollectionId);
+ cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, collectionId.iUid);
+ }
+ else
+ {
+ User::Leave( KErrArgument );
+ }
+
+ iColUtil->CommandL(*cmd);
+
+ CleanupStack::PopAndDestroy(cmd);
+ }
+
+// ---------------------------------------------------------------------------
// CMPXCollectionMediator::AddItemL()
// ---------------------------------------------------------------------------
//
--- a/mmappcomponents/harvester/filehandler/group/mpxfilehandler.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/group/mpxfilehandler.mmp Mon May 03 12:58:40 2010 +0300
@@ -28,6 +28,11 @@
CAPABILITY CAP_GENERAL_DLL
VENDORID VID_DEFAULT
+MACRO __RAMDISK_PERF_ENABLE
+#define __RAMDISK_PERF_ENABLE
+
+MACRO ABSTRACTAUDIOALBUM_INCLUDED
+#define ABSTRACTAUDIOALBUM_INCLUDED
SOURCEPATH ../src
SOURCE mpxharvesterfilehandler.cpp
SOURCE mpxharvesterfilehandlerimp.cpp
--- a/mmappcomponents/harvester/filehandler/inc/mpxdbcommon.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/inc/mpxdbcommon.h Mon May 03 12:58:40 2010 +0300
@@ -23,7 +23,11 @@
// Harvester db increment 9 v1
// Please update the increment number for each increment
// Please update the version number for each schema change
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+_LIT( KHarvesterDBName, "harvesterdbv9_6.dat" );
+#else
_LIT( KHarvesterDBName, "harvesterdbv9_5.dat" );
+#endif
_LIT( KHarvesterDBPattern, "harvesterdbv*.dat" );
const TInt KDbMaxTableCreationSQLLength = 1024;
--- a/mmappcomponents/harvester/filehandler/inc/mpxharvesterdb.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/inc/mpxharvesterdb.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/harvester/filehandler/inc/mpxharvesterdbmanager.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/inc/mpxharvesterdbmanager.h Mon May 03 12:58:40 2010 +0300
@@ -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<CMPXHarvesterDB> 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
};
--- a/mmappcomponents/harvester/filehandler/inc/mpxharvesterfilehandlerimp.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/inc/mpxharvesterfilehandlerimp.h Mon May 03 12:58:40 2010 +0300
@@ -432,6 +432,7 @@
TUid iPodcastCollectionId;
TBool iDisablePodcasting;
+ TInt iCurUSBEvent;
// DRM
CDRMNotifier* iDrmNotifier;
--- a/mmappcomponents/harvester/filehandler/src/mpxdiskspacewatcher.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/src/mpxdiskspacewatcher.cpp Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/harvester/filehandler/src/mpxfoldermonitor.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/src/mpxfoldermonitor.cpp Mon May 03 12:58:40 2010 +0300
@@ -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;
--- a/mmappcomponents/harvester/filehandler/src/mpxharvesterdb.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/src/mpxharvesterdb.cpp Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/harvester/filehandler/src/mpxharvesterdbmanager.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/src/mpxharvesterdbmanager.cpp Mon May 03 12:58:40 2010 +0300
@@ -21,17 +21,43 @@
#include <pathinfo.h>
#include <driveinfo.h>
#endif //RD_MULTIPLE_DRIVE
+
+#ifdef __RAMDISK_PERF_ENABLE
+#include <centralrepository.h>
+#include <bautils.h>
+#include <mpxharvestercrkeys.h>
+#include "mpxdbcommon.h"
+#endif //__RAMDISK_PERF_ENABLE
+
#include <mpxlog.h>
#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; i<count; ++i )
- {
- CMPXHarvesterDB* db = (CMPXHarvesterDB*) iDatabases[i];
- if( db->GetDbDrive() == aDrive )
+ TInt count( iDatabases.Count() );
+ for( TInt i=0; i<count; ++i )
{
- db->OpenL();
- 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
--- a/mmappcomponents/harvester/filehandler/src/mpxharvesterfilehandlerimp.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/src/mpxharvesterfilehandlerimp.cpp Mon May 03 12:58:40 2010 +0300
@@ -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: da1mmcf#72.1.14.2.4.1.4.1.2.5.1 % << 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<TDriveNumber>(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;
--- a/mmappcomponents/harvester/metadataextractor/group/mpxmetadataextractor.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/metadataextractor/group/mpxmetadataextractor.mmp Mon May 03 12:58:40 2010 +0300
@@ -30,6 +30,8 @@
MACRO RD_MPX_TNM_INTEGRATION
#define RD_MPX_TNM_INTEGRATION
+MACRO ABSTRACTAUDIOALBUM_INCLUDED
+#define ABSTRACTAUDIOALBUM_INCLUDED
SOURCEPATH ../src
SOURCE mpxmetadataextractor.cpp
SOURCE mpxfileinfoutility.cpp
--- a/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Mon May 03 12:58:40 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: Extracts metadata from a file
-* Version : %version: da1mmcf#38.1.4.2.6.1.5 % << Don't touch! Updated by Synergy at check-out.
+* Version : %version: da1mmcf#38.1.4.2.6.1.5.3.1 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -51,6 +51,9 @@
const TInt KMPXMaxThumbnailRequest = 5;
#endif //RD_MPX_TNM_INTEGRATION
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+_LIT( KNonEmbeddedArtExt, ".alb" );
+#endif
//Helper functions
static void FindAndReplaceForbiddenChars(TDes& aString, TInt aLen)
{
@@ -337,14 +340,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,7 +455,14 @@
{
#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);
@@ -478,7 +495,10 @@
break;
}
}
- CleanupStack::PopAndDestroy(value);
+ if (fieldType != EMetaDataJpeg)
+ {
+ CleanupStack::PopAndDestroy( value );
+ }
}
MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL --->" );
@@ -717,7 +737,31 @@
// Get full file name.
const TDesC& path = aMedia->ValueText(KMPXMediaGeneralUri);
MPX_DEBUG2("CMPXMetadataExtractor::ExtractAlbumArtL Filename:%S ", &path );
-
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ TParsePtrC parse( path );
+ TPtrC ext( parse.Ext() );
+ if (ext.CompareF(KNonEmbeddedArtExt)== 0)
+ {
+ #ifdef RD_MPX_TNM_INTEGRATION
+
+ //check if can send TN request, If thumbnail creation is ongoing, wait til it is done
+ CheckBeforeSendRequest();
+
+ CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
+ path, KImageFileType );
+
+
+
+ iTNManager->CreateThumbnails( *source );
+
+ iOutstandingThumbnailRequest++;
+ CleanupStack::PopAndDestroy( source );
+
+ #endif
+ }
+ else
+ {
+#endif
// create wanted fields array
RArray<TMetaDataFieldId> wantedFields;
CleanupClosePushL( wantedFields );
@@ -746,7 +790,9 @@
// Reset the utility
iMetadataUtility->ResetL();
-
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+ }
+#endif
return err;
}
@@ -761,13 +807,20 @@
// 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);
@@ -793,26 +846,9 @@
MPX_FUNC("CMPXMetadataExtractor::AddMediaAlbumArtL()");
#ifdef RD_MPX_TNM_INTEGRATION
- // If thumbnail creation is ongoing, wait til it is done
- if ( iOutstandingThumbnailRequest > KMPXMaxThumbnailRequest )
- {
- MPX_DEBUG1("CMPXMetadataExtractor::AddMediaAlbumArtL(): Thumbnail creation ongoing!");
- iTNMBlockCount++;
- // Cancel timer.
- CancelTimeoutTimer();
- // Start timer in case there is no callback from ThumbNail Manager.
- iTimer->Start(
- KMPXTimeoutTimer,
- KMPXTimeoutTimer,
- TCallBack(TimeoutTimerCallback, this ));
-
- // Start wait loop until we get a callback from ThumbNail Manager.
- if ( !iTNSyncWait->IsStarted() )
- {
- iTNSyncWait->Start();
- }
- }
-
+ //check if can send TN request, If thumbnail creation is ongoing, wait til it is done
+ CheckBeforeSendRequest();
+
aMedia.SetTextValueL( KMPXMediaMusicAlbumArtFileName, aFile );
TBuf<256> mimeType;
@@ -826,3 +862,29 @@
#endif // RD_MPX_TNM_INTEGRATION
}
+
+void CMPXMetadataExtractor::CheckBeforeSendRequest()
+ {
+ MPX_FUNC("CMPXMetadataExtractor::CheckBeforeSendRequest()");
+#ifdef RD_MPX_TNM_INTEGRATION
+ // If thumbnail creation is ongoing, wait til it is done
+ if ( iOutstandingThumbnailRequest > KMPXMaxThumbnailRequest )
+ {
+ MPX_DEBUG1("CMPXMetadataExtractor::CheckBeforeSendRequest(): Thumbnail creation ongoing!");
+ iTNMBlockCount++;
+ // Cancel timer.
+ CancelTimeoutTimer();
+ // Start timer in case there is no callback from ThumbNail Manager.
+ iTimer->Start(
+ KMPXTimeoutTimer,
+ KMPXTimeoutTimer,
+ TCallBack(TimeoutTimerCallback, this ));
+
+ // Start wait loop until we get a callback from ThumbNail Manager.
+ if ( !iTNSyncWait->IsStarted() )
+ {
+ iTNSyncWait->Start();
+ }
+ }
+#endif // RD_MPX_TNM_INTEGRATION
+ }
--- a/mmappcomponents/harvester/server/inc/mpxusbeventhandler.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/server/inc/mpxusbeventhandler.h Mon May 03 12:58:40 2010 +0300
@@ -113,7 +113,6 @@
*/
MMPXSystemEventObserver& iObserver;
TInt iState;
- TBool iMTPActive;
RUsb iUsbMan;
TUsbDeviceState iDeviceState;
--- a/mmappcomponents/harvester/server/src/mpxusbeventhandler.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/harvester/server/src/mpxusbeventhandler.cpp Mon May 03 12:58:40 2010 +0300
@@ -41,7 +41,6 @@
CActive( EPriorityStandard ),
iWasMtp ( EFalse ),
iObserver( aObserver ),
- iMTPActive ( EFalse ),
iUsbManConnected( EFalse )
{
CActiveScheduler::Add( this );
@@ -175,7 +174,6 @@
{
MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP End");
iObserver.HandleSystemEventL( EUSBMTPEndEvent, removableDrive );
- iMTPActive = EFalse;
}
MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - USB Start");
#ifdef RD_MULTIPLE_DRIVE
@@ -199,20 +197,15 @@
if (value == EMtpPSStatusActive)
{
- if( !iMTPActive )
- {
- MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP Start");
- iObserver.HandleSystemEventL( EUSBMTPStartEvent, removableDrive );
- iState = KUsbPersonalityIdMTP;
- iMTPActive = ETrue;
- }
+ MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP Start");
+ iObserver.HandleSystemEventL( EUSBMTPStartEvent, removableDrive );
+ iState = KUsbPersonalityIdMTP;
}
else if( value != EMtpPSStatusReadyToSync )
{
MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP Not Active");
iObserver.HandleSystemEventL( EUSBMTPNotActiveEvent, removableDrive );
iState = KUsbPersonalityIdMTP;
- iMTPActive = EFalse;
}
}
// Make sure MTP and MS flags are OFF
@@ -231,7 +224,6 @@
{
MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP End");
iObserver.HandleSystemEventL( EUSBMTPEndEvent, removableDrive );
- iMTPActive = EFalse;
}
iState = KUsbWatcherSelectedPersonalityNone;
}
--- a/mmappcomponents/mediaplayersettingsengine/group/MPSettEng.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mediaplayersettingsengine/group/MPSettEng.mmp Mon May 03 12:58:40 2010 +0300
@@ -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,11 +15,11 @@
*
*/
-// Version : %version: 4.1.3 %
+// Version : %version: 4.1.4 %
+
#include <platform_paths.hrh>
-
TARGET mpsettengine.dll
TARGETTYPE dll
UID 0x1000006C 0x101F853D
@@ -36,13 +36,13 @@
LIBRARY ecom.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
--- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpaccesssingleton.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpaccesssingleton.h Mon May 03 12:58:40 2010 +0300
@@ -19,11 +19,6 @@
#ifndef CMMMTPDPACCESSSINGLETON_H
#define CMMMTPDPACCESSSINGLETON_H
-/**
-* Implements the MM MTP Data Priovider access singletons reference manager.
-*/
-
-class RFs;
class CMmMtpDpMetadataAccessWrapper;
class MMTPDataProviderFramework;
@@ -36,8 +31,7 @@
* @param aRFs RFs reference
* @param aFramework framework reference
*/
- IMPORT_C static void CreateL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework );
+ IMPORT_C static void CreateL( MMTPDataProviderFramework& aFramework );
/**
* release singleton instance
@@ -68,14 +62,12 @@
/*
* 2-phase construction
*/
- static CMmMtpDpAccessSingleton* NewL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework );
+ static CMmMtpDpAccessSingleton* NewL( MMTPDataProviderFramework& aFramework );
/*
* 2-phase construction
*/
- void ConstructL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework );
+ void ConstructL( MMTPDataProviderFramework& aFramework );
/*
* destruction
*/
@@ -83,6 +75,7 @@
private:
CMmMtpDpMetadataAccessWrapper* iWrapper;
+
};
#endif // CMMMTPDPACCESSSINGLETON_H
--- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h Mon May 03 12:58:40 2010 +0300
@@ -19,10 +19,8 @@
#ifndef CMMMTPDPMETADATAACCESSWRAPPER_H
#define CMMMTPDPMETADATAACCESSWRAPPER_H
-#include <mtp/cmtpobjectmetadata.h>
-#include <mtp/mtpprotocolconstants.h>
#include <mpxmediageneraldefs.h>
-#include <mtp/mmtpdataproviderframework.h>
+#include <badesca.h>
// forward declacration
class CMmMtpDpMetadataMpxAccess;
@@ -30,16 +28,15 @@
class RFs;
class MMTPType;
-class CMTPTypeObjectPropList;
class CMPXMediaArray;
class CMPXMedia;
class MMTPDataProviderFramework;
+class CMTPObjectMetaData;
class CMmMtpDpMetadataAccessWrapper : public CBase
{
public:
- static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework );
+ static CMmMtpDpMetadataAccessWrapper* NewL( MMTPDataProviderFramework& aFramework );
/**
* Destructor
@@ -48,42 +45,45 @@
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 CMTPObjectMetaData& aObject );
/**
- * Set playlist to DB
- * @param aPlaylistFileName, full file name of playlist file
+ * Set abstract media to DB
+ * @param aObject,
* @param aRefFileArray, a array to store the full file name of media files
* @return void
*/
- IMPORT_C void SetPlaylistL( const TDesC& aPlaylistFileName,
+ IMPORT_C void SetReferenceL( const CMTPObjectMetaData& aObject,
CDesCArray& aRefFileArray );
/**
@@ -114,18 +114,17 @@
/**
* Renames the file part of a record in the collection database
- * @param aFile, old full file name of Media file
+ * @param aOldObject, object need to be renamed
* @param aNewFileName, new file name need update
* @return void
*/
- IMPORT_C void RenameObjectL( const TDesC& aOldFileName, const TDesC& aNewFileName );
+ IMPORT_C void RenameObjectL( const CMTPObjectMetaData& aOldObject, const TDesC& aNewFileName );
/**
* Deletes metadata information associated with the object
- * @param aFullFileName, full file name of Media file
- * @param aFormatCode, format code
+ * @param aObject, the object need to be deleted
*/
- void DeleteObjectL( const TDesC& aFullFileName, const TUint aFormatCode );
+ void DeleteObjectL( const CMTPObjectMetaData& aObject );
/**
* Set current drive info
@@ -139,9 +138,9 @@
* @param aWidth, the width of an object in pixels to set
* @parem aHeight, the height of an object in pixels to set
*/
- void SetImageObjPropL( const TDesC& aFullFileName,
- const TUint32 aWidth,
- const TUint32 aHeight );
+ void SetImageObjPropL( const CMTPObjectMetaData& aObject,
+ const TUint32 aWidth,
+ const TUint32 aHeight );
/*
* get image specific properties specific to videos
@@ -149,10 +148,10 @@
* @param aWidth, the width of an object in pixels to get
* @parem aHeight, the height of an object in pixels to get
*/
- void GetImageObjPropL( const TDesC& aFullFileName,
- TUint32& aWidth,
- TUint32& aHeight );
-
+ void GetImageObjPropL( const CMTPObjectMetaData& aObject,
+ TUint32& aWidth,
+ TUint32& aHeight );
+
/**
* Get Modified object from DB
* @param aStorageRoot, the root path of storage
@@ -160,16 +159,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,59 +178,60 @@
* 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 );
-
+
+ TMPXGeneralCategory Category( const CMTPObjectMetaData& aObject );
+
private:
- CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework );
+ CMmMtpDpMetadataAccessWrapper( MMTPDataProviderFramework& aFramework );
void ConstructL();
- TMPXGeneralCategory Category( const TUint aFormatCode );
-
+ TMPXGeneralCategory ContainerCategory( const TDesC& aFullFileName );
+
/**
* Remove all dummy file of which format is "pla", and leave the "m3u"
*/
void RemoveDummyFiles();
private:
- // Data
- RFs& iRfs;
CMmMtpDpMetadataMpxAccess* iMmMtpDpMetadataMpxAccess;
CMmMtpDpMetadataVideoAccess* iMmMtpDpMetadataVideoAccess;
TBool iOpenSession;
-
- MMTPDataProviderFramework& iFramework;
-
- CDesCArray* iPlaylistArray;
-
+
+ MMTPDataProviderFramework& iFramework;
+ RFs& iFs; // should not remove this member data!!!
+
+ CDesCArray* iAbstractMediaArray;
+
};
#endif // CMMMTPDPMETADATAACCESSWRAPPER_H
--- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadatampxaccess.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadatampxaccess.h Mon May 03 12:58:40 2010 +0300
@@ -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,170 +39,170 @@
} 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 );
/**
- * 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* 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 );
-
- /**
- * 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 );
-
- void GetObjectMetadataValueL( const TUint16 aPropCode,
- MMTPType& aNewData,
- const CMTPObjectMetaData& aObjectMetaData );
+ * 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 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 );
+ * Set abstract media to DB
+ * @param aRefOwnerName, 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 SetReferenceL( const TDesC& aRefOwnerName,
+ CDesCArray& aRefFileArray,
+ TMPXGeneralCategory aCategory );
+
+ void GetObjectMetadataValueL( const TUint16 aPropCode,
+ MMTPType& aNewData,
+ const TDesC& aFullFileName,
+ TMPXGeneralCategory aCategory );
/**
- * 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 aObjectMetaData, owner of the property which should be
+ * updated into database
+ */
void SetObjectMetadataValueL( const TUint16 aPropCode,
- const MMTPType& aNewData,
- const TDesC& aSuid );
+ const MMTPType& aNewData,
+ const TDesC& aFullFileName,
+ TMPXGeneralCategory aCategory );
- 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 aCategory, the category of object
+ */
+ void RenameObjectL( const TDesC& aOldFileName,
+ const TDesC& aNewFileName,
+ TMPXGeneralCategory aCategory );
/**
- * 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 );
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();
private:
- // File server to allow file access
RFs& iRfs;
TBuf<KStorageRootMaxLength> iStoreRoot;
MMPXCollectionHelper* iCollectionHelper;
-
- MMTPDataProviderFramework& iFramework;
#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
CMmMtpDpPerfLog* iPerfLog;
--- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.h Mon May 03 12:58:40 2010 +0300
@@ -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<const TDesC> aFmt, ... );
+public:
+
+ inline static CMmMtpDpPerfLog* NewL( const TDesC& aTitle );
+ inline ~CMmMtpDpPerfLog();
+
+ inline void Write( const TDesC& aText );
+ inline void WriteFormat( TRefByValue<const TDesC> 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<TUint32> iStartTick;
+ CArrayFixFlat<TUint64> iTotalTime;
+ CArrayFixFlat<TUint32> iTotalUsage;
- HBufC16* iTitle;
- CDesC16ArrayFlat iDescription;
- CArrayFixFlat<TUint32> iStartTick;
- CArrayFixFlat<TUint64> iTotalTime;
- CArrayFixFlat<TUint32> iTotalUsage;
-
- TInt iNTickPeriod;
- TInt iLastIndex;
-
+ TInt iNTickPeriod;
+ TInt iLastIndex;
+
};
#include "cmmmtpdpperflog.inl"
--- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.inl Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpperflog.inl Mon May 03 12:58:40 2010 +0300
@@ -71,10 +71,13 @@
VA_LIST list;
VA_START( list, aFmt );
- TBuf<KMtpLogBufferSize> buf;
-
- buf.AppendFormatList( aFmt, list, &iOverflowHandler );
- Write( buf );
+ HBufC* buf = HBufC::New( KMtpLogBufferSize );
+ if ( buf )
+ {
+ buf->Des().AppendFormatList( aFmt, list, &iOverflowHandler );
+ Write( *buf );
+ delete buf;
+ }
}
void CMmMtpDpPerfLog::Start( const TDesC& aDescription )
@@ -187,9 +190,11 @@
if (totalTimeValue <= 0xFFFFFFFF)
{
+ //Define the ptr on stack to avoid compiling warnning for wiscw udeb
+ TPtrC ptr( iDescription[index] );
WriteFormat( _L( "<PERFLOG>%S-%S, usage = %u, last time = %u.%S ms, total time = %u.%S ms, average time = %u.%S ms</PERFLOG>" ),
iTitle,
- &iDescription[index],
+ &ptr,
iTotalUsage[index],
lastTimeValue,
&lastTimeDecimal,
@@ -200,9 +205,11 @@
}
else
{
+ //Define the ptr on stack to avoid compiling warnning for wiscw udeb
+ TPtrC ptr( iDescription[index] );
WriteFormat( _L( "<PERFLOG>%S-%S, usage = %u, last time = %u.%S ms, total time = %u%u.%S ms, average time = %u.%S ms</PERFLOG>" ),
iTitle,
- &iDescription[index],
+ &ptr,
iTotalUsage[index],
lastTimeValue,
&lastTimeDecimal,
--- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdp_variant.hrh Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdp_variant.hrh Mon May 03 12:58:40 2010 +0300
@@ -25,4 +25,7 @@
// flag to enable replace the exist object
#undef MMMTPDP_REPLACE_EXIST_FILE
+// flag to enable support for non embedded album art, should be ON by default
+#define MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+
#endif // MMMTPDP_VARIANT_HRH
--- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdpconfig.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdpconfig.h Mon May 03 12:58:40 2010 +0300
@@ -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<TUint>* 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<TUint>* 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<TUint>* 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
--- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdpfiledefs.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdpfiledefs.h Mon May 03 12:58:40 2010 +0300
@@ -29,6 +29,7 @@
//--------------------------------------------------------------------------------------------
_LIT( KTxtExtension3GP, ".3gp" );
+_LIT( KTxtExtension3G2, ".3g2" );
_LIT( KTxtExtensionAAC, ".aac" );
_LIT( KTxtExtensionASF, ".asf" );
_LIT( KTxtExtensionM4A, ".m4a" );
@@ -41,6 +42,7 @@
_LIT( KTxtExtensionO4V, ".o4v" );
_LIT( KTxtExtensionODF, ".odf" );
+_LIT( KTxtExtensionALB, ".alb" );
_LIT( KTxtExtensionM3U, ".m3u" );
_LIT( KTxtExtensionPLA, ".pla" );
_LIT( KTxtExtensionVIR, ".vir" ); // virtual playlist from MPX
@@ -49,6 +51,7 @@
_LIT(KFormatExtensionWMA, "0xb901:wma");
_LIT(KFormatExtensionMP4, "0xb982:mp4");
_LIT(KFormatExtension3GP, "0xb984:3gp");
+_LIT(KFormatExtension3G2, "0xb984:3g2");
_LIT(KFormatExtensionAAC, "0xb903:aac");
_LIT(KFormatExtensionWAV, "0x3008:wav");
_LIT(KFormatExtensionWMV, "0xb981:wmv");
@@ -64,6 +67,9 @@
_LIT(KFormatExtensionO4A, "0xB984:o4a");
_LIT(KFormatExtensionO4V, "0xB984:o4v");
+//Abstract Album
+_LIT(KFormatExtensionALB, "0xBA03:alb");
+
//Playlists
_LIT(KFormatExtensionM3U, "0xba11:m3u");
_LIT(KFormatExtensionPLA, "0xBA05:pla");
@@ -93,7 +99,8 @@
{
EMTPSubFormatCodeUnknown,
EMTPSubFormatCodeAudio,
- EMTPSubFormatCodeVideo
+ EMTPSubFormatCodeVideo,
+ EMTPSubFormatCodeUndefine
};
#endif // MMMTPDPFILEDEFS_H
--- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h Mon May 03 12:58:40 2010 +0300
@@ -24,8 +24,7 @@
#include "mmmtpdpfiledefs.h"
// forward declacration
-class CMTPObjectMetaData;
-class MMTPDataProviderFramework;
+class RFs;
class MmMtpDpUtility
{
@@ -45,20 +44,11 @@
static TBool HasMetadata( 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
+ * Utility function to decide if there is any reference
+ * @param aObjFormatCode, object format code
+ * @return TBool for decide if there are some references
*/
- IMPORT_C static TBool IsVideoL( const TDesC& aFullFileName );
-
- /**
- * Utility function to decide if the file is video.
- * For internal use, this is fast version by querying framework DB
- * @param aFullFileName, the full file name
- * @param aFramework, the mtp framework instance pointer, default is null
- * @return TBool for decide if the file is video
- */
- static TBool IsVideoL( const TDesC& aFullFileName, const MMTPDataProviderFramework& aFramework );
+ static TBool HasReference( TUint16 aObjFormatCode );
/**
* Check the filename length to see if it exceeds Symbian 256 limit.
@@ -83,7 +73,7 @@
* @param aFullFileName, fine name
* @return TTime for specified file
*/
- static TTime GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName );
+ static void GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName, TDes& aDateModified );
/**
* Check if file is read-only, if file doesn't exist, leave
@@ -145,7 +135,7 @@
* @param aSubFormatCode, output the sub format code
* @return if success, return KErrNone, otherwise, error code
*/
- static TInt SubFormatCodeFromMime( const TDesC8& aMimeType, TMmMtpSubFormatCode& aSubFormatCode );
+ static TMmMtpSubFormatCode SubFormatCodeFromMime( const TDesC8& aMimeType );
/**
* Get DRM status
--- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpvideodbdefs.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpvideodbdefs.h Mon May 03 12:58:40 2010 +0300
@@ -53,13 +53,12 @@
_LIT( KMtpVideoEncodingProfile, "EncodingProfile" );
_LIT( KMtpVideoParentalRating, "ParentalRating" );
-_LIT( KMtpVideoUseCount , "UseCount" );
_LIT( KMtpVideoDRM, "DRM" );
_LIT( KMtpVideoDeleted, "Deleted" );
// field type
-_LIT( KMtpVideoLocationType, " CHAR (255) NOT NULL" );
+_LIT( KMtpVideoLocationType, " LONG VARCHAR NOT NULL" );
_LIT( KMtpVideoNameType, " LONG VARCHAR" );
_LIT( KMtpVideoArtistType, " LONG VARCHAR" );
_LIT( KMtpVideoTrackType, " UNSIGNED SMALLINT" );
@@ -86,7 +85,6 @@
_LIT( KMtpVideoEncodingProfileType, " LONG VARCHAR" );
_LIT( KMtpVideoParentalRatingType, " LONG VARCHAR" );
-_LIT( KMtpVideoUseCountType, " UNSIGNED INTEGER" );
_LIT( KMtpVideoDRMType, " UNSIGNED SMALLINT" );
_LIT( KMtpVideoDeletedType, " BIT" );
--- a/mmappcomponents/mmmtpdataprovider/inc/tobjectdescription.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/inc/tobjectdescription.h Mon May 03 12:58:40 2010 +0300
@@ -23,6 +23,11 @@
// vendor extended property code
const TUint16 EMTPExtObjectPropCodeOmaDrmStatus = 0xDB01;
+const TUint32 KMTPMaxDescriptionLen = 0x00000100; // 256
+const TInt KMtpMaxStringLength = 255;
+const TInt KMtpMaxDateTimeStringLength = 15;
+_LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" );
+
struct TObjectDescription
{
@@ -32,7 +37,8 @@
enum TGroupCodeType
{
- EGroupCodeGeneral = 0x00000001,
+ EGroupCodeGeneral = 0x00000001,
+ EGroupCodeSample = 0x00000100,
EGroupCodeMediaDB = 0x00FF0000,
EGroupCodeNotDefined = 0xFFFFFFFF // TODO: need to reconsider
};
@@ -40,59 +46,70 @@
static const TGroupCodeType KSupportedGroupCode[] =
{
EGroupCodeGeneral,
+ EGroupCodeSample,
EGroupCodeMediaDB
};
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
+ { EMTPObjectPropCodeName, EGroupCodeGeneral }, // only for winlogo
+ { EMTPObjectPropCodeDateCreated, EGroupCodeGeneral },
+ { EMTPObjectPropCodeDateModified, EGroupCodeGeneral },
- // Second group, additional for all
- { EMTPObjectPropCodeName, EGroupCodeMediaDB },
- { EMTPObjectPropCodeDateAdded, EGroupCodeMediaDB },
+ // The first group, mandatory for video
+ { EMTPObjectPropCodeWidth, EGroupCodeGeneral }, // only for winlogo
+ { EMTPObjectPropCodeHeight, EGroupCodeGeneral }, // only for winlogo
- // Second group, mandatory for audio
- { EMTPObjectPropCodeArtist, EGroupCodeMediaDB },
- { EMTPObjectPropCodeTrack, EGroupCodeMediaDB },
- { EMTPObjectPropCodeGenre, EGroupCodeMediaDB },
- { EMTPObjectPropCodeAlbumName, EGroupCodeMediaDB },
- { EMTPObjectPropCodeSampleRate, EGroupCodeMediaDB },
+ // The second group, for non-embedded album art
+ { EMTPObjectPropCodeRepresentativeSampleFormat, EGroupCodeGeneral }, // changed for winlogo
+ { EMTPObjectPropCodeRepresentativeSampleSize, EGroupCodeGeneral }, // changed for winlogo
+ { EMTPObjectPropCodeRepresentativeSampleHeight, EGroupCodeGeneral }, // changed for winlogo
+ { EMTPObjectPropCodeRepresentativeSampleWidth, EGroupCodeGeneral }, // changed for winlogo
+ { EMTPObjectPropCodeRepresentativeSampleData, EGroupCodeGeneral }, // changed for winlogo
+
+ // The third group, additional for all
+ { EMTPObjectPropCodeDateAdded, EGroupCodeMediaDB },
+
+ // The third 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 },
+ { EMTPObjectPropCodeAlbumArtist, EGroupCodeMediaDB },
- // Second group, mandatory for video
- { EMTPObjectPropCodeWidth, EGroupCodeMediaDB },
- { EMTPObjectPropCodeHeight, EGroupCodeMediaDB },
- { EMTPObjectPropCodeUseCount, EGroupCodeMediaDB },
- { EMTPObjectPropCodeScanType, EGroupCodeMediaDB },
+ // The third group, mandatory for video
+ { 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 third group, additional for video
+ { EMTPObjectPropCodeParentalRating, EGroupCodeMediaDB },
+ { EMTPObjectPropCodeDRMStatus, EGroupCodeMediaDB },
+ { EMTPExtObjectPropCodeOmaDrmStatus, EGroupCodeMediaDB }
};
#endif // TOBJECTDESCRIPTION_H
+
Binary file mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpstub.pkg has changed
Binary file mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpupdate.pkg has changed
Binary file mmappcomponents/mmmtpdataprovider/install/rom/mmmtpdpupdatedebug.pkg has changed
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/data/abstractmediamtpdataprovider_config.rss Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/data/abstractmediamtpdataprovider_config.rss Mon May 03 12:58:40 2010 +0300
@@ -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 <mtp/mtpdataproviderconfig.rh>
-#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;
- }
-
-
-
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/group/abstractmediamtpdataprovider.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/group/abstractmediamtpdataprovider.mmp Mon May 03 12:58:40 2010 +0300
@@ -40,19 +40,15 @@
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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataprovider_config.rh Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderconst.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderconst.h Mon May 03 12:58:40 2010 +0300
@@ -11,15 +11,42 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
-
#ifndef ABSTRACTMEDIAMTPDATAPROVIDERCONST_H
#define ABSTRACTMEDIAMTPDATAPROVIDERCONST_H
#include <mtp/mtpprotocolconstants.h>
+#include "mmmtpdp_variant.hrh"
+
+enum TMmMtpSampleSizeRange
+ {
+ EMTPMinSampleSize = 0x00000001, // 1 bytes
+ EMTPMaxSampleSize = 0x00010000, // 64 kb
+ EMTPStepSampleSize = 0x00000001 // 1 byte
+ };
+
+enum TMmMtpSampleHeightRange
+ {
+ EMTPSampleMinHeight = 0x00000001, // 1 pixel
+ EMTPSampleMaxHeight = 0x00000168, // 360 pixel
+ EMTPSampleStepHeight = 0x00000001 // 1 pixel
+ };
+
+enum TMmMtpSampleWidthRange
+ {
+ EMTPSampleMinWidth = 0x00000001, // 1 pixel
+ EMTPSampleMaxWidth = 0x00000168, // 360 pixel
+ EMTPSampleStepWidth = 0x00000001 // 1 pixel
+ };
+
+// Supported sample format
+static const TUint16 TMmMtpSupportedSampleFormat[] =
+ {
+ EMTPFormatCodeEXIFJPEG
+ };
const TUint16 EMTPExtOpCodeAbstractMediaPreference = 0x9203;
@@ -28,6 +55,9 @@
*/
static const TUint16 KAbstractMediaMtpDataProviderSupportedFormats[] =
{
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ EMTPFormatCodeAbstractAudioAlbum,
+#endif
EMTPFormatCodeM3UPlaylist,
EMTPFormatCodeAbstractAudioVideoPlaylist
};
@@ -55,39 +85,25 @@
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 properties for ALB
+static const TUint16 KMmMtpDpSupportedPropMandatoryALB[] =
{
- // Mandatory for all objects
- EMTPObjectPropCodeStorageID,
- EMTPObjectPropCodeObjectFormat,
- EMTPObjectPropCodeProtectionStatus,
- EMTPObjectPropCodeObjectSize,
- EMTPObjectPropCodeObjectFileName,
- EMTPObjectPropCodeParentObject,
- EMTPObjectPropCodePersistentUniqueObjectIdentifier,
- EMTPObjectPropCodeName,
- EMTPObjectPropCodeNonConsumable,
-
- // additional for all
- EMTPObjectPropCodeDateAdded,
- EMTPObjectPropCodeDateCreated,
- EMTPObjectPropCodeDateModified,
+ EMTPObjectPropCodeRepresentativeSampleFormat,
+ EMTPObjectPropCodeRepresentativeSampleSize,
+ EMTPObjectPropCodeRepresentativeSampleHeight,
+ EMTPObjectPropCodeRepresentativeSampleWidth,
+ EMTPObjectPropCodeRepresentativeSampleData,
+ EMTPObjectPropCodeAlbumArtist
};
-#endif
-
#endif // ABSTRACTMEDIAMTPDATAPROVIDERCONST_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderprocessor.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/abstractmediamtpdataproviderprocessor.h Mon May 03 12:58:40 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -22,7 +22,6 @@
// class forward
class MMTPConnection;
class TMTPTypeRequest;
-class MMTPDataProviderFramework;
class MMmRequestProcessor;
class MMmMtpDpConfig;
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovider.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovider.h Mon May 03 12:58:40 2010 +0300
@@ -24,7 +24,7 @@
#include "abstractmediamtpdataproviderprocessor.h"
#include "mmmtpenumerationcallback.h"
#include "mmmtpdpconfig.h"
-
+#include "mmmtpdp_variant.hrh"
// Forward declaration
class MMmRequestProcessor;
@@ -66,10 +66,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 +108,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 );
@@ -168,6 +179,8 @@
void GetSupportedPropertiesL();
+ void GetAllSupportedPropL();
+
private:
// data
RPointerArray<MMmRequestProcessor> iActiveProcessors;
@@ -175,13 +188,21 @@
RArray<TUint32> iPendingEnumerations;
TInt iActiveProcessor;
+ TBool iActiveProcessorRemoved;
CAbstractMediaMtpDataProviderRenameObject *iRenameObject;
TBool iIsSessionOpen;
RArray<TUint> iSupportedFormat;
- RArray<TUint> iSupportedProperties;
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ RArray<TUint> iSupportedPropAbstractAlbum;
+#endif
+ RArray<TUint> iSupportedPropPlaylist;
+ RArray<TUint> iSupportedPropAll;
+
+ CPropertySettingUtility* iPropSettingUtility;
+ CDescriptionUtility* iDescriptionUtility;
};
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderabstractmediapreference.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderabstractmediapreference.h Mon May 03 12:58:40 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidercopyobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidercopyobject.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderdescriptionutility.h Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* 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:
+ /**
+ * Construct property description of SampleFormat.
+ * @return Property description dataset of sample format.
+ */
+ CMTPTypeObjectPropDesc* NewRepresentativeSampleFormatL();
+
+ /**
+ * Construct property description of SampleSize.
+ * @return Property description dataset of sample size.
+ */
+ CMTPTypeObjectPropDesc* NewRepresentativeSampleSizeL();
+
+ /**
+ * Construct property description of SampleHeight.
+ * @return Property description dataset of sample height.
+ */
+ CMTPTypeObjectPropDesc* NewRepresentativeSampleHeightL();
+
+ /**
+ * Construct property description of SampleWidth.
+ * @return Property description dataset of sample width.
+ */
+ CMTPTypeObjectPropDesc* NewRepresentativeSampleWidthL();
+
+ /**
+ * Construct property description of SampleData.
+ * @return Property description dataset of sample data.
+ */
+ CMTPTypeObjectPropDesc* NewRepresentativeSampleDataL();
+ };
+
+#endif // CABSTRACTMEDIAMTPDATAPROVIDERDESCRIPTIONUTILITY_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderenumerator.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderenumerator.h Mon May 03 12:58:40 2010 +0300
@@ -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;
@@ -83,6 +74,14 @@
TInt RunError( TInt aError );
private:
+
+ enum TEnumState
+ {
+ EEnumPlaylist,
+ EEnumAbstractAlbum,
+ EEnumCount
+ };
+
/**
* Standard C++ Constructor
* @param aFramework Reference to MMTPDataProviderFramework
@@ -99,7 +98,7 @@
void SignalCompleteL( MMTPEnumerationCallback& aCallback,
TInt aError = KErrNone );
- void ScanStorageL( TUint32 aStorageId );
+ void InitStorageL( );
/**
* Scan next storage
@@ -143,6 +142,7 @@
CMPXMediaArray* iAbstractMedias;
TInt iCount;
TInt iCurrentIndex;
+ TInt iEnumState;
#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
CMmMtpDpPerfLog* iPerfLog;
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetformatcapabilities.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetinterdependentpropdesc.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidergetobjectpropdesc.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidermoveobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidermoveobject.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataproviderpropertysettingutility.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersendobject.h Fri Apr 16 15:28:14 2010 +0300
+++ /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_*/
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectproplist.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
-
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/inc/cabstractmediamtpdataprovidersetobjectreferences.h Fri Apr 16 15:28:14 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +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: Set object references operation.
-*
-*/
-
-
-#ifndef CABSTRACTMEDIAMTPDATAPROVIDERSETOBJECTREFERENCES_H
-#define CABSTRACTMEDIAMTPDATAPROVIDERSETOBJECTREFERENCES_H
-
-#include "csetobjectreferences.h"
-
-/**
-* Defines abstract media data provider SetObjectReferences request processor
-*/
-class CAbstractMediaMtpDataProviderSetObjectReferences : public CSetObjectReferences
- {
-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
- */
- static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig );
-
- /**
- * Destructor
- */
- ~CAbstractMediaMtpDataProviderSetObjectReferences();
-
-private:
- /**
- * Standard c++ constructor
- * @param aFramework The data provider framework
- * @param aConnection The connection from which the request comes
- * @param aWrapper medadata access interface
- */
- CAbstractMediaMtpDataProviderSetObjectReferences( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig );
-
- /**
- * two-phase construction
- */
- void ConstructL();
-
-protected:
- // from CSetObjectPropValue
- /**
- * set references to DB
- * @param aWrapper medadata access interface
- * @param aObjectFormat the format of the file
- * @param aSrcFileName file name, from
- * @param aRefFileArray the array of file names, to
- */
- void DoSetObjectReferencesL( CMmMtpDpMetadataAccessWrapper& aWrapper,
- TUint16 aObjectFormat,
- const TDesC& aSrcFileName,
- CDesCArray& aRefFileArray );
-
- };
-
-#endif // CABSTRACTMEDIAMTPDATAPROVIDERSETOBJECTREFERENCES_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataprovidercontrollerimp.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataprovidercontrollerimp.cpp Mon May 03 12:58:40 2010 +0300
@@ -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;
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataproviderprocessor.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/abstractmediamtpdataproviderprocessor.cpp Mon May 03 12:58:40 2010 +0300
@@ -28,49 +28,48 @@
#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 "csetobjectreferences.h"
#include "cdeleteobject.h"
#include "cabstractmediamtpdataprovidercopyobject.h"
#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, CSetObjectReferences::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
};
// -----------------------------------------------------------------------------
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovider.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovider.cpp Mon May 03 12:58:40 2010 +0300
@@ -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
@@ -74,8 +76,13 @@
iActiveProcessor( -1 ),
iRenameObject( NULL ),
iSupportedFormat( KAbstractMediaMtpDpArrayGranularity ),
- iSupportedProperties( KAbstractMediaMtpDpArrayGranularity )
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ iSupportedPropAbstractAlbum( KAbstractMediaMtpDpArrayGranularity ),
+#endif
+ iSupportedPropPlaylist( KAbstractMediaMtpDpArrayGranularity ),
+ iSupportedPropAll( KAbstractMediaMtpDpArrayGranularity )
{
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -87,6 +94,9 @@
{
PRINT( _L( "MM MTP => CAbstractMediaMtpDataProvider::~CAbstractMediaMtpDataProvider" ) );
+ delete iPropSettingUtility;
+ delete iDescriptionUtility;
+
iPendingEnumerations.Close();
TInt count = iActiveProcessors.Count();
for ( TInt i = 0; i < count; i++ )
@@ -102,7 +112,11 @@
delete iRenameObject;
iSupportedFormat.Close();
- iSupportedProperties.Close();
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ iSupportedPropAbstractAlbum.Close();
+#endif
+ iSupportedPropPlaylist.Close();
+ iSupportedPropAll.Close();
PRINT( _L( "MM MTP => CAbstractMediaMtpDataProvider::~CAbstractMediaMtpDataProvider" ) );
}
@@ -123,10 +137,14 @@
iAbstractMediaEnumerator = CAbstractMediaMtpDataProviderEnumerator::NewL( Framework(), *this );
- CMmMtpDpAccessSingleton::CreateL( Framework().Fs(), Framework() );
+ CMmMtpDpAccessSingleton::CreateL( Framework() );
GetSupportedFormatL();
GetSupportedPropertiesL();
+ GetAllSupportedPropL();
+
+ iPropSettingUtility = CAbstractMediaMtpDataProviderPropertySettingUtility::NewL();
+ iDescriptionUtility = CAbstractMediaMtpDataProviderDescriptionUtility::NewL();
PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProvider::ConstructL" ) );
}
@@ -158,13 +176,11 @@
{
case EMTPSessionClosed:
PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProvider::ProcessNotificationL EMTPSessionClosed event recvd" ) );
-
SessionClosedL( *reinterpret_cast<const TMTPNotificationParamsSessionChange*> ( aParams ) );
break;
case EMTPSessionOpened:
PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProvider::ProcessNotificationL EMTPSessionOpened event recvd" ) );
-
SessionOpenedL( *reinterpret_cast<const TMTPNotificationParamsSessionChange*> ( aParams ) );
break;
@@ -201,18 +217,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,26 +247,25 @@
iIsSessionOpen = EFalse;
TInt count = iActiveProcessors.Count();
PRINT1( _L( "MM MTP => CAbstractMediaMtpDataProvider::SessionClosedL, total processor count = %d" ), count );
- for( TInt i = 0; i < count; i++ )
+ while ( count-- )
{
- MMmRequestProcessor* processor = iActiveProcessors[i];
+ MMmRequestProcessor* processor = iActiveProcessors[count];
- // replaced for the Request() is invalid sometimes
- // TUint32 sessionId( processor->Request().Uint32( TMTPTypeRequest::ERequestSessionID ) );
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
+ iActiveProcessors.Remove( count );
+ if ( count == iActiveProcessor )
+ {
+ iActiveProcessorRemoved = ETrue;
+ iActiveProcessor = -1; // update iActiveProcessor
+ }
+ else
{
processor->Release();
}
@@ -354,11 +369,11 @@
case EObjectProperties:
{
- TInt count = iSupportedProperties.Count();
+ TInt count = iSupportedPropAll.Count();
for ( TInt i = 0; i < count; i++ )
{
- aArray.Append( iSupportedProperties[i] );
+ aArray.Append( iSupportedPropAll[i] );
}
PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProvider::Supported properties count = %d" ), aArray.Count() );
}
@@ -386,7 +401,9 @@
{
if( aCategory == EFormatExtensionSets )
{
- //EMTPFormatCodeM3U,
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ aStrings.AppendL(KFormatExtensionALB);
+#endif
aStrings.AppendL(KFormatExtensionM3U);
aStrings.AppendL(KFormatExtensionPLA);
aStrings.AppendL(KFormatExtensionVIR);
@@ -472,7 +489,7 @@
// -----------------------------------------------------------------------------
// CAbstractMediaMtpDataProvider::GetWrapper
-// return the reference of CMmMtpDpMetadataAccessWrapper to enumerator
+// return wrapper references
// -----------------------------------------------------------------------------
//
CMmMtpDpMetadataAccessWrapper& CAbstractMediaMtpDataProvider::GetWrapperL()
@@ -480,6 +497,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
//
@@ -503,7 +540,22 @@
const RArray<TUint>* CAbstractMediaMtpDataProvider::GetSupportedPropertiesL( TUint32 aFormatCode ) const
{
- return &iSupportedProperties;
+ if ( ( aFormatCode == EMTPFormatCodeM3UPlaylist ) || ( aFormatCode == EMTPFormatCodeAbstractAudioVideoPlaylist ) )
+ {
+ return &iSupportedPropPlaylist;
+ }
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ else if ( aFormatCode == EMTPFormatCodeAbstractAudioAlbum )
+ {
+ return &iSupportedPropAbstractAlbum;
+ }
+#endif
+ else
+ {
+ User::Leave( KErrNotSupported );
+ }
+ // should never run to this line, just for avoiding warning.
+ return NULL;
}
// ---------------------------------------------------------------------------
@@ -513,20 +565,37 @@
//
void CAbstractMediaMtpDataProvider::GetSupportedPropertiesL()
{
- iSupportedProperties.Reset();
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ iSupportedPropAbstractAlbum.Reset();
+#endif
+ iSupportedPropPlaylist.Reset();
TInt count = 0, i = 0;
count = sizeof( KMmMtpDpSupportedPropMandatoryAll ) / sizeof( TUint16 );
for ( i = 0; i < count; i++ )
{
- InsertL( iSupportedProperties, KMmMtpDpSupportedPropMandatoryAll[i] );
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ InsertL( iSupportedPropAbstractAlbum, KMmMtpDpSupportedPropMandatoryAll[i] );
+#endif
+ InsertL( iSupportedPropPlaylist, KMmMtpDpSupportedPropMandatoryAll[i] );
}
count = sizeof( KMmMtpDpSupportedPropAdditionalAll ) / sizeof( TUint16 );
for ( i = 0; i < count; i++ )
{
- InsertL( iSupportedProperties, KMmMtpDpSupportedPropAdditionalAll[i] );
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ InsertL( iSupportedPropAbstractAlbum, KMmMtpDpSupportedPropAdditionalAll[i] );
+#endif
+ InsertL( iSupportedPropPlaylist, KMmMtpDpSupportedPropAdditionalAll[i] );
}
+
+#ifdef MMMTPDP_ABSTRACTAUDIOALBUM_SUPPORT
+ count = sizeof( KMmMtpDpSupportedPropMandatoryALB ) / sizeof( TUint16 );
+ for ( i = 0; i < count; i++ )
+ {
+ InsertL( iSupportedPropAbstractAlbum, KMmMtpDpSupportedPropMandatoryALB[i] );
+ }
+#endif
}
// ---------------------------------------------------------------------------
@@ -536,7 +605,31 @@
//
const RArray<TUint>* CAbstractMediaMtpDataProvider::GetAllSupportedProperties() const
{
- return &iSupportedProperties;
+ return &iSupportedPropAll;
+ }
+
+void CAbstractMediaMtpDataProvider::GetAllSupportedPropL()
+ {
+ iSupportedPropAll.Reset();
+
+ TInt count = 0, i = 0;
+ count = sizeof( KMmMtpDpSupportedPropMandatoryAll ) / sizeof( TUint16 );
+ for ( i = 0; i < count; i++ )
+ {
+ InsertL( iSupportedPropAll, KMmMtpDpSupportedPropMandatoryAll[i] );
+ }
+
+ count = sizeof( KMmMtpDpSupportedPropAdditionalAll ) / sizeof( TUint16 );
+ for ( i = 0; i < count; i++ )
+ {
+ InsertL( iSupportedPropAll, KMmMtpDpSupportedPropAdditionalAll[i] );
+ }
+
+ count = sizeof( KMmMtpDpSupportedPropMandatoryALB ) / sizeof( TUint16 );
+ for ( i = 0; i < count; i++ )
+ {
+ InsertL( iSupportedPropAll, KMmMtpDpSupportedPropMandatoryALB[i] );
+ }
}
// ---------------------------------------------------------------------------
@@ -552,10 +645,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 ) );
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderabstractmediapreference.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderabstractmediapreference.cpp Mon May 03 12:58:40 2010 +0300
@@ -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
+
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidercopyobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidercopyobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderdescriptionutility.cpp Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,224 @@
+/*
+* 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 <mtp/mtpprotocolconstants.h>
+#include <mtp/cmtptypeobjectpropdesc.h>
+#include <mtp/cmtptypestring.h>
+
+#include "cabstractmediamtpdataproviderdescriptionutility.h"
+#include "abstractmediamtpdataproviderconst.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;
+ if( aFormatCode == EMTPFormatCodeAbstractAudioAlbum )
+ {
+ switch ( aPropCode )
+ {
+ case EMTPObjectPropCodeRepresentativeSampleFormat:
+ propertyDesc = NewRepresentativeSampleFormatL();
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleSize:
+ propertyDesc = NewRepresentativeSampleSizeL();
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleHeight:
+ propertyDesc = NewRepresentativeSampleHeightL();
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleWidth:
+ propertyDesc = NewRepresentativeSampleWidthL();
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleData:
+ propertyDesc = NewRepresentativeSampleDataL();
+ break;
+ default:
+ // do nothing
+ break;
+ }
+ }
+ return propertyDesc;
+ }
+
+// -----------------------------------------------------------------------------
+// CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleFormatL
+//
+// -----------------------------------------------------------------------------
+//
+CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleFormatL()
+ {
+ CMTPTypeObjectPropDescEnumerationForm* form =
+ CMTPTypeObjectPropDescEnumerationForm::NewL( EMTPTypeUINT16 );
+ CleanupStack::PushL( form ); // + form
+
+ TInt numValues = sizeof ( TMmMtpSupportedSampleFormat ) / sizeof ( TMmMtpSupportedSampleFormat[0] );
+ for ( TInt i = 0; i < numValues; i++ )
+ {
+ TMTPTypeUint16 data( TMmMtpSupportedSampleFormat[i] );
+ form->AppendSupportedValueL( data );
+ }
+
+ CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo;
+ propertyInfo.iDataType = EMTPTypeUINT16;
+ propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm;
+ propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly;
+ CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeRepresentativeSampleFormat,
+ propertyInfo,
+ form );
+ CleanupStack::PopAndDestroy( form ); // - form
+ return propertyDesc;
+ }
+
+// -----------------------------------------------------------------------------
+// CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleSizeL
+//
+// -----------------------------------------------------------------------------
+//
+CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleSizeL()
+ {
+ CMTPTypeObjectPropDescRangeForm* form =
+ CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form
+
+ // Set expected values
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, EMTPMinSampleSize );
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, EMTPMaxSampleSize );
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, EMTPStepSampleSize );
+
+ CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo;
+ propertyInfo.iDataType = EMTPTypeUINT32;
+ propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm;
+ propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly;
+ CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeRepresentativeSampleSize,
+ propertyInfo,
+ form );
+ CleanupStack::PopAndDestroy( form ); // - form
+ return propertyDesc;
+ }
+
+// -----------------------------------------------------------------------------
+// CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleHeightL
+//
+// -----------------------------------------------------------------------------
+//
+CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleHeightL()
+ {
+ CMTPTypeObjectPropDescRangeForm* form =
+ CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form
+
+ // Set expected values
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, EMTPSampleMinHeight );
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, EMTPSampleMaxHeight );
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, EMTPSampleStepHeight );
+
+ CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo;
+ propertyInfo.iDataType = EMTPTypeUINT32;
+ propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm;
+ propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly;
+ CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeRepresentativeSampleHeight,
+ propertyInfo,
+ form );
+ CleanupStack::PopAndDestroy( form ); // - form
+ return propertyDesc;
+ }
+
+// -----------------------------------------------------------------------------
+// CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleWidthL
+//
+// -----------------------------------------------------------------------------
+//
+CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleWidthL()
+ {
+ CMTPTypeObjectPropDescRangeForm* form =
+ CMTPTypeObjectPropDescRangeForm::NewLC( EMTPTypeUINT32 ); // + form
+
+ // Set expected values
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMinimumValue, EMTPSampleMinWidth );
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EMaximumValue, EMTPSampleMaxWidth );
+ form->SetUint32L( CMTPTypeObjectPropDescRangeForm::EStepSize, EMTPSampleStepWidth );
+
+ CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo;
+ propertyInfo.iDataType = EMTPTypeUINT32;
+ propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::ERangeForm;
+ propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadOnly;
+ CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeRepresentativeSampleWidth,
+ propertyInfo,
+ form );
+ CleanupStack::PopAndDestroy( form ); // - form
+ return propertyDesc;
+ }
+
+// -----------------------------------------------------------------------------
+// CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleDataL
+//
+// -----------------------------------------------------------------------------
+//
+CMTPTypeObjectPropDesc* CAbstractMediaMtpDataProviderDescriptionUtility::NewRepresentativeSampleDataL()
+ {
+ return CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeRepresentativeSampleData );
+ }
+
+// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderenumerator.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderenumerator.cpp Mon May 03 12:58:40 2010 +0300
@@ -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,10 +78,11 @@
iObjectMgr( aFramework.ObjectMgr() ),
iDataProviderId( aFramework.DataProviderId() ),
iDataProvider( aDataProvider ),
- iStorages( 2 ),
+ iStorages( KAbstractMediaDpArrayGranularity ),
iAbstractMedias( NULL ),
iCount( 0 ),
- iCurrentIndex( 0 )
+ iCurrentIndex( 0 ),
+ iEnumState ( EEnumPlaylist )
{
PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::CAbstractMediaMtpDataProviderEnumerator, iDataProviderId = %d" ), iDataProviderId );
}
@@ -105,6 +115,7 @@
delete iAbstractMedias;
iAbstractMedias = NULL;
+
#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
delete iPerfLog;
#endif // _DEBUG
@@ -170,123 +181,129 @@
// keep in mind for notification when enumeration complete
iStorageId = aStorageId;
-
+ iEnumState = EEnumPlaylist;
if ( iStorages.Count() > 0 )
{
- ScanStorageL( iStorages[0] );
+ InitStorageL();
}
- else
- {
- iStorages.Reset();
- SignalCompleteL( iDataProvider );
- }
+ ScanNextL();
PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::StartL" ) );
}
// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderEnumerator::ScanStorageL
-// Find out all AbstractMedia file according to storage id
+// CAbstractMediaMtpDataProviderEnumerator::InitStorageL
+// Initialize iAbstractMedia, iCount and iCurrentIndex according to iStorages and iEnumState
// -----------------------------------------------------------------------------
//
-void CAbstractMediaMtpDataProviderEnumerator::ScanStorageL( TUint32 aStorageId )
+void CAbstractMediaMtpDataProviderEnumerator::InitStorageL()
{
- PRINT1( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::ScanStorageL aStorageId = 0x%x" ), aStorageId );
+ __ASSERT_DEBUG(iStorages.Count() > 0 && iEnumState < EEnumCount, User::Invariant() );
+ PRINT2( _L( "MM MTP => CAbstractMediaMtpDataProviderEnumerator::InitStorageL storageId = 0x%x, state=%d" ), iStorages[0], iEnumState );
const CMTPStorageMetaData& storage(
- iFramework.StorageMgr().StorageL( aStorageId ) );
+ iFramework.StorageMgr().StorageL( iStorages[0] ) );
__ASSERT_DEBUG( ( storage.Uint( CMTPStorageMetaData::EStorageSystemType ) ==
CMTPStorageMetaData::ESystemTypeDefaultFileSystem ), User::Invariant() );
TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) );
- PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL StorageSuid = %S" ), &root );
+ PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::InitStorageL StorageSuid = %S" ), &root );
- // created by windows media player, or else return responsecode is Access denied
- // Create abstract media directory if it does not exist
- HBufC* tempBuf = HBufC::NewLC( KMaxFileName ); // + tempBuf
- TPtr folder = tempBuf->Des();
- folder.Zero();
- folder.Append( root );
- folder.Append( KPlaylistFilePath );
- TBool ret = BaflUtils::FileExists( iFramework.Fs(), folder );
- PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL ret = %d, folder = %S" ), ret, &folder );
- if( !ret )
+ if ( iEnumState == EEnumPlaylist )
{
- TInt err = iFramework.Fs().MkDirAll( folder );
- PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::ScanStorageL Creating folder (%S) returned error %d" ), tempBuf, err );
+ // created by windows media player, or else return responsecode is Access denied
+ // 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();
+ folder.Append( root );
+ folder.Append( KPlaylistFilePath );
+ TBool ret = BaflUtils::FileExists( iFramework.Fs(), folder );
+ PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::InitStorageL ret = %d, folder = %S" ), ret, &folder );
+ if( !ret )
+ {
+ TInt err = iFramework.Fs().MkDirAll( folder );
+ PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::InitStorageL Creating folder (%S) returned error %d" ), tempBuf, err );
- // add this new folder to framework metadata DB
- CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC( 0, // Dev Dp hard code
- EMTPFormatCodeAssociation,
- aStorageId,
- folder ); // + object
- object->SetUint( CMTPObjectMetaData::EParentHandle, KMTPHandleNoParent );
- object->SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPAssociationTypeGenericFolder );
- PERFLOGSTART( KObjectManagerInsert );
- iObjectMgr.InsertObjectL( *object );
- PERFLOGSTOP( KObjectManagerInsert );
- CleanupStack::PopAndDestroy( object ); // - object
+ // add this new folder to framework metadata DB
+ CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC( 0, // Dev Dp hard code
+ EMTPFormatCodeAssociation,
+ iStorages[0],
+ folder ); // + object
+ object->SetUint( CMTPObjectMetaData::EParentHandle, KMTPHandleNoParent );
+ object->SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPAssociationTypeGenericFolder );
+ PERFLOGSTART( KObjectManagerInsert );
+ iObjectMgr.InsertObjectL( *object );
+ PERFLOGSTOP( KObjectManagerInsert );
+ CleanupStack::PopAndDestroy( object ); // - object
+ }
+ CleanupStack::PopAndDestroy( tempBuf ); // - tempBuf
}
- CleanupStack::PopAndDestroy( tempBuf ); // - tempBuf
// find all abstract medias stored in MPX
delete iAbstractMedias;
iAbstractMedias = NULL;
- PERFLOGSTART( KMpxGetAllPlaylist );
- TRAPD( err, iDataProvider.GetWrapperL().GetAllPlaylistL( root, &iAbstractMedias ) );
- PERFLOGSTOP( KMpxGetAllPlaylist );
+ TMPXGeneralCategory category = ( iEnumState == EEnumPlaylist ) ? EMPXPlaylist : EMPXAbstractAlbum;
+ PERFLOGSTART( KMpxGetAllAbstractMedia );
+ TRAPD( err, iDataProvider.GetWrapperL().GetAllAbstractMediaL( root, &iAbstractMedias, category ) );
+ PERFLOGSTOP( KMpxGetAllAbstractMedia );
if ( iAbstractMedias != NULL && err == KErrNone )
{
iCount = iAbstractMedias->Count();
- iCurrentIndex = 0;
-
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, iStatus.Int() );
- SetActive();
}
else
{
iCount = 0;
- iCurrentIndex = 0;
- ScanNextL();
}
+ iCurrentIndex = 0;
- PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::ScanStorageL" ) );
+ PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::InitStorageL" ) );
}
// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderEnumerator::ScanNextStorageL
-//
+// CAbstractMediaMtpDataProviderEnumerator::ScanNextL
+// Proceed to next abstract media item
// -----------------------------------------------------------------------------
//
void CAbstractMediaMtpDataProviderEnumerator::ScanNextL()
{
- PRINT1( _L( "MM MTP = > CAbstractMediaMtpDataProviderEnumerator::ScanNextStorageL iStorages.Count = %d" ), iStorages.Count() );
- if ( iCurrentIndex < iCount )
+ while (iStorages.Count() > 0)
{
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, iStatus.Int() );
- SetActive();
-
- PRINT2( _L( "MM MTP <> Current storage is still being scanned, current index = %d, total AbstractMedia count = %d" ),
- iCurrentIndex,
- iCount );
+ while ( iEnumState < EEnumCount )
+ {
+ if ( iCurrentIndex < iCount )
+ {
+ TRequestStatus* status = &iStatus;
+ User::RequestComplete( status, iStatus.Int() );
+ SetActive();
+ PRINT2( _L( "MM MTP <> Current storage is still being scanned, current index = %d, total AbstractMedia count = %d" ),
+ iCurrentIndex,
+ iCount );
+ return;
+ }
+ ++iEnumState;
+ if (iEnumState == EEnumCount)
+ {
+ break;
+ }
+ InitStorageL();
+ }
+ iStorages.Remove( 0 );
+ if (iStorages.Count() == 0)
+ {
+ break;
+ }
+ iEnumState = EEnumPlaylist;
+ InitStorageL();
}
- // If there are one or more unscanned storages left
- // (the currently scanned one is still on the list)
- else if ( iStorages.Count() > 1 )
- {
- iStorages.Remove( 0 );
- ScanStorageL( iStorages[0] );
- }
- else
- {
- // We are done
- PRINT( _L( "MM MTP <> Objects enumeration completed 2" ) );
- iStorages.Reset();
- SignalCompleteL( iDataProvider );
- }
+ // We are done
+ PRINT( _L( "MM MTP <> Objects enumeration completed" ) );
+ delete iAbstractMedias;
+ iAbstractMedias = NULL;
+ iStorages.Reset();
+ SignalCompleteL( iDataProvider );
}
// -----------------------------------------------------------------------------
@@ -296,28 +313,43 @@
//
void CAbstractMediaMtpDataProviderEnumerator::RunL()
{
- TBuf<KMaxFileName> 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++;
+ TMPXGeneralCategory category = ( iEnumState == EEnumPlaylist ) ? EMPXPlaylist : EMPXAbstractAlbum;
+ HBufC* abstractMedia = iDataProvider.GetWrapperL().GetAbstractMediaNameL( media, category );
+ CleanupStack::PushL( abstractMedia ); // + abstractMedia
+ TBool ret = ETrue;
+ if ( iEnumState == EEnumAbstractAlbum )
+ {
+ //The abstract album may be removed, check it first
+ ret = BaflUtils::FileExists( iFramework.Fs(), *abstractMedia );
+ PRINT2( _L( "MM MTP <> BaflUtils::FileExists( RFs,%S ) ret = %d" ), abstractMedia, ret );
+ }
- // find all reference of each playlist and create dummy files for each playlist
- CDesCArray* references = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity );
- CleanupStack::PushL( references ); // + references
+ if ( ret )
+ {
+ PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::RunL abstractMedia=%S" ), abstractMedia );
+ AddEntryL( *abstractMedia );
- PERFLOGSTART( KMpxQueryPlaylistReference );
- iDataProvider.GetWrapperL().GetAllReferenceL( media, *references );
- PERFLOGSTOP( KMpxQueryPlaylistReference );
-
- // insert references into reference db
- AddReferencesL( playlist, *references );
-
- CleanupStack::PopAndDestroy( references ); // - references
- iCurrentIndex++;
+ // find all reference of each abstract media
+ CDesCArray* references = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity );
+ CleanupStack::PushL( references ); // + references
+
+ PERFLOGSTART( KMpxQueryAbstractMediaReference );
+ iDataProvider.GetWrapperL().GetAllReferenceL( media, *references );
+ PERFLOGSTOP( KMpxQueryAbstractMediaReference );
+
+ // insert references into reference db
+ AddReferencesL( *abstractMedia, *references );
+
+ CleanupStack::PopAndDestroy( references ); // - references
+ }
+ CleanupStack::PopAndDestroy( abstractMedia ); // - abstractMedia
ScanNextL();
}
@@ -343,7 +375,7 @@
//
void CAbstractMediaMtpDataProviderEnumerator::DoCancel()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -378,18 +410,23 @@
PERFLOGSTART( KObjectManagerObjectUid );
TUint32 parentHandle = iFramework.ObjectMgr().HandleL( parser.DriveAndPath() );
PERFLOGSTOP( KObjectManagerObjectUid );
+
object->SetUint( CMTPObjectMetaData::EParentHandle, parentHandle );
- PERFLOGSTART(KObjectManagerInsert);
+ PERFLOGSTART( KObjectManagerInsert );
iObjectMgr.InsertObjectL( *object );
- PERFLOGSTOP(KObjectManagerInsert);
+ PERFLOGSTOP( KObjectManagerInsert );
CleanupStack::PopAndDestroy( object );// - object
- iDataProvider.GetWrapperL().CreateDummyFile( aSuid );
+ //Only remember the playlist file for clean up
+ if( iEnumState == EEnumPlaylist )
+ {
+ iDataProvider.GetWrapperL().CreateDummyFile( aSuid );
- // remember the abstract media file for clean up
- iDataProvider.GetWrapperL().AddDummyFileL( aSuid );
+ // remember the abstract media file for clean up
+ iDataProvider.GetWrapperL().AddDummyFileL( aSuid );
+ }
PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderEnumerator::AddEntryL" ) );
}
@@ -413,13 +450,13 @@
for ( TInt i = 0; i < count; i++ )
{
TInt index = i - removeCount;
- PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL ref[%d]'s name = %S" ), index, &( aReferences[index] ) );
+ TPtrC temp( aReferences[index] );
+ PRINT2( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL ref[%d]'s name = %S" ), index, &temp );
PERFLOGSTART( KObjectManagerHandle );
- TUint32 handle = iFramework.ObjectMgr().HandleL( aReferences[index] );
+ TUint32 handle = iFramework.ObjectMgr().HandleL( temp );
PERFLOGSTOP( KObjectManagerHandle );
if ( handle == KMTPHandleNone ) // object doesn't exist
{
- TPtrC temp( aReferences[index] );
PRINT1( _L( "MM MTP <> CAbstractMediaMtpDataProviderEnumerator::AddReferencesL, [%S] doesn't existed in handle db, remove this from reference array" ), &temp );
// if handle is invalid, remove from reference array
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetformatcapabilities.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/cmtptypeinterdependentpropdesc.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetinterdependentpropdesc.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/tmtptyperequest.h>
-#include <mtp/mtpdatatypeconstants.h>
-#include <mtp/mmtpdataproviderframework.h>
-#include <mtp/mmtpobjectmgr.h>
-#include <mtp/cmtpobjectmetadata.h>
-#include <mtp/cmtptypestring.h>
-#include <mtp/cmtptypeobjectpropdesc.h>
-#include <mtp/cmtptypeinterdependentpropdesc.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropdesc.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/cmtptypeobjectpropdesc.h>
-#include <mtp/mtpprotocolconstants.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,6 +16,10 @@
*/
+#include <mtp/cmtptypeobjectproplist.h>
+#include <mtp/cmtptypearray.h>
+#include <f32file.h>
+
#include "cabstractmediamtpdataprovidergetobjectproplist.h"
#include "abstractmediamtpdataproviderconst.h"
#include "mmmtpdplogger.h"
@@ -50,7 +54,7 @@
//
CAbstractMediaMtpDataProviderGetObjectPropList::~CAbstractMediaMtpDataProviderGetObjectPropList()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -61,9 +65,9 @@
CAbstractMediaMtpDataProviderGetObjectPropList::CAbstractMediaMtpDataProviderGetObjectPropList( MMTPDataProviderFramework& aFramework,
MMTPConnection& aConnection,
MMmMtpDpConfig& aDpConfig ) :
- CGetObjectPropList( aFramework, aConnection, aDpConfig )
+ CGetObjectPropList( aFramework, aConnection, aDpConfig )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -81,11 +85,70 @@
// do nothing here, just leave, as this should never be invoked or invalid propcode
// -----------------------------------------------------------------------------
//
-TInt CAbstractMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/,
- TUint32 /*aHandle*/ )
+TInt CAbstractMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL( TUint16 aPropCode,
+ TUint32 aHandle )
{
- PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL, leave with KErrNotSupported" ) );
- return KErrNotSupported;
+ PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL" ) );
+ TInt err = KErrNone;
+ switch ( aPropCode )
+ {
+ case EMTPObjectPropCodeRepresentativeSampleFormat:
+ {
+ iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, 0 );
+ }
+ break;
+ case EMTPObjectPropCodeRepresentativeSampleSize:
+ case EMTPObjectPropCodeRepresentativeSampleHeight:
+ case EMTPObjectPropCodeRepresentativeSampleWidth:
+ {
+ iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, 0 );
+ }
+ break;
+ case EMTPObjectPropCodeRepresentativeSampleData:
+ {
+ const TDesC& suid( iObject->DesC( CMTPObjectMetaData::ESuid ) );
+ CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT8 ); // + desData
+
+ RFile sampleFile;
+ TInt err = sampleFile.Open( iFramework.Fs(), suid, EFileShareReadersOnly );
+ PRINT2( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData open filename=%S, err=%d" ), &suid, err );
+
+ CleanupClosePushL( sampleFile ); // + sampleFile
+ TInt size = 0;
+ if( err == KErrNone )
+ {
+ err = sampleFile.Size( size );
+ }
+ PRINT2( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData sampleFile.Size size=%d, err=%d" ), size, err );
+ if( err == KErrNone && size > 0 )
+ {
+ HBufC8* sampleData = HBufC8::NewLC( size * sizeof( TUint8 ) ); // + sampleData
+ TPtr8 samplePtr = sampleData->Des();
+ err = sampleFile.Read( samplePtr );
+ PRINT1( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData sampleFile.Read err=%d" ), err );
+ PRINT1( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData samplePtr.Size=%d" ), samplePtr.Size() );
+ if( err == KErrNone )
+ {
+ desData->SetByDesL( samplePtr );
+ }
+ CleanupStack::PopAndDestroy( sampleData ); // - sampleData
+ }
+ iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
+ iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData );
+
+ CleanupStack::PopAndDestroy( &sampleFile ); // - sampleFile
+ CleanupStack::PopAndDestroy( desData ); // - desData
+ }
+ break;
+
+ default:
+ err = KErrNotSupported;
+ }
+
+ PRINT1( _L( "MM MTP <= CAbstractMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL, err = %d" ), err );
+ return err;
}
// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,6 +16,9 @@
*/
+#include <mtp/cmtptypearray.h>
+#include <f32file.h>
+
#include "cabstractmediamtpdataprovidergetobjectpropvalue.h"
#include "abstractmediamtpdataproviderconst.h"
#include "mmmtpdplogger.h"
@@ -49,7 +52,7 @@
//
void CAbstractMediaMtpDataProviderGetObjectPropValue::ConstructL()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -59,7 +62,7 @@
//
CAbstractMediaMtpDataProviderGetObjectPropValue::~CAbstractMediaMtpDataProviderGetObjectPropValue()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -72,7 +75,7 @@
MMmMtpDpConfig& aDpConfig ) :
CGetObjectPropValue( aFramework, aConnection, aDpConfig )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -81,10 +84,64 @@
// invoked or invalid propcode
// -----------------------------------------------------------------------------
//
-void CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/ )
+void CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 aPropCode )
{
- PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL, leave with KErrNotSupported"));
- User::Leave( KErrNotSupported );
+ PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL" ) );
+ switch ( aPropCode )
+ {
+ case EMTPObjectPropCodeRepresentativeSampleFormat:
+ {
+ iMTPTypeUint16.Set( 0 );
+ SendDataL( iMTPTypeUint16 );
+ }
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleSize: // fall through
+ case EMTPObjectPropCodeRepresentativeSampleHeight: // fall through
+ case EMTPObjectPropCodeRepresentativeSampleWidth:
+ {
+ iMTPTypeUint32.Set( 0 );
+ SendDataL( iMTPTypeUint32 );
+ }
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleData:
+ {
+ if ( iMTPTypeArray != NULL )
+ {
+ delete iMTPTypeArray;
+ iMTPTypeArray = NULL;
+ }
+ iMTPTypeArray = CMTPTypeArray::NewL( EMTPTypeAUINT8 );
+
+ const TDesC& suid = iObjectInfo->DesC( CMTPObjectMetaData::ESuid );
+ PRINT1( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData file suid=%S" ), &suid );
+ RFile sampleFile;
+ User::LeaveIfError( sampleFile.Open( iFramework.Fs(), suid, EFileShareReadersOnly ) );
+ CleanupClosePushL( sampleFile ); // + sampleFile
+
+ TInt size = 0;
+ User::LeaveIfError( sampleFile.Size( size ) );
+ PRINT1( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData sampleFile.Size() size=%d" ), size );
+
+ if( size > 0 )
+ {
+ HBufC8* sampleData = HBufC8::NewLC( size * sizeof(TUint8) ); // + sampleData
+ TPtr8 samplePtr = sampleData->Des();
+ User::LeaveIfError( sampleFile.Read( samplePtr ) );
+ iMTPTypeArray->SetByDesL( samplePtr );
+ CleanupStack::PopAndDestroy( sampleData ); // - sampleData
+ }
+ CleanupStack::PopAndDestroy( &sampleFile ); // - sampleFile
+
+ SendDataL( *iMTPTypeArray );
+ }
+ break;
+
+ default:
+ PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL, leave with KErrNotSupported"));
+ User::Leave( KErrNotSupported );
+ }
}
// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidermoveobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidermoveobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderpropertysettingutility.cpp Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,95 @@
+/*
+ * 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 <mtp/cmtptypeobjectproplist.h>
+#include <mtp/mtpprotocolconstants.h>
+#include <mtp/mtpdatatypeconstants.h>
+#include <mtp/cmtptypearray.h>
+
+#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" ) );
+
+ TMTPResponseCode responseCode = EMTPRespCodeOK;
+
+ switch ( aPropCode )
+ {
+ case EMTPObjectPropCodeRepresentativeSampleData:
+ {
+ CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT8 );
+ desData->SetByDesL( aElement.ArrayL( CMTPTypeObjectPropListElement::EValue ) );
+ responseCode = SetMetaDataToWrapper( aDpConfig, aPropCode, *desData, aObject );
+ CleanupStack::PopAndDestroy( desData );
+ }
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleFormat:
+ case EMTPObjectPropCodeRepresentativeSampleSize:
+ case EMTPObjectPropCodeRepresentativeSampleHeight:
+ case EMTPObjectPropCodeRepresentativeSampleWidth:
+ // no place to store, do nothing. reserve here for future usage
+ break;
+
+ default:
+ // Should not happen, property code should have been checked before set to store.
+ User::Leave( KErrNotSupported );
+ }
+
+ PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL" ) );
+ return responseCode;
+ }
+
+// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderrenameobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataproviderrenameobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -17,10 +17,9 @@
#include <badesca.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
+#include <mtp/tmtptypeuint32.h>
#include <mtp/cmtpobjectmetadata.h>
-#include <mtp/tmtptypeuint32.h>
#include "cabstractmediamtpdataproviderrenameobject.h"
#include "mmmtpdplogger.h"
@@ -53,9 +52,9 @@
//
CAbstractMediaMtpDataProviderRenameObject::CAbstractMediaMtpDataProviderRenameObject( MMTPDataProviderFramework& aFramework,
CMmMtpDpMetadataAccessWrapper& aWrapper ) :
- CRenameObject( aFramework, aWrapper )
+ CRenameObject( aFramework, aWrapper )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -65,7 +64,7 @@
//
CAbstractMediaMtpDataProviderRenameObject::~CAbstractMediaMtpDataProviderRenameObject()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -92,7 +91,7 @@
}
else
{
- TRAPD( err, iWrapper.RenameObjectL( iOldFileName, iFileName ) );
+ TRAPD( err, iWrapper.RenameObjectL( *iObjectInfo, iFileName ) );
// should not fail for 1 file, keep it going, as folder already renamed
if ( err != KErrNone )
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersendobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtptypeobjectproplist.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectproplist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtptypeobjectproplist.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectpropvalue.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectpropvalue.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,6 +16,8 @@
*/
+#include <mtp/cmtptypearray.h>
+
#include "cabstractmediamtpdataprovidersetobjectpropvalue.h"
#include "abstractmediamtpdataproviderconst.h"
#include "mmmtpdplogger.h"
@@ -49,7 +51,7 @@
//
void CAbstractMediaMtpDataProviderSetObjectPropValue::ConstructL()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -60,9 +62,9 @@
CAbstractMediaMtpDataProviderSetObjectPropValue::CAbstractMediaMtpDataProviderSetObjectPropValue( MMTPDataProviderFramework& aFramework,
MMTPConnection& aConnection,
MMmMtpDpConfig& aDpConfig ) :
- CSetObjectPropValue( aFramework, aConnection, aDpConfig )
+ CSetObjectPropValue( aFramework, aConnection, aDpConfig )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -72,7 +74,7 @@
//
CAbstractMediaMtpDataProviderSetObjectPropValue::~CAbstractMediaMtpDataProviderSetObjectPropValue()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -81,9 +83,22 @@
// invalid propcode
// -----------------------------------------------------------------------------
//
-TBool CAbstractMediaMtpDataProviderSetObjectPropValue::IsSpecificPropCodeReadOnly( TUint16 /*aPropCode*/ ) const
+TBool CAbstractMediaMtpDataProviderSetObjectPropValue::IsSpecificPropCodeReadOnly( TUint16 aPropCode ) const
{
- return EFalse;
+ TBool ret = EFalse;
+ switch ( aPropCode )
+ {
+ case EMTPObjectPropCodeRepresentativeSampleFormat:
+ case EMTPObjectPropCodeRepresentativeSampleSize:
+ case EMTPObjectPropCodeRepresentativeSampleHeight:
+ case EMTPObjectPropCodeRepresentativeSampleWidth:
+ ret = ETrue;
+ break;
+ default:
+ ret = EFalse;
+ break;
+ }
+ return ret;
}
// -----------------------------------------------------------------------------
@@ -92,10 +107,24 @@
// invalid propcode
// -----------------------------------------------------------------------------
//
-void CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL( TUint16 /*aPropCode*/ )
+void CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL( TUint16 aPropCode )
{
- PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL leave with KErrNotSupported" ) );
- User::Leave( KErrNotSupported );
+ PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL" ) );
+ if ( aPropCode == EMTPObjectPropCodeRepresentativeSampleData )
+ {
+ delete iMTPTypeArray;
+ iMTPTypeArray = NULL;
+
+ iMTPTypeArray = CMTPTypeArray::NewL( EMTPTypeAUINT8 );
+ ReceiveDataL( *iMTPTypeArray );
+ }
+ else
+ {
+ PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ReceiveDataSpecificObjectPropertyL leave with KErrNotSupported" ) );
+ // Do nothing now.
+ // May need add implementation here for further extension.
+ User::Leave( KErrNotSupported );
+ }
}
// -----------------------------------------------------------------------------
@@ -104,12 +133,26 @@
// invalid propcode
// -----------------------------------------------------------------------------
//
-TMTPResponseCode CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 /*aPropCode*/ )
+TMTPResponseCode CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 aPropCode )
{
- PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL leave with KErrNotSupported" ) );
- User::Leave( KErrNotSupported );
+ PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL" ) );
+ TMTPResponseCode responseCode = EMTPRespCodeOK;
- return EMTPRespCodeOK;
+ if ( aPropCode == EMTPObjectPropCodeRepresentativeSampleData )
+ {
+ responseCode = ServiceMetaDataToWrapperL( aPropCode,
+ *iMTPTypeArray,
+ *iObjectInfo );
+ }
+ else
+ {
+ PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL leave with KErrNotSupported" ) );
+ // Do nothing now.
+ // May need add implementation here for further extension.
+ User::Leave( KErrNotSupported );
+ }
+ PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderSetObjectPropValue::ServiceSpecificObjectPropertyL" ) );
+ return responseCode;
}
// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidersetobjectreferences.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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: SetObjectReferences
-*
-*/
-
-
-#include "cabstractmediamtpdataprovidersetobjectreferences.h"
-#include "abstractmediamtpdataproviderconst.h"
-#include "cmmmtpdpmetadataaccesswrapper.h"
-#include "mmmtpdplogger.h"
-
-// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderSetObjectReferences::NewL
-// Two-phase construction method
-// -----------------------------------------------------------------------------
-//
-MMmRequestProcessor* CAbstractMediaMtpDataProviderSetObjectReferences::NewL( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig )
- {
- CAbstractMediaMtpDataProviderSetObjectReferences* self =
- new ( ELeave ) CAbstractMediaMtpDataProviderSetObjectReferences( aFramework,
- aConnection,
- aDpConfig );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
-
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderSetObjectReferences::ConstructL
-// Two-phase construction method
-// -----------------------------------------------------------------------------
-//
-void CAbstractMediaMtpDataProviderSetObjectReferences::ConstructL()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderSetObjectReferences::~CAbstractMediaMtpDataProviderSetObjectReferences
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CAbstractMediaMtpDataProviderSetObjectReferences::~CAbstractMediaMtpDataProviderSetObjectReferences()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderSetObjectReferences::CAbstractMediaMtpDataProviderSetObjectReferences
-// Standard c++ constructor
-// -----------------------------------------------------------------------------
-//
-CAbstractMediaMtpDataProviderSetObjectReferences::CAbstractMediaMtpDataProviderSetObjectReferences( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig ) :
- CSetObjectReferences( aFramework, aConnection, aDpConfig )
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CAbstractMediaMtpDataProviderSetObjectReferences::DoSetObjectReferencesL
-// set references to DB
-// -----------------------------------------------------------------------------
-//
-void CAbstractMediaMtpDataProviderSetObjectReferences::DoSetObjectReferencesL( CMmMtpDpMetadataAccessWrapper& aWrapper,
- TUint16 aObjectFormat,
- const TDesC& aSrcFileName,
- CDesCArray& aRefFileArray )
- {
- TInt count = sizeof( KAbstractMediaMtpDataProviderSupportedFormats ) / sizeof (TUint16);
- TBool supported = EFalse;
-
- for( TInt i = 0; i < count; i++ )
- {
- if( KAbstractMediaMtpDataProviderSupportedFormats[i] == aObjectFormat )
- {
- supported = ETrue;
- break;
- }
- }
-
- if ( supported )
- {
- aWrapper.SetPlaylistL( aSrcFileName, aRefFileArray );
- }
- }
-
-// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/data/mediamtpdataprovider_config.rss Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/data/mediamtpdataprovider_config.rss Mon May 03 12:58:40 2010 +0300
@@ -17,24 +17,15 @@
#include <mtp/mtpdataproviderconfig.rh>
-#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
- }
-
-
-
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/group/mediamtpdataprovider.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/group/mediamtpdataprovider.mmp Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovider.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovider.h Mon May 03 12:58:40 2010 +0300
@@ -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<TUint32> iPendingEnumerations;
TInt iActiveProcessor;
+ TBool iActiveProcessorRemoved;
TBool iIsSessionOpen;
CRenameObject *iRenameObject;
@@ -178,7 +189,8 @@
RArray<TUint> iSupportedPropVideo;
RArray<TUint> iSupportedPropAll;
- TUint32 iDefaultStorageId;
+ CPropertySettingUtility* iPropSettingUtility;
+ CDescriptionUtility* iDescriptionUtility;
};
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidercopyobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidercopyobject.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderdescriptionutility.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderenumerator.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderenumerator.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetformatcapabilities.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetinterdependentpropdesc.h Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/cmtptypeobjectpropdesc.h>
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidergetobjectpropdesc.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidermoveobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidermoveobject.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataproviderpropertysettingutility.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidersendobject.h Fri Apr 16 15:28:14 2010 +0300
+++ /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_*/
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/cmediamtpdataprovidersetobjectproplist.h Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataprovider_config.rh Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderconst.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderconst.h Mon May 03 12:58:40 2010 +0300
@@ -25,8 +25,6 @@
_LIT( KMTPTxtColon, ":" );
-/** Granularity of the drive list*/
-const TInt KMtpMaxStringLength = 255;
enum TMmMtpNumberOfChannels
{
@@ -80,21 +78,21 @@
enum TMmMtpWidthRange
{
EMTPMinWidth = 0x000000b0, // 176 pixels
- EMTPMaxWidth = 0x00000140, // 320 pixels
+ EMTPMaxWidth = 0x00000500, // 1280 pixels, standard for 720p content
EMTPStepWidth = 0x00000001,
};
enum TMmMtpHeightRange
{
EMTPMinHeight = 0x00000090, // 144 pixels
- EMTPMaxHeight = 0x000000F0, // 240 pixels
+ EMTPMaxHeight = 0x000002D0, // 720 pixels, standard for 720p content
EMTPStepHeight = 0x00000001,
};
enum TMmMtpVideoBitRateRange
{
EMTPWMVMinBitrate = 0x00000000,
- EMTPWMVMaxBitrate = 0x0005dc00, // 384 kbps
+ EMTPWMVMaxBitrate = 0x01312D00, // 20 Mbps, recommanded by Helix team
EMTPVideoBitrateStep = 0x00000001
};
@@ -113,7 +111,7 @@
enum TMmMtpFramesPerThousandSecondsRange
{
EMTPMinFramesPerThousandSeconds = 0x00000000,
- EMTPMaxFramesPerThousandSeconds = 0x00003a98, // 15000 frame per ms
+ EMTPMaxFramesPerThousandSeconds = 0x00007530, // 30000 frame per ms (30 frame/s), standard for progressive content
EMTPStepFramesPerThousandSeconds = 0x00000001
};
@@ -181,6 +179,8 @@
EMTPOpCodeSetObjectPropList,
EMTPOpCodeGetInterdependentPropDesc,
EMTPOpCodeSendObjectPropList,
+
+ // window 7 extension
EMTPOpCodeGetFormatCapabilities
};
@@ -195,6 +195,7 @@
EMTPObjectPropCodeNumberOfChannels,
EMTPObjectPropCodeAudioWAVECodec,
EMTPObjectPropCodeAudioBitRate,
+ EMTPObjectPropCodeAlbumArtist
};
// Additional for audio formats
@@ -215,7 +216,6 @@
EMTPObjectPropCodeHeight,
EMTPObjectPropCodeDuration,
EMTPObjectPropCodeGenre,
- EMTPObjectPropCodeUseCount,
EMTPObjectPropCodeSampleRate,
EMTPObjectPropCodeNumberOfChannels,
EMTPObjectPropCodeScanType,
@@ -236,5 +236,4 @@
EMTPExtObjectPropCodeOmaDrmStatus,
};
-
#endif // MEDIAMTPDATAPROVIDERCONST_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderprocessor.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/inc/mediamtpdataproviderprocessor.h Mon May 03 12:58:40 2010 +0300
@@ -19,16 +19,14 @@
#ifndef MEDIAMTPDATAPROVIDERPROCESSOR_H
#define MEDIAMTPDATAPROVIDERPROCESSOR_H
-#include "crequestprocessor.h"
-
// class forward
class MMTPConnection;
class TMTPTypeRequest;
class CMTPDataProviderPlugin;
-class MMTPDataProviderFramework;
class MMTPRequestProcessor;
class CMediaMtpDataProvider;
class MMmMtpDpConfig;
+class MMmRequestProcessor;
typedef MMmRequestProcessor* ( *TMediaMtpDataProviderRequestProcessorCreateFunc )(
MMTPDataProviderFramework& aFramework,
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovider.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovider.cpp Mon May 03 12:58:40 2010 +0300
@@ -15,7 +15,6 @@
*
*/
-
#include <mtp/mmtpconnection.h>
#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpstoragemgr.h>
@@ -26,6 +25,7 @@
#include <driveinfo.h>
#include "cmediamtpdataprovider.h"
+#include "crequestprocessor.h"
#include "mediamtpdataproviderconst.h"
#include "cmediamtpdataproviderenumerator.h"
#include "mmmtpdplogger.h"
@@ -36,6 +36,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 +79,7 @@
iSupportedPropVideo( KMediaMtpDpArrayGranularity ),
iSupportedPropAll( KMediaMtpDpArrayGranularity )
{
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -90,6 +93,8 @@
CMmMtpDpAccessSingleton::Release();
delete iMediaEnumerator;
+ delete iPropSettingUtility;
+ delete iDescriptionUtility;
iPendingEnumerations.Close();
TInt count = iActiveProcessors.Count();
@@ -126,12 +131,15 @@
iMediaEnumerator = CMediaMtpDataProviderEnumerator::NewL( Framework(), *this );
- CMmMtpDpAccessSingleton::CreateL( Framework().Fs(), Framework() );
+ CMmMtpDpAccessSingleton::CreateL( Framework() );
GetSupportedFormatL();
GetSupportedPropL();
GetAllSupportedPropL();
+ iPropSettingUtility = CMediaMtpDataProviderPropertySettingUtility::NewL();
+ iDescriptionUtility = CMediaMtpDataProviderDescriptionUtility::NewL();
+
PRINT( _L( "MM MTP <= CMediaMtpDataProvider::ConstructL" ) );
}
@@ -162,13 +170,11 @@
{
case EMTPSessionClosed:
PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPSessionClosed event recvd" ) );
-
SessionClosedL( *reinterpret_cast<const TMTPNotificationParamsSessionChange*> ( aParams ) );
break;
case EMTPSessionOpened:
PRINT( _L( "MM MTP <> CMediaMtpDataProvider::ProcessNotificationL EMTPSessionOpened event recvd" ) );
-
SessionOpenedL( *reinterpret_cast<const TMTPNotificationParamsSessionChange*> ( aParams ) );
break;
@@ -205,14 +211,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();
@@ -231,9 +242,9 @@
iIsSessionOpen = EFalse;
TInt count = iActiveProcessors.Count();
PRINT1( _L( "MM MTP => CMediaMtpDataProvider::SessionClosedL, total processor count = %d" ), count );
- for( TInt i = 0; i < count; i++ )
+ while ( count-- )
{
- MMmRequestProcessor* processor = iActiveProcessors[i];
+ MMmRequestProcessor* processor = iActiveProcessors[count];
// replaced for the Request() is invalid sometimes
// TUint32 sessionId( processor->Request().Uint32( TMTPTypeRequest::ERequestSessionID ) );
@@ -245,8 +256,16 @@
{
processor->UsbDisconnect(); // Rollback
- iActiveProcessors.Remove( i );
- processor->Release();
+ iActiveProcessors.Remove( count );
+ if ( count == iActiveProcessor )
+ {
+ iActiveProcessorRemoved = ETrue;
+ iActiveProcessor = -1; // update iActiveProcessor
+ }
+ else
+ {
+ processor->Release();
+ }
}
}
@@ -400,6 +419,7 @@
//EMTPFormatCode3GPContainer,
aStrings.AppendL(KFormatExtension3GP);
+ aStrings.AppendL(KFormatExtension3G2);
//EMTPFormatCodeAAC,
aStrings.AppendL(KFormatExtensionAAC);
@@ -500,7 +520,7 @@
// -----------------------------------------------------------------------------
// CMediaMtpDataProvider::GetWrapper
-// return the reference of CMmMtpDpMetadataAccessWrapper to enumerator
+// return wrapper references
// -----------------------------------------------------------------------------
//
CMmMtpDpMetadataAccessWrapper& CMediaMtpDataProvider::GetWrapperL()
@@ -508,6 +528,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
//
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidercopyobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidercopyobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypeobjectproplist.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
@@ -65,7 +64,7 @@
//
CMediaMtpDataProviderCopyObject::~CMediaMtpDataProviderCopyObject()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -78,7 +77,7 @@
MMmMtpDpConfig& aDpConfig ) :
CCopyObject( aFramework, aConnection, aDpConfig )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -124,10 +123,6 @@
{
iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars());
-
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// *textData );
}
CleanupStack::PopAndDestroy( textData ); // - textData
@@ -148,10 +143,6 @@
{
iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData);
-
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// *desData );
}
CleanupStack::PopAndDestroy( desData ); // - desData
@@ -173,19 +164,13 @@
{
iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value());
-
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// uint16 );
}
-
}
break;
case EMTPObjectPropCodeWidth:
case EMTPObjectPropCodeHeight:
case EMTPObjectPropCodeDuration:
- case EMTPObjectPropCodeUseCount:
case EMTPObjectPropCodeSampleRate:
case EMTPObjectPropCodeAudioWAVECodec:
case EMTPObjectPropCodeAudioBitRate:
@@ -204,9 +189,6 @@
{
iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value());
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// uint32 );
}
}
break;
@@ -220,14 +202,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;
@@ -239,12 +216,9 @@
}
// centralize logic to handle error, doing so, that's on need to trap the
- // 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 ) ) ) )
+ // Ignore all errors came from mpx db.
+ // It's enough that only file copied successfully no matter metadata got whatever failure.
+ if ( err != KErrNone )
{
iPropertyElement = NULL;
}
@@ -255,121 +229,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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderdescriptionutility.cpp Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,640 @@
+/*
+* 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 <mtp/cmtptypeobjectpropdesc.h>
+#include <mtp/cmtptypestring.h>
+
+#include "cmediamtpdataproviderdescriptionutility.h"
+#include "mediamtpdataproviderconst.h"
+#include "tobjectdescription.h"
+#include "mmmtpdpconfig.h"
+#include "mmmtpdplogger.h"
+
+
+// -----------------------------------------------------------------------------
+// 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<TUint>* 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 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( KMTPMaxDescriptionLen );
+ 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 );
+
+ // newly added to support 720p content as suggested by Helix team
+ string->SetL( _L("MP@ML"));
+ expectedForm->AppendSupportedValueL( *string );
+ string->SetL( _L("MP@HL"));
+ 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderenumerator.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderenumerator.cpp Mon May 03 12:58:40 2010 +0300
@@ -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(),
@@ -211,14 +219,17 @@
const CMTPStorageMetaData& storage( iFramework.StorageMgr().StorageL( iStorages[0] ) );
TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) );
GetModifiedContentL( root );
- iDataProvider.GetWrapperL().UpdateMusicCollectionL();
+ TRAPD( err, iDataProvider.GetWrapperL().UpdateMusicCollectionL() );
+ if ( err != KErrNone )
+ {
+ PRINT1( _L("MM MTP <> ScanNextStorageL, UpdateMusicCollectionL err =%d "), err );
+ }
iStorages.Remove( 0 );
ScanStorageL( iStorages[0] );
}
else
{
-
// Round trip suppport
const CMTPStorageMetaData& storage( iFramework.StorageMgr().StorageL( iStorages[0] ) );
TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) );
@@ -283,7 +294,7 @@
delete entry;
entry = NULL;
iDir.Close();
-
+
// Scan the next directory of the parent
ScanNextDirL();
}
@@ -314,9 +325,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 +337,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();
@@ -412,7 +423,8 @@
//
TInt CMediaMtpDataProviderEnumerator::RunError( TInt aError )
{
- PRINT1( _L( "MM MTP <> CMediaMtpDataProviderEnumerator::RunError with error %d" ), aError );
+ if ( aError != KErrNone )
+ PRINT1( _L( "MM MTP <> CMediaMtpDataProviderEnumerator::RunError with error %d" ), aError );
TRAP_IGNORE( SignalCompleteL( iDataProvider ) );
@@ -461,34 +473,39 @@
{
PRINT( _L( "MM MTP => CMediaMtpDataProviderEnumerator::ProcessEntriesL" ) );
- TBuf<KMaxFileName> path = iPath.DriveAndPath();
+ TFileName path = iPath.DriveAndPath();
while ( !IsOverThreshold() && iFirstUnprocessed < iEntries.Count() )
{
const TEntry& entry = iEntries[iFirstUnprocessed];
- path.Append( entry.iName );
- PRINT1( _L( "MM MTP <> path = %S" ), &path );
TInt len = entry.iName.Length();
- if ( entry.IsDir() )
+ // Skip object with too long name
+ if ( KMaxFileName >= path.Length() + len )
{
- path.Append( '\\' );
- ++len;
+ path.Append( entry.iName );
+ PRINT1( _L( "MM MTP <> path = %S" ), &path );
+
+ if ( entry.IsDir() )
+ {
+ path.Append( '\\' );
+ ++len;
- // we don't need to process folder, just remember
- // the folder
- TEntry* dirEntry = new TEntry( entry );
- User::LeaveIfNull( dirEntry );
- iDirStack.AppendL( dirEntry );
+ // we don't need to process folder, just remember
+ // the folder
+ TEntry* dirEntry = new TEntry( entry );
+ User::LeaveIfNull( dirEntry );
+ iDirStack.AppendL( dirEntry );
+ }
+ else if ( IsFileAccepted( path ) )
+ {
+ AddEntryL( path );
+ }
+
+ // Remove filename part
+ path.SetLength( path.Length() - len );
}
- else if ( IsFileAccepted( path ) )
- {
- AddEntryL( path );
- }
-
- // Remove filename part
- path.SetLength( path.Length() - len );
iFirstUnprocessed++;
}
@@ -553,7 +570,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 +584,7 @@
}
}
- PERFLOGSTOP(KFormatFilter);
+ PERFLOGSTOP( KFormatFilter );
return accepted;
}
@@ -612,7 +629,9 @@
CDesCArray* modifiedContents = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity );
CleanupStack::PushL( modifiedContents ); // + modifiedContents
- iDataProvider.GetWrapperL().GetModifiedContentL( aStorageRoot, arrayCount, *modifiedContents );
+ TRAPD( err, iDataProvider.GetWrapperL().GetModifiedContentL( aStorageRoot, arrayCount, *modifiedContents ) );
+ if ( err != KErrNone )
+ PRINT1( _L("MM MTP <> GetModifiedContentL err =%d "), err );
if ( arrayCount > 0 )
{
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetformatcapabilities.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/cmtptypeobjectpropdesc.h>
-#include <mtp/mtpprotocolconstants.h>
-#include <mtp/cmtptypestring.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetinterdependentpropdesc.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropdesc.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/cmtptypeobjectpropdesc.h>
-#include <mtp/mtpprotocolconstants.h>
-#include <mtp/cmtptypestring.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectproplist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectproplist.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypeobjectproplist.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
@@ -54,7 +53,7 @@
//
CMediaMtpDataProviderGetObjectPropList::~CMediaMtpDataProviderGetObjectPropList()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -63,10 +62,11 @@
// -----------------------------------------------------------------------------
//
CMediaMtpDataProviderGetObjectPropList::CMediaMtpDataProviderGetObjectPropList( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig ) :
- CGetObjectPropList( aFramework, aConnection, aDpConfig )
+ MMTPConnection& aConnection,
+ MMmMtpDpConfig& aDpConfig ) :
+ CGetObjectPropList( aFramework, aConnection, aDpConfig )
{
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -96,7 +96,6 @@
switch ( aPropCode )
{
- //case EMTPObjectPropCodeName:
case EMTPObjectPropCodeArtist:
case EMTPObjectPropCodeGenre:
case EMTPObjectPropCodeComposer:
@@ -113,11 +112,8 @@
PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL err = %d" ), err );
- if ( err == KErrNone )
- {
- 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
}
@@ -133,12 +129,9 @@
PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL err = %d" ), err );
- if ( err == KErrNone )
- {
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData);
- }
-
+ iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
+ iPropertyElement->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData);
+
CleanupStack::PopAndDestroy( desData ); // - desData
}
break;
@@ -154,18 +147,14 @@
*iObject ) );
PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL err = %d" ), err );
- if ( err == KErrNone )
- {
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value());
- }
+ iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
+ iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value());
}
break;
case EMTPObjectPropCodeWidth:
case EMTPObjectPropCodeHeight:
case EMTPObjectPropCodeDuration:
- case EMTPObjectPropCodeUseCount:
case EMTPObjectPropCodeSampleRate:
case EMTPObjectPropCodeAudioWAVECodec:
case EMTPObjectPropCodeAudioBitRate:
@@ -180,11 +169,8 @@
*iObject ) );
PRINT1( _L( "MM MTP <> CMediaMtpDataProviderGetObjectPropList::ServiceSpecificObjectPropertyL err = %d" ), err );
- if ( err == KErrNone )
- {
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value());
- }
+ iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
+ iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value());
}
break;
@@ -192,10 +178,10 @@
{
TInt drmStatus = MmMtpDpUtility::GetDrmStatus( iObject->DesC( CMTPObjectMetaData::ESuid ) );
TMTPTypeUint8 result;
- result.Set( 0 );
+ result.Set( EMTPDrmStatusNotProtected );
if ( drmStatus == EMTPDrmStatusProtected )
- result.Set( 1 );
+ result.Set( EMTPDrmStatusProtected );
iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EDatatype, EMTPTypeUINT8);
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropvalue.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidergetobjectpropvalue.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
@@ -54,7 +53,7 @@
//
void CMediaMtpDataProviderGetObjectPropValue::ConstructL()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -64,7 +63,7 @@
//
CMediaMtpDataProviderGetObjectPropValue::~CMediaMtpDataProviderGetObjectPropValue()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -77,10 +76,10 @@
MMmMtpDpConfig& aDpConfig ) :
CGetObjectPropValue( aFramework, aConnection, aDpConfig )
{
-
+ // Do nothing
}
-void CMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL(TUint16 aPropCode)
+void CMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL( TUint16 aPropCode )
{
PRINT( _L( "MM MTP => CMediaMtpDataProviderGetObjectPropValue::ServiceSpecificObjectPropertyL" ) );
switch ( aPropCode )
@@ -120,7 +119,6 @@
case EMTPObjectPropCodeWidth: // 0xDC87
case EMTPObjectPropCodeHeight: // 0xDC88
case EMTPObjectPropCodeDuration: // 0xDC89
- case EMTPObjectPropCodeUseCount: // 0xDC91
case EMTPObjectPropCodeSampleRate: // 0xDE93
case EMTPObjectPropCodeAudioWAVECodec: // 0xDE99
case EMTPObjectPropCodeAudioBitRate: // 0xDE9A
@@ -151,7 +149,7 @@
TInt drmStatus = MmMtpDpUtility::GetDrmStatus( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
iMTPTypeUint8.Set( 0 );
- if (drmStatus == EMTPDrmStatusProtected)
+ if ( drmStatus == EMTPDrmStatusProtected )
iMTPTypeUint8.Set( 1 );
SendDataL( iMTPTypeUint8 );
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidermoveobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidermoveobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -1,22 +1,21 @@
/*
-* 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 <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypeobjectproplist.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
@@ -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,29 +122,21 @@
if ( err == KErrNone )
{
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars());
-
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// *textData );
+ iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() );
}
- else if ( err == KErrNotFound )
- {
+ else
+ {
iPropertyElement = NULL;
- }
- else
- {
- User::Leave( err );
- }
+ }
- CleanupStack::PopAndDestroy( textData ); // - textData
+ CleanupStack::PopAndDestroy( textData ); // - textData
}
break;
case EMTPObjectPropCodeDescription:
{
- desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData
+ desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData
TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( aPropCode,
*desData,
@@ -154,24 +146,15 @@
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->SetArrayL( CMTPTypeObjectPropListElement::EValue, *desData );
}
- else if ( err == KErrNotFound )
+ else
{
iPropertyElement = NULL;
}
- else
- {
- User::Leave( err );
- }
- CleanupStack::PopAndDestroy( desData ); // - desData
+ CleanupStack::PopAndDestroy( desData ); // - desData
}
break;
@@ -188,21 +171,12 @@
if ( err == KErrNone )
{
-
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value());
-
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// uint16 );
- }
- else if ( err == KErrNotFound )
- {
- iPropertyElement = NULL;
+ iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetUint16L( CMTPTypeObjectPropListElement::EValue, uint16.Value() );
}
else
{
- User::Leave( err );
+ iPropertyElement = NULL;
}
}
break;
@@ -210,7 +184,6 @@
case EMTPObjectPropCodeWidth:
case EMTPObjectPropCodeHeight:
case EMTPObjectPropCodeDuration:
- case EMTPObjectPropCodeUseCount:
case EMTPObjectPropCodeSampleRate:
case EMTPObjectPropCodeAudioWAVECodec:
case EMTPObjectPropCodeAudioBitRate:
@@ -227,20 +200,12 @@
if ( err == KErrNone )
{
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value());
-
-// iPropertyElement = CMTPTypeObjectPropListElement::NewL( aHandle,
-// aPropCode,
-// uint32 );
- }
- else if ( err == KErrNotFound )
- {
- iPropertyElement = NULL;
+ iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, uint32.Value() );
}
else
{
- User::Leave( err );
+ iPropertyElement = NULL;
}
}
break;
@@ -254,129 +219,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 +232,7 @@
break;
}
- PRINT( _L( "MM MTP <= CMediaMtpDataProviderMoveObject::ServiceSetSpecificObjectPropertyL" ) );
-
- return responseCode;
+ PRINT( _L( "MM MTP <= CMediaMtpDataProviderMoveObject::ServiceSpecificObjectPropertyL" ) );
}
// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderpropertysettingutility.cpp Mon May 03 12:58:40 2010 +0300
@@ -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 <mtp/cmtptypeobjectproplist.h>
+#include <mtp/cmtptypestring.h>
+#include <mtp/cmtptypearray.h>
+#include <mtp/tmtptypeuint8.h>
+#include <mtp/tmtptypeuint16.h>
+#include <mtp/tmtptypeuint32.h>
+#include <mtp/mtpdatatypeconstants.h>
+#include <mtp/cmtpobjectmetadata.h>
+
+#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 = SetMetaDataToWrapper( 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 = SetMetaDataToWrapper( aDpConfig,
+ aPropCode,
+ *desData,
+ aObject );
+ CleanupStack::PopAndDestroy( desData ); // - desData
+ }
+ break;
+
+ case EMTPObjectPropCodeWidth:
+ case EMTPObjectPropCodeHeight:
+ case EMTPObjectPropCodeDuration:
+ case EMTPObjectPropCodeSampleRate:
+ case EMTPObjectPropCodeAudioWAVECodec:
+ case EMTPObjectPropCodeAudioBitRate:
+ case EMTPObjectPropCodeVideoFourCCCodec:
+ case EMTPObjectPropCodeFramesPerThousandSeconds:
+ case EMTPObjectPropCodeKeyFrameDistance:
+ {
+ TMTPTypeUint32 uint32( aElement.Uint32L( CMTPTypeObjectPropListElement::EValue ) );
+ responseCode = SetMetaDataToWrapper( aDpConfig,
+ aPropCode,
+ uint32,
+ aObject );
+ }
+ break;
+
+ case EMTPObjectPropCodeTrack:
+ case EMTPObjectPropCodeNumberOfChannels:
+ case EMTPObjectPropCodeScanType:
+ case EMTPObjectPropCodeDRMStatus:
+ {
+ TMTPTypeUint16 uint16( aElement.Uint16L( CMTPTypeObjectPropListElement::EValue ) );
+ responseCode = SetMetaDataToWrapper( 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersendobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtptypeobjectproplist.h>
-#include <mtp/cmtptypestring.h>
-#include <mtp/cmtptypearray.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectproplist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ /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 <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtptypeobjectproplist.h>
-#include <mtp/cmtptypestring.h>
-#include <mtp/cmtptypearray.h>
-
-#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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectpropvalue.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataprovidersetobjectpropvalue.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
#include <mtp/mmtpobjectmgr.h>
@@ -54,7 +53,7 @@
//
void CMediaMtpDataProviderSetObjectPropValue::ConstructL()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -65,9 +64,9 @@
CMediaMtpDataProviderSetObjectPropValue::CMediaMtpDataProviderSetObjectPropValue( MMTPDataProviderFramework& aFramework,
MMTPConnection& aConnection,
MMmMtpDpConfig& aDpConfig ) :
- CSetObjectPropValue( aFramework, aConnection, aDpConfig )
+ CSetObjectPropValue( aFramework, aConnection, aDpConfig )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -77,7 +76,7 @@
//
CMediaMtpDataProviderSetObjectPropValue::~CMediaMtpDataProviderSetObjectPropValue()
{
-
+ // Do nothing
}
TBool CMediaMtpDataProviderSetObjectPropValue::IsSpecificPropCodeReadOnly( TUint16 aPropCode ) const
@@ -132,7 +131,6 @@
case EMTPObjectPropCodeWidth: // 0xDC87
case EMTPObjectPropCodeHeight: // 0xDC88
case EMTPObjectPropCodeDuration: // 0xDC89
- case EMTPObjectPropCodeUseCount: // 0xDC91
case EMTPObjectPropCodeSampleRate: // 0xDE93
case EMTPObjectPropCodeAudioWAVECodec: // 0xDE99
case EMTPObjectPropCodeAudioBitRate: // 0xDE9A
@@ -185,7 +183,6 @@
case EMTPObjectPropCodeWidth: //0xDC87
case EMTPObjectPropCodeHeight: //0xDC88
case EMTPObjectPropCodeDuration: //0xDC89
- case EMTPObjectPropCodeUseCount: //0xDC91
case EMTPObjectPropCodeSampleRate: //0xDE93
case EMTPObjectPropCodeAudioWAVECodec: //0xDE99
case EMTPObjectPropCodeAudioBitRate: //0xDE9A
@@ -221,12 +218,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;
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataprovidercontrollerimp.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataprovidercontrollerimp.cpp Mon May 03 12:58:40 2010 +0300
@@ -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;
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataproviderprocessor.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/mediamtpdataproviderprocessor.cpp Mon May 03 12:58:40 2010 +0300
@@ -18,54 +18,51 @@
#include <mtp/tmtptyperequest.h>
-//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
};
// -----------------------------------------------------------------------------
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/bwins/mmmtpdprequestprocessoru.def Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/bwins/mmmtpdprequestprocessoru.def Mon May 03 12:58:40 2010 +0300
@@ -3,152 +3,157 @@
?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 &)
- ?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 &)
- ?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
- ??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)
+ ?Release@CMmMtpDpAccessSingleton@@SAXXZ @ 22 NONAME ; void CMmMtpDpAccessSingleton::Release(void)
+ ?UsbDisconnect@CSendObject@@MAEXXZ @ 23 NONAME ; void CSendObject::UsbDisconnect(void)
+ ?ServiceL@CGetFormatCapabilities@@MAEXXZ @ 24 NONAME ; void CGetFormatCapabilities::ServiceL(void)
+ ?GetAllReferenceL@CMmMtpDpMetadataAccessWrapper@@QAEXPAVCMPXMedia@@AAVCDesC16Array@@@Z @ 25 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetAllReferenceL(class CMPXMedia *, class CDesC16Array &)
+ ??1CSetObjectPropList@@UAE@XZ @ 26 NONAME ; CSetObjectPropList::~CSetObjectPropList(void)
+ ?ServiceL@CSetObjectPropList@@MAEXXZ @ 27 NONAME ; void CSetObjectPropList::ServiceL(void)
+ ??0CMoveObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 28 NONAME ; CMoveObject::CMoveObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ??0CRequestUnknown@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 29 NONAME ; CRequestUnknown::CRequestUnknown(class MMTPDataProviderFramework &, class MMTPConnection &)
+ ?ConstructL@CGetObjectPropList@@IAEXXZ @ 30 NONAME ; void CGetObjectPropList::ConstructL(void)
+ ??1CSendObject@@UAE@XZ @ 31 NONAME ; CSendObject::~CSendObject(void)
+ ?ServiceMetaDataFromWrapperL@CGetObjectPropValue@@IAEXGAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 32 NONAME ; void CGetObjectPropValue::ServiceMetaDataFromWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &)
+ ?NewL@CGetObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 33 NONAME ; class MMmRequestProcessor * CGetObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ??1CGetObjectPropValue@@UAE@XZ @ 34 NONAME ; CGetObjectPropValue::~CGetObjectPropValue(void)
+ ?CreateL@CMmMtpDpAccessSingleton@@SAXAAVMMTPDataProviderFramework@@@Z @ 35 NONAME ; void CMmMtpDpAccessSingleton::CreateL(class MMTPDataProviderFramework &)
+ ??1CGetFormatCapabilities@@UAE@XZ @ 36 NONAME ; CGetFormatCapabilities::~CGetFormatCapabilities(void)
+ ?ServiceL@CSetObjectReferences@@EAEXXZ @ 37 NONAME ; void CSetObjectReferences::ServiceL(void)
+ ?DoHandleDataIToRPhaseL@CRequestProcessor@@MAEHXZ @ 38 NONAME ; int CRequestProcessor::DoHandleDataIToRPhaseL(void)
+ ??0CGetObjectPropList@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 39 NONAME ; CGetObjectPropList::CGetObjectPropList(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?ConstructL@CCopyObject@@IAEXXZ @ 40 NONAME ; void CCopyObject::ConstructL(void)
+ ?SetMetaDataToWrapper@CPropertySettingUtility@@QAE?AW4TMTPResponseCode@@AAVMMmMtpDpConfig@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 41 NONAME ; enum TMTPResponseCode CPropertySettingUtility::SetMetaDataToWrapper(class MMmMtpDpConfig &, unsigned short, class MMTPType &, class CMTPObjectMetaData const &)
+ ?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
+ ?DoCancel@CRequestProcessor@@MAEXXZ @ 52 NONAME ; void CRequestProcessor::DoCancel(void)
+ ?CheckRequestL@CGetPartialObject@@MAE?AW4TMTPResponseCode@@XZ @ 53 NONAME ; enum TMTPResponseCode CGetPartialObject::CheckRequestL(void)
+ ?NewL@CRequestUnknown@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 54 NONAME ; class MMmRequestProcessor * CRequestUnknown::NewL(class MMTPDataProviderFramework &, class MMTPConnection &)
+ ??0CGetFormatCapabilities@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 55 NONAME ; CGetFormatCapabilities::CGetFormatCapabilities(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?ConstructL@CGetObjectInfo@@AAEXXZ @ 56 NONAME ; void CGetObjectInfo::ConstructL(void)
+ ?UsbDisconnect@CRequestProcessor@@MAEXXZ @ 57 NONAME ; void CRequestProcessor::UsbDisconnect(void)
+ ?UpdateMusicCollectionL@CMmMtpDpMetadataAccessWrapper@@QAEXXZ @ 58 NONAME ; void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL(void)
+ ??1CMoveObject@@UAE@XZ @ 59 NONAME ; CMoveObject::~CMoveObject(void)
+ ?CheckRequestL@CSendObject@@MAE?AW4TMTPResponseCode@@XZ @ 60 NONAME ; enum TMTPResponseCode CSendObject::CheckRequestL(void)
+ ??1CRequestProcessor@@MAE@XZ @ 61 NONAME ; CRequestProcessor::~CRequestProcessor(void)
+ ?DoCancel@CDeleteObject@@MAEXXZ @ 62 NONAME ; void CDeleteObject::DoCancel(void)
+ ??1CGetObject@@UAE@XZ @ 63 NONAME ; CGetObject::~CGetObject(void)
+ ?NewL@CGetInterdependentPropDesc@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 64 NONAME ; class MMmRequestProcessor * CGetInterdependentPropDesc::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?DoHandleResponsePhaseL@CSetObjectReferences@@EAEHXZ @ 65 NONAME ; int CSetObjectReferences::DoHandleResponsePhaseL(void)
+ ?GetAccessWrapperL@CMmMtpDpAccessSingleton@@SAAAVCMmMtpDpMetadataAccessWrapper@@XZ @ 66 NONAME ; class CMmMtpDpMetadataAccessWrapper & CMmMtpDpAccessSingleton::GetAccessWrapperL(void)
+ ??1CGetObjectPropsSupported@@UAE@XZ @ 67 NONAME ; CGetObjectPropsSupported::~CGetObjectPropsSupported(void)
+ ?CheckRequestL@CGetObjectPropList@@MAE?AW4TMTPResponseCode@@XZ @ 68 NONAME ; enum TMTPResponseCode CGetObjectPropList::CheckRequestL(void)
+ ?HasDataphase@CRequestProcessor@@MBEHXZ @ 69 NONAME ; int CRequestProcessor::HasDataphase(void) const
+ ?NewL@CGetObjectPropsSupported@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 70 NONAME ; class MMmRequestProcessor * CGetObjectPropsSupported::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?Connection@CRequestProcessor@@MBEAAVMMTPConnection@@XZ @ 71 NONAME ; class MMTPConnection & CRequestProcessor::Connection(void) const
+ ?ConstructL@CGetFormatCapabilities@@AAEXXZ @ 72 NONAME ; void CGetFormatCapabilities::ConstructL(void)
+ ??1CPropertySettingUtility@@UAE@XZ @ 73 NONAME ; CPropertySettingUtility::~CPropertySettingUtility(void)
+ ??1CGetPartialObject@@UAE@XZ @ 74 NONAME ; CGetPartialObject::~CGetPartialObject(void)
+ ?NewL@CGetObjectInfo@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 75 NONAME ; class MMmRequestProcessor * CGetObjectInfo::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?RunError@CSetObjectPropList@@MAEHH@Z @ 76 NONAME ; int CSetObjectPropList::RunError(int)
+ ?CheckRequestL@CGetInterdependentPropDesc@@MAE?AW4TMTPResponseCode@@XZ @ 77 NONAME ; enum TMTPResponseCode CGetInterdependentPropDesc::CheckRequestL(void)
+ ?Match@CRequestUnknown@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 78 NONAME ; int CRequestUnknown::Match(class TMTPTypeRequest const &, class MMTPConnection &) const
+ ?ServiceL@CMoveObject@@MAEXXZ @ 79 NONAME ; void CMoveObject::ServiceL(void)
+ ?CreateDummyFile@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 80 NONAME ; void CMmMtpDpMetadataAccessWrapper::CreateDummyFile(class TDesC16 const &)
+ ?CheckRequestL@CGetObjectPropDesc@@MAE?AW4TMTPResponseCode@@XZ @ 81 NONAME ; enum TMTPResponseCode CGetObjectPropDesc::CheckRequestL(void)
+ ?DoHandleRToIPhaseL@CRequestProcessor@@MAEHXZ @ 82 NONAME ; int CRequestProcessor::DoHandleRToIPhaseL(void)
+ ?ServiceMetaDataToWrapperL@CSetObjectPropValue@@IAE?AW4TMTPResponseCode@@GAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 83 NONAME ; enum TMTPResponseCode CSetObjectPropValue::ServiceMetaDataToWrapperL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &)
+ ?NewCommonObjectPropertyL@CDescriptionUtility@@QAEPAVCMTPTypeObjectPropDesc@@G@Z @ 84 NONAME ; class CMTPTypeObjectPropDesc * CDescriptionUtility::NewCommonObjectPropertyL(unsigned short)
+ ?FormatFromFilename@MmMtpDpUtility@@SA?AW4TMTPFormatCode@@ABVTDesC16@@@Z @ 85 NONAME ; enum TMTPFormatCode MmMtpDpUtility::FormatFromFilename(class TDesC16 const &)
+ ?CheckRequestL@CSetObjectPropValue@@MAE?AW4TMTPResponseCode@@XZ @ 86 NONAME ; enum TMTPResponseCode CSetObjectPropValue::CheckRequestL(void)
+ ??0CPropertySettingUtility@@IAE@XZ @ 87 NONAME ; CPropertySettingUtility::CPropertySettingUtility(void)
+ ?Match@CRequestProcessor@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 88 NONAME ; int CRequestProcessor::Match(class TMTPTypeRequest const &, class MMTPConnection &) const
+ ??0CCopyObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 89 NONAME ; CCopyObject::CCopyObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?CheckRequestL@CRequestProcessor@@MAE?AW4TMTPResponseCode@@XZ @ 90 NONAME ; enum TMTPResponseCode CRequestProcessor::CheckRequestL(void)
+ ?SendResponseL@CRequestProcessor@@IAEXW4TMTPResponseCode@@HPAK@Z @ 91 NONAME ; void CRequestProcessor::SendResponseL(enum TMTPResponseCode, int, unsigned long *)
+ ??0CGetPartialObject@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@@Z @ 92 NONAME ; CGetPartialObject::CGetPartialObject(class MMTPDataProviderFramework &, class MMTPConnection &)
+ ?DoHandleCompletingPhaseL@CRequestProcessor@@MAEHXZ @ 93 NONAME ; int CRequestProcessor::DoHandleCompletingPhaseL(void)
+ ?DeleteDummyFile@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 94 NONAME ; void CMmMtpDpMetadataAccessWrapper::DeleteDummyFile(class TDesC16 const &)
+ ?DoSetObjectReferencesL@CSetObjectReferences@@IAEXABVCMTPObjectMetaData@@@Z @ 95 NONAME ; void CSetObjectReferences::DoSetObjectReferencesL(class CMTPObjectMetaData const &)
+ ??1CGetObjectInfo@@UAE@XZ @ 96 NONAME ; CGetObjectInfo::~CGetObjectInfo(void)
+ ?ServiceL@CRequestUnknown@@MAEXXZ @ 97 NONAME ; void CRequestUnknown::ServiceL(void)
+ ?HasDataphase@CSetObjectPropList@@MBEHXZ @ 98 NONAME ; int CSetObjectPropList::HasDataphase(void) const
+ ?NewL@CGetObjectReferences@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 99 NONAME ; class MMmRequestProcessor * CGetObjectReferences::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?DoCancel@CRenameObject@@MAEXXZ @ 100 NONAME ; void CRenameObject::DoCancel(void)
+ ??1CSetObjectReferences@@UAE@XZ @ 101 NONAME ; CSetObjectReferences::~CSetObjectReferences(void)
+ ?Match@CSendObject@@MBEHABVTMTPTypeRequest@@AAVMMTPConnection@@@Z @ 102 NONAME ; int CSendObject::Match(class TMTPTypeRequest const &, class MMTPConnection &) const
+ ?NewL@CSetObjectPropList@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 103 NONAME ; class MMmRequestProcessor * CSetObjectPropList::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?GetAllAbstractMediaL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@PAPAVCMPXMediaArray@@W4TMPXGeneralCategory@@@Z @ 104 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetAllAbstractMediaL(class TDesC16 const &, class CMPXMediaArray * *, enum TMPXGeneralCategory)
+ ??1CCopyObject@@UAE@XZ @ 105 NONAME ; CCopyObject::~CCopyObject(void)
+ ?GetModifiedContentL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@AAHAAVCDesC16Array@@@Z @ 106 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetModifiedContentL(class TDesC16 const &, int &, class CDesC16Array &)
+ ?RunL@CGetObjectPropList@@MAEXXZ @ 107 NONAME ; void CGetObjectPropList::RunL(void)
+ ?NewRangeFormDescriptionL@CDescriptionUtility@@QAEPAVCMTPTypeObjectPropDesc@@GKKKH@Z @ 108 NONAME ; class CMTPTypeObjectPropDesc * CDescriptionUtility::NewRangeFormDescriptionL(unsigned short, unsigned long, unsigned long, unsigned long, int)
+ ?RunError@CRequestProcessor@@MAEHH@Z @ 109 NONAME ; int CRequestProcessor::RunError(int)
+ ?SessionId@CRequestProcessor@@MAEKXZ @ 110 NONAME ; unsigned long CRequestProcessor::SessionId(void)
+ ??0CDescriptionUtility@@IAE@XZ @ 111 NONAME ; CDescriptionUtility::CDescriptionUtility(void)
+ ?HandleEventL@CRequestProcessor@@MAEXABVTMTPTypeEvent@@@Z @ 112 NONAME ; void CRequestProcessor::HandleEventL(class TMTPTypeEvent const &)
+ ?NewL@CGetPartialObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 113 NONAME ; class MMmRequestProcessor * CGetPartialObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?HasDataphase@CSetObjectReferences@@EBEHXZ @ 114 NONAME ; int CSetObjectReferences::HasDataphase(void) const
+ ?ConstructL@CGetInterdependentPropDesc@@IAEXXZ @ 115 NONAME ; void CGetInterdependentPropDesc::ConstructL(void)
+ ?RunError@CGetObjectPropList@@MAEHH@Z @ 116 NONAME ; int CGetObjectPropList::RunError(int)
+ ?DoHandleResponsePhaseL@CSetObjectPropList@@MAEHXZ @ 117 NONAME ; int CSetObjectPropList::DoHandleResponsePhaseL(void)
+ ??0CDeleteObject@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 118 NONAME ; CDeleteObject::CDeleteObject(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?NewL@CRenameObject@@SAPAV1@AAVMMTPDataProviderFramework@@AAVCMmMtpDpMetadataAccessWrapper@@@Z @ 119 NONAME ; class CRenameObject * CRenameObject::NewL(class MMTPDataProviderFramework &, class CMmMtpDpMetadataAccessWrapper &)
+ ?RenameObjectL@CMmMtpDpMetadataAccessWrapper@@QAEXABVCMTPObjectMetaData@@ABVTDesC16@@@Z @ 120 NONAME ; void CMmMtpDpMetadataAccessWrapper::RenameObjectL(class CMTPObjectMetaData const &, class TDesC16 const &)
+ ?GetObjectMetadataValueL@CMmMtpDpMetadataAccessWrapper@@QAEXGAAVMMTPType@@ABVCMTPObjectMetaData@@@Z @ 121 NONAME ; void CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL(unsigned short, class MMTPType &, class CMTPObjectMetaData const &)
+ ?AddDummyFileL@CMmMtpDpMetadataAccessWrapper@@QAEXABVTDesC16@@@Z @ 122 NONAME ; void CMmMtpDpMetadataAccessWrapper::AddDummyFileL(class TDesC16 const &)
+ ??0CGetObjectPropDesc@@AAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 123 NONAME ; CGetObjectPropDesc::CGetObjectPropDesc(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ?ConstructL@CGetObjectPropDesc@@AAEXXZ @ 124 NONAME ; void CGetObjectPropDesc::ConstructL(void)
+ ??0CGetInterdependentPropDesc@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 125 NONAME ; CGetInterdependentPropDesc::CGetInterdependentPropDesc(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ??1CGetObjectPropDesc@@UAE@XZ @ 126 NONAME ; CGetObjectPropDesc::~CGetObjectPropDesc(void)
+ ?ServiceL@CGetObjectPropDesc@@MAEXXZ @ 127 NONAME ; void CGetObjectPropDesc::ServiceL(void)
+ ?HasDataphase@CSetObjectPropValue@@MBEHXZ @ 128 NONAME ; int CSetObjectPropValue::HasDataphase(void) const
+ ?ServiceL@CCopyObject@@MAEXXZ @ 129 NONAME ; void CCopyObject::ServiceL(void)
+ ?CheckRequestL@CGetObjectPropValue@@MAE?AW4TMTPResponseCode@@XZ @ 130 NONAME ; enum TMTPResponseCode CGetObjectPropValue::CheckRequestL(void)
+ ?CloseSessionL@CMmMtpDpAccessSingleton@@SAXXZ @ 131 NONAME ; void CMmMtpDpAccessSingleton::CloseSessionL(void)
+ ?NewL@CGetFormatCapabilities@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 132 NONAME ; class MMmRequestProcessor * CGetFormatCapabilities::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
?ReceiveDataL@CRequestProcessor@@IAEXAAVMMTPType@@@Z @ 133 NONAME ; void CRequestProcessor::ReceiveDataL(class MMTPType &)
- ?ConstructL@CMoveObject@@IAEXXZ @ 134 NONAME ; void CMoveObject::ConstructL(void)
+ ??1CDescriptionUtility@@UAE@XZ @ 134 NONAME ; CDescriptionUtility::~CDescriptionUtility(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 &)
+ ?ConstructL@CMoveObject@@IAEXXZ @ 136 NONAME ; void CMoveObject::ConstructL(void)
+ ?NewL@CSendObject@@SAPAVMMmRequestProcessor@@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 137 NONAME ; class MMmRequestProcessor * CSendObject::NewL(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ??1CGetObjectReferences@@UAE@XZ @ 138 NONAME ; CGetObjectReferences::~CGetObjectReferences(void)
+ ?HasDataphase@CSendObject@@MBEHXZ @ 139 NONAME ; int CSendObject::HasDataphase(void) const
+ ??1CSetObjectPropValue@@UAE@XZ @ 140 NONAME ; CSetObjectPropValue::~CSetObjectPropValue(void)
+ ?ConstructL@CRenameObject@@IAEXXZ @ 141 NONAME ; void CRenameObject::ConstructL(void)
+ ?SendDataL@CRequestProcessor@@IAEXABVMMTPType@@@Z @ 142 NONAME ; void CRequestProcessor::SendDataL(class MMTPType const &)
+ ?DoHandleResponsePhaseL@CSendObject@@MAEHXZ @ 143 NONAME ; int CSendObject::DoHandleResponsePhaseL(void)
+ ?SetReferenceL@CMmMtpDpMetadataAccessWrapper@@QAEXABVCMTPObjectMetaData@@AAVCDesC16Array@@@Z @ 144 NONAME ; void CMmMtpDpMetadataAccessWrapper::SetReferenceL(class CMTPObjectMetaData const &, class CDesC16Array &)
+ ?DoCancel@CGetObjectPropList@@MAEXXZ @ 145 NONAME ; void CGetObjectPropList::DoCancel(void)
+ ?ServiceL@CGetInterdependentPropDesc@@MAEXXZ @ 146 NONAME ; void CGetInterdependentPropDesc::ServiceL(void)
+ ?DoHandleRequestPhaseL@CRequestProcessor@@MAEHXZ @ 147 NONAME ; int CRequestProcessor::DoHandleRequestPhaseL(void)
+ ?GetAbstractMediaNameL@CMmMtpDpMetadataAccessWrapper@@QAEPAVHBufC16@@PAVCMPXMedia@@W4TMPXGeneralCategory@@@Z @ 148 NONAME ; class HBufC16 * CMmMtpDpMetadataAccessWrapper::GetAbstractMediaNameL(class CMPXMedia *, enum TMPXGeneralCategory)
+ ?ServiceL@CSetObjectPropValue@@MAEXXZ @ 149 NONAME ; void CSetObjectPropValue::ServiceL(void)
+ ?RunError@CRenameObject@@MAEHH@Z @ 150 NONAME ; int CRenameObject::RunError(int)
+ ??1CDeleteObject@@UAE@XZ @ 151 NONAME ; CDeleteObject::~CDeleteObject(void)
+ ?DoHandleResponsePhaseL@CGetPartialObject@@MAEHXZ @ 152 NONAME ; int CGetPartialObject::DoHandleResponsePhaseL(void)
+ ?CheckRequestL@CGetFormatCapabilities@@MAE?AW4TMTPResponseCode@@XZ @ 153 NONAME ; enum TMTPResponseCode CGetFormatCapabilities::CheckRequestL(void)
+ ??0CSetObjectPropValue@@IAE@AAVMMTPDataProviderFramework@@AAVMMTPConnection@@AAVMMmMtpDpConfig@@@Z @ 154 NONAME ; CSetObjectPropValue::CSetObjectPropValue(class MMTPDataProviderFramework &, class MMTPConnection &, class MMmMtpDpConfig &)
+ ??1CGetObjectPropList@@UAE@XZ @ 155 NONAME ; CGetObjectPropList::~CGetObjectPropList(void)
+ ?ServiceL@CGetObjectPropList@@MAEXXZ @ 156 NONAME ; void CGetObjectPropList::ServiceL(void)
+ ??0CRenameObject@@IAE@AAVMMTPDataProviderFramework@@AAVCMmMtpDpMetadataAccessWrapper@@@Z @ 157 NONAME ; CRenameObject::CRenameObject(class MMTPDataProviderFramework &, class CMmMtpDpMetadataAccessWrapper &)
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/eabi/mmmtpdprequestprocessoru.def Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/eabi/mmmtpdprequestprocessoru.def Mon May 03 12:58:40 2010 +0300
@@ -4,156 +4,156 @@
_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
- _ZN22CGetFormatCapabilities8ServiceLEv @ 155 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
+ _ZN15CRequestUnknown4NewLER25MMTPDataProviderFrameworkR14MMTPConnection @ 51 NONAME
+ _ZN15CRequestUnknown8ServiceLEv @ 52 NONAME
+ _ZN15CRequestUnknownC1ER25MMTPDataProviderFrameworkR14MMTPConnection @ 53 NONAME
+ _ZN15CRequestUnknownC2ER25MMTPDataProviderFrameworkR14MMTPConnection @ 54 NONAME
+ _ZN15CRequestUnknownD0Ev @ 55 NONAME
+ _ZN15CRequestUnknownD1Ev @ 56 NONAME
+ _ZN15CRequestUnknownD2Ev @ 57 NONAME
+ _ZN17CGetPartialObject13CheckRequestLEv @ 58 NONAME
+ _ZN17CGetPartialObject22DoHandleResponsePhaseLEv @ 59 NONAME
+ _ZN17CGetPartialObject4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 60 NONAME
+ _ZN17CGetPartialObject8ServiceLEv @ 61 NONAME
+ _ZN17CGetPartialObjectC1ER25MMTPDataProviderFrameworkR14MMTPConnection @ 62 NONAME
+ _ZN17CGetPartialObjectC2ER25MMTPDataProviderFrameworkR14MMTPConnection @ 63 NONAME
+ _ZN17CGetPartialObjectD0Ev @ 64 NONAME
+ _ZN17CGetPartialObjectD1Ev @ 65 NONAME
+ _ZN17CGetPartialObjectD2Ev @ 66 NONAME
+ _ZN17CRequestProcessor12HandleEventLERK13TMTPTypeEvent @ 67 NONAME
+ _ZN17CRequestProcessor12ReceiveDataLER8MMTPType @ 68 NONAME
+ _ZN17CRequestProcessor13CheckRequestLEv @ 69 NONAME
+ _ZN17CRequestProcessor13SendResponseLE16TMTPResponseCodeiPm @ 70 NONAME
+ _ZN17CRequestProcessor13UsbDisconnectEv @ 71 NONAME
+ _ZN17CRequestProcessor14HandleRequestLERK15TMTPTypeRequest20TMTPTransactionPhase @ 72 NONAME
+ _ZN17CRequestProcessor18DoHandleRToIPhaseLEv @ 73 NONAME
+ _ZN17CRequestProcessor21DoHandleRequestPhaseLEv @ 74 NONAME
+ _ZN17CRequestProcessor22DoHandleDataIToRPhaseLEv @ 75 NONAME
+ _ZN17CRequestProcessor22DoHandleResponsePhaseLEv @ 76 NONAME
+ _ZN17CRequestProcessor24DoHandleCompletingPhaseLEv @ 77 NONAME
+ _ZN17CRequestProcessor4RunLEv @ 78 NONAME
+ _ZN17CRequestProcessor7ReleaseEv @ 79 NONAME
+ _ZN17CRequestProcessor8DoCancelEv @ 80 NONAME
+ _ZN17CRequestProcessor8RunErrorEi @ 81 NONAME
+ _ZN17CRequestProcessor9SendDataLERK8MMTPType @ 82 NONAME
+ _ZN17CRequestProcessor9SessionIdEv @ 83 NONAME
+ _ZN17CRequestProcessorC2ER25MMTPDataProviderFrameworkR14MMTPConnectioniPK22TMTPRequestElementInfo @ 84 NONAME
+ _ZN17CRequestProcessorD0Ev @ 85 NONAME
+ _ZN17CRequestProcessorD1Ev @ 86 NONAME
+ _ZN17CRequestProcessorD2Ev @ 87 NONAME
+ _ZN18CGetObjectPropDesc10ConstructLEv @ 88 NONAME
+ _ZN18CGetObjectPropDesc13CheckRequestLEv @ 89 NONAME
+ _ZN18CGetObjectPropDesc4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 90 NONAME
+ _ZN18CGetObjectPropDesc8ServiceLEv @ 91 NONAME
+ _ZN18CGetObjectPropDescC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 92 NONAME
+ _ZN18CGetObjectPropDescC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 93 NONAME
+ _ZN18CGetObjectPropDescD0Ev @ 94 NONAME
+ _ZN18CGetObjectPropDescD1Ev @ 95 NONAME
+ _ZN18CGetObjectPropDescD2Ev @ 96 NONAME
+ _ZN18CGetObjectPropList10ConstructLEv @ 97 NONAME
+ _ZN18CGetObjectPropList13CheckRequestLEv @ 98 NONAME
+ _ZN18CGetObjectPropList4RunLEv @ 99 NONAME
+ _ZN18CGetObjectPropList8DoCancelEv @ 100 NONAME
+ _ZN18CGetObjectPropList8RunErrorEi @ 101 NONAME
+ _ZN18CGetObjectPropList8ServiceLEv @ 102 NONAME
+ _ZN18CGetObjectPropListC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 103 NONAME
+ _ZN18CGetObjectPropListD0Ev @ 104 NONAME
+ _ZN18CGetObjectPropListD1Ev @ 105 NONAME
+ _ZN18CGetObjectPropListD2Ev @ 106 NONAME
+ _ZN18CSetObjectPropList13CheckRequestLEv @ 107 NONAME
+ _ZN18CSetObjectPropList22DoHandleResponsePhaseLEv @ 108 NONAME
+ _ZN18CSetObjectPropList4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 109 NONAME
+ _ZN18CSetObjectPropList4RunLEv @ 110 NONAME
+ _ZN18CSetObjectPropList8DoCancelEv @ 111 NONAME
+ _ZN18CSetObjectPropList8RunErrorEi @ 112 NONAME
+ _ZN18CSetObjectPropList8ServiceLEv @ 113 NONAME
+ _ZN18CSetObjectPropListD0Ev @ 114 NONAME
+ _ZN18CSetObjectPropListD1Ev @ 115 NONAME
+ _ZN18CSetObjectPropListD2Ev @ 116 NONAME
+ _ZN19CDescriptionUtility24NewCommonObjectPropertyLEt @ 117 NONAME
+ _ZN19CDescriptionUtility24NewRangeFormDescriptionLEtmmmi @ 118 NONAME
+ _ZN19CDescriptionUtilityC2Ev @ 119 NONAME
+ _ZN19CDescriptionUtilityD0Ev @ 120 NONAME
+ _ZN19CDescriptionUtilityD1Ev @ 121 NONAME
+ _ZN19CDescriptionUtilityD2Ev @ 122 NONAME
+ _ZN19CGetObjectPropValue13CheckRequestLEv @ 123 NONAME
+ _ZN19CGetObjectPropValue27ServiceMetaDataFromWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 124 NONAME
+ _ZN19CGetObjectPropValue8ServiceLEv @ 125 NONAME
+ _ZN19CGetObjectPropValueC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 126 NONAME
+ _ZN19CGetObjectPropValueD0Ev @ 127 NONAME
+ _ZN19CGetObjectPropValueD1Ev @ 128 NONAME
+ _ZN19CGetObjectPropValueD2Ev @ 129 NONAME
+ _ZN19CSetObjectPropValue13CheckRequestLEv @ 130 NONAME
+ _ZN19CSetObjectPropValue22DoHandleResponsePhaseLEv @ 131 NONAME
+ _ZN19CSetObjectPropValue25ServiceMetaDataToWrapperLEtR8MMTPTypeRK18CMTPObjectMetaData @ 132 NONAME
+ _ZN19CSetObjectPropValue8ServiceLEv @ 133 NONAME
+ _ZN19CSetObjectPropValueC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 134 NONAME
+ _ZN19CSetObjectPropValueD0Ev @ 135 NONAME
+ _ZN19CSetObjectPropValueD1Ev @ 136 NONAME
+ _ZN19CSetObjectPropValueD2Ev @ 137 NONAME
+ _ZN20CGetObjectReferences4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 138 NONAME
+ _ZN20CGetObjectReferencesD0Ev @ 139 NONAME
+ _ZN20CGetObjectReferencesD1Ev @ 140 NONAME
+ _ZN20CGetObjectReferencesD2Ev @ 141 NONAME
+ _ZN20CSetObjectReferences22DoHandleResponsePhaseLEv @ 142 NONAME
+ _ZN20CSetObjectReferences22DoSetObjectReferencesLERK18CMTPObjectMetaData @ 143 NONAME
+ _ZN20CSetObjectReferences4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 144 NONAME
+ _ZN20CSetObjectReferences8ServiceLEv @ 145 NONAME
+ _ZN20CSetObjectReferencesC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 146 NONAME
+ _ZN20CSetObjectReferencesC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 147 NONAME
+ _ZN20CSetObjectReferencesD0Ev @ 148 NONAME
+ _ZN20CSetObjectReferencesD1Ev @ 149 NONAME
+ _ZN20CSetObjectReferencesD2Ev @ 150 NONAME
+ _ZN22CGetFormatCapabilities10ConstructLEv @ 151 NONAME
+ _ZN22CGetFormatCapabilities13CheckRequestLEv @ 152 NONAME
+ _ZN22CGetFormatCapabilities4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 153 NONAME
+ _ZN22CGetFormatCapabilities8ServiceLEv @ 154 NONAME
+ _ZN22CGetFormatCapabilitiesC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 155 NONAME
_ZN22CGetFormatCapabilitiesC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 156 NONAME
_ZN22CGetFormatCapabilitiesD0Ev @ 157 NONAME
_ZN22CGetFormatCapabilitiesD1Ev @ 158 NONAME
@@ -161,98 +161,118 @@
_ZN23CMmMtpDpAccessSingleton12OpenSessionLEv @ 160 NONAME
_ZN23CMmMtpDpAccessSingleton13CloseSessionLEv @ 161 NONAME
_ZN23CMmMtpDpAccessSingleton17GetAccessWrapperLEv @ 162 NONAME
- _ZN23CMmMtpDpAccessSingleton7CreateLER3RFsR25MMTPDataProviderFramework @ 163 NONAME
+ _ZN23CMmMtpDpAccessSingleton7CreateLER25MMTPDataProviderFramework @ 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
+ _ZN23CPropertySettingUtility20SetMetaDataToWrapperER14MMmMtpDpConfigtR8MMTPTypeRK18CMTPObjectMetaData @ 165 NONAME
+ _ZN23CPropertySettingUtilityC2Ev @ 166 NONAME
+ _ZN23CPropertySettingUtilityD0Ev @ 167 NONAME
+ _ZN23CPropertySettingUtilityD1Ev @ 168 NONAME
+ _ZN23CPropertySettingUtilityD2Ev @ 169 NONAME
+ _ZN24CGetObjectPropsSupported4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 170 NONAME
+ _ZN24CGetObjectPropsSupported8ServiceLEv @ 171 NONAME
+ _ZN24CGetObjectPropsSupportedD0Ev @ 172 NONAME
+ _ZN24CGetObjectPropsSupportedD1Ev @ 173 NONAME
+ _ZN24CGetObjectPropsSupportedD2Ev @ 174 NONAME
+ _ZN26CGetInterdependentPropDesc10ConstructLEv @ 175 NONAME
+ _ZN26CGetInterdependentPropDesc13CheckRequestLEv @ 176 NONAME
+ _ZN26CGetInterdependentPropDesc4NewLER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 177 NONAME
+ _ZN26CGetInterdependentPropDesc8ServiceLEv @ 178 NONAME
+ _ZN26CGetInterdependentPropDescC1ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 179 NONAME
+ _ZN26CGetInterdependentPropDescC2ER25MMTPDataProviderFrameworkR14MMTPConnectionR14MMmMtpDpConfig @ 180 NONAME
+ _ZN26CGetInterdependentPropDescD0Ev @ 181 NONAME
+ _ZN26CGetInterdependentPropDescD1Ev @ 182 NONAME
+ _ZN26CGetInterdependentPropDescD2Ev @ 183 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper13AddDummyFileLERK7TDesC16 @ 184 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper13RenameObjectLERK18CMTPObjectMetaDataRK7TDesC16 @ 185 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper13SetReferenceLERK18CMTPObjectMetaDataR12CDesC16Array @ 186 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper15CreateDummyFileERK7TDesC16 @ 187 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper15DeleteDummyFileERK7TDesC16 @ 188 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper16CleanupDatabaseLEv @ 189 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper16GetAllReferenceLEP9CMPXMediaR12CDesC16Array @ 190 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper19GetModifiedContentLERK7TDesC16RiR12CDesC16Array @ 191 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper20GetAllAbstractMediaLERK7TDesC16PP14CMPXMediaArray19TMPXGeneralCategory @ 192 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper21GetAbstractMediaNameLEP9CMPXMedia19TMPXGeneralCategory @ 193 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper22UpdateMusicCollectionLEv @ 194 NONAME
+ _ZN29CMmMtpDpMetadataAccessWrapper23GetObjectMetadataValueLEtR8MMTPTypeRK18CMTPObjectMetaData @ 195 NONAME
+ _ZNK11CSendObject12HasDataphaseEv @ 196 NONAME
+ _ZNK11CSendObject5MatchERK15TMTPTypeRequestR14MMTPConnection @ 197 NONAME
+ _ZNK15CRequestUnknown5MatchERK15TMTPTypeRequestR14MMTPConnection @ 198 NONAME
+ _ZNK17CRequestProcessor10ConnectionEv @ 199 NONAME
+ _ZNK17CRequestProcessor12HasDataphaseEv @ 200 NONAME
+ _ZNK17CRequestProcessor5MatchERK13TMTPTypeEventR14MMTPConnection @ 201 NONAME
+ _ZNK17CRequestProcessor5MatchERK15TMTPTypeRequestR14MMTPConnection @ 202 NONAME
+ _ZNK17CRequestProcessor7RequestEv @ 203 NONAME
+ _ZNK18CSetObjectPropList12HasDataphaseEv @ 204 NONAME
+ _ZNK19CSetObjectPropValue12HasDataphaseEv @ 205 NONAME
+ _ZNK20CSetObjectReferences12HasDataphaseEv @ 206 NONAME
+ _ZTI10CGetObject @ 207 NONAME
+ _ZTI11CCopyObject @ 208 NONAME
+ _ZTI11CMoveObject @ 209 NONAME
+ _ZTI11CSendObject @ 210 NONAME
+ _ZTI13CDeleteObject @ 211 NONAME
+ _ZTI13CRenameObject @ 212 NONAME
+ _ZTI14CGetObjectInfo @ 213 NONAME
+ _ZTI15CRequestChecker @ 214 NONAME
+ _ZTI15CRequestUnknown @ 215 NONAME
+ _ZTI15TMTPTypeFlatBuf @ 216 NONAME
+ _ZTI17CGetPartialObject @ 217 NONAME
+ _ZTI17CRequestProcessor @ 218 NONAME
+ _ZTI18CGetObjectPropDesc @ 219 NONAME
+ _ZTI18CGetObjectPropList @ 220 NONAME
+ _ZTI18CHXMetaDataUtility @ 221 NONAME
+ _ZTI18CSetObjectPropList @ 222 NONAME
+ _ZTI19CDescriptionUtility @ 223 NONAME
+ _ZTI19CGetObjectPropValue @ 224 NONAME
+ _ZTI19CSetObjectPropValue @ 225 NONAME
+ _ZTI20CGetObjectReferences @ 226 NONAME
+ _ZTI20CSetObjectReferences @ 227 NONAME
+ _ZTI22CGetFormatCapabilities @ 228 NONAME
+ _ZTI23CMmMtpDpAccessSingleton @ 229 NONAME
+ _ZTI23CPropertySettingUtility @ 230 NONAME
+ _ZTI24CGetObjectPropsSupported @ 231 NONAME
+ _ZTI25CMmMtpDpMetadataMpxAccess @ 232 NONAME
+ _ZTI26CGetInterdependentPropDesc @ 233 NONAME
+ _ZTI27CMmMtpDpMetadataVideoAccess @ 234 NONAME
+ _ZTI29CMmMtpDpMetadataAccessWrapper @ 235 NONAME
+ _ZTV10CGetObject @ 236 NONAME
+ _ZTV11CCopyObject @ 237 NONAME
+ _ZTV11CMoveObject @ 238 NONAME
+ _ZTV11CSendObject @ 239 NONAME
+ _ZTV13CDeleteObject @ 240 NONAME
+ _ZTV13CRenameObject @ 241 NONAME
+ _ZTV14CGetObjectInfo @ 242 NONAME
+ _ZTV15CRequestChecker @ 243 NONAME
+ _ZTV15CRequestUnknown @ 244 NONAME
+ _ZTV15TMTPTypeFlatBuf @ 245 NONAME
+ _ZTV17CGetPartialObject @ 246 NONAME
+ _ZTV17CRequestProcessor @ 247 NONAME
+ _ZTV18CGetObjectPropDesc @ 248 NONAME
+ _ZTV18CGetObjectPropList @ 249 NONAME
+ _ZTV18CHXMetaDataUtility @ 250 NONAME
+ _ZTV18CSetObjectPropList @ 251 NONAME
+ _ZTV19CDescriptionUtility @ 252 NONAME
+ _ZTV19CGetObjectPropValue @ 253 NONAME
+ _ZTV19CSetObjectPropValue @ 254 NONAME
+ _ZTV20CGetObjectReferences @ 255 NONAME
+ _ZTV20CSetObjectReferences @ 256 NONAME
+ _ZTV22CGetFormatCapabilities @ 257 NONAME
+ _ZTV23CMmMtpDpAccessSingleton @ 258 NONAME
+ _ZTV23CPropertySettingUtility @ 259 NONAME
+ _ZTV24CGetObjectPropsSupported @ 260 NONAME
+ _ZTV25CMmMtpDpMetadataMpxAccess @ 261 NONAME
+ _ZTV26CGetInterdependentPropDesc @ 262 NONAME
+ _ZTV27CMmMtpDpMetadataVideoAccess @ 263 NONAME
+ _ZTV29CMmMtpDpMetadataAccessWrapper @ 264 NONAME
+ _ZThn28_N11CSendObject13UsbDisconnectEv @ 265 NONAME
+ _ZThn28_N17CRequestProcessor12HandleEventLERK13TMTPTypeEvent @ 266 NONAME
+ _ZThn28_N17CRequestProcessor13UsbDisconnectEv @ 267 NONAME
+ _ZThn28_N17CRequestProcessor14HandleRequestLERK15TMTPTypeRequest20TMTPTransactionPhase @ 268 NONAME
+ _ZThn28_N17CRequestProcessor7ReleaseEv @ 269 NONAME
+ _ZThn28_N17CRequestProcessor9SessionIdEv @ 270 NONAME
+ _ZThn28_NK11CSendObject5MatchERK15TMTPTypeRequestR14MMTPConnection @ 271 NONAME
+ _ZThn28_NK15CRequestUnknown5MatchERK15TMTPTypeRequestR14MMTPConnection @ 272 NONAME
+ _ZThn28_NK17CRequestProcessor10ConnectionEv @ 273 NONAME
+ _ZThn28_NK17CRequestProcessor5MatchERK13TMTPTypeEventR14MMTPConnection @ 274 NONAME
+ _ZThn28_NK17CRequestProcessor5MatchERK15TMTPTypeRequestR14MMTPConnection @ 275 NONAME
+ _ZThn28_NK17CRequestProcessor7RequestEv @ 276 NONAME
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp Mon May 03 12:58:40 2010 +0300
@@ -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
-
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/ccopyobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/ccopyobject.h Mon May 03 12:58:40 2010 +0300
@@ -21,8 +21,6 @@
#include "crequestprocessor.h"
-class RFs;
-class CFileMan;
class CMTPObjectMetaData;
class CMTPTypeObjectPropList;
class CMTPTypeObjectPropListElement;
@@ -35,17 +33,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 ~CCopyObject();
@@ -55,8 +42,8 @@
* Standard c++ constructor
*/
IMPORT_C CCopyObject( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig );
+ MMTPConnection& aConnection,
+ MMmMtpDpConfig& aDpConfig );
/**
* Second phase constructor
@@ -70,115 +57,74 @@
*/
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
*/
void GetParametersL();
+ /**
+ * Set a default destination if it is not specified
+ */
void SetDefaultParentObjectL();
/**
- * Copy object operation
+ * Copy file and metadata and send response to pc
+ * If everything was right, the handle of newly created file
+ * should be sent back
*/
- void CopyObjectL( TUint32& aNewHandle );
+ void CopyObjectL();
/**
- * Check if we can copy the file to the new location
+ * Check if the file can be copied
+ * @param aOldName used to get file size
+ * @param aNewName the full path name of newly copied file
*/
TMTPResponseCode CanCopyObjectL( const TDesC& aOldName,
- const TDesC& aNewName ) const;
+ const TDesC& aNewName ) const;
/**
* Save the object properties before doing the copy
*/
- void GetPreviousPropertiesL( const CMTPObjectMetaData& aObject );
+ void GetPreviousPropertiesL();
/**
* Set the object properties after doing the copy
*/
- void SetPreviousPropertiesL( const CMTPObjectMetaData& aObject );
+ void SetPreviousPropertiesL();
/**
* A helper function of CopyObjectL.
* @param aNewFileName the new full filename after copy.
- * @return objectHandle of new copy of object.
+ * @return handle of the newly copied object.
*/
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.
+ * Add metadata of the newly created file into database and
+ * update related references
+ * @param aOldObjectName old reference owner
+ * @param aNewObjectName new reference owner
+ * @return handle of the newly copied object
*/
- 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:
- CMTPObjectMetaData* iObjectInfo; // Not owned
- RArray<TUint> iObjectHandles;
- CFileMan* iFileMan;
+ TUint32 iStorageId;
+ CMTPObjectMetaData* iSourceObject;
+ CMTPObjectMetaData* iTargetObject;
HBufC* iDest;
TUint32 iNewParentHandle;
- TUint32 iHandle;
- TUint32 iStorageId;
- TInt iCopyObjectIndex;
- TInt iNumberOfObjects;
- HBufC* iPathToCopy;
- HBufC* iNewRootFolder;
TTime iPreviousModifiedTime;
};
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdeleteobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdeleteobject.h Mon May 03 12:58:40 2010 +0300
@@ -19,16 +19,11 @@
#ifndef CDELETEOBJECT_H
#define CDELETEOBJECT_H
-#include <f32file.h>
#include <d32dbms.h>
-#include <badesca.h>
#include "crequestprocessor.h"
//forward declaration
-class RFs;
-class CMTPTypeArray;
-class MMTPObjectMgr;
class MMmMtpDpConfig;
/**
@@ -110,12 +105,6 @@
void DeleteObjectL( const CMTPObjectMetaData& aObjectInfo );
private:
- // MTP Object Manager
- MMTPObjectMgr& iObjectMgr;
-
- // File server used to open the database
- RFs& iFs;
-
// Array of all the objects to delete
RArray<TUint> iObjectsToDelete;
@@ -127,6 +116,7 @@
// Accessor of DB
MMmMtpDpConfig& iDpConfig;
+
};
#endif // CDELETEOBJECT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cdescriptionutility.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetformatcapabilities.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetformatcapabilities.h Mon May 03 12:58:40 2010 +0300
@@ -20,16 +20,10 @@
#include <mtp/cmtptypeformatcapabilitylist.h>
#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 +33,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 +63,7 @@
* Constructor
* Second phase constructor
*/
- IMPORT_C void ConstructL();
+ void ConstructL();
protected:
// from CMTPRequestProcessor
@@ -74,73 +79,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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetinterdependentpropdesc.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobject.h Mon May 03 12:58:40 2010 +0300
@@ -22,7 +22,6 @@
#include "crequestprocessor.h"
// forward declaration
-class RFs;
class CMTPTypeFile;
class MMmMtpDpConfig;
@@ -78,17 +77,14 @@
void GetObjectL( const TDesC& aFileName );
private:
- // File server used to open the database
- RFs& iFs;
-
// File Object to encapsulate the object to send back
CMTPTypeFile* iFileObject;
// Object Info
CMTPObjectMetaData* iObjectInfo;
- //
TMTPResponseCode iError;
+
};
#endif // CGETOBJECT_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectinfo.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectinfo.h Mon May 03 12:58:40 2010 +0300
@@ -22,7 +22,6 @@
#include "crequestprocessor.h"
// forward declacration
-class CMmMtpDpMetadataAccessWrapper;
class CMTPTypeObjectInfo;
class MMmMtpDpConfig;
@@ -78,10 +77,10 @@
void BuildObjectInfoL();
private:
-
CMTPTypeObjectInfo* iObjectInfo;
MMmMtpDpConfig& iDpConfig;
+
};
#endif // CGETOBJECTINFO_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropdesc.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropdesc.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectproplist.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectproplist.h Mon May 03 12:58:40 2010 +0300
@@ -161,8 +161,6 @@
void GetPropertiesL( RArray<TUint>& aPropArray, TUint32 aGroupCode, TUint16 aFormatCode ) const;
- void SetSubFormatCodeL();
-
protected:
CMTPTypeObjectPropListElement* iPropertyElement; // used by media DP directly
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropssupported.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropssupported.h Mon May 03 12:58:40 2010 +0300
@@ -70,6 +70,7 @@
private:
CMTPTypeArray* iObjectPropsSupported;
MMmMtpDpConfig& iDpConfig;
+
};
#endif // CGETOBJECTPROPSSUPPORTED_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropvalue.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectpropvalue.h Mon May 03 12:58:40 2010 +0300
@@ -29,7 +29,6 @@
class TMTPTypeUint128;
class CMTPTypeString;
class CMTPTypeArray;
-class TMTPObjectInfo;
class MMmMtpDpConfig;
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetpartialobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetpartialobject.h Mon May 03 12:58:40 2010 +0300
@@ -21,9 +21,6 @@
#include "crequestprocessor.h"
-class MMTPDataProviderFramework;
-class RFs;
-class TMTPTypeFlatBase;
class CMTPTypeFile;
class CMmMtpDpMetadataAccessWrapper;
class MMmMtpDpConfig;
@@ -100,16 +97,11 @@
private:
MMTPDataProviderFramework& iFramework;
- RFs& iFs;
- TMTPTypeFlatBase* iPartialData;
- HBufC8* iBuffer;
- TPtr8 iBufferPtr8;
- TInt iOffset;
- TInt iPartialDataLength;
- TBool iCompleteFile;
- CMTPTypeFile* iFileObject;
- TBuf<KMaxFileName> iFileSuid;
- TUint32 iObjectHandle;
+ TUint iOffset;
+ TUint iPartialDataLength;
+
+ CMTPTypeFile* iFileObject;
+ TUint32 iObjectHandle;
};
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cmoveobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cmoveobject.h Mon May 03 12:58:40 2010 +0300
@@ -21,9 +21,7 @@
#include "crequestprocessor.h"
-class CFileMan;
class CMTPObjectMetaData;
-class CMmMtpDpMetadataAccessWrapper;
class CMTPTypeObjectPropList;
class CMTPTypeObjectPropListElement;
class MMmMtpDpConfig;
@@ -35,18 +33,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 +42,8 @@
* Standard c++ constructor
*/
IMPORT_C CMoveObject( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection,
- MMmMtpDpConfig& aDpConfig );
+ MMTPConnection& aConnection,
+ MMmMtpDpConfig& aDpConfig );
/**
* Second phase constructor
@@ -71,34 +57,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 +85,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 +101,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 +109,9 @@
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 );
+ void SetPropertiesL( const TDesC& aNewFileName );
/*
* Move a single object and update the database
@@ -179,17 +125,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<TUint> iObjectHandles;
- TInt iMoveObjectIndex;
- TInt iNumberOfObjects;
+
};
#endif // CMOVEOBJCT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cpropertysettingutility.h Mon May 03 12:58:40 2010 +0300
@@ -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 <mtp/mtpprotocolconstants.h> // 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 SetMetaDataToWrapper( 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crenameobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crenameobject.h Mon May 03 12:58:40 2010 +0300
@@ -22,7 +22,6 @@
// Forward declarations
class MMTPDataProviderFramework;
class CMmMtpDpMetadataAccessWrapper;
-class MMTPObjectMgr;
class CMTPObjectMetaData;
class CRenameObject: public CActive
@@ -92,6 +91,7 @@
private:
CActiveSchedulerWait* iRenameWaiter;
TUint32 iParentHandle;
+
};
#endif // CRENAMEOBJECT_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestchecker.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestchecker.h Mon May 03 12:58:40 2010 +0300
@@ -19,11 +19,9 @@
#ifndef CREQUESTCHECKER_H
#define CREQUESTCHECKER_H
-#include <e32base.h>
-#include <mtp/mtpprotocolconstants.h>
#include <mtp/tmtptyperequest.h>
+#include <mtp/cmtpobjectmetadata.h>
-class CMTPObjectMetaData;
class MMTPDataProviderFramework;
class MMTPConnection;
@@ -121,7 +119,7 @@
* @return a pointer to the created request checker object
*/
static CRequestChecker* NewL( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection );
+ MMTPConnection& aConnection );
/**
* Destructor
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestprocessor.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/crequestprocessor.h Mon May 03 12:58:40 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -19,22 +19,24 @@
#ifndef CREQUESTPROCESSOR_H
#define CREQUESTPROCESSOR_H
-#include <e32base.h>
+
+#include <mtp/tmtptypenull.h>
#include <mtp/mtpdataproviderapitypes.h>
#include <mtp/mtpprotocolconstants.h>
#include <mtp/tmtptyperesponse.h>
-#include <mtp/tmtptypenull.h>
+
+// for derived processors
+#include <mtp/mmtpdataproviderframework.h>
#include "crequestchecker.h"
class MMTPConnection;
class TMTPTypeRequest;
-class CMTPDataProviderPlugin;
class MMTPDataProviderFramework;
class TMTPTypeEvent;
class CMTPObjectInfo;
-static const TInt KMmMtpRArrayGranularity = 2;
+const TInt KMmMtpRArrayGranularity = 2;
/**
* Defines a request processor interface
@@ -100,8 +102,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
*/
@@ -111,9 +113,8 @@
/**
* Defines a processor factory function pointer
*/
-typedef MMmRequestProcessor
- * (*TMTPRequestProcessorCreateFunc)( MMTPDataProviderFramework& aFramework,
- MMTPConnection& aConnection );
+typedef MMmRequestProcessor* (*TMTPRequestProcessorCreateFunc)( MMTPDataProviderFramework& aFramework,
+ MMTPConnection& aConnection );
/**
* Defines an entry which maps from operation code to the request processor
@@ -237,12 +238,13 @@
/*
* 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
*/
IMPORT_C TUint32 SessionId();
+
protected:
// from CActive
/**
@@ -261,7 +263,7 @@
IMPORT_C TInt RunError( TInt aError );
protected:
- //new virtuals
+ // new virtuals
/**
* Handle the request phase of the current request
* @return EFalse
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h Mon May 03 12:58:40 2010 +0300
@@ -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
@@ -186,7 +173,7 @@
/*
* Handle response phase of SetObjectPropListL operation
*/
- TMTPResponseCode SetObjectPropListL( const CMTPTypeObjectPropList& aPropList );
+ TMTPResponseCode SetObjectPropListL();
/**
*
@@ -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
@@ -226,7 +213,7 @@
/**
* Set protection status of object which could be read/write-only
*/
- void SetProtectionStatusL();
+ void SetProtectionStatus();
/**
* Save object information of object whose size is zero
@@ -299,6 +286,7 @@
TUint32 iPreviousTransactionID;
TUint32 iPreviousOperation;
+
};
#endif // CSENDOBJECT_H
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectproplist.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectproplist.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectpropvalue.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectpropvalue.h Mon May 03 12:58:40 2010 +0300
@@ -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;
};
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectreferences.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csetobjectreferences.h Mon May 03 12:58:40 2010 +0300
@@ -64,16 +64,9 @@
protected:
/**
* set references to DB
- * @param aWrapper medadata access interface
- * @param aObjectFormat the format of the file
- * @param aSrcFileName file name, from
- * @param aRefFileArray the array of file names, to
+ * @param aObject, the reference owner
*/
- IMPORT_C virtual void
- DoSetObjectReferencesL( CMmMtpDpMetadataAccessWrapper& aWrapper,
- TUint16 aObjectFormat,
- const TDesC& aSrcFileName,
- CDesCArray& aRefFileArray );
+ void DoSetObjectReferencesL( const CMTPObjectMetaData& aObject );
private:
//from CRequestProcessor
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/ccopyobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/ccopyobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -1,28 +1,25 @@
/*
-* 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 <bautils.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
#include <mtp/mmtpreferencemgr.h>
#include <mtp/mmtpstoragemgr.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
#include <mtp/cmtptypeobjectproplist.h>
@@ -33,16 +30,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
@@ -74,14 +72,12 @@
{
Cancel();
+ delete iTargetObject;
delete iDest;
- delete iFileMan;
- iObjectHandles.Close();
+
if ( iPropertyElement )
delete iPropertyElement;
delete iPropertyList;
- delete iPathToCopy;
- delete iNewRootFolder;
}
// -----------------------------------------------------------------------------
@@ -92,17 +88,32 @@
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 ),
+ iSourceObject( NULL ),
+ iTargetObject( NULL )
{
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 +121,55 @@
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<TUint> 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 ) );
+ const TDesC& suid( iSourceObject->DesC( CMTPObjectMetaData::ESuid ) );
TParsePtrC fileNameParser( suid );
+ if ( ( newObjectName.Length() + fileNameParser.NameAndExt().Length() )
+ <= newObjectName.MaxLength() )
+ {
+ newObjectName.Append( fileNameParser.NameAndExt() );
+ responseCode = CanCopyObjectL( suid, newObjectName );
- // 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() )
+ TUint32 newHandle = KMTPHandleNone;
+ if ( responseCode == EMTPRespCodeOK )
{
- newObjectName.Append( fileNameParser.NameAndExt() );
- }
- responseCode = CanCopyObjectL( suid, newObjectName );
- }
- 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 );
+ newHandle = CopyFileL( newObjectName );
+ SendResponseL( EMTPRespCodeOK, 1, &newHandle );
+ PRINT2( _L( "MM MTP <= CCopyObject::CopyObjectL responseCode = 0x%x, aNewHandle = 0x%x" ),
+ responseCode,
+ newHandle );
}
- }
-
- delete iNewRootFolder;
- iNewRootFolder = NULL;
- iNewRootFolder = newObjectName.AllocL();
-
- 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 );
- }
+ else
+ SendResponseL( responseCode );
}
else
- SendResponseL( responseCode );
+ // Destination is not appropriate for the full path name shouldn't be longer than 255
+ SendResponseL( EMTPRespCodeInvalidDataset );
CleanupStack::PopAndDestroy( &newObjectName ); // - newObjectName
- PRINT2( _L( "MM MTP <= CCopyObject::CopyObjectL responseCode = 0x%x, aNewHandle = 0x%x" ),
- responseCode, aNewHandle );
}
// -----------------------------------------------------------------------------
@@ -337,37 +180,41 @@
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 ) );
+ iSourceObject = iRequestChecker->GetObjectInfo( objectHandle );
+ __ASSERT_DEBUG( iSourceObject, 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" ) );
}
// -----------------------------------------------------------------------------
// CCopyObject::SetDefaultParentObjectL
-// Get a default parent object, ff the request does not specify a parent object,
+// Set a default destination, if the request does not specify a parent object,
// -----------------------------------------------------------------------------
//
void CCopyObject::SetDefaultParentObjectL()
@@ -376,11 +223,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 +239,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<TDriveNumber>( 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;
}
@@ -433,7 +281,7 @@
#endif
}
// This is used to keep the same behavior in mass storage and device file manager.
- else if ( iObjectInfo->Uint( CMTPObjectMetaData::EFormatCode )
+ else if ( iSourceObject->Uint( CMTPObjectMetaData::EFormatCode )
== EMTPFormatCodeAbstractAudioVideoPlaylist )
{
PRINT( _L( "MM MTP <> CCopyObject::CanCopyObjectL playlist file can't copy" ) );
@@ -445,38 +293,62 @@
}
// -----------------------------------------------------------------------------
+// CCopyObject::CopyFileL
+// A helper function of CopyFileL
+// -----------------------------------------------------------------------------
+//
+TUint32 CCopyObject::CopyFileL( const TDesC& aNewFileName )
+ {
+ PRINT( _L( "MM MTP => CCopyObject::CopyFileL" ) );
+
+ GetPreviousPropertiesL();
+
+ // TODO: Need rollback mechanism for consistant with image dp in fw.
+ // Not sure if it should be trap if something wrong with MPX db.
+ TPtrC oldFileName( iSourceObject->DesC( CMTPObjectMetaData::ESuid ) );
+ TUint32 handle = AddObjectToStoreL( oldFileName, aNewFileName );
+
+ // Only leave when getting proplist element from data received by fw.
+ // It should not happen after ReceiveDataL in which construction of proplist already succeed.
+ SetPreviousPropertiesL();
+
+ CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() );
+ User::LeaveIfError( fileMan->Copy( oldFileName, aNewFileName ) );
+ delete fileMan;
+ fileMan = NULL;
+
+ PRINT( _L( "MM MTP <= CCopyObject::CopyFileL" ) );
+ return handle;
+ }
+
+// -----------------------------------------------------------------------------
// CCopyObject::GetPreviousPropertiesL
// Save the object properties before doing the copy
// -----------------------------------------------------------------------------
//
-void CCopyObject::GetPreviousPropertiesL( const CMTPObjectMetaData& aObject )
+void CCopyObject::GetPreviousPropertiesL()
{
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 );
+ TUint formatCode = iSourceObject->Uint( CMTPObjectMetaData::EFormatCode );
const RArray<TUint>* properties = iDpConfig.GetSupportedPropertiesL( formatCode );
TInt count = properties->Count();
- CMTPTypeString* textData = NULL;
TInt err = KErrNone;
TUint16 propCode;
- TUint32 handle = aObject.Uint( CMTPObjectMetaData::EHandle ) ;
+ TUint32 handle = iSourceObject->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,53 +357,51 @@
case EMTPObjectPropCodeObjectFileName:
case EMTPObjectPropCodeParentObject:
case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
- case EMTPObjectPropCodeNonConsumable:
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
break;
+ case EMTPObjectPropCodeNonConsumable:
+ iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) );
+ iPropertyElement->SetUint8L( CMTPTypeObjectPropListElement::EValue,
+ iSourceObject->Uint( CMTPObjectMetaData::ENonConsumable ) );
+ break;
+
case EMTPObjectPropCodeName:
case EMTPObjectPropCodeDateAdded:
- if ( ( propCode == EMTPObjectPropCodeName )
- || ( ( !MmMtpDpUtility::IsVideoL( aObject.DesC( CMTPObjectMetaData::ESuid ), iFramework ) )
- && ( propCode == EMTPObjectPropCodeDateAdded ) ) )
- {
- textData = CMTPTypeString::NewLC(); // + textData
+ case EMTPObjectPropCodeAlbumArtist:
+ {
+ CMTPTypeString* textData = CMTPTypeString::NewLC(); // + textData
- TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( propCode,
- *textData,
- aObject ) );
+ TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( propCode,
+ *textData,
+ *iSourceObject ) );
- 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 );
- }
- else if ( err == KErrNotFound )
- {
- iPropertyElement = NULL;
- }
- else
- {
- User::Leave( err );
- }
+ if ( err == KErrNone )
+ {
+ iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) );
+ iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue,
+ textData->StringChars() );
+ }
+ else
+ {
+ iPropertyElement = NULL;
+ }
- CleanupStack::PopAndDestroy( textData ); // - textData
- }
+ CleanupStack::PopAndDestroy( textData ); // - textData
+ }
break;
default:
{
- ServiceGetSpecificObjectPropertyL( propCode, handle, aObject );
+ ServiceGetSpecificObjectPropertyL( propCode, handle, *iSourceObject );
}
break;
}
- if ( iPropertyElement )
+ if ( iPropertyElement != NULL )
{
iPropertyList->CommitPropElemL( *iPropertyElement );
iPropertyElement = NULL;
@@ -542,78 +412,29 @@
}
// -----------------------------------------------------------------------------
-// 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
// -----------------------------------------------------------------------------
//
-void CCopyObject::SetPreviousPropertiesL( const CMTPObjectMetaData& aObject )
+void CCopyObject::SetPreviousPropertiesL()
{
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,21 +445,29 @@
case EMTPObjectPropCodeObjectFileName:
case EMTPObjectPropCodeParentObject:
case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
- case EMTPObjectPropCodeNonConsumable:
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
case EMTPObjectPropCodeDateAdded:
break;
+ case EMTPObjectPropCodeNonConsumable:
+ iTargetObject->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( *iTargetObject );
+ break;
+
case EMTPObjectPropCodeName:
+ case EMTPObjectPropCodeAlbumArtist:
{
- stringData = CMTPTypeString::NewLC(
- element.StringL(
- CMTPTypeObjectPropListElement::EValue)); // + stringData
+ CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData
- respcode = ServiceMetaDataToWrapper( propertyCode,
+ respcode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
+ propertyCode,
*stringData,
- aObject );
+ *iTargetObject );
CleanupStack::PopAndDestroy( stringData ); // - stringData
}
@@ -646,17 +475,19 @@
default:
{
- respcode = ServiceSetSpecificObjectPropertyL( propertyCode,
- aObject,
- element );
+ respcode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
+ propertyCode,
+ *iTargetObject,
+ element );
}
break;
}
} // end of for loop
- if( respcode == EMTPRespCodeOK )
+ // ignore errors
+ if ( respcode == EMTPRespCodeOK )
{
- // do nothing, ignore warning
+ // do nothing, just to get rid of build warning
}
PRINT1( _L( "MM MTP <= CCopyObject::SetPreviousPropertiesL respcode = 0x%x" ), respcode );
@@ -667,168 +498,42 @@
// 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".
- CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC(); // + objectInfo
- const TMTPTypeUint32 objectHandle( iObjectInfo->Uint( CMTPObjectMetaData::EHandle ) );
- if ( iFramework.ObjectMgr().ObjectL( objectHandle, *objectInfo) )
+ PRINT2( _L( "MM MTP => CCopyObject::AddObjectToStoreL aOldObjectName = %S, aNewObjectName = %S" ),
+ &aOldObjectName,
+ &aNewObjectName );
+
+ iTargetObject = CMTPObjectMetaData::NewL();
+
+ // 1. Add new object into objectMgr db
+ iTargetObject->SetUint( CMTPObjectMetaData::EDataProviderId, iSourceObject->Uint( CMTPObjectMetaData::EDataProviderId ) );
+ TUint formatCode = iSourceObject->Uint( CMTPObjectMetaData::EFormatCode );
+ iTargetObject->SetUint( CMTPObjectMetaData::EFormatCode, formatCode );
+ TUint subFormatCode = iSourceObject->Uint( CMTPObjectMetaData::EFormatSubCode );
+ iTargetObject->SetUint( CMTPObjectMetaData::EFormatSubCode, subFormatCode );
+ iTargetObject->SetUint( CMTPObjectMetaData::EParentHandle, iNewParentHandle );
+ iTargetObject->SetUint( CMTPObjectMetaData::EStorageId, iStorageId );
+ iTargetObject->SetDesCL( CMTPObjectMetaData::ESuid, aNewObjectName );
+ iFramework.ObjectMgr().InsertObjectL( *iTargetObject );
+
+ // 2. Add new object into MPX db
+ iDpConfig.GetWrapperL().AddObjectL( *iTargetObject );
+
+ // 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" ) );
+ TUint32 handle = iTargetObject->Uint( CMTPObjectMetaData::EHandle );
+
+ 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdeleteobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,16 +16,17 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
-#include <mtp/cmtpobjectmetadata.h>
+#include <mtp/mmtpreferencemgr.h>
#include "cdeleteobject.h"
#include "mmmtpdplogger.h"
#include "mmmtpdpconfig.h"
#include "cmmmtpdpmetadataaccesswrapper.h"
+#include "mmmtpdputility.h"
-// static const TInt KMTPDriveGranularity = 5;
+const TInt KMaxDeletionTimes = 10;
+const TInt KDeletionThreshold = 100 * 1000; // (100 millisec)
// -----------------------------------------------------------------------------
// Verification data for the DeleteObject request
@@ -89,9 +90,7 @@
aConnection,
sizeof( KMTPDeleteObjectPolicy ) / sizeof( TMTPRequestElementInfo ),
KMTPDeleteObjectPolicy ),
- iObjectMgr( aFramework.ObjectMgr() ),
- iFs( aFramework.Fs() ),
- iObjectsToDelete( KMmMtpRArrayGranularity ),
+ iObjectsToDelete( KMmMtpRArrayGranularity ),
iDeleteError( KErrNone ),
iDpConfig( aDpConfig )
{
@@ -191,7 +190,7 @@
CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC(); // + objectInfo
TUint32 handle = iObjectsToDelete[0];
- iObjectMgr.ObjectL( handle, *objectInfo );
+ iFramework.ObjectMgr().ObjectL( handle, *objectInfo );
TFileName fileName( objectInfo->DesC( CMTPObjectMetaData::ESuid ) );
PRINT2( _L( "MM MTP <> CDeleteObject::RunL delete object handle is 0x%x, fileName is %S" ), handle, &fileName );
@@ -225,14 +224,13 @@
TFileName fileName( aObjectInfo.DesC( CMTPObjectMetaData::ESuid ) );
PRINT1( _L( "MM MTP <> CDeleteObject::DeleteObjectL fileName = %S" ), &fileName );
- TParsePtrC parse( fileName );
- iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() );
+ iDpConfig.GetWrapperL().SetStorageRootL( fileName );
// To capture special situation: After copy, move, rename playlist folder name,
// record in MPX is not inlined with framework db, playlist should not be deleted
// until next session.
// This is used to keep the same behavior in mass storage and device file manager.
- if ( aObjectInfo.Uint(CMTPObjectMetaData::EFormatCode )
+ if ( aObjectInfo.Uint( CMTPObjectMetaData::EFormatCode )
== EMTPFormatCodeAbstractAudioVideoPlaylist
&& !iDpConfig.GetWrapperL().IsExistL( fileName ) )
{
@@ -243,26 +241,45 @@
// 1. Delete object from file system
TEntry fileInfo;
- iFs.Entry( fileName, fileInfo );
+ iFramework.Fs().Entry( fileName, fileInfo );
if ( fileInfo.IsReadOnly() )
{
iDeleteError = KErrAccessDenied;
PRINT1( _L( "MM MTP <= CDeleteObject::DeleteObjectL, \"%S\" is a read-only file"), &fileName );
return;
}
- iDeleteError = iFs.Delete( fileName );
- if ( iDeleteError != KErrNone && iDeleteError != KErrNotFound )
+ // Some other component might be holding on to the file (MDS background harvesting),
+ // try again after 100 millisec, up to 10 times, before give up
+ TInt count = KMaxDeletionTimes;
+ while ( count > 0 )
{
- PRINT1( _L( "MM MTP <= CDeleteObject::DeleteObjectL, Delete from file system failed, err = %d" ), iDeleteError );
- return;
+ iDeleteError = iFramework.Fs().Delete( fileName );
+ if ( iDeleteError == KErrNone || iDeleteError == KErrNotFound )
+ {
+ break;
+ }
+ else if ( ( iDeleteError == KErrInUse ) && ( count > 1 ) )
+ {
+ User::After( KDeletionThreshold );
+ count--;
+ }
+ else
+ {
+ PRINT1( _L( "MM MTP <= CDeleteObject::DeleteObjectL, Delete from file system failed, err = %d" ), iDeleteError );
+ return;
+ }
}
// 2. Delete object from metadata db
- TRAP( iDeleteError, iDpConfig.GetWrapperL().DeleteObjectL( fileName, aObjectInfo.Uint( CMTPObjectMetaData::EFormatCode ) ));
+ TRAP( iDeleteError, iDpConfig.GetWrapperL().DeleteObjectL( aObjectInfo ) );
PRINT1( _L( "MM MTP <> CDeleteObject::DeleteObjectL, Delete from Media DB, err = %d" ), iDeleteError );
// 3. Delete object from framework db
- iObjectMgr.RemoveObjectL( aObjectInfo.Uint( CMTPObjectMetaData::EHandle ) );
+ iFramework.ObjectMgr().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" ) );
}
@@ -342,7 +359,7 @@
else
{
CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC(); // + objectInfo
- iObjectMgr.ObjectL( handles[i], *objectInfo );
+ iFramework.ObjectMgr().ObjectL( handles[i], *objectInfo );
if ( EMTPFormatCodeAssociation == objectInfo->Uint( CMTPObjectMetaData::EFormatCode ) )
{
GetObjectHandlesL( KMTPStorageAll, handles[i] );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cdescriptionutility.cpp Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,229 @@
+/*
+* 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 <mtp/cmtptypeinterdependentpropdesc.h>
+#include <mtp/cmtptypeobjectpropdesc.h>
+#include <mtp/cmtptypestring.h>
+
+#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:
+ case EMTPObjectPropCodeAlbumArtist:
+ 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetformatcapabilities.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetformatcapabilities.cpp Mon May 03 12:58:40 2010 +0300
@@ -11,23 +11,35 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include <mtp/cmtptypeinterdependentpropdesc.h>
#include <mtp/cmtptypeobjectpropdesc.h>
-#include <mtp/mtpprotocolconstants.h>
-#include <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtptypestring.h>
-
#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<TUint>* 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<TUint>* 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<TUint>* 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetinterdependentpropdesc.cpp Mon May 03 12:58:40 2010 +0300
@@ -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 <mtp/cmtptypeinterdependentpropdesc.h>
+
+#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<TUint>* 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,8 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/cmtptypefile.h>
#include "cgetobject.h"
@@ -84,12 +82,11 @@
//
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 ),
+ iError( EMTPRespCodeOK )
{
PRINT( _L( "Operation: GetObject(0x1009)" ) );
}
@@ -141,7 +138,7 @@
// Create the file object
delete iFileObject;
iFileObject = NULL;
- iFileObject = CMTPTypeFile::NewL( iFs, aFileName, EFileRead );
+ iFileObject = CMTPTypeFile::NewL( iFramework.Fs(), aFileName, EFileRead );
PRINT( _L( "MM MTP <= CGetObject::GetObjectL" ) );
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectinfo.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectinfo.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypeobjectinfo.h>
#include <f32file.h>
@@ -26,9 +25,8 @@
#include "tmmmtpdppanic.h"
#include "mmmtpdplogger.h"
#include "mmmtpdpconfig.h"
+#include "tobjectdescription.h"
-_LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" );
-const TInt KMtpMaxDateTimeStringLength = 15;
// -----------------------------------------------------------------------------
// Verification data for GetObjectInfo request
@@ -164,7 +162,7 @@
TUint32 width(0);
TUint32 height(0);
TInt err = KErrNone;
- TRAP( err, iDpConfig.GetWrapperL().GetImageObjPropL( suid, width, height ) );
+ TRAP( err, iDpConfig.GetWrapperL().GetImageObjPropL( *object, width, height ) );
if( err != KErrNone )
PRINT1( _L( "MM MTP <> CGetObjectInfo::BuildObjectInfoL TRAP iWrapper.GetImageObjPropL err = %d" ), err );
@@ -188,11 +186,9 @@
TParsePtrC parse( suid );
iObjectInfo->SetStringL( CMTPTypeObjectInfo::EFilename, parse.NameAndExt() );
- TTime dataModified;
- dataModified = MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(), suid );
+ TBuf<KMtpMaxDateTimeStringLength> date;
+ MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(), suid, date );
- TBuf<KMtpMaxDateTimeStringLength> date;
- dataModified.FormatL( date, KMtpDateTimeFormat );
PRINT1( _L( "MM MTP <> CGetObjectInfo::BuildObjectInfo date is %S" ), &date );
// Date Created
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropdesc.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropdesc.cpp Mon May 03 12:58:40 2010 +0300
@@ -11,22 +11,35 @@
*
* Contributors:
*
-* Description: Implement operation: GetObjectPropDesc
+* Description: Request processor which handle common property description
*
*/
-
#include <mtp/cmtptypeobjectpropdesc.h>
-#include <mtp/cmtptypestring.h>
#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<TUint>* 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<TUint>* properties = NULL;
- if ( formatCode == KMTPFormatsAll )
- properties= iDpConfig.GetAllSupportedProperties();
- else
- properties = iDpConfig.GetSupportedPropertiesL( formatCode );
+ const RArray<TUint>* 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp Mon May 03 12:58:40 2010 +0300
@@ -18,12 +18,11 @@
#include <bautils.h>
#include <e32std.h>
-#include <mtp/mmtpdataproviderframework.h>
+
#include <mtp/mmtpobjectmgr.h>
#include <mtp/cmtptypeobjectproplist.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
-#include <mtp/cmtpobjectmetadata.h>
#include "tobjectdescription.h"
#include "cgetobjectproplist.h"
@@ -34,12 +33,7 @@
#include "cmmmtpdpmetadataaccesswrapper.h"
static const TUint32 KMTPAll = 0xffffffff;
-_LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" );
-const TInt KMtpMaxDateTimeStringLength = 15;
-#if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
-_LIT( KSubFormatParse, "SubFormatParse" );
-#endif
// Verification data for the getObjectPropList request
const TMTPRequestElementInfo KMTPGetObjectPropListPolicy[] =
@@ -82,13 +76,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 +138,7 @@
// -----------------------------------------------------------------------------
// CGetObjectPropList::ServiceL
-// service a request at request phase
+// GetObjectPropList request handler
// -----------------------------------------------------------------------------
//
EXPORT_C void CGetObjectPropList::ServiceL()
@@ -167,7 +161,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() )
@@ -178,8 +172,6 @@
if ( iFramework.ObjectMgr().ObjectL( handle, *iObject ) ) // Populate the object meta data
{
- SetSubFormatCodeL();
-
err = ServiceOneObjectPropertyL( handle, iPropCode );
if ( err != KErrNone && err != KErrNotSupported )
break;
@@ -187,9 +179,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 +197,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 +220,7 @@
for ( TInt i = 0; i < count; i++ )
{
- if ( formatCode == (*format)[i ] )
+ if ( formatCode == (*format)[i] )
{
response = EMTPRespCodeOK;
break;
@@ -238,7 +235,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,12 +256,11 @@
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++ )
{
- if ( groupCode == KSupportedGroupCode[i ] )
+ if ( groupCode == KSupportedGroupCode[i] )
break;
}
if ( i == count )
@@ -275,15 +271,12 @@
{
PRINT1( _L( "MM MTP <> CGetObjectPropList::CheckPropCode, Property(0x%x) was queried." ), iPropCode );
- TInt err = KErrNone;
const RArray<TUint>* 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 +305,7 @@
// -----------------------------------------------------------------------------
// CGetObjectPropList::CheckDepth
-// Ensures the depth operation parameter is valid
+// Ensure the depth operation parameter is valid
// -----------------------------------------------------------------------------
//
TMTPResponseCode CGetObjectPropList::CheckDepth() const
@@ -341,7 +334,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()
@@ -362,8 +355,7 @@
{
CMTPObjectMetaData* meta( iRequestChecker->GetObjectInfo( iHandle ) );
TPtrC suid( meta->DesC( CMTPObjectMetaData::ESuid ) );
- TParsePtrC parse( suid );
- iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() );
+ iDpConfig.GetWrapperL().SetStorageRootL( suid );
__ASSERT_DEBUG( meta, Panic( EMmMTPDpObjectNull ) );
@@ -383,12 +375,12 @@
// -----------------------------------------------------------------------------
// CGetObjectPropList::GetObjectHandlesL
-// Gets all object handles (for GetObjectHandlesL)
+// Get all object handles (for GetObjectHandlesL)
// -----------------------------------------------------------------------------
//
void CGetObjectPropList::GetObjectHandlesL( TUint32 aStorageId,
TUint32 aParentHandle,
- TUint16 aFormat /*= 0x0000*/)
+ TUint16 aFormat /*= 0x0000*/ )
{
PRINT2( _L( "MM MTP => CGetObjectPropList::GetObjectHandlesL, aStorageId = 0x%x, aParentHandle = 0x%x" ),
aStorageId,
@@ -512,20 +504,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 );
@@ -548,7 +554,7 @@
for ( TInt i = 0; i < count; i++ )
{
err = ServiceOneObjectPropertyL( aHandle, iPropertyArray[i] );
- if ( err == KErrNotSupported ) // Skip
+ if ( err == KErrNotSupported || err == KErrNotFound ) // Skip
err = KErrNone;
if ( err != KErrNone )
break;
@@ -561,7 +567,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 +591,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 +600,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 +610,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 +636,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 +645,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,51 +654,42 @@
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;
case EMTPObjectPropCodeName:
case EMTPObjectPropCodeDateAdded:
+ case EMTPObjectPropCodeAlbumArtist:
{
- if ( ( aPropCode == EMTPObjectPropCodeName )
- || ( ( !MmMtpDpUtility::IsVideoL( iObject->DesC( CMTPObjectMetaData::ESuid ), iFramework ) )
- && ( aPropCode == EMTPObjectPropCodeDateAdded ) ) )
- {
- textData = CMTPTypeString::NewLC(); // + textData
-
- TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( aPropCode,
- *textData,
- *iObject ) );
+ textData = CMTPTypeString::NewLC(); // + textData
- PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL err = %d" ), err );
+ TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( aPropCode,
+ *textData,
+ *iObject ) );
- if ( err == KErrNone )
- {
- iPropertyElement = &(iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
- iPropertyElement->SetStringL(CMTPTypeObjectPropListElement::EValue, textData->StringChars());
- }
+ PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL err = %d" ), err );
- CleanupStack::PopAndDestroy( textData ); // - textData
- }
+ iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() );
+
+ CleanupStack::PopAndDestroy( textData ); // - textData
}
break;
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
{
- TTime dataModified;
- dataModified = MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(),
- iObject->DesC( CMTPObjectMetaData::ESuid ) );
+ TBuf<KMtpMaxDateTimeStringLength> timeStr;
+ MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(),
+ iObject->DesC( CMTPObjectMetaData::ESuid ),
+ timeStr );
+ PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL Date time %S" ), &timeStr );
- TBuf<KMtpMaxDateTimeStringLength> timeStr;
- dataModified.FormatL( timeStr, KMtpDateTimeFormat );
- PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL Date time %S" ), &timeStr );
CMTPTypeString* datastring = CMTPTypeString::NewLC( timeStr ); // + datastring
-
- iPropertyElement = &(iPropertyList->ReservePropElemL(aHandle, aPropCode));
- iPropertyElement->SetStringL(CMTPTypeObjectPropListElement::EValue, datastring->StringChars());
+ iPropertyElement = &(iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
+ iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, datastring->StringChars() );
CleanupStack::PopAndDestroy( datastring ); // - datastring
}
break;
@@ -701,12 +698,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;
@@ -744,8 +744,6 @@
if ( iFramework.ObjectMgr().ObjectL( handle, *iObject ) ) // Populate the object meta data
{
- SetSubFormatCodeL();
-
if ( iPropCode == KMTPAll )
err = ServiceAllPropertiesL( handle );
else if ( iPropCode == EMTPObjectPropCodeUndefined )
@@ -773,7 +771,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 );
}
}
@@ -785,8 +784,10 @@
//
EXPORT_C TInt CGetObjectPropList::RunError( TInt aError )
{
- PRINT1( _L( "MM MTP <> CGetObjectPropList::RunError aError = %d" ), aError );
- TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) );
+ if ( aError != KErrNone )
+ PRINT1( _L( "MM MTP <> CGetObjectPropList::RunError aError = %d" ), aError );
+
+ TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) );
return KErrNone;
}
@@ -798,8 +799,6 @@
//
EXPORT_C void CGetObjectPropList::DoCancel()
{
- // TODO: need to send the data here?
- // SendDataL( *iPropertyList );
}
void CGetObjectPropList::GetPropertiesL( RArray<TUint>& aPropArray,
@@ -819,7 +818,7 @@
{
for ( TInt j = 0; j < count; j++ )
{
- if( KPropGroupMapTable[j].iPropCode == (*properties)[i]
+ if( KPropGroupMapTable[j].iPropCode == ( *properties )[i]
&& KPropGroupMapTable[j].iGroupCode == aGroupCode )
{
aPropArray.Append( (*properties)[i] );
@@ -829,35 +828,4 @@
}
}
-void CGetObjectPropList::SetSubFormatCodeL()
- {
- __ASSERT_DEBUG( iObject, Panic( EMmMTPDpObjectNull ) );
-
- // Note: Parsing out subformat code in external enumeration phase.
- // This process was delayed in internal phase to avoid time-out.
- TUint16 formatCode = iObject->Uint( CMTPObjectMetaData::EFormatCode );
- TUint subFormatCode = iObject->Uint( CMTPObjectMetaData::EFormatSubCode );
- PRINT2( _L( "MM MTP <> CGetObjectPropList::SetSubFormatCode, formatCode = 0x%x, subFormatCode = 0x%x" ),
- formatCode,
- subFormatCode );
-
- TBool ifNeedParse = ( ( formatCode == EMTPFormatCodeMP4Container )
- || ( formatCode == EMTPFormatCode3GPContainer )
- || ( formatCode== EMTPFormatCodeASF ) )
- && ( subFormatCode == EMTPSubFormatCodeUnknown );
- if ( ifNeedParse )
- {
- PERFLOGSTART( KSubFormatParse );
-
- if ( MmMtpDpUtility::IsVideoL( iObject->DesC( CMTPObjectMetaData::ESuid ) ) )
- subFormatCode = EMTPSubFormatCodeVideo;
- else
- subFormatCode = EMTPSubFormatCodeAudio;
-
- PERFLOGSTOP( KSubFormatParse );
-
- iObject->SetUint( CMTPObjectMetaData::EFormatSubCode, subFormatCode );
- }
- }
-
// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp Mon May 03 12:58:40 2010 +0300
@@ -18,9 +18,7 @@
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <f32file.h>
#include "cgetobjectpropvalue.h"
@@ -28,9 +26,8 @@
#include "cmmmtpdpmetadataaccesswrapper.h"
#include "mmmtpdplogger.h"
#include "mmmtpdpconfig.h"
+#include "tobjectdescription.h"
-_LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" );
-const TInt KMtpMaxDateTimeStringLength = 15;
// -----------------------------------------------------------------------------
// Verification data for the GetObjectPropValue request
@@ -138,7 +135,7 @@
TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 );
TUint32 propCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 );
PRINT2( _L( "MM MTP <> CGetObjectPropValue::ServiceL objectHandle = 0x%x, propCode = 0x%x" ),
- objectHandle, propCode );
+ objectHandle, propCode );
// don't have the ownship of the object
iObjectInfo = iRequestChecker->GetObjectInfo( objectHandle );
@@ -146,8 +143,6 @@
PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL object file name is %S" ), &suid );
TParsePtrC parse( suid );
- iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() );
-
if ( iMTPTypeString != NULL )
{
delete iMTPTypeString;
@@ -182,7 +177,7 @@
{
iMTPTypeUint16.Set( 0 );
iMTPTypeUint16 = MmMtpDpUtility::GetProtectionStatusL( iFramework.Fs(),
- iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
+ iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
SendDataL( iMTPTypeUint16 );
}
break;
@@ -231,26 +226,21 @@
// Name and DataAdded (audio only) fall under the same branch while dateadded(video)/modified/created fall under another
case EMTPObjectPropCodeName: // 0xDC44
case EMTPObjectPropCodeDateAdded: // 0xDC4E
+ case EMTPObjectPropCodeAlbumArtist:
{
- if ( ( propCode == EMTPObjectPropCodeName)
- || ( ( !MmMtpDpUtility::IsVideoL(iObjectInfo->DesC( CMTPObjectMetaData::ESuid ), iFramework ) )
- && ( propCode == EMTPObjectPropCodeDateAdded ) ) )
- {
- iMTPTypeString = CMTPTypeString::NewL();
- ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo );
- break;
- }
+ iMTPTypeString = CMTPTypeString::NewL();
+ ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo );
}
+ break;
//lint -fallthrough
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
{
- TTime dataModified;
- dataModified = MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(),
- iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
+ TBuf<KMtpMaxDateTimeStringLength> timeStr;
+ MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(),
+ iObjectInfo->DesC( CMTPObjectMetaData::ESuid ),
+ timeStr );
- TBuf<KMtpMaxDateTimeStringLength> timeStr;
- dataModified.FormatL( timeStr, KMtpDateTimeFormat );
PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL Date time %S" ), &timeStr );
iMTPTypeString = CMTPTypeString::NewL( timeStr );
SendDataL( *iMTPTypeString );
@@ -260,7 +250,7 @@
// Consumable
case EMTPObjectPropCodeNonConsumable:
{
- iMTPTypeUint8.Set( 0 );
+ iMTPTypeUint8.Set( iObjectInfo->Uint( CMTPObjectMetaData::ENonConsumable ) );
SendDataL( iMTPTypeUint8 );
}
break;
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectreferences.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectreferences.cpp Mon May 03 12:58:40 2010 +0300
@@ -17,10 +17,8 @@
#include <mtp/cmtptypearray.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpreferencemgr.h>
#ifdef _DEBUG
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/mmtpobjectmgr.h>
#include <mtp/tmtptypeuint128.h>
#endif
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetpartialobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetpartialobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -17,13 +17,10 @@
#include <mtp/cmtptypefile.h>
-#include <mtp/mmtpdataproviderframework.h>
-#include <mtp/cmtpobjectmetadata.h>
#include "cgetpartialobject.h"
#include "mmmtpdplogger.h"
#include "tmmmtpdppanic.h"
-#include "ttypeflatbuf.h"
#include "mmmtpdpconfig.h"
/**
@@ -41,7 +38,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 +54,6 @@
//
EXPORT_C CGetPartialObject::~CGetPartialObject()
{
- delete iBuffer;
- delete iPartialData;
delete iFileObject;
}
@@ -69,18 +64,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 +109,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 +128,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 +147,23 @@
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 ) );
+
+ // NOTE: Change all TBuf<KMaxFileName> into TFileName for easily change when fs change the limitation of filename
+ TFileName 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
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cmoveobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cmoveobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -17,11 +17,8 @@
#include <bautils.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
#include <mtp/mmtpstoragemgr.h>
-#include <mtp/mmtpreferencemgr.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/cmtptypearray.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypeobjectproplist.h>
@@ -32,6 +29,7 @@
#include "mmmtpdputility.h"
#include "cmmmtpdpmetadataaccesswrapper.h"
#include "mmmtpdpconfig.h"
+#include "cpropertysettingutility.h"
/**
* Verification data for the MoveObject request
@@ -39,37 +37,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 +72,10 @@
Cancel();
delete iDest;
- delete iFileMan;
- delete iPathToMove;
- delete iNewRootFolder;
- iObjectHandles.Close();
+
if ( iPropertyElement )
delete iPropertyElement;
+
delete iPropertyList;
}
@@ -94,18 +85,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 +118,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 +143,24 @@
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 = CanMoveObjectL( 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 );
- }
- }
-
- iNewRootFolder = newObjectName.AllocL();
+ newObjectName.Append( fileNameParser.NameAndExt() );
+ responseCode = CanMoveObjectL( suid, newObjectName );
- if ( responseCode == EMTPRespCodeOK )
- {
- delete iFileMan;
- iFileMan = NULL;
- iFileMan = CFileMan::NewL( iFramework.Fs() );
-
- if ( !isFolder )
- {
+ if ( responseCode == EMTPRespCodeOK )
MoveFileL( newObjectName );
- SendResponseL( responseCode );
- }
- else
- {
- MoveFolderL();
- }
}
- CleanupStack::PopAndDestroy( &newObjectName ); // - newObjectName.
+ else
+ // Destination is not appropriate for the full path name shouldn't be longer than 255
+ responseCode = EMTPRespCodeInvalidDataset;
+
+ SendResponseL( responseCode );
+
+ CleanupStack::PopAndDestroy( &newObjectName ); // - newObjectName
PRINT1( _L( "MM MTP <= CMoveObject::MoveObjectL responseCode = 0x%x" ), responseCode );
- return responseCode;
}
// -----------------------------------------------------------------------------
@@ -335,30 +171,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 +214,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 +226,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<TDriveNumber>( 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 +275,37 @@
}
// -----------------------------------------------------------------------------
+// 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;
+
+ // Move the file first no matter if it will fail in Get/SetPreviousPropertiesL
+ // Already trapped inside
+ GetPreviousPropertiesL( *iObjectInfo );
+ TRAPD( err, SetPropertiesL( aNewFileName ) );
+
+ CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() );
+ err = fileMan->Move( oldFileName, aNewFileName );
+
+ if ( err != KErrNone )
+ PRINT1( _L( "MM MTP <> CMoveObject::MoveFileL err = %d" ), err );
+
+ PRINT( _L( "MM MTP <= CMoveObject::MoveFileL" ) );
+ }
+
+// -----------------------------------------------------------------------------
// CMoveObject::GetPreviousPropertiesL
// Save the object properties before doing the move
// -----------------------------------------------------------------------------
@@ -445,8 +316,6 @@
const TDesC& suid( aObject.DesC( CMTPObjectMetaData::ESuid ) );
- User::LeaveIfError( iFramework.Fs().Modified( suid, iPreviousModifiedTime ) );
-
// same storage, not necessary to get the properties
if ( iSameStorage )
return;
@@ -454,12 +323,11 @@
TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode );
const RArray<TUint>* 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 +335,9 @@
for ( TInt i = 0; i < count; i++ )
{
- propCode = (*properties)[i];
- switch( propCode )
+ propCode = ( *properties )[i];
+
+ switch ( propCode )
{
case EMTPObjectPropCodeStorageID:
case EMTPObjectPropCodeObjectFormat:
@@ -477,43 +346,40 @@
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 ) )
- && ( propCode == EMTPObjectPropCodeDateAdded ) ) )
- {
- textData = CMTPTypeString::NewLC(); // + textData
+ case EMTPObjectPropCodeAlbumArtist:
+ {
+ CMTPTypeString* textData = CMTPTypeString::NewLC(); // + textData
- TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( propCode,
- *textData,
- aObject ) );
-
- PRINT1( _L( "MM MTP <> CMoveObject::GetPreviousPropertiesL::ServiceSpecificObjectPropertyL err = %d" ), err );
+ TRAP( err, iDpConfig.GetWrapperL().GetObjectMetadataValueL( propCode,
+ *textData,
+ aObject ) );
+ 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 );
- }
- else if ( err == KErrNotFound )
- {
- iPropertyElement = NULL;
- }
- else
- {
- User::Leave( err );
- }
+ if ( err == KErrNone )
+ {
+ iPropertyElement = &( iPropertyList->ReservePropElemL( handle, propCode ) );
+ iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue,
+ textData->StringChars() );
+ }
+ else
+ {
+ iPropertyElement = NULL;
+ }
- CleanupStack::PopAndDestroy( textData ); // - textData
- }
+ CleanupStack::PopAndDestroy( textData ); // - textData
+ }
break;
default:
@@ -523,92 +389,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 +433,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 ) );
+ iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo );
+ break;
+
case EMTPObjectPropCodeName:
+ case EMTPObjectPropCodeAlbumArtist:
{
- stringData = CMTPTypeString::NewLC(
- element.StringL(CMTPTypeObjectPropListElement::EValue)); // + stringData
+ CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData
- respcode = ServiceMetaDataToWrapper( propertyCode,
+ respcode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
+ propertyCode,
*stringData,
- aObject );
+ *iObjectInfo );
CleanupStack::PopAndDestroy( stringData ); // - stringData
}
@@ -640,17 +460,19 @@
default:
{
- respcode = ServiceSetSpecificObjectPropertyL( propertyCode,
- aObject,
- element );
+ respcode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
+ propertyCode,
+ *iObjectInfo,
+ element );
}
break;
}
} // end of for loop
- if( respcode == EMTPRespCodeOK )
+ // ignore errors
+ if ( respcode == EMTPRespCodeOK )
{
- // do nothing, ignore warning
+ // do nothing, just to get rid of build warning
}
PRINT1( _L( "MM MTP <= CMoveObject::SetPreviousPropertiesL respcode = 0x%x" ), respcode );
@@ -661,189 +483,43 @@
// 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& aNewFileName )
{
- PRINT2( _L( "MM MTP => CMoveObject::SetPropertiesL aOldFileName = %S, aNewFileName = %S" ),
- &aOldFileName, &aNewFileName );
+ PRINT1( _L( "MM MTP => CMoveObject::SetPropertiesL, aNewFileName = %S" ), &aNewFileName );
- 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
+ // TODO: Need rollback mechanism for consistant with image dp in fw.
+ // Not sure if it should be trap if something wrong with MPX db.
{
- // if the two object in different stoarge, we should delete the old one and insert new one
if ( iSameStorage )
- iDpConfig.GetWrapperL().RenameObjectL( aOldFileName, aNewFileName );
- else
+ {
+ iDpConfig.GetWrapperL().RenameObjectL( *iObjectInfo, aNewFileName );
+ }
+ else // if the two object in different storage, we should delete the old one and insert new one
{
- iDpConfig.GetWrapperL().DeleteObjectL( aOldFileName, formatCode );
- iDpConfig.GetWrapperL().AddObjectL( aNewFileName );
- SetPreviousPropertiesL( aNewObject );
+ iDpConfig.GetWrapperL().DeleteObjectL( *iObjectInfo );
+ iDpConfig.GetWrapperL().AddObjectL( *iObjectInfo );
+
+ // Only leave when getting proplist element from data received by fw.
+ // It should not happen after ReceiveDataL in which construction of proplist already succeed.
+ 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 );
-// }
+ iObjectInfo->SetDesCL( CMTPObjectMetaData::ESuid, aNewFileName );
+ iObjectInfo->SetUint( CMTPObjectMetaData::EStorageId, iStorageId );
+ iObjectInfo->SetUint( CMTPObjectMetaData::EParentHandle, iNewParentHandle );
+ 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<TUint> 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cpropertysettingutility.cpp Mon May 03 12:58:40 2010 +0300
@@ -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 <mtp/cmtptypeobjectproplist.h>
+#include <mtp/cmtptypestring.h>
+#include <mtp/cmtptypearray.h>
+#include <mtp/tmtptypeuint8.h>
+#include <mtp/tmtptypeuint16.h>
+#include <mtp/tmtptypeuint32.h>
+#include <mtp/mtpdatatypeconstants.h>
+
+#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::SetMetaDataToWrapper
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TMTPResponseCode CPropertySettingUtility::SetMetaDataToWrapper( 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::SetMetaDataToWrapper err = %d"), err);
+
+ if ( err == KErrNone )
+ responseCode = EMTPRespCodeOK;
+ else // Other errors are not SetMetaDataToWrapper related, should be respond before this calling
+ responseCode = EMTPRespCodeGeneralError;
+
+ PRINT1( _L( "MM MTP <= CPropertySettingUtility::SetMetaDataToWrapper resCode = 0x%x" ), responseCode );
+
+ return responseCode;
+ }
+
+// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crenameobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -18,9 +18,7 @@
#include <f32file.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/tmtptypeuint32.h>
#include "crenameobject.h"
@@ -34,7 +32,7 @@
// -----------------------------------------------------------------------------
//
EXPORT_C CRenameObject* CRenameObject::NewL( MMTPDataProviderFramework& aFramework,
- CMmMtpDpMetadataAccessWrapper& aWrapper )
+ CMmMtpDpMetadataAccessWrapper& aWrapper )
{
PRINT( _L( "MM MTP => CRenameObject::NewL" ) );
@@ -59,6 +57,7 @@
iObjectHandles( KMmMtpRArrayGranularity ),
iWrapper ( aWrapper )
{
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -121,7 +120,7 @@
//
EXPORT_C void CRenameObject::DoCancel()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -146,6 +145,8 @@
if ( iNewFolderName.Length() + iRightPartName.Length() <= KMaxFileName )
{
+ PerformAdditionalActionL();
+
iFileName.Zero();
iFileName.Append( iNewFolderName );
iFileName.Append( iRightPartName );
@@ -154,8 +155,6 @@
iObjectInfo->SetDesCL( CMTPObjectMetaData::ESuid, iFileName );
iObjectInfo->SetUint( CMTPObjectMetaData::EObjectMetaDataUpdate, 1 );
iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo );
-
- PerformAdditionalActionL();
}
}
@@ -220,8 +219,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 +230,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 +252,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 +261,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
@@ -297,7 +285,7 @@
PRINT( _L( "MM MTP => CRenameObject::PerformAdditionalActionL" ) );
// update MPX DB
- TRAPD( err, iWrapper.RenameObjectL( iOldFileName, iFileName ) );
+ TRAPD( err, iWrapper.RenameObjectL( *iObjectInfo, iFileName ) );
// should not fail for 1 file, keep it going, as folder already renamed
if ( err != KErrNone )
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestchecker.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestchecker.cpp Mon May 03 12:58:40 2010 +0300
@@ -11,12 +11,11 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/mmtpconnection.h>
#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
@@ -54,7 +53,7 @@
iHandles( KMTPRequestCheckerHandleGranularity ),
iObjectArray( KMTPRequestCheckerHandleGranularity )
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -64,7 +63,7 @@
//
void CRequestChecker::ConstructL()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -80,12 +79,12 @@
// -----------------------------------------------------------------------------
// CRequestChecker::VerifyRequestL
-// Verfiy the request
+// Verify the request
// -----------------------------------------------------------------------------
//
TMTPResponseCode CRequestChecker::VerifyRequestL( const TMTPTypeRequest& aRequest,
- TInt aCount,
- const TMTPRequestElementInfo* aElementInfo )
+ TInt aCount,
+ const TMTPRequestElementInfo* aElementInfo )
{
TMTPResponseCode result = EMTPRespCodeOK;
iHandles.Close();
@@ -96,9 +95,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 +199,7 @@
ret = EMTPRespCodeSessionNotOpen;
}
}
-
+
return ret;
}
@@ -209,7 +210,7 @@
// -----------------------------------------------------------------------------
//
TMTPResponseCode CRequestChecker::VerifySessionId( TUint32 aSessionId,
- const TMTPRequestElementInfo& /*aElementInfo*/ ) const
+ const TMTPRequestElementInfo& /*aElementInfo*/ ) const
{
TMTPResponseCode ret = EMTPRespCodeOK;
@@ -224,7 +225,7 @@
{
ret = EMTPRespCodeInvalidParameter;
}
-
+
return ret;
}
@@ -235,7 +236,7 @@
// -----------------------------------------------------------------------------
//
TMTPResponseCode CRequestChecker::VerifyObjectHandleL( TUint32 aHandle,
- const TMTPRequestElementInfo& aElementInfo )
+ const TMTPRequestElementInfo& aElementInfo )
{
PRINT1( _L("MM MTP => CRequestChecker::VerifyObjectHandleL aHandle = 0x%x"), aHandle );
TMTPResponseCode ret = EMTPRespCodeOK;
@@ -252,61 +253,35 @@
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 ) )
- {
- // Special association type .. not always present on the filesystem.
- return ret;
- }
- else
+
+ if ( err == KErrNotFound )
{
- User::LeaveIfError( err );
-
+ iFramework.ObjectMgr().RemoveObjectL( suid );
+ // TODO: workaround for abstractalbumart
+ // ret = EMTPRespCodeInvalidObjectHandle;
+ }
+ else if ( err != KErrNone )
+ ret = EMTPRespCodeGeneralError;
+ else if ( object->Uint( CMTPObjectMetaData::EFormatCode ) != EMTPFormatCodeAssociation )
+ {
if ( iFramework.ObjectMgr().ObjectOwnerId( aHandle ) != iFramework.DataProviderId() )
- {
- PRINT( _L(" ewrwe ret = EMTPRespCodeInvalidObjectHandle;"));
ret = EMTPRespCodeInvalidObjectHandle;
- }
- }
- if ( aElementInfo.iElementAttr & EMTPElementAttrWrite )
- {
- if ( entry.IsReadOnly() )
- {
+ if ( ( aElementInfo.iElementAttr & EMTPElementAttrWrite ) && entry.IsReadOnly() )
ret = EMTPRespCodeObjectWriteProtected;
- }
- }
-
- //((EMTPRespCodeOK == ret) && (aElementInfo.iElementAttr & EMTPElementAttrFileOrDir)) is
- // covered implicitly here, EMTPRespCodeOK will be returned. It is a valid case for an object to be either a folder or file
- // for certain operation's request parameter, for instance the first parameter of copyObject or
- // moveObject can be either a file or a directory.
- // Other cases.
- if ( ( EMTPRespCodeOK == ret ) && ( aElementInfo.iElementAttr & EMTPElementAttrFile) )
- {
- if ( entry.IsDir() )
- {
+ if ( ( EMTPRespCodeOK == ret ) && ( aElementInfo.iElementAttr & EMTPElementAttrFile ) && entry.IsDir() )
ret = EMTPRespCodeInvalidObjectHandle;
- }
- }
- if ( ( EMTPRespCodeOK == ret ) && ( aElementInfo.iElementAttr & EMTPElementAttrDir ) )
- {
- if (!entry.IsDir())
- {
+ if ( ( EMTPRespCodeOK == ret ) && ( aElementInfo.iElementAttr & EMTPElementAttrDir ) && !entry.IsDir() )
ret = EMTPRespCodeInvalidParentObject;
- }
}
}
else
- {
- PRINT( _L( "MM MTP <> CRequestChecker::VerifyObjectHandleL, Object does not exist." ) );
ret = EMTPRespCodeInvalidObjectHandle;
- }
+
PRINT1( _L( "MM MTP <= CRequestChecker::VerifyObjectHandleL ret = 0x%x" ), ret );
-
+
return ret;
}
@@ -316,7 +291,7 @@
// -----------------------------------------------------------------------------
//
TMTPResponseCode CRequestChecker::VerifyStorageIdL( TUint32 aStorageId,
- const TMTPRequestElementInfo& aElementInfo ) const
+ const TMTPRequestElementInfo& aElementInfo ) const
{
MMTPStorageMgr& mgr( iFramework.StorageMgr() );
TMTPResponseCode ret( EMTPRespCodeOK );
@@ -357,7 +332,7 @@
}
}
}
-
+
return ret;
}
@@ -367,7 +342,7 @@
// -----------------------------------------------------------------------------
//
TMTPResponseCode CRequestChecker::VerifyFormatCode( TUint32 aFormatCode,
- const TMTPRequestElementInfo& aElementInfo ) const
+ const TMTPRequestElementInfo& aElementInfo ) const
{
PRINT1( _L( "MM MTP => CRequestChecker::VerifyFormatCode aFormatCode = 0x%x" ), aFormatCode );
TMTPResponseCode ret = EMTPRespCodeInvalidObjectFormatCode;
@@ -395,7 +370,7 @@
}
PRINT1( _L( "MM MTP => CRequestChecker::VerifyFormatCode ret = 0x%x" ), ret );
-
+
return ret;
}
@@ -405,7 +380,7 @@
// -----------------------------------------------------------------------------
//
TBool CRequestChecker::IsSpecialValue( TUint32 aParameter,
- const TMTPRequestElementInfo& aElementInfo ) const
+ const TMTPRequestElementInfo& aElementInfo ) const
{
TBool result = EFalse;
switch ( aElementInfo.iCount )
@@ -413,16 +388,16 @@
case 1:
result = ( aParameter == aElementInfo.iValue1 );
break;
-
+
case 2:
result = ( aParameter == aElementInfo.iValue1
|| aParameter == aElementInfo.iValue2 );
break;
-
+
default:
break;
}
-
+
return result;
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestprocessor.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestprocessor.cpp Mon May 03 12:58:40 2010 +0300
@@ -18,12 +18,11 @@
#include <mtp/mtpprotocolconstants.h>
#include <mtp/tmtptyperequest.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/tmtptypeevent.h>
#include <mtp/mmtpconnection.h>
#include <mtp/mmtpobjectmgr.h>
#include <e32property.h>
-#include <MtpPrivatePSKeys.h>
+#include <mtpprivatepskeys.h>
#include "crequestprocessor.h"
#include "crequestchecker.h"
@@ -39,13 +38,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 +57,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 +393,7 @@
//
EXPORT_C void CRequestProcessor::RunL()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -400,7 +403,7 @@
//
EXPORT_C void CRequestProcessor::DoCancel()
{
-
+ // Do nothing
}
// -----------------------------------------------------------------------------
@@ -410,8 +413,11 @@
//
EXPORT_C TInt CRequestProcessor::RunError( TInt aError )
{
- PRINT1( _L( "MM MTP <> CRequestProcessor RunError = %d" ), aError );
+ if ( aError != KErrNone )
+ PRINT1( _L( "MM MTP <> CRequestProcessor RunError = %d" ), aError );
+
TRAP_IGNORE( SendResponseL( EMTPRespCodeGeneralError ) );
+
return KErrNone;
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestunknown.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestunknown.cpp Mon May 03 12:58:40 2010 +0300
@@ -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" ) );
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,14 +16,11 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpobjectmgr.h>
#include <mtp/cmtptypestring.h>
-#include <mtp/cmtptypearray.h>
#include <mtp/cmtptypeobjectinfo.h>
#include <mtp/cmtptypefile.h>
#include <mtp/mmtpstoragemgr.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <bautils.h>
#include <mtp/cmtptypeobjectproplist.h>
@@ -32,6 +29,7 @@
#include "mmmtpdputility.h"
#include "tmmmtpdppanic.h"
#include "mmmtpdplogger.h"
+#include "cpropertysettingutility.h"
#include "cmmmtpdpmetadataaccesswrapper.h"
// Verification data for the SendObjectInfo request
@@ -57,16 +55,31 @@
};
// -----------------------------------------------------------------------------
+// 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
// -----------------------------------------------------------------------------
//
EXPORT_C CSendObject::~CSendObject()
{
- if ( ( iProgress == EObjectInfoSucceed
- || iProgress == EObjectInfoFail
- || iProgress == EObjectInfoInProgress )
- && !iNoRollback )
+ if ( !iNoRollback )
{
// Not finished SendObjectInfo \ SendObject pair detected.
Rollback();
@@ -88,10 +101,10 @@
// Standard C++ Constructor
// -----------------------------------------------------------------------------
//
-EXPORT_C CSendObject::CSendObject( MMTPDataProviderFramework& aFramework,
+CSendObject::CSendObject( MMTPDataProviderFramework& aFramework,
MMTPConnection& aConnection,
MMmMtpDpConfig& aDpConfig ) :
- CRequestProcessor( aFramework, aConnection, 0, NULL),
+ CRequestProcessor( aFramework, aConnection, 0, NULL ),
iFs( iFramework.Fs() ),
iObjectMgr( iFramework.ObjectMgr() ),
iDpConfig( aDpConfig )
@@ -104,7 +117,7 @@
// 2nd Phase Constructor
// -----------------------------------------------------------------------------
//
-EXPORT_C void CSendObject::ConstructL()
+void CSendObject::ConstructL()
{
PRINT( _L( "MM MTP => CSendObject::ConstructL" ) );
@@ -563,53 +576,60 @@
TBool result = ETrue;
- delete iFileReceived;
- iFileReceived = NULL;
-
- TEntry fileEntry;
- User::LeaveIfError( iFs.Entry( iFullPath, fileEntry ) );
- if ( fileEntry.iSize != iObjectSize )
+ // SendObject is cancelled or connection is dropped.
+ if ( iCancelled )
{
- iFs.Delete( iFullPath );
- iObjectMgr.UnreserveObjectHandleL( *iReceivedObjectInfo );
- TMTPResponseCode responseCode = EMTPRespCodeObjectTooLarge;
- if ( fileEntry.iSize < iObjectSize )
- {
- responseCode = EMTPRespCodeIncompleteTransfer;
- }
- SendResponseL( responseCode );
- result = EFalse;
- }
-
- // SendObject is cancelled or connection is dropped.
- if ( result && iCancelled )
- {
+ // In SendObject response phase, unregister is not necessary.
+ // But there's no harm, still keep it here.
iFramework.RouteRequestUnregisterL( iExpectedSendObjectRequest,
iConnection );
+
Rollback();
SendResponseL( EMTPRespCodeTransactionCancelled );
}
- else if ( result && !iCancelled )
+ else
{
- if ( iObjectSize > 0 ) // media file
+ TEntry fileEntry;
+ User::LeaveIfError( iFs.Entry( iFullPath, fileEntry ) );
+
+ if ( fileEntry.FileSize() != iObjectSize )
{
- AddMediaToStoreL();
+ Rollback();
+ TMTPResponseCode responseCode = EMTPRespCodeObjectTooLarge;
+ if ( fileEntry.FileSize() < iObjectSize )
+ {
+ responseCode = EMTPRespCodeIncompleteTransfer;
+ }
+ SendResponseL( responseCode );
+ result = EFalse;
+ }
+ else
+ {
+ if ( iObjectSize > 0 ) // media file
+ {
+ TRAPD( err, AddMediaToStoreL() );
+ PRINT1( _L( "MM MTP <> CSendObject::DoHandleResponsePhaseObjectL err = %d" ), err );
- if( iPreviousOperation == EMTPOpCodeSendObjectPropList )
- {
- SetObjectPropListL( *iObjectPropList );
+ if ( ( iPreviousOperation == EMTPOpCodeSendObjectPropList )
+ && ( err == KErrNone ) )
+ {
+ // Only leave when getting proplist element from data received by fw.
+ // It should not happen after ReceiveDataL in which construction of proplist already succeed.
+ SetObjectPropListL();
+ }
+
+ // Commits into MTP data object enumeration store the object handle and
+ // storage space previously reserved for the specified object.
+ iFramework.ObjectMgr().CommitReservedObjectHandleL( *iReceivedObjectInfo );
}
- // Commits into MTP data object enumeration store the object handle and
- // storage space previously reserved for the specified object.
- iFramework.ObjectMgr().CommitReservedObjectHandleL( *iReceivedObjectInfo );
- }
+ // In SendObject response phase, unregister is not necessary.
+ // But there's no harm, still keep it here.
+ iFramework.RouteRequestUnregisterL( iExpectedSendObjectRequest,
+ iConnection );
- // Commit object to MTP data store
- iFramework.RouteRequestUnregisterL( iExpectedSendObjectRequest,
- iConnection );
-
- SendResponseL( EMTPRespCodeOK );
+ SendResponseL( EMTPRespCodeOK );
+ }
}
PRINT1( _L( "MM MTP <= CSendObject::DoHandleResponsePhaseObjectL result = %d" ), result );
@@ -684,7 +704,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 +723,7 @@
const RArray<TUint>* 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 +805,6 @@
break;
case EMTPObjectPropCodeDateCreated:
- // TODO: this property is read-only, should response EMTPRespCodeAccessDenied or set nothing?
case EMTPObjectPropCodeDateModified:
case EMTPObjectPropCodeObjectFileName:
case EMTPObjectPropCodeName:
@@ -805,11 +824,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 +881,7 @@
break;
}
- PRINT1( _L( "MM MTP <= CSendObject::ExtractPropertyL, responseCode = 0x%X" ), responseCode );
+ PRINT1( _L( "MM MTP <= CSendObject::ExtractPropertyL, responseCode = 0x%x" ), responseCode );
return responseCode;
}
@@ -867,7 +890,7 @@
// Reserve object proplist into database
// -----------------------------------------------------------------------------
//
-TMTPResponseCode CSendObject::SetObjectPropListL( const CMTPTypeObjectPropList& aPropList )
+TMTPResponseCode CSendObject::SetObjectPropListL()
{
PRINT( _L( "MM MTP => CSendObject::SetObjectPropListL" ) );
@@ -882,13 +905,13 @@
TUint16 propertyCode = element.Uint16L( CMTPTypeObjectPropListElement::EPropertyCode );
TUint16 dataType = element.Uint16L( CMTPTypeObjectPropListElement::EDatatype );
PRINT2( _L( "MM MTP <> SetObjectPropListL propertyCode = 0x%x, dataType = 0x%x" ),
- propertyCode, dataType );
+ propertyCode,
+ dataType );
switch ( propertyCode )
{
case EMTPObjectPropCodeStorageID:
case EMTPObjectPropCodeObjectFormat:
- case EMTPObjectPropCodeProtectionStatus:
case EMTPObjectPropCodeObjectSize:
case EMTPObjectPropCodeParentObject:
case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
@@ -896,11 +919,15 @@
break;
case EMTPObjectPropCodeNonConsumable:
+ iReceivedObjectInfo->SetUint( CMTPObjectMetaData::ENonConsumable,
+ element.Uint8L( CMTPTypeObjectPropListElement::EValue ) );
+ break;
+
case EMTPObjectPropCodeDateAdded:
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
case EMTPObjectPropCodeObjectFileName:
- // TODO: Does anything need to be done on these read-only properties?
+ // Do nothing for read-only properties
/* spec:
* Object properties that are get-only (0x00 GET)
* should accept values during object creation by
@@ -908,11 +935,18 @@
*/
break;
+ case EMTPObjectPropCodeProtectionStatus:
+ // Already done in AddMediaToStore, it's not necessary to set it again.
+ // SetProtectionStatus();
+ break;
+
case EMTPObjectPropCodeName:
+ case EMTPObjectPropCodeAlbumArtist:
{
CMTPTypeString* stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData
- responseCode = SetMetaDataToWrapperL( propertyCode,
+ responseCode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
+ propertyCode,
*stringData,
*iReceivedObjectInfo );
@@ -922,7 +956,8 @@
default:
{
- responseCode = SetSpecificObjectPropertyL( propertyCode,
+ responseCode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
+ propertyCode,
*iReceivedObjectInfo,
element );
}
@@ -935,53 +970,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 +979,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 +1034,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;
}
@@ -1091,17 +1080,32 @@
PRINT1( _L("MM MTP => CSendObject::GetFullPathNameL aFileName = %S"), &aFileName );
TBool result( EFalse );
+
if ( aFileName.Length() > 0 )
{
iFullPath.Zero();
iFullPath.Append( *iParentSuid );
- if ( ( iFullPath.Length() + aFileName.Length() ) < KMaxFileName )
+
+ // TODO: need to be done in derived class
+ // Only add extension for alb to pass winlogo test cases
+ TInt length = iFullPath.Length() + aFileName.Length();
+
+ TParsePtrC parser( aFileName );
+ TBool isAlbWithoutExt =
+ ( ( iObjectFormat == EMTPFormatCodeAbstractAudioAlbum ) && ( !parser.ExtPresent() ) );
+ if ( isAlbWithoutExt )
+ length += KTxtExtensionALB().Length();
+
+ if ( length < KMaxFileName )
{
iFullPath.Append( aFileName );
+ if ( isAlbWithoutExt )
+ iFullPath.Append( KTxtExtensionALB );
PRINT1( _L( "MM MTP <> CSendObject::GetFullPathNameL iFullPath = %S" ), &iFullPath );
result = iFramework.Fs().IsValidName( iFullPath );
}
}
+
if ( result && ( iObjectFormat != MmMtpDpUtility::FormatFromFilename( iFullPath ) ) )
{
PRINT2( _L( "MM MTP <> %S does not match 0x%x" ), &iFullPath, iObjectFormat );
@@ -1172,14 +1176,22 @@
// Reserves space for and assigns an object handle to the object described
// by the specified object information record.
TRAP( err, iObjectMgr.ReserveObjectHandleL( *iReceivedObjectInfo,
- iObjectSize ) );
+ iObjectSize ) );
PRINT2( _L( "MM MTP => CSendObject::ReserveObjectL iObjectsize = %Lu, Operation: 0x%x" ), iObjectSize, iOperationCode );
if ( err != KErrNone )
PRINT1( _L( "MM MTP <> CSendObject::ReserveObjectL err = %d" ), err );
if ( iObjectSize == 0 )
{
+ // Already trapped inside SaveEmptyFileL.
SaveEmptyFileL();
+ if( iOperationCode == EMTPOpCodeSendObjectPropList )
+ {
+ // Only leave when getting proplist element from data received by fw.
+ // It should not happen after ReceiveDataL in which construction of proplist already succeed.
+ SetObjectPropListL();
+ }
+
iObjectMgr.CommitReservedObjectHandleL( *iReceivedObjectInfo );
}
@@ -1197,29 +1209,40 @@
}
// -----------------------------------------------------------------------------
-// CSendObject::SetProtectionStatusL
+// CSendObject::SetProtectionStatus
// -----------------------------------------------------------------------------
//
-void CSendObject::SetProtectionStatusL()
+void CSendObject::SetProtectionStatus()
{
- PRINT1( _L( "MM MTP => CSendObject::SetProtectionStatusL iProtectionStatus = %d" ), iProtectionStatus );
+ PRINT1( _L( "MM MTP => CSendObject::SetProtectionStatus iProtectionStatus = %d" ), iProtectionStatus );
- if ( iProtectionStatus == EMTPProtectionNoProtection
- || iProtectionStatus == EMTPProtectionReadOnly )
+ if ( iFileReceived != NULL )
{
- // TODO: wait for review
- TInt err = KErrNone;
- if ( iProtectionStatus == EMTPProtectionNoProtection )
+ if ( iProtectionStatus == EMTPProtectionNoProtection
+ || iProtectionStatus == EMTPProtectionReadOnly )
{
- iFs.SetAtt( iFullPath, KEntryAttNormal, KEntryAttReadOnly );
+ TInt err = KErrNone;
+ if ( iProtectionStatus == EMTPProtectionNoProtection )
+ {
+ err = iFileReceived->File().SetAtt( KEntryAttNormal, KEntryAttReadOnly );
+ }
+ else
+ {
+ err = iFileReceived->File().SetAtt( KEntryAttReadOnly, KEntryAttNormal );
+ }
+
+ if ( err != KErrNone )
+ {
+ PRINT1( _L("MM MTP <> CSendObject::SetProtectionStatus err = %d" ), err );
+ }
}
- else
- {
- iFs.SetAtt( iFullPath, KEntryAttReadOnly, KEntryAttNormal );
- }
- User::LeaveIfError( err );
+ // Close the file after SetProtectionStatus to make sure other process won't open
+ // the file successfully right at the time calling RFile::SetAtt.
+ delete iFileReceived;
+ iFileReceived = NULL;
}
- PRINT( _L( "MM MTP <= CSendObject::SetProtectionStatusL" ) );
+
+ PRINT( _L( "MM MTP <= CSendObject::SetProtectionStatus" ) );
}
// -----------------------------------------------------------------------------
@@ -1232,28 +1255,28 @@
RFile file;
User::LeaveIfError( file.Create( iFs, iFullPath, EFileWrite ) );
- file.Close();
-
- // set entry protection status and modified date
- SetProtectionStatusL();
-
- // add playlist to MPX DB
- TParsePtrC parse( iFullPath );
- iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() );
- iDpConfig.GetWrapperL().AddObjectL( iFullPath );
+ CleanupClosePushL( file ); // + file
if ( EMTPFormatCodeAbstractAudioVideoPlaylist == iObjectFormat )
{
TInt err = KErrNone;
- err = iFs.SetAtt( iFullPath,
- KEntryAttSystem | KEntryAttHidden,
+ err = file.SetAtt( KEntryAttSystem | KEntryAttHidden,
KEntryAttReadOnly | KEntryAttNormal );
if ( err != KErrNone )
PRINT1( _L( "MM MTP <> CSendObject::SaveEmptyFileL err = %d" ), err );
iDpConfig.GetWrapperL().AddDummyFileL( iFullPath );
}
+ CleanupStack::PopAndDestroy( &file ); // - file
- PRINT( _L( "MM MTP <= CSendObject::SaveEmptyFileL" ) );
+ // add playlist to MPX DB
+ TRAPD( err, AddMediaToStoreL() );
+
+ if ( err != KErrNone )
+ {
+ // Ignore err even add into MPX get failed.
+ }
+
+ PRINT1( _L( "MM MTP <= CSendObject::SaveEmptyFileLerr = %d" ), err );
}
// -----------------------------------------------------------------------------
@@ -1265,56 +1288,16 @@
{
PRINT( _L( "MM MTP => CSendObject::AddMediaToStoreL" ) );
- TBool isVideo = EFalse;
- switch ( iObjectFormat )
- {
- case EMTPFormatCode3GPContainer:
- case EMTPFormatCodeMP4Container:
- case EMTPFormatCodeASF:
- {
- TMmMtpSubFormatCode subFormatCode;
-
- if ( MmMtpDpUtility::IsVideoL( iFullPath ) )
- {
- subFormatCode = EMTPSubFormatCodeVideo;
- isVideo = ETrue;
- }
- else
- {
- subFormatCode = EMTPSubFormatCodeAudio;
- isVideo = EFalse;
- }
-
- iReceivedObjectInfo->SetUint( CMTPObjectMetaData::EFormatSubCode,
- ( TUint ) subFormatCode );
- }
- break;
+ // SetProtectionStatus here make sure no matter the previous operation is SendObjectInfo
+ // or SendObjectPropList
+ // Might need to set dateadded and datemodify for further extension.
+ SetProtectionStatus();
- // put all just video format codes here
- case EMTPFormatCodeWMV:
- {
- isVideo = ETrue;
- }
- break;
-
- default:
- PRINT( _L( "MM MTP <> CSendObject::DoHandleResponsePhaseObjectL default" ) );
- break;
- }
+ iDpConfig.GetWrapperL().SetStorageRootL( iFullPath );
+ PRINT1( _L( "MM MTP <> CSendObject::AddMediaToStoreL iFullPath = %S" ), &iFullPath );
+ iDpConfig.GetWrapperL().AddObjectL( *iReceivedObjectInfo );
- TPtrC suid( iReceivedObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
- PRINT1( _L( "MM MTP <> CSendObject::AddMediaToStoreL suid = %S" ), &suid );
- TParsePtrC parse( suid );
- iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() );
- iDpConfig.GetWrapperL().AddObjectL( iFullPath, isVideo );
-
- if ( isVideo )
- {
- TInt err = KErrNone;
- TRAP( err, iDpConfig.GetWrapperL().SetImageObjPropL( iFullPath, iWidth, iHeight ) );
-
- PRINT1( _L( "MM MTP <= CSendObject::AddVideoToStoreL err = %d" ), err );
- }
+ iDpConfig.GetWrapperL().SetImageObjPropL( *iReceivedObjectInfo, iWidth, iHeight );
PRINT( _L( "MM MTP <= CSendObject::AddMediaToStoreL" ) );
}
@@ -1339,11 +1322,17 @@
void CSendObject::Rollback()
{
// Delete this object from file system.
- if ( iProgress == ESendObjectInProgress )
+ if ( iProgress == ESendObjectInProgress
+ || iProgress == EObjectInfoSucceed
+ ||iProgress == EObjectInfoFail )
{
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;
}
}
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectproplist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectproplist.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypeobjectproplist.h>
#include <mtp/mmtpobjectmgr.h>
#include <mtp/cmtptypestring.h>
@@ -27,38 +26,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 +68,7 @@
// 2nd Phase Constructor
// -----------------------------------------------------------------------------
//
-EXPORT_C void CSetObjectPropList::ConstructL()
+void CSetObjectPropList::ConstructL()
{
CActiveScheduler::Add( this );
@@ -88,6 +88,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 +152,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 +176,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 +197,6 @@
case EMTPObjectPropCodeObjectSize:
case EMTPObjectPropCodeParentObject:
case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
- case EMTPObjectPropCodeNonConsumable:
case EMTPObjectPropCodeDateAdded:
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
@@ -181,31 +205,43 @@
}
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<KMaxFileName> newSuid( aPropListElement.StringL(
- CMTPTypeObjectPropListElement::EValue ) );
- TInt err = KErrNone;
- 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
- {
+ TPtrC ptr( aPropListElement.StringL( CMTPTypeObjectPropListElement::EValue ) );
+ if ( KMaxFileName < ptr.Length() )
responseCode = EMTPRespCodeInvalidDataset;
- }
- else if ( ( KErrNone == err ) || ( KErrAlreadyExists == err ) )
+ else
{
- TRAP( err, iDpConfig.GetWrapperL().RenameObjectL( suid, newSuid ) ); //Update MPX DB
- PRINT1( _L( "MM MTP <> Rename Object err = %d" ), err );
- // it is ok if file is not found in DB, following S60 solution
- if ( KErrNotFound == err )
+ TFileName newSuid( ptr );
+ 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
+ {
+ responseCode = EMTPRespCodeInvalidDataset;
+ }
+ else if ( KErrNone == err ) // TODO: ( KErrAlreadyExists == err )
{
- TRAP( err, iDpConfig.GetWrapperL().AddObjectL( newSuid ) );
- PRINT1( _L( "MM MTP <> Add Object err = %d" ), err );
- }
+ TRAP( err, iDpConfig.GetWrapperL().RenameObjectL( *object, newSuid ) ); //Update MPX DB
- if ( KErrNone == err )
- {
+ PRINT1( _L( "MM MTP <> Rename MPX object file name err = %d" ), err );
+ // it is ok if file is not found in DB, following S60 solution
+ if ( KErrNotFound == err )
+ {
+ TRAP( err, iDpConfig.GetWrapperL().AddObjectL( *object ) );
+ PRINT1( _L( "MM MTP <> Add MPX object file name err = %d" ), err );
+ }
+
object->SetDesCL( CMTPObjectMetaData::ESuid, newSuid );
iFramework.ObjectMgr().ModifyObjectL( *object );
}
@@ -218,13 +254,15 @@
break;
case EMTPObjectPropCodeName:
+ case EMTPObjectPropCodeAlbumArtist:
{
CMTPTypeString* stringData = CMTPTypeString::NewLC(
- aPropListElement.StringL(
- CMTPTypeObjectPropListElement::EValue ) );// + stringData
+ aPropListElement.StringL( CMTPTypeObjectPropListElement::EValue ) );// + stringData
- responseCode = ServiceMetaDataToWrapperL( propertyCode,
- *stringData, *object );
+ responseCode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
+ propertyCode,
+ *stringData,
+ *object );
CleanupStack::PopAndDestroy( stringData );// - stringData
}
@@ -232,15 +270,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 +296,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 +333,9 @@
//
EXPORT_C TInt CSetObjectPropList::RunError( TInt aError )
{
- PRINT1( _L( "MM MTP <> CSetObjectPropList::RunError with error %d" ), aError );
+ if ( aError != KErrNone )
+ 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 +348,6 @@
//
EXPORT_C void CSetObjectPropList::DoCancel()
{
-
}
// end of file
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectpropvalue.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectpropvalue.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,7 +16,6 @@
*/
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
#include <mtp/mmtpobjectmgr.h>
@@ -72,7 +71,8 @@
sizeof(KMTPSetObjectPropValuePolicy) / sizeof(TMTPRequestElementInfo),
KMTPSetObjectPropValuePolicy ),
iObjectMgr( aFramework.ObjectMgr() ),
- iDpConfig( aDpConfig )
+ iDpConfig( aDpConfig ),
+ iFs( aFramework.Fs() )
{
SetPSStatus();
PRINT( _L( "Operation: SetObjectPropValue(0x9804)" ) );
@@ -107,13 +107,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 +135,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 <> CSetObjectPropValue::CheckRequestL, objectInfo is NULL" ) );
return EMTPRespCodeInvalidObjectHandle;
}
- 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 );
+ TFileName fileName = objectInfo->DesC( CMTPObjectMetaData::ESuid );
+ TUint32 formatCode = objectInfo->Uint( CMTPObjectMetaData::EFormatCode );
+ PRINT3( _L( "MM MTP <> CSetObjectPropValue::CheckRequestL, handle = 0x%x, filename = %S, formatCode = 0x%x" ),
+ objectHandle,
+ &fileName,
+ formatCode );
const RArray<TUint>* 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,16 +217,20 @@
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
+ case EMTPObjectPropCodeAlbumArtist:
{
delete iMTPTypeString;
iMTPTypeString = NULL;
@@ -252,33 +261,42 @@
switch ( iPropCode )
{
+ case EMTPObjectPropCodeNonConsumable:
+ iObjectInfo->SetUint( CMTPObjectMetaData::ENonConsumable, iMTPTypeUint8.Value() );
+ iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo );
+ break;
+
case EMTPObjectPropCodeObjectFileName:
{
TPtrC suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
- TBuf<KMaxFileName> newSuid( iMTPTypeString->StringChars() );
- PRINT2( _L( "MM MTP <> old name = %S, new name = %S" ), &suid, &newSuid );
- TInt err = KErrNone;
- 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
- {
+ TPtrC ptr ( iMTPTypeString->StringChars() );
+ if ( KMaxFileName < ptr.Length() )
responseCode = EMTPRespCodeInvalidDataset;
- }
- else if ( ( KErrNone == err ) || ( KErrAlreadyExists == err ) )
+ else
{
- TRAP( err, iDpConfig.GetWrapperL().RenameObjectL( suid, newSuid ) ); //Update MPX DB
- PRINT1( _L( "MM MTP <> Rename MPX object file name err = %d" ), err );
- // it is ok if file is not found in DB, following S60 solution
- if ( KErrNotFound == err )
+ TFileName newSuid( ptr );
+ PRINT2( _L( "MM MTP <> old name = %S, new name = %S" ), &suid, &newSuid );
+ TInt err = KErrNone;
+ err = MmMtpDpUtility::UpdateObjectFileName( iFramework.Fs(),
+ suid,
+ newSuid );
+ // TODO: if the new name is the same with old name
+ PRINT1( _L( "MM MTP <> Update object file name err = %d" ), err );
+ if ( KErrOverflow == err ) // full path name is too long
{
- TRAP( err, iDpConfig.GetWrapperL().AddObjectL( newSuid ) );
- PRINT1( _L( "MM MTP <> Add MPX object file name err = %d" ), err );
+ responseCode = EMTPRespCodeInvalidDataset;
}
+ else if ( KErrNone == err )
+ {
+ TRAP( err, iDpConfig.GetWrapperL().RenameObjectL( *iObjectInfo, newSuid ) ); //Update MPX DB
+ PRINT1( _L( "MM MTP <> Rename MPX object file name err = %d" ), err );
+ // it is ok if file is not found in DB, following S60 solution
+ if ( KErrNotFound == err )
+ {
+ TRAP( err, iDpConfig.GetWrapperL().AddObjectL( *iObjectInfo ) );
+ PRINT1( _L( "MM MTP <> Add MPX object file name err = %d" ), err );
+ }
- if ( KErrNone == err )
- {
iObjectInfo->SetDesCL( CMTPObjectMetaData::ESuid, newSuid );
iFramework.ObjectMgr().ModifyObjectL( *iObjectInfo );
}
@@ -291,6 +309,7 @@
break;
case EMTPObjectPropCodeName: // 0xDC44
+ case EMTPObjectPropCodeAlbumArtist:
{
responseCode = ServiceMetaDataToWrapperL( iPropCode,
*iMTPTypeString,
@@ -343,12 +362,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
{
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectreferences.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectreferences.cpp Mon May 03 12:58:40 2010 +0300
@@ -18,7 +18,6 @@
#include <mtp/cmtptypearray.h>
#include <mtp/mmtpobjectmgr.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <mtp/mmtpreferencemgr.h>
#include "csetobjectreferences.h"
@@ -28,6 +27,8 @@
#include "mmmtpdputility.h"
#include "mmmtpdpconfig.h"
+const TInt KMmMtpRefArrayGranularity = 3;
+
// -----------------------------------------------------------------------------
// Verification data for the SetReferences request
// -----------------------------------------------------------------------------
@@ -88,16 +89,14 @@
// Standard c++ constructor
// -----------------------------------------------------------------------------
//
-EXPORT_C CSetObjectReferences::CSetObjectReferences(
- MMTPDataProviderFramework& aFramework,
+EXPORT_C CSetObjectReferences::CSetObjectReferences( MMTPDataProviderFramework& aFramework,
MMTPConnection& aConnection,
MMmMtpDpConfig& aDpConfig ) :
- CRequestProcessor(
- aFramework,
- aConnection,
- sizeof( KMTPSetObjectReferencesPolicy )/sizeof( TMTPRequestElementInfo ),
- KMTPSetObjectReferencesPolicy ),
- iDpConfig( aDpConfig )
+ CRequestProcessor( aFramework,
+ aConnection,
+ sizeof( KMTPSetObjectReferencesPolicy ) / sizeof( TMTPRequestElementInfo ),
+ KMTPSetObjectReferencesPolicy ),
+ iDpConfig( aDpConfig )
{
PRINT( _L( "Operation: SetObjectReferences(0x9811)" ) );
}
@@ -107,12 +106,15 @@
// set references to DB
// -----------------------------------------------------------------------------
//
-EXPORT_C void CSetObjectReferences::DoSetObjectReferencesL( CMmMtpDpMetadataAccessWrapper& aWrapper,
- TUint16 aObjectFormat,
- const TDesC& aSrcFileName,
- CDesCArray& aRefFileArray )
+EXPORT_C void CSetObjectReferences::DoSetObjectReferencesL( const CMTPObjectMetaData& aObject )
{
- // do nothing, do special thing by inheriting
+ TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode );
+ TBool hasReference = MmMtpDpUtility::HasReference( formatCode );
+
+ if ( hasReference )
+ {
+ iDpConfig.GetWrapperL().SetReferenceL( aObject, *iReferenceSuids );
+ }
}
// -----------------------------------------------------------------------------
@@ -142,7 +144,7 @@
delete iReferenceSuids;
iReferenceSuids = NULL;
- iReferenceSuids = new ( ELeave ) CDesCArrayFlat( 3 );
+ iReferenceSuids = new ( ELeave ) CDesCArrayFlat( KMmMtpRefArrayGranularity );
if ( !VerifyReferenceHandlesL() )
{
@@ -159,10 +161,7 @@
CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); // + object
iFramework.ObjectMgr().ObjectL( objectHandle, *object );
PRINT1( _L( "MM MTP <> object file name is %S" ), &(object->DesC( CMTPObjectMetaData::ESuid ) ) );
- DoSetObjectReferencesL( iDpConfig.GetWrapperL(),
- object->Uint( CMTPObjectMetaData::EFormatCode ),
- object->DesC( CMTPObjectMetaData::ESuid ),
- *iReferenceSuids );
+ DoSetObjectReferencesL( *object );
CleanupStack::PopAndDestroy( object ); // - object
@@ -196,8 +195,9 @@
result = EFalse;
break;
}
-
- iReferenceSuids->AppendL( object->DesC( CMTPObjectMetaData::ESuid ) );
+ // Only audio in playlist is supported
+ if ( iDpConfig.GetWrapperL().Category( *object ) == EMPXSong )
+ iReferenceSuids->AppendL( object->DesC( CMTPObjectMetaData::ESuid ) );
}
CleanupStack::PopAndDestroy( object ); // - object
PRINT( _L( "MM MTP <= CSetObjectReferences::VerifyReferenceHandlesL" ) );
--- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpaccesssingleton.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpaccesssingleton.cpp Mon May 03 12:58:40 2010 +0300
@@ -50,14 +50,13 @@
// create singleton instance
// -----------------------------------------------------------------------------
//
-EXPORT_C void CMmMtpDpAccessSingleton::CreateL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework )
+EXPORT_C void CMmMtpDpAccessSingleton::CreateL( MMTPDataProviderFramework& aFramework )
{
CMmMtpDpAccessSingleton* self = reinterpret_cast<CMmMtpDpAccessSingleton*>( Dll::Tls() );
if ( self == NULL )
{
- self = CMmMtpDpAccessSingleton::NewL( aRfs, aFramework );
+ self = CMmMtpDpAccessSingleton::NewL( aFramework );
Dll::SetTls( reinterpret_cast<TAny*>( self ) );
}
else
@@ -135,12 +134,11 @@
// two-phase construction
// -----------------------------------------------------------------------------
//
-CMmMtpDpAccessSingleton* CMmMtpDpAccessSingleton::NewL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework )
+CMmMtpDpAccessSingleton* CMmMtpDpAccessSingleton::NewL( MMTPDataProviderFramework& aFramework )
{
CMmMtpDpAccessSingleton* self = new(ELeave) CMmMtpDpAccessSingleton;
CleanupStack::PushL( self );
- self->ConstructL(aRfs, aFramework);
+ self->ConstructL( aFramework );
CleanupStack::Pop( self );
return self;
}
@@ -150,10 +148,9 @@
// two-phase construction
// -----------------------------------------------------------------------------
//
-void CMmMtpDpAccessSingleton::ConstructL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework )
+void CMmMtpDpAccessSingleton::ConstructL( MMTPDataProviderFramework& aFramework )
{
- iWrapper = CMmMtpDpMetadataAccessWrapper::NewL( aRfs, aFramework );
+ iWrapper = CMmMtpDpMetadataAccessWrapper::NewL( aFramework );
}
--- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp Mon May 03 12:58:40 2010 +0300
@@ -16,37 +16,39 @@
*/
+#include <mtp/mmtpdataproviderframework.h>
+#include <mtp/mmtpobjectmgr.h>
+#include <mtp/cmtptypestring.h>
+#include <mtp/cmtpobjectmetadata.h>
#include <bautils.h>
#include <e32math.h>
-#include <mtp/mmtpdataproviderframework.h>
#include <e32property.h>
-#include <MtpPrivatePSKeys.h>
+#include <mtpprivatepskeys.h>
#include "cmmmtpdpmetadataaccesswrapper.h"
#include "cmmmtpdpmetadatampxaccess.h"
#include "cmmmtpdpmetadatavideoaccess.h"
#include "mmmtpdputility.h"
+#include "tobjectdescription.h"
#include "mmmtpdplogger.h"
-const TInt KMMMTPDummyFileArrayGranularity = 5;
+const TInt KMmMtpDummyFileArrayGranularity = 5;
-CMmMtpDpMetadataAccessWrapper* CMmMtpDpMetadataAccessWrapper::NewL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework )
+CMmMtpDpMetadataAccessWrapper* CMmMtpDpMetadataAccessWrapper::NewL( MMTPDataProviderFramework& aFramework )
{
- CMmMtpDpMetadataAccessWrapper* me = new (ELeave) CMmMtpDpMetadataAccessWrapper( aRfs, aFramework );
+ CMmMtpDpMetadataAccessWrapper* me = new (ELeave) CMmMtpDpMetadataAccessWrapper( aFramework );
CleanupStack::PushL( me );
me->ConstructL();
CleanupStack::Pop( me );
-
+
return me;
}
-CMmMtpDpMetadataAccessWrapper::CMmMtpDpMetadataAccessWrapper( RFs& aRfs,
- MMTPDataProviderFramework& aFramework ) :
- iRfs( aRfs ),
- iFramework( aFramework )
+CMmMtpDpMetadataAccessWrapper::CMmMtpDpMetadataAccessWrapper( MMTPDataProviderFramework& aFramework ) :
+ iFramework( aFramework ),
+ iFs( aFramework.Fs() )
{
-
+ // Do nothing
}
// ---------------------------------------------------------------------------
@@ -58,19 +60,19 @@
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::ConstructL" ) );
- iMmMtpDpMetadataMpxAccess = CMmMtpDpMetadataMpxAccess::NewL( iRfs, iFramework );
+ iMmMtpDpMetadataMpxAccess = CMmMtpDpMetadataMpxAccess::NewL( iFs );
- iMmMtpDpMetadataVideoAccess = CMmMtpDpMetadataVideoAccess::NewL( iRfs );
-
- iPlaylistArray = new ( ELeave ) CDesCArrayFlat( KMMMTPDummyFileArrayGranularity );
-
+ iMmMtpDpMetadataVideoAccess = CMmMtpDpMetadataVideoAccess::NewL( iFs );
+
+ 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 +88,41 @@
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::SetReferenceL
+// Set abstract media to DB
// -----------------------------------------------------------------------------
//
-EXPORT_C void CMmMtpDpMetadataAccessWrapper::SetPlaylistL( const TDesC& aPlaylistFileName, CDesCArray& aRefFileArray )
+EXPORT_C void CMmMtpDpMetadataAccessWrapper::SetReferenceL( const CMTPObjectMetaData& aObject,
+ CDesCArray& aRefFileArray )
{
- PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetPlaylistL aPlaylistFileName = %S" ), &aPlaylistFileName );
+ TPtrC refOwner( aObject.DesC( CMTPObjectMetaData::ESuid ) );
+ PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetReferenceL reference owner = %S" ),
+ &refOwner );
- if ( !MmMtpDpUtility::IsVideoL( aPlaylistFileName, iFramework ) )
+ TMPXGeneralCategory category = Category( aObject );
+ if ( category == EMPXPlaylist || category == EMPXAbstractAlbum )
{
- iMmMtpDpMetadataMpxAccess->SetPlaylistL( aPlaylistFileName, aRefFileArray );
+ iMmMtpDpMetadataMpxAccess->SetReferenceL( refOwner, aRefFileArray, category );
}
- PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetPlaylistL" ) );
+ PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetReferenceL" ) );
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataAccessWrapper::AddMediaL
+// CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL
// Gets a piece of metadata from the collection
// ---------------------------------------------------------------------------
//
@@ -126,18 +132,53 @@
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL" ) );
- TPtrC fullFileName( aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ) );
- if ( !MmMtpDpUtility::IsVideoL( fullFileName, iFramework ) )
+ TMPXGeneralCategory category = Category( aObjectMetaData );
+ switch ( category )
{
- iMmMtpDpMetadataMpxAccess->GetObjectMetadataValueL( aPropCode,
- aNewData,
- aObjectMetaData );
- }
- else
- {
- iMmMtpDpMetadataVideoAccess->GetObjectMetadataValueL( aPropCode,
- aNewData,
- aObjectMetaData );
+ case EMPXAbstractAlbum:
+ if ( aPropCode == EMTPObjectPropCodeDateAdded && EMTPTypeString == aNewData.Type() )
+ {
+ TBuf<KMtpMaxDateTimeStringLength> timeStr;
+ MmMtpDpUtility::GetObjectDateModifiedL( iFs,
+ aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ),
+ timeStr );
+ PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL Date time %S" ), &timeStr );
+
+ ( ( CMTPTypeString & ) aNewData ).SetL( timeStr );
+ break;
+ }
+ // else
+ // get from mpx
+ case EMPXPlaylist:
+ case EMPXSong:
+ {
+ iMmMtpDpMetadataMpxAccess->GetObjectMetadataValueL( aPropCode,
+ aNewData,
+ aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ),
+ category );
+ }
+ break;
+ case EMPXVideo:
+ if ( aPropCode == EMTPObjectPropCodeDateAdded && EMTPTypeString == aNewData.Type() )
+ {
+ TBuf<KMtpMaxDateTimeStringLength> timeStr;
+ MmMtpDpUtility::GetObjectDateModifiedL( iFs,
+ aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ),
+ timeStr );
+ PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL Date time %S" ), &timeStr );
+
+ ( ( CMTPTypeString & ) aNewData ).SetL( timeStr );
+ }
+ else
+ {
+ iMmMtpDpMetadataVideoAccess->GetObjectMetadataValueL( aPropCode,
+ aNewData,
+ aObjectMetaData );
+ }
+ break;
+ default:
+ // do nothing
+ break;
}
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::GetObjectMetadataValueL" ) );
@@ -154,96 +195,90 @@
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetObjectMetadataValueL" ) );
- TPtrC fullFileName( aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ) );
- if ( MmMtpDpUtility::IsVideoL( fullFileName, iFramework ) )
+ TMPXGeneralCategory category = Category( aObjectMetaData );
+ switch ( category )
{
- iMmMtpDpMetadataVideoAccess->SetObjectMetadataValueL( aPropCode,
- aNewData,
- aObjectMetaData );
+ case EMPXAbstractAlbum:
+ case EMPXSong:
+ case EMPXPlaylist:
+ iMmMtpDpMetadataMpxAccess->SetObjectMetadataValueL( aPropCode,
+ aNewData,
+ aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ),
+ category );
+ break;
+ case EMPXVideo:
+ iMmMtpDpMetadataVideoAccess->SetObjectMetadataValueL( aPropCode,
+ aNewData,
+ aObjectMetaData );
+ break;
+ default:
+ break;
}
- else
- {
- iMmMtpDpMetadataMpxAccess->SetObjectMetadataValueL( aPropCode,
- aNewData,
- aObjectMetaData );
- }
-
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetObjectMetadataValueL" ) );
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataAccessWrapper::SetObjectMetadataValueL
+// CMmMtpDpMetadataAccessWrapper::RenameObjectL
// Renames the file part of a record in the collection database
// ---------------------------------------------------------------------------
//
-EXPORT_C void CMmMtpDpMetadataAccessWrapper::RenameObjectL( const TDesC& aOldFileName,
+EXPORT_C void CMmMtpDpMetadataAccessWrapper::RenameObjectL( const CMTPObjectMetaData& aOldObject,
const TDesC& aNewFileName )
{
+ TPtrC oldFileName( aOldObject.DesC( CMTPObjectMetaData::ESuid ) );
PRINT2( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::RenameObjectL old = %S, new = %S" ),
- &aOldFileName,
+ &oldFileName,
&aNewFileName );
-
- TMTPFormatCode formatCode = MmMtpDpUtility::FormatFromFilename( aOldFileName );
- if ( formatCode == EMTPFormatCodeWMV )
+
+ TMPXGeneralCategory category = Category( aOldObject );
+ switch ( category )
{
- iMmMtpDpMetadataVideoAccess->RenameRecordL( aOldFileName, aNewFileName );
+ case EMPXSong:
+ case EMPXAbstractAlbum:
+ case EMPXPlaylist:
+ {
+ iMmMtpDpMetadataMpxAccess->RenameObjectL( oldFileName,
+ aNewFileName,
+ category );
+ }
+ break;
+ case EMPXVideo:
+ iMmMtpDpMetadataVideoAccess->RenameRecordL( oldFileName, aNewFileName );
+ break;
+ default:
+ break;
}
- else
- {
- if ( !MmMtpDpUtility::IsVideoL( aNewFileName , iFramework ) )
- {
- iMmMtpDpMetadataMpxAccess->RenameObjectL( aOldFileName, aNewFileName, formatCode );
- }
- else
- {
- iMmMtpDpMetadataVideoAccess->RenameRecordL( aOldFileName, aNewFileName );
- }
- }
+
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::RenameObjectL" ) );
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataAccessWrapper::SetObjectMetadataValueL
+// CMmMtpDpMetadataAccessWrapper::DeleteObjectL
// Deletes metadata information associated with the object
// ---------------------------------------------------------------------------
//
-void CMmMtpDpMetadataAccessWrapper::DeleteObjectL( const TDesC& aFullFileName,
- const TUint aFormatCode )
+void CMmMtpDpMetadataAccessWrapper::DeleteObjectL( const CMTPObjectMetaData& aObject )
{
- PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::DeleteObjectL" ) );
+ TPtrC fileName( aObject.DesC( CMTPObjectMetaData::ESuid ) );
+ PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::DeleteObjectL name = %S" ), &fileName );
- TMPXGeneralCategory category = Category( aFormatCode );
-
- // Have to do this. File might not be in file system anymore, have to
- // reply on ObjectManager
- if ( ( aFormatCode == EMTPFormatCodeMP4Container )
- || ( aFormatCode == EMTPFormatCode3GPContainer )
- || ( aFormatCode == EMTPFormatCodeASF ) )
- {
- if ( MmMtpDpUtility::IsVideoL( aFullFileName, iFramework ) )
- {
- category = EMPXVideo;
- }
- else
- {
- category = EMPXSong;
- }
- }
-
+ TMPXGeneralCategory category = Category( aObject );
+
switch ( category )
{
+ case EMPXSong:
+ case EMPXAbstractAlbum:
case EMPXPlaylist:
- case EMPXSong:
{
- iMmMtpDpMetadataMpxAccess->DeleteObjectL( aFullFileName, category );
+ iMmMtpDpMetadataMpxAccess->DeleteObjectL( fileName, category );
}
break;
case EMPXVideo:
{
- iMmMtpDpMetadataVideoAccess->DeleteRecordL( aFullFileName );
+ iMmMtpDpMetadataVideoAccess->DeleteRecordL( fileName );
}
break;
@@ -269,19 +304,24 @@
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetStorageRootL" ) );
}
+
// -----------------------------------------------------------------------------
// CMmMtpDpMetadataMpxAccess::SetImageObjPropL
// set image specific properties specific to videos
// -----------------------------------------------------------------------------
//
-void CMmMtpDpMetadataAccessWrapper::SetImageObjPropL( const TDesC& aFullFileName,
+void CMmMtpDpMetadataAccessWrapper::SetImageObjPropL( const CMTPObjectMetaData& aObject,
const TUint32 aWidth,
const TUint32 aHeight )
{
- if ( MmMtpDpUtility::IsVideoL( aFullFileName, iFramework ) )
+ TMPXGeneralCategory category = Category( aObject );
+ if ( category == EMPXVideo )
{
- iMmMtpDpMetadataVideoAccess->SetStorageRootL( aFullFileName );
- iMmMtpDpMetadataVideoAccess->SetImageObjPropL( aFullFileName, aWidth, aHeight );
+ TPtrC fullFileName( aObject.DesC( CMTPObjectMetaData::ESuid ) );
+ iMmMtpDpMetadataVideoAccess->SetStorageRootL( fullFileName );
+ iMmMtpDpMetadataVideoAccess->SetImageObjPropL( fullFileName,
+ aWidth,
+ aHeight );
}
}
@@ -290,17 +330,20 @@
// get image specific properties specific to videos
// -----------------------------------------------------------------------------
//
-void CMmMtpDpMetadataAccessWrapper::GetImageObjPropL( const TDesC& aFullFileName,
+void CMmMtpDpMetadataAccessWrapper::GetImageObjPropL( const CMTPObjectMetaData& aObject,
TUint32& aWidth,
TUint32& aHeight )
{
- if ( MmMtpDpUtility::IsVideoL( aFullFileName, iFramework ) )
+ TMPXGeneralCategory category = Category( aObject );
+ if ( category == EMPXVideo )
{
- iMmMtpDpMetadataVideoAccess->SetStorageRootL( aFullFileName );
- iMmMtpDpMetadataVideoAccess->GetImageObjPropL( aFullFileName, aWidth, aHeight );
+ TPtrC fullFileName( aObject.DesC( CMTPObjectMetaData::ESuid ) );
+ iMmMtpDpMetadataVideoAccess->SetStorageRootL( fullFileName );
+ iMmMtpDpMetadataVideoAccess->GetImageObjPropL( fullFileName, aWidth, aHeight );
}
}
-// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
// CMmMtpDpMetadataAccessWrapper::OpenSessionL
// Called when the MTP session is initialised
// -----------------------------------------------------------------------------
@@ -334,29 +377,61 @@
// Get category according format code
// ---------------------------------------------------------------------------
//
-TMPXGeneralCategory CMmMtpDpMetadataAccessWrapper::Category( const TUint aFormatCode )
+TMPXGeneralCategory CMmMtpDpMetadataAccessWrapper::Category( const CMTPObjectMetaData& aObject )
{
TMPXGeneralCategory category = EMPXNoCategory;
- switch ( aFormatCode )
+ TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode );
+ switch ( formatCode )
{
+ case EMTPFormatCodeASF:
+ case EMTPFormatCodeMP4Container:
+ case EMTPFormatCode3GPContainer:
+ {
+ TUint aSubFormatCode = aObject.Uint( CMTPObjectMetaData::EFormatSubCode );
+ if ( aSubFormatCode == EMTPSubFormatCodeUnknown )
+ {
+ category = ContainerCategory( aObject.DesC( CMTPObjectMetaData::ESuid ) );
+ if ( category == EMPXSong )
+ aSubFormatCode = EMTPSubFormatCodeAudio;
+ else if ( category == EMPXVideo )
+ aSubFormatCode = EMTPSubFormatCodeVideo;
+ else
+ aSubFormatCode = EMTPSubFormatCodeUndefine;
+ const_cast<CMTPObjectMetaData&>(aObject).SetUint( CMTPObjectMetaData::EFormatSubCode, aSubFormatCode );
+ // If object doesn't exist, do nothing
+ TRAP_IGNORE( iFramework.ObjectMgr().ModifyObjectL( aObject ) );
+ }
+ else if ( aSubFormatCode == EMTPSubFormatCodeAudio )
+ category = EMPXSong;
+ else if ( aSubFormatCode == EMTPSubFormatCodeVideo )
+ category = EMPXVideo;
+ else if( aSubFormatCode == EMTPSubFormatCodeUndefine )
+ category = EMPXOther;
+ }
+ break;
+
case EMTPFormatCodeMP3:
case EMTPFormatCodeWAV:
case EMTPFormatCodeWMA:
case EMTPFormatCodeAAC:
- case EMTPFormatCodeASF:
- case EMTPFormatCodeMP4Container:
- case EMTPFormatCode3GPContainer:
{
category = EMPXSong;
}
break;
+ case EMTPFormatCodeM3UPlaylist:
case EMTPFormatCodeAbstractAudioVideoPlaylist:
{
category = EMPXPlaylist;
}
break;
+ case EMTPFormatCodeAbstractAudioAlbum:
+ {
+ category = EMPXAbstractAlbum;
+ }
+ break;
+
case EMTPFormatCodeWMV:
{
category = EMPXVideo;
@@ -366,84 +441,104 @@
default:
break;
}
+ PRINT1( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::Category category = %d" ), category );
+ return category;
+ }
+
+TMPXGeneralCategory CMmMtpDpMetadataAccessWrapper::ContainerCategory( const TDesC& aFullFileName )
+ {
+ PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::ContainerCategory aFullFileName = %S" ), &aFullFileName );
+
+ TMPXGeneralCategory category = EMPXNoCategory;
+ TParsePtrC pathParser( aFullFileName );
+ TPtrC ext( pathParser.Ext() );
+
+ if ( ext.Length() <= 0 )
+ category = EMPXOther;
+
+ if ( ext.CompareF( KTxtExtensionMP4 ) == 0
+ || ext.CompareF( KTxtExtension3GP ) == 0
+ || ext.CompareF( KTxtExtension3G2 ) == 0
+ || ext.CompareF( KTxtExtensionODF ) == 0
+ || ext.CompareF( KTxtExtensionASF ) == 0 )
+ {
+ HBufC8* mimetype = MmMtpDpUtility::ContainerMimeType( aFullFileName );
+ if ( mimetype != NULL )
+ {
+ TMmMtpSubFormatCode subFormatCode = MmMtpDpUtility::SubFormatCodeFromMime( *mimetype );
+
+ if ( subFormatCode == EMTPSubFormatCodeVideo )
+ category = EMPXVideo;
+ else if( subFormatCode == EMTPSubFormatCodeAudio )
+ category = EMPXSong;
+ else
+ category = EMPXOther;
+ }
+ }
+ else if ( ext.CompareF( KTxtExtensionO4V ) == 0 )
+ category = EMPXVideo;
+ else
+ category = EMPXOther;
+
+ PRINT1( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::ContainerCategory, category = %d" ), category );
return category;
}
// ---------------------------------------------------------------------------
-// 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 CMTPObjectMetaData& aObject )
{
- PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL aFullFileName = %S" ), &aFullFileName );
+ PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL" ) );
+ TMPXGeneralCategory category = Category( aObject );
- if ( aFullFileName.Length() <= 0)
- {
- User::Leave( KErrArgument );
- }
- if ( aIsVideo )
+ TPtrC fullFileName( aObject.DesC( CMTPObjectMetaData::ESuid ) );
+ if ( category == EMPXVideo )
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL Addvideo" ) );
- iMmMtpDpMetadataVideoAccess->AddVideoL( aFullFileName );
+ iMmMtpDpMetadataVideoAccess->AddVideoL( fullFileName );
}
- else
+ else if ( category == EMPXPlaylist || category == EMPXAbstractAlbum )
{
- if ( MmMtpDpUtility::IsVideoL( aFullFileName, iFramework ) )
- {
- PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL Addvideo" ) );
- iMmMtpDpMetadataVideoAccess->AddVideoL( aFullFileName );
- }
- 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 AddPlaylist" ) );
+ iMmMtpDpMetadataMpxAccess->AddAbstractMediaL( fullFileName,
+ category );
+ }
+ else if ( category == EMPXSong )
+ {
+ PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::AddObjectL AddSong" ) );
+ iMmMtpDpMetadataMpxAccess->AddSongL( fullFileName );
}
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::AddObjectL" ) );
@@ -454,8 +549,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 +574,7 @@
return iMmMtpDpMetadataMpxAccess->IsExistL( aSuid );
}
-// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
// CMmMtpDpMetadataAccessWrapper::AddDummyFile
// Add one dummy file to dummy files array
// -----------------------------------------------------------------------------
@@ -487,10 +582,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 +594,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 );
}
}
}
@@ -522,7 +617,7 @@
EMTPFormatCodeAbstractAudioVideoPlaylist )
{
RFile newfile;
- TInt err = newfile.Replace( iFramework.Fs(), aPlaylistName, EFileWrite );
+ TInt err = newfile.Replace( iFs, aPlaylistName, EFileWrite );
if ( err != KErrNone )
{
@@ -533,7 +628,7 @@
{
err = newfile.Flush();
newfile.Close();
- err = iFramework.Fs().SetAtt( aPlaylistName, KEntryAttSystem | KEntryAttHidden,
+ err = iFs.SetAtt( aPlaylistName, KEntryAttSystem | KEntryAttHidden,
KEntryAttReadOnly | KEntryAttNormal );
if ( err != KErrNone )
PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CreateDummyFile Dummy Playlist file created. err = %d" ), err );
@@ -543,32 +638,51 @@
// -----------------------------------------------------------------------------
// CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles
-// Remove all dummy file of which format is "pla", and leave the "m3u"
+// Remove all dummy file of which format is "pla" and "alb", and leave the "m3u"
// -----------------------------------------------------------------------------
//
void CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles()
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles" ) );
-
- TInt count = iPlaylistArray->Count();
+
+ TInt count = iAbstractMediaArray->Count();
+ PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles, count = %d" ), 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] ) !=
- EMTPFormatCodeM3UPlaylist )
+ TPtrC fileName( (*iAbstractMediaArray)[i] );
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles, fileName = %S" ), &fileName );
+
+ TMTPFormatCode format = MmMtpDpUtility::FormatFromFilename( fileName );
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles, format = 0x%x" ), format );
+ if ( format == EMTPFormatCodeAbstractAudioAlbum )
{
- // delete the virtual playlist
- // iFramework has release don't use iFramework.FS()
- TInt err = iRfs.Delete( (*iPlaylistArray)[i] );
+ // delete the abstract album if its size is zero
+ TEntry entry;
+ TInt err = iFs.Entry( fileName, entry );
+ if ( err == KErrNone && entry.iSize == 0 )
+ {
+ TRAP( err, iMmMtpDpMetadataMpxAccess->DeleteObjectL( fileName, EMPXAbstractAlbum ) );
+ if( err == KErrNone )
+ {
+ err = iFs.Delete( fileName );
+ }
+ }
+ PRINT3( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile filename = %S, err %d, entry.iSize = %d" ),
+ &fileName, err, entry.iSize );
+ }
+ else if ( format != EMTPFormatCodeM3UPlaylist )
+ {
+ TInt err = iFs.Delete( fileName );
PRINT2( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile filename = %S, err %d" ),
- &( (*iPlaylistArray)[i] ),
+ &fileName,
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]" ), &fileName );
}
}
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles" ) );
@@ -579,7 +693,7 @@
// Update Music collection
// ---------------------------------------------------------------------------
//
-EXPORT_C void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL()
+EXPORT_C void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL()
{
iMmMtpDpMetadataMpxAccess->UpdateMusicCollectionL( );
}
--- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp Mon May 03 12:58:40 2010 +0300
@@ -24,9 +24,7 @@
#include <mtp/tmtptypeuint128.h>
#include <mtp/cmtptypestring.h>
#include <mtp/cmtptypearray.h>
-#include <mtp/cmtpobjectmetadata.h>
#include <mtp/mmtpdataproviderframework.h>
-#include <mtp/mmtpreferencemgr.h>
#include <mtp/mtpprotocolconstants.h>
// from MPX
#include <mpxmedia.h>
@@ -44,26 +42,36 @@
#include "mmmtpdplogger.h"
#include "mmmtpdputility.h"
#include "tmmmtpdppanic.h"
+#include "tobjectdescription.h"
static const TInt KMtpInvalidSongID = 0x1FFFFFFF;
static const TInt KMtpChannelMono = 1;
static const TInt KMtpChannelStereo = 2;
-static const TInt KMtpDateTimeStringLength = 15;
-static const TInt KMtpMaxStringLength = 255;
-static const TInt KMtpMaxDescriptionLength = 0x200;
-_LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" );
+
_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
-CMmMtpDpMetadataMpxAccess* CMmMtpDpMetadataMpxAccess::NewL( RFs& aRfs,
- MMTPDataProviderFramework& aFramework )
+CMmMtpDpMetadataMpxAccess* CMmMtpDpMetadataMpxAccess::NewL( RFs& aRfs )
{
- CMmMtpDpMetadataMpxAccess* self = new(ELeave) CMmMtpDpMetadataMpxAccess( aRfs, aFramework );
+ CMmMtpDpMetadataMpxAccess* self = new( ELeave ) CMmMtpDpMetadataMpxAccess( aRfs );
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop( self );
@@ -71,12 +79,10 @@
return self;
}
-CMmMtpDpMetadataMpxAccess::CMmMtpDpMetadataMpxAccess( RFs& aRfs,
- MMTPDataProviderFramework& aFramework ):
- iRfs( aRfs ),
- iFramework( aFramework )
+CMmMtpDpMetadataMpxAccess::CMmMtpDpMetadataMpxAccess( RFs& aRfs ):
+ iRfs( aRfs )
{
-
+ // Do nothing
}
// ---------------------------------------------------------------------------
@@ -118,25 +124,18 @@
//
void CMmMtpDpMetadataMpxAccess::GetObjectMetadataValueL( const TUint16 aPropCode,
MMTPType& aNewData,
- const CMTPObjectMetaData& aObjectMetaData )
+ const TDesC& aFullFileName,
+ TMPXGeneralCategory aCategory )
{
PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetObjectMetadataValueL aPropCode = 0x%x" ), aPropCode );
- // File Path
- HBufC* suid = aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ).AllocLC(); // + suid
- TUint format = aObjectMetaData.Uint( CMTPObjectMetaData::EFormatCode );
- TMPXGeneralCategory category = ( format == EMTPFormatCodeAbstractAudioVideoPlaylist ) ||
- ( format == EMTPFormatCodeM3UPlaylist ) ? EMPXPlaylist : EMPXSong;
-
PERFLOGSTART( KMpxCollectionGetL );
- const CMPXMedia& media = CollectionHelperL()->GetL( *suid, category );
+ const CMPXMedia& media = CollectionHelperL()->GetL( aFullFileName, aCategory );
PERFLOGSTOP( KMpxCollectionGetL );
- 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);
+ PRINT1(_L( "MM MTP <> CMmMtpDpMetadataMpxAccess::GetObjectMetadataValueL isSupported = %d" ), isSupported );
if ( aPropCode != EMTPObjectPropCodeOriginalReleaseDate
&& aPropCode != EMTPObjectPropCodeDRMStatus
@@ -193,7 +192,7 @@
case EMTPObjectPropCodeDateCreated:
{
TTime time( *media.Value<TInt64> ( attrib ) );
- TBuf<KMtpDateTimeStringLength> timeStr;
+ TBuf<KMtpMaxDateTimeStringLength> timeStr;
time.FormatL( timeStr, KMtpDateTimeFormat );
if ( EMTPTypeString == aNewData.Type() )
@@ -245,7 +244,7 @@
case EMTPObjectPropCodeOriginalReleaseDate:
{
// Compose DateTime string in format YYYYMMDDTHHMMSS
- TBuf<KMtpDateTimeStringLength> dateTime;
+ TBuf<KMtpMaxDateTimeStringLength> dateTime;
dateTime.Zero();
// NOTE: Handled specially, shouldn't leave like other property, following S60
@@ -346,9 +345,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.
@@ -418,7 +417,6 @@
searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup );
searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong );
searchMedia->SetTObjectValueL<TBool>( aWMPMediaID, aFlag );
-
searchMedia->SetTextValueL( KMPXMediaGeneralDrive, iStoreRoot );
RArray<TMPXAttribute> songAttributes;
@@ -427,8 +425,7 @@
PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::FindWMPMediaLC searchMedia setup with no problems" ) );
- CMPXMedia* foundMedia = CollectionHelperL()->FindAllL(
- *searchMedia,
+ CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia,
songAttributes.Array() );
PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::FindWMPMediaLC foundMedia assigned from FindAllL" ) );
@@ -543,9 +540,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
}
@@ -593,27 +590,14 @@
//
void CMmMtpDpMetadataMpxAccess::RenameObjectL( const TDesC& aOldFileName,
const TDesC& aNewFileName,
- TUint aFormatCode )
+ TMPXGeneralCategory aCategory )
{
PRINT2( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::RenameObjectL aOldFileName = %S, aNewFileName = %S" ),
- &aOldFileName, &aNewFileName );
+ &aOldFileName,
+ &aNewFileName );
TInt err = KErrNone;
-
- if ( ( aFormatCode == EMTPFormatCodeAbstractAudioVideoPlaylist )
- || ( aFormatCode == EMTPFormatCodeM3UPlaylist ) )
- {
- PRINT( _L( "MM MTP <> Playlist" ) );
- TRAP( err, CollectionHelperL()->RenameL(
- aOldFileName,
- aNewFileName,
- EMPXPlaylist ) );
- }
- else // Not a playlist
- {
- PRINT( _L( "MM MTP <> Non-Playlist" ) );
- TRAP( err, CollectionHelperL()->RenameL( aOldFileName, aNewFileName, EMPXSong ) );
- }
+ TRAP( err, CollectionHelperL()->RenameL( aOldFileName, aNewFileName, aCategory ) );
if ( KErrNotFound == err )
{
@@ -632,119 +616,43 @@
// -----------------------------------------------------------------------------
void CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL( const TUint16 aPropCode,
const MMTPType& aNewData,
- const TDesC& aSuid )
+ const TDesC& aFullFileName,
+ TMPXGeneralCategory aCategory )
{
- PRINT2( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL aPropCode = 0x%x aSuid = %S" ),
- aPropCode,
- &aSuid );
- CMPXMedia* media = NULL;
+ PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL aPropCode = 0x%x" ), aPropCode );
- // Creat media properties for the song
RArray<TInt> contentIDs;
CleanupClosePushL( contentIDs ); // + contentIDs
+
contentIDs.AppendL( KMPXMediaIdGeneral );
- contentIDs.AppendL( KMPXMediaIdAudio );
- contentIDs.AppendL( KMPXMediaIdMusic );
- contentIDs.AppendL( KMPXMediaIdMTP );
- media = CMPXMedia::NewL( contentIDs.Array() );
- CleanupStack::PopAndDestroy( &contentIDs ); // - contentIDs
+ if ( aCategory == EMPXSong )
+ {
+ contentIDs.AppendL( KMPXMediaIdAudio );
+ contentIDs.AppendL( KMPXMediaIdMusic );
+ contentIDs.AppendL( KMPXMediaIdMTP );
+ }
+
+ CMPXMedia* media = CMPXMedia::NewL( contentIDs.Array() );
CleanupStack::PushL( media ); // + media
- media->SetTObjectValueL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory,
- EMPXSong );
+ media->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory, aCategory );
// MPXMedia default types
media->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXItem );
- // Get file path
- TParsePtrC parse( aSuid );
- media->SetTextValueL( KMPXMediaGeneralUri, aSuid );
+ TParsePtrC parse( aFullFileName );
+ media->SetTextValueL( KMPXMediaGeneralUri, aFullFileName );
media->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() );
- TRAPD( err, SetMetadataValueL( aPropCode, aNewData, *media ) );
-
- if ( err == KErrNone )
- {
- SetStorageRootL( parse.Drive() );
-
- // Update the song's metadata with the media object
- PERFLOGSTART( KMpxCollectionSetL );
- CollectionHelperL()->SetL( media );
- PERFLOGSTOP( KMpxCollectionSetL );
- }
- else
- {
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL ERROR = %d" ), err );
-
- User::Leave( err );
- }
-
- CleanupStack::PopAndDestroy( media ); // - media
- PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL" ) );
- }
-
-// -----------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL
-// Updated object metadata in MPX database
-// -----------------------------------------------------------------------------
-void CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL( const TUint16 aPropCode,
- const MMTPType& aNewData,
- const CMTPObjectMetaData& aObjectMetaData )
- {
- PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL aPropCode = 0x%x" ), aPropCode );
- CMPXMedia* media = NULL;
-
- RArray<TInt> contentIDs;
- CleanupClosePushL( contentIDs ); // + contentIDs
-
- TUint format = aObjectMetaData.Uint( CMTPObjectMetaData::EFormatCode );
- if ( ( format == EMTPFormatCodeAbstractAudioVideoPlaylist )
- || ( format == EMTPFormatCodeM3UPlaylist ) )
- {
- PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL format is playlist" ) );
- contentIDs.AppendL( KMPXMediaIdGeneral );
-
- media = CMPXMedia::NewL( contentIDs.Array() );
- CleanupStack::PushL( media ); // + media
-
- media->SetTObjectValueL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory,
- EMPXPlaylist );
- }
- else
- {
- // Creat media properties for the song
- contentIDs.AppendL( KMPXMediaIdGeneral );
- contentIDs.AppendL( KMPXMediaIdAudio );
- contentIDs.AppendL( KMPXMediaIdMusic );
- contentIDs.AppendL( KMPXMediaIdMTP );
-
- media = CMPXMedia::NewL( contentIDs.Array() );
- CleanupStack::PushL( media ); // + media
-
- media->SetTObjectValueL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory,
- EMPXSong );
- }
-
- // MPXMedia default types
- media->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXItem );
-
- // Get file path
- HBufC* suid = aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ).AllocLC(); // + suid
- TParsePtrC parse( *suid );
- media->SetTextValueL( KMPXMediaGeneralUri, *suid );
- 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 +673,7 @@
TMTPTypeUint16 uint16Data;
TMTPTypeUint32 uint32Data;
- TMPXAttributeData attrib( MpxAttribFromPropL( aMediaProp, aPropCode ) );
+ TMPXAttributeData attrib( MpxAttribFromPropL( aPropCode ) );
switch ( aPropCode )
{
@@ -778,12 +686,11 @@
{
PRINT1( _L( "MM MTP <> SetMetadataValueL Before Copy, string length = %d" ), aNewData.Size() );
MMTPType::CopyL( aNewData, *textData );
- PRINT1( _L( "MM MTP <> SetMetadataValueL string length = %d" ), textData->StringChars().Length() );
- aMediaProp.SetTextValueL( attrib, textData->StringChars() );
- HBufC* log = textData->StringChars().AllocL();
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL string = %S" ), log );
- delete log;
- log = NULL;
+ HBufC* string = textData->StringChars().AllocLC();
+ PRINT1( _L( "MM MTP <> SetMetadataValueL string length = %d" ), string->Des().Length() );
+ aMediaProp.SetTextValueL( attrib, string->Des() );
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL string = %S" ), string );
+ CleanupStack::PopAndDestroy(string);
}
break;
@@ -830,10 +737,10 @@
MMTPType::CopyL( aNewData, *textData );
TBuf<KMtpMaxStringLength> data;
- data.Copy( textData->StringChars().Left( KMtpDateTimeStringLength ) );
+ data.Copy( textData->StringChars().Left( KMtpMaxDateTimeStringLength ) );
PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL 0xDC99 date = %S" ),
&data );
- if ( data.Length() < KMtpDateTimeStringLength )
+ if ( data.Length() < KMtpMaxDateTimeStringLength )
{
PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL 0xDC99 date string is too short" ) );
break;
@@ -906,27 +813,25 @@
case EMTPObjectPropCodeDescription:
{
#ifdef __MUSIC_ID_SUPPORT
- //WriteMusicIdsL(*longString);
+ // WriteMusicIdsL(*longString);
#else
desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData
MMTPType::CopyL( aNewData, *desData );
TUint length = desData->NumElements();
PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL length = %d" ),
length );
- if ( length != 0 )
- {
- TBuf<KMtpMaxDescriptionLength> text;
- text.Zero();
- for ( TUint i = 0; i < length; i++ )
- text.Append( desData->ElementUint( i ) );
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL text = %S" ),
- &text );
- aMediaProp.SetTextValueL( KMPXMediaGeneralComment, text );
- }
- else
- {
- aMediaProp.SetTextValueL( KMPXMediaGeneralComment, KEmptyText );
- }
+
+ length = ( length < KMTPMaxDescriptionLen ) ? length : KMTPMaxDescriptionLen;
+ HBufC* text = HBufC::NewLC( length ); // + text
+ TPtr ptr = text->Des();
+
+ for ( TUint i = 0; i < length; i++ )
+ ptr.Append( desData->ElementUint( i ) );
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL text = %S" ),
+ text );
+ aMediaProp.SetTextValueL( KMPXMediaGeneralComment, text->Des() );
+ CleanupStack::PopAndDestroy( text ); // - text
+
CleanupStack::PopAndDestroy( desData ); // - desData
#endif //__MUSIC_ID_SUPPORT
}
@@ -940,6 +845,27 @@
}
break;
+ case EMTPObjectPropCodeRepresentativeSampleData:
+ {
+ const CMTPTypeArray& mtpTypeArray = static_cast<const CMTPTypeArray&>( aNewData );
+ TUint32 numElements = mtpTypeArray.NumElements();
+ const TDesC& suid = aMediaProp.ValueText( KMPXMediaGeneralUri );
+ PRINT2( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL SampleData numElements = %d, suid = %S" ), numElements, &suid );
+
+ HBufC8* sampleData = HBufC8::NewLC( numElements * sizeof( TUint8 ) );
+ TPtr8 samplePtr = sampleData->Des();
+ mtpTypeArray.ToDes( samplePtr );
+ RFile sampleFile;
+ CleanupClosePushL( sampleFile );
+ User::LeaveIfError( sampleFile.Replace( iRfs, suid, EFileWrite ) );
+ User::LeaveIfError( sampleFile.Write( samplePtr ) );
+ CleanupStack::PopAndDestroy( &sampleFile );
+ CleanupStack::PopAndDestroy( sampleData );
+ aMediaProp.SetTObjectValueL<TBool>( attrib, ETrue );
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL SampleData is ready = %u" ), 1 );
+ }
+ break;
+
default:
{
User::Leave( KErrNotSupported );
@@ -970,10 +896,9 @@
CleanupStack::PushL( searchMedia ); // + searchMedia
searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
-
searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong );
-
searchMedia->SetTextValueL( KMPXMediaGeneralUri, aFullFileName );
+ searchMedia->SetTextValueL( KMPXMediaGeneralDrive, iStoreRoot );
RArray<TMPXAttribute> songAttributes;
CleanupClosePushL( songAttributes ); // + songAttributes
@@ -981,11 +906,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 +946,9 @@
CleanupStack::PushL( media ); // + media
// MPXMedia default types
- media->SetTObjectValueL<TMPXGeneralType>(
- KMPXMediaGeneralType,
+ media->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType,
EMPXItem );
- media->SetTObjectValueL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory,
+ media->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory,
EMPXSong );
// File Path
//
@@ -1050,17 +972,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 +996,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<TInt> contentIDs;
CleanupClosePushL( contentIDs ); // + contentIDs
contentIDs.AppendL( KMPXMediaIdGeneral );
@@ -1092,21 +1014,24 @@
CleanupStack::PushL( searchMedia ); // + searchMedia
searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
- searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist );
+ searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory );
searchMedia->SetTextValueL( KMPXMediaGeneralUri, aFullFileName );
- RArray<TMPXAttribute> playlistAttributes;
- CleanupClosePushL( playlistAttributes ); // + playlistAttributes
- playlistAttributes.AppendL( KMPXMediaGeneralId );
- playlistAttributes.AppendL( KMPXMediaGeneralTitle );
- playlistAttributes.AppendL( KMPXMediaGeneralUri );
+ RArray<TMPXAttribute> 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 +1042,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<TInt> contentIDs;
CleanupClosePushL( contentIDs ); // + contentIDs
contentIDs.AppendL( KMPXMediaIdGeneral );
@@ -1131,14 +1056,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<TMPXGeneralType>( KMPXMediaGeneralType,
EMPXItem );
media->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory,
- EMPXPlaylist );
+ aCategory );
// File Path
//
media->SetTextValueL( KMPXMediaGeneralUri, aFullFileName );
@@ -1146,47 +1071,49 @@
TParsePtrC parse( aFullFileName );
media->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() );
- media->SetTextValueL( KMPXMediaGeneralTitle, parse.Name() );
+ if ( ( aCategory == EMPXPlaylist ) || ( aCategory == EMPXAbstractAlbum ) )
+ {
+ media->SetTextValueL( KMPXMediaGeneralTitle, parse.Name() );
+ }
media->SetTObjectValueL<TBool>( KMPXMediaGeneralSynchronized, ETrue );
- media->SetCObjectValueL( KMPXMediaArrayContents, playlistArray );
- media->SetTObjectValueL( KMPXMediaArrayCount, playlistArray->Count() );
+ media->SetCObjectValueL( KMPXMediaArrayContents, abstractMediaArray );
+ media->SetTObjectValueL( KMPXMediaArrayCount, abstractMediaArray->Count() );
+ if ( aCategory == EMPXAbstractAlbum )
+ {
+ media->SetTObjectValueL( KMPXMediaMTPSampleDataFlag, EFalse );
+ }
- 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::SetReferenceL
+// Set abstract media to DB
// -----------------------------------------------------------------------------
//
-void CMmMtpDpMetadataMpxAccess::SetPlaylistL( const TDesC& aPlaylistFileName,
- CDesCArray& aRefFileArray )
+void CMmMtpDpMetadataMpxAccess::SetReferenceL( const TDesC& aRefOwnerName,
+ CDesCArray& aRefFileArray,
+ TMPXGeneralCategory aCategory )
{
- PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetPlaylistL" ) );
- CMPXMediaArray* playlistArray = CMPXMediaArray::NewL();
- CleanupStack::PushL( playlistArray ); // + playlistArray
+ PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetReferenceL" ) );
+ CMPXMediaArray* abstractMediaArray = CMPXMediaArray::NewL();
+ CleanupStack::PushL( abstractMediaArray ); // + abstractMediaArray
TUint count = aRefFileArray.Count();
for ( TUint j = 0; j < count; j++ )
{
- // if the file is video, skip it and continue
- if ( MmMtpDpUtility::IsVideoL( aRefFileArray[j], iFramework ) )
- {
- continue;
- }
-
// Creat media properties for the song
RArray<TInt> contentIDs;
CleanupClosePushL( contentIDs ); // + contentIDs
@@ -1204,14 +1131,14 @@
EMPXItem );
media->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory,
EMPXSong );
- // File Path
- //
+
+ media->SetTextValueL( KMPXMediaGeneralUri, aRefFileArray[j] );
+ // TODO: need to confirm that should set drive letter or storage root path.
TParsePtrC parse( aRefFileArray[j] );
- media->SetTextValueL( KMPXMediaGeneralUri, aRefFileArray[j] );
media->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() );
// Add media into array contents
- playlistArray->AppendL( media );
+ abstractMediaArray->AppendL( media );
CleanupStack::Pop( media ); // - media
}
@@ -1220,35 +1147,30 @@
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
-
- playlistMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
+ CleanupStack::PushL( abstractMedia ); // + abstractMedia
- playlistMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist );
-
- playlistMedia->SetTextValueL( KMPXMediaGeneralUri, aPlaylistFileName );
-
- TParsePtrC parse( aPlaylistFileName );
- playlistMedia->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() );
- playlistMedia->SetTObjectValueL<TBool>( KMPXMediaGeneralSynchronized,
+ abstractMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
+ abstractMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory );
+ abstractMedia->SetTextValueL( KMPXMediaGeneralUri, aRefOwnerName );
+ TParsePtrC parse( aRefOwnerName );
+ abstractMedia->SetTextValueL( KMPXMediaGeneralDrive, parse.Drive() );
+ abstractMedia->SetTObjectValueL<TBool>( 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
+ CleanupStack::PopAndDestroy( abstractMediaArray ); // - abstractMediaArray
- // Clear the array
- CleanupStack::PopAndDestroy( playlistArray ); // - playlistArray
-
- PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetPlaylistL" ) );
+ PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetReferenceL" ) );
}
// ---------------------------------------------------------------------------
@@ -1261,8 +1183,7 @@
PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetStorageRoot aStoreRoot = %S" ), &aStorageRoot );
// get the drive number
- TParse pathParser;
- User::LeaveIfError( pathParser.Set( aStorageRoot, NULL, NULL ) );
+ TParsePtrC pathParser( aStorageRoot );
TChar driveChar( pathParser.Drive()[0] );
TInt driveNumber;
@@ -1299,36 +1220,55 @@
aMediaProp.SetTextValueL( KMPXMediaMusicGenre, KNullDesC );
// Composer
aMediaProp.SetTextValueL( KMPXMediaMusicComposer, KNullDesC );
- // Album artFilename
- aMediaProp.SetTextValueL( KMPXMediaMusicAlbumArtFileName, KNullDesC );
+ // Album Artist
+ aMediaProp.SetTextValueL( KMPXMediaMusicAlbumArtist, 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<TUint32>( KMPXMediaAudioSamplerate, 0 );
+ // AudioBitrate
+ aMediaProp.SetTObjectValueL<TUint32>( KMPXMediaAudioBitrate, 0 );
+ // Duration
+ aMediaProp.SetTObjectValueL<TInt>( KMPXMediaGeneralDuration, 0 );
+ // DrmStatus
+ aMediaProp.SetTObjectValueL<TUint16>( KMPXMediaMTPDrmStatus, 0 );
+ // NumberOfChannels
+ aMediaProp.SetTObjectValueL<TUint32>( KMPXMediaAudioNumberOfChannels, 0 );
+ // AudioCodec
+ aMediaProp.SetTObjectValueL<TUint32>( 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, KMPXMediaMusicAlbumArtist },
+ { EMTPObjectPropCodeRepresentativeSampleData,KMPXMediaMTPSampleDataFlag }
+ };
TInt i = 0;
TInt count = sizeof( KMetadataTable ) / sizeof( KMetadataTable[0] );
@@ -1349,14 +1289,15 @@
}
// ---------------------------------------------------------------------------
-// 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 +1310,24 @@
CleanupStack::PushL( searchMedia ); // + searchMedia
searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
- searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist );
+ searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory );
searchMedia->SetTextValueL( KMPXMediaGeneralDrive, iStoreRoot );
- RArray<TMPXAttribute> playlistAttributes;
- CleanupClosePushL( playlistAttributes ); // + playlistAttributes
- playlistAttributes.AppendL( KMPXMediaGeneralId );
- playlistAttributes.AppendL( KMPXMediaGeneralTitle );
- playlistAttributes.AppendL( KMPXMediaGeneralUri );
+ RArray<TMPXAttribute> 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 +1336,9 @@
User::Leave( KErrNotSupported );
}
- TInt count = *foundMedia->Value<TInt> ( KMPXMediaArrayCount );
+ TInt count = *foundMedia->Value<TInt>( 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 +1347,13 @@
User::Leave( KErrNotSupported );
}
- *aPlaylists = CMPXMediaArray::NewL( *( foundMedia->Value<CMPXMediaArray> (
- KMPXMediaArrayContents ) ) );
+ *aAbstractMedias =
+ CMPXMediaArray::NewL( *( foundMedia->Value<CMPXMediaArray> ( KMPXMediaArrayContents ) ) );
}
CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia
- PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::GetAllPlaylistL" ) );
+ PRINT( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::GetAllAbstractMediaL" ) );
}
// ---------------------------------------------------------------------------
@@ -1417,15 +1361,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<TMPXItemId> ( KMPXMediaGeneralId );
+ TUint32 abstractMediaId = *( *aAbstractMedia ).Value<TMPXItemId>( KMPXMediaGeneralId );
// find the media object that contains a list of songs in the playlist
RArray<TInt> contentIDs;
@@ -1438,17 +1382,17 @@
searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXGroup );
searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong );
- searchMedia->SetTObjectValueL<TMPXItemId> ( KMPXMediaGeneralId, playlistId );
+ searchMedia->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, abstractMediaId );
RArray<TMPXAttribute> 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 +1442,38 @@
}
// ---------------------------------------------------------------------------
-// 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 if ( aCategory == EMPXAbstractAlbum )
+ {
+ if ( !aAbstractMedia->IsSupported( KMPXMediaGeneralTitle ) )
+ {
+ User::Leave( KErrNotSupported );
+ }
+ name = aAbstractMedia->ValueText( KMPXMediaGeneralTitle ).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 +1482,7 @@
// ---------------------------------------------------------------------------
//
void CMmMtpDpMetadataMpxAccess::GetModifiedContentL( TInt& arrayCount,
- CDesCArray& aModifiedcontent )
+ CDesCArray& aModifiedcontent )
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::GetModifiedContentL" ) );
CMPXMedia* foundMedia;
@@ -1597,6 +1556,7 @@
searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist );
searchMedia->SetTextValueL( KMPXMediaGeneralUri, aSuid );
+ searchMedia->SetTextValueL( KMPXMediaGeneralDrive, iStoreRoot );
RArray<TMPXAttribute> playlistAttributes;
CleanupClosePushL( playlistAttributes ); // + playlistAttributes
--- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp Mon May 03 12:58:40 2010 +0300
@@ -1,19 +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 Video 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 Video access
+ *
+ */
#include <ContentListingFactory.h>
#include <MCLFContentListingEngine.h>
@@ -38,9 +38,8 @@
#include "mmmtpdputility.h"
#include "tmmmtpdppanic.h"
#include "mmmtpvideodbdefs.h"
+#include "tobjectdescription.h"
-static const TInt KMtpMaxStringLength = 255;
-static const TInt KMtpMaxDescriptionLength = 0x200;
const TInt KStorageRootMaxLength = 10;
#ifdef _DEBUG
@@ -62,23 +61,24 @@
CMmMtpDpMetadataVideoAccess* CMmMtpDpMetadataVideoAccess::NewL( RFs& aRfs )
{
- CMmMtpDpMetadataVideoAccess* me = new(ELeave) CMmMtpDpMetadataVideoAccess( aRfs );
- CleanupStack::PushL(me);
+ CMmMtpDpMetadataVideoAccess* me = new( ELeave ) CMmMtpDpMetadataVideoAccess( aRfs );
+ CleanupStack::PushL( me );
me->ConstructL();
- CleanupStack::Pop(me);
+ CleanupStack::Pop( me );
return me;
}
-CMmMtpDpMetadataVideoAccess::CMmMtpDpMetadataVideoAccess( RFs& aRfs ) : iRfs(aRfs),
- iDbState(ENoRecord),
- iDbOpened(EFalse)
+CMmMtpDpMetadataVideoAccess::CMmMtpDpMetadataVideoAccess( RFs& aRfs ) :
+ iRfs( aRfs ),
+ iDbState( ENoRecord ),
+ iDbOpened( EFalse )
{
-
+ // Do nothing
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::ConstructL
+// CMmMtpDpMetadataVideoAccess::ConstructL
// Second-phase
// ---------------------------------------------------------------------------
//
@@ -88,8 +88,7 @@
User::LeaveIfError( iDbsSession.Connect() );
- TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory,
- iStoreNum );
+ TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, iStoreNum );
err = OpenDatabase();
@@ -100,7 +99,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::OpenDatabase
+// CMmMtpDpMetadataVideoAccess::OpenDatabase
// Open data base
// ---------------------------------------------------------------------------
//
@@ -168,7 +167,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::OpenDatabaseL
+// CMmMtpDpMetadataVideoAccess::OpenDatabaseL
// Open data base
// ---------------------------------------------------------------------------
//
@@ -181,7 +180,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::~CMmMtpDpMetadataVideoAccess
+// CMmMtpDpMetadataVideoAccess::~CMmMtpDpMetadataVideoAccess
// Destructor
// ---------------------------------------------------------------------------
//
@@ -196,7 +195,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::CreateDatabaseTablesL
+// CMmMtpDpMetadataVideoAccess::CreateDatabaseTablesL
// Case where a new memory card is used and the player has not been opened
// ---------------------------------------------------------------------------
//
@@ -304,10 +303,6 @@
formatBuf.Append( KMtpVideoParentalRatingType );
formatBuf.Append( KMtpVideoCommaSign );
- formatBuf.Append( KMtpVideoUseCount );
- formatBuf.Append( KMtpVideoUseCountType );
- formatBuf.Append( KMtpVideoCommaSign );
-
formatBuf.Append( KMtpVideoDRM );
formatBuf.Append( KMtpVideoDRMType );
formatBuf.Append( KMtpVideoCommaSign );
@@ -341,7 +336,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::CleanupDbIfNecessaryL
+// CMmMtpDpMetadataVideoAccess::CleanupDbIfNecessaryL
// Cleanup Database
// ---------------------------------------------------------------------------
//
@@ -369,7 +364,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::IdentifyDeletedFilesL
+// CMmMtpDpMetadataVideoAccess::IdentifyDeletedFilesL
// Identify deleted files
// ---------------------------------------------------------------------------
//
@@ -380,7 +375,7 @@
ExecuteQueryL( KAllColumns, KMtpVideoTable, KMtpVideoLocation, KNullDesC, ETrue );
PRINT1( _L( "MM MTP <> CleanupDbIfNecessaryL Database total count = %d" ), iRecordSet.CountL() );
- for ( iRecordSet.FirstL(); iRecordSet.AtRow(); iRecordSet.NextL( ))
+ for ( iRecordSet.FirstL(); iRecordSet.AtRow(); iRecordSet.NextL() )
{
HBufC* data = ReadLongTextL( KMtpVideoLocation );
CleanupStack::PushL( data );
@@ -407,7 +402,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::ReadLongTextL
+// CMmMtpDpMetadataVideoAccess::ReadLongTextL
// Read from Data base
// ---------------------------------------------------------------------------
//
@@ -443,11 +438,12 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::WriteLongTextL
+// CMmMtpDpMetadataVideoAccess::WriteLongTextL
// Utility to write to the database
// ---------------------------------------------------------------------------
//
-void CMmMtpDpMetadataVideoAccess::WriteLongTextL( const TDesC& aColumn, const TDesC& aValue )
+void CMmMtpDpMetadataVideoAccess::WriteLongTextL( const TDesC& aColumn,
+ const TDesC& aValue )
{
PRINT2( _L( "MM MTP <> WriteLongTextL Metadata value for %S is \"%S\"" ), &aColumn, &aValue );
TDbColNo num = iColSet->ColNo( aColumn );
@@ -459,13 +455,16 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::ExecuteQueryL
+// CMmMtpDpMetadataVideoAccess::ExecuteQueryL
// Executes a query on the database and sets the cursor at the start of the recordset
// ---------------------------------------------------------------------------
//
-void CMmMtpDpMetadataVideoAccess::ExecuteQueryL( const TDesC& aSelectThese, const TDesC& aFromTable,
- const TDesC& aColumnToMatch, const TDesC& aMatchCriteria,
- const TBool aIfNot, const TBool aNeedQuotes )
+void CMmMtpDpMetadataVideoAccess::ExecuteQueryL( const TDesC& aSelectThese,
+ const TDesC& aFromTable,
+ const TDesC& aColumnToMatch,
+ const TDesC& aMatchCriteria,
+ const TBool aIfNot,
+ const TBool aNeedQuotes )
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::ExecuteQueryL" ) );
@@ -531,17 +530,17 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::OpenSessionL
+// CMmMtpDpMetadataVideoAccess::OpenSessionL
// Called when the MTP session is initialised
// ---------------------------------------------------------------------------
//
void CMmMtpDpMetadataVideoAccess::OpenSessionL()
{
-
+ // Do nothing
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::CloseSessionL
+// CMmMtpDpMetadataVideoAccess::CloseSessionL
// Called when the MTP session is closed
// ---------------------------------------------------------------------------
//
@@ -562,7 +561,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::AddVideoL
+// CMmMtpDpMetadataVideoAccess::AddVideoL
// Adds video info to the database
// ---------------------------------------------------------------------------
//
@@ -593,7 +592,8 @@
iRecordSet.SetColL( num, aFullFileName );
num = iColSet->ColNo( KMtpVideoName );
- iRecordSet.SetColL( num, aFullFileName ); // Default name is the filename.
+ TParsePtrC parser( aFullFileName );
+ iRecordSet.SetColL( num, parser.Name() ); // Default name is the filename.
num = iColSet->ColNo( KMtpVideoArtist );
iRecordSet.SetColL( num, KNullDesC );
@@ -622,8 +622,8 @@
num = iColSet->ColNo( KMtpVideoHeight );
iRecordSet.SetColL( num, 0 );
- num = iColSet->ColNo(KMtpVideoDuration);
- iRecordSet.SetColL(num, 0);
+ num = iColSet->ColNo( KMtpVideoDuration );
+ iRecordSet.SetColL( num, 0 );
num = iColSet->ColNo( KMtpVideoSampleRate );
iRecordSet.SetColL( num, 0 );
@@ -643,8 +643,8 @@
num = iColSet->ColNo( KMtpVideoVideoBitrate );
iRecordSet.SetColL( num, 0 );
- num = iColSet->ColNo(KMtpVideoFramesPer1000Sec);
- iRecordSet.SetColL(num, 0);
+ num = iColSet->ColNo( KMtpVideoFramesPer1000Sec );
+ iRecordSet.SetColL( num, 0 );
num = iColSet->ColNo( KMtpVideoKeyFrameDistance );
iRecordSet.SetColL( num, 0 );
@@ -658,9 +658,6 @@
num = iColSet->ColNo( KMtpVideoParentalRating );
iRecordSet.SetColL( num, KNullDesC );
- num = iColSet->ColNo( KMtpVideoUseCount );
- iRecordSet.SetColL( num, 0 );
-
num = iColSet->ColNo( KMtpVideoDRM );
iRecordSet.SetColL( num, 0 );
}
@@ -694,13 +691,13 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::GetObjectMetadataValueL
+// CMmMtpDpMetadataVideoAccess::GetObjectMetadataValueL
// Gets a piece of metadata from the collection
// ---------------------------------------------------------------------------
//
void CMmMtpDpMetadataVideoAccess::GetObjectMetadataValueL( const TUint16 aPropCode,
- MMTPType& aNewData,
- const CMTPObjectMetaData& aObjectMetaData )
+ MMTPType& aNewData,
+ const CMTPObjectMetaData& aObjectMetaData )
{
PRINT1( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::GetObjectMetadataValue aPropCode = 0x%x" ), aPropCode );
@@ -718,7 +715,7 @@
TUint32 uInt32 = 0;
TUint16 uInt16 = 0;
- switch (aPropCode)
+ switch ( aPropCode )
{
case EMTPObjectPropCodeName:
{
@@ -783,10 +780,13 @@
PRINT( _L( "MM MTP <> EMTPObjectPropCodeDescription-MD" ) );
data = ReadLongTextL( KMtpVideoComment );
- if ( data->Length() != 0 )
- ( ( CMTPTypeString& ) aNewData ).SetL( *data ) ;
- else
- ( ( TMTPTypeUint32 & ) aNewData ).Set( 0 ); // return zero if description is empty
+ TInt len = data->Length();
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::GetObjectMetadataValue len = %d" ),len );
+ if ( len != 0 )
+ {
+ for ( TInt i = 0; i < len; i++ )
+ ( ( CMTPTypeArray& ) aNewData ).AppendUintL( ( *data )[i] );
+ }
delete data;
data = NULL;
@@ -863,13 +863,13 @@
num = iColSet->ColNo( KMtpVideoNumberOfChannels );
uInt16 = iRecordSet.ColUint16( num );
if ( EMTPTypeUINT16 == aNewData.Type() )
- {
- ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
- }
- else
- {
- User::Leave( KErrArgument );
- }
+ {
+ ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
+ }
+ else
+ {
+ User::Leave( KErrArgument );
+ }
}
break;
@@ -975,13 +975,13 @@
num = iColSet->ColNo( KMtpVideoScanType );
uInt16 = iRecordSet.ColUint16( num );
if ( EMTPTypeUINT16 == aNewData.Type() )
- {
- ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
- }
- else
- {
- User::Leave( KErrArgument );
- }
+ {
+ ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
+ }
+ else
+ {
+ User::Leave( KErrArgument );
+ }
}
break;
@@ -999,35 +999,19 @@
}
break;
- case EMTPObjectPropCodeUseCount:
- {
- PRINT( _L( "MM MTP <> EMTPObjectPropCodeUseCount-MD" ) );
- num = iColSet->ColNo( KMtpVideoUseCount );
- uInt32 = iRecordSet.ColUint32( num );
- if ( EMTPTypeUINT32 == aNewData.Type() )
- {
- ( ( TMTPTypeUint32 & ) aNewData ).Set( uInt32 );
- }
- else
- {
- User::Leave( KErrArgument );
- }
- }
- break;
-
case EMTPObjectPropCodeDRMStatus:
{
PRINT( _L( "MM MTP <> EMTPObjectPropCodeDRMStatus-MD" ) );
num = iColSet->ColNo( KMtpVideoDRM );
uInt16 = iRecordSet.ColUint16( num );
if ( EMTPTypeUINT16 == aNewData.Type() )
- {
- ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
- }
- else
- {
- User::Leave( KErrArgument );
- }
+ {
+ ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
+ }
+ else
+ {
+ User::Leave( KErrArgument );
+ }
}
break;
@@ -1039,7 +1023,7 @@
}
// Pack the info to aNewData
- if (data)
+ if ( data )
{
#ifdef _DEBUG
if ( data->Length() > KMtpMaxStringDescLength ) // Have to concatenate for MTP
@@ -1064,7 +1048,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL
+// CMmMtpDpMetadataVideoAccess::SetObjectMetadataValueL
// Sets a piece of metadata in the collection
// ---------------------------------------------------------------------------
//
@@ -1079,24 +1063,14 @@
// Get file path
TPtrC suid( aObjectMetaData.DesC( CMTPObjectMetaData::ESuid ) );
- TParsePtrC parse( suid );
SetRecordL( suid, ERecordWrite );
- TRAPD( err, SetMetadataL( aPropCode, aNewData ) );
-
- if ( err < KErrNone ) // EPOC error condition
- {
- PRINT1( _L( "MM MTP <> Metadata write failed, with error %d" ), err );
- SetRecordL( suid, EFailedWrite );
- }
-
- if ( err != KErrNone )
- User::Leave( err );
+ SetMetadataL( aPropCode, aNewData );
PRINT( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::SetObjectMetadataValueL" ) );
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetMetadataL
+// CMmMtpDpMetadataVideoAccess::SetMetadataL
// Set meta data.
// ---------------------------------------------------------------------------
//
@@ -1123,7 +1097,7 @@
case EMTPObjectPropCodeEncodingProfile:
case EMTPObjectPropCodeParentalRating:
{
- if( EMTPTypeString != aNewData.Type())
+ if ( EMTPTypeString != aNewData.Type() )
{
User::Leave( KErrArgument );
}
@@ -1137,23 +1111,26 @@
{
PRINT( _L( "MM MTP <> EMTPObjectPropCodeDescription-MD" ) );
#ifdef __MUSIC_ID_SUPPORT
- //WriteMusicIdsL(*longString);
+ // WriteMusicIdsL(*longString);
#else
desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData
MMTPType::CopyL( aNewData, *desData );
TUint length = desData->NumElements();
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL length = %d" ), length );
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL length = %d" ),
+ length );
if ( length != 0 )
{
- TBuf<KMtpMaxDescriptionLength> text;
- text.Zero();
+ length = ( length < KMTPMaxDescriptionLen ) ? length : KMTPMaxDescriptionLen;
+ HBufC* text = HBufC::NewLC( length ); // + text
+ TPtr ptr = text->Des();
+
for ( TUint i = 0; i < length; i++ )
- {
- text.Append( desData->ElementUint( i ) );
- }
+ ptr.Append( desData->ElementUint( i ) );
PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL text = %S" ),
- &text );
- WriteLongTextL( KMtpVideoComment, text );
+ text );
+
+ WriteLongTextL( KMtpVideoComment, *text );
+ CleanupStack::PopAndDestroy( text ); // - text
}
else
{
@@ -1174,7 +1151,6 @@
case EMTPObjectPropCodeVideoBitRate:
case EMTPObjectPropCodeFramesPerThousandSeconds:
case EMTPObjectPropCodeKeyFrameDistance:
- case EMTPObjectPropCodeUseCount:
{
if ( EMTPTypeUINT32 != aNewData.Type() )
{
@@ -1210,11 +1186,12 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::RenameRecordL
+// CMmMtpDpMetadataVideoAccess::RenameRecordL
// Renames the file part of a record in the collection database.
// ---------------------------------------------------------------------------
//
-void CMmMtpDpMetadataVideoAccess::RenameRecordL(const TDesC& aOldFileName, const TDesC& aNewFileName)
+void CMmMtpDpMetadataVideoAccess::RenameRecordL( const TDesC& aOldFileName,
+ const TDesC& aNewFileName )
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::RenameRecordL()" ) );
@@ -1230,7 +1207,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::DeleteRecordL
+// CMmMtpDpMetadataVideoAccess::DeleteRecordL
// Deletes metadata information associated with the object
// ---------------------------------------------------------------------------
//
@@ -1267,7 +1244,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::DeleteAllRecordsL
+// CMmMtpDpMetadataVideoAccess::DeleteAllRecordsL
// Empties the database - used by the FormatStore command
// ---------------------------------------------------------------------------
//
@@ -1276,7 +1253,7 @@
PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::DeleteAllRecordsL()" ) );
//open database if not opened
- if (!IsDatabaseOpened())
+ if ( !IsDatabaseOpened() )
OpenDatabaseL();
SetRecordL( KNullDesC, ENoRecord ); // Commit any other changes to the DB
@@ -1298,18 +1275,19 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetRecordL
+// CMmMtpDpMetadataVideoAccess::SetRecordL
// Set Record
// ---------------------------------------------------------------------------
//
-void CMmMtpDpMetadataVideoAccess::SetRecordL( const TDesC& aFullFileName, TMtpDbState aState )
+void CMmMtpDpMetadataVideoAccess::SetRecordL( const TDesC& aFullFileName,
+ TMtpDbState aState )
{
PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::SetRecordL()" ) );
if ( ( aState == iDbState )
- && ( 0 == aFullFileName.Compare( iCurrentFileName ) ) ) // Already have it
+ && ( 0 == aFullFileName.Compare( iCurrentFileName ) ) ) // Already have it
{
- if (iDbState == ERecordRead)
+ if ( iDbState == ERecordRead )
iRecordSet.GetL();
PRINT1( _L( "MM MTP <> Cached recordset, filename is '%S'" ), &iCurrentFileName );
@@ -1332,20 +1310,20 @@
PRINT( _L( "MM MTP <> SetRecordL ERecordWrite" ) );
TRAPD( err, iRecordSet.PutL() );
- if (KErrNone != err)
+ if ( KErrNone != err )
{
iRecordSet.Cancel();
User::Leave( err );
}
- //lint -fallthrough
+ //lint -fallthrough
case ENoRecord: // intentionally fallthrough
// We need to just close the open record
PRINT( _L( "MM MTP <> SetRecordL ENoRecord" ) );
- //lint -fallthrough
+ //lint -fallthrough
case ERecordRead: // intentionally fallthrough
// We need to open a row for reading
PRINT( _L( "MM MTP <> SetRecordL ERecordRead" ) );
- //lint -fallthrough
+ //lint -fallthrough
default: // intentionally fallthrough
PRINT( _L( "MM MTP <> SetRecordL Closing recordset" ) );
delete iColSet;
@@ -1355,7 +1333,7 @@
break;
}
- if ( aState == ENoRecord ) // We are closing the session if this is the case
+ if ( aState == ENoRecord ) // We are closing the session if this is the case
{
PRINT( _L( "MM MTP <> SetRecordL Record closed, no request to open" ) );
return;
@@ -1365,7 +1343,6 @@
TUint16 format = MmMtpDpUtility::FormatFromFilename( iCurrentFileName );
PRINT1( _L( "MM MTP <> SetRecordL format = 0x%x" ), format );
-
if ( MmMtpDpUtility::HasMetadata( format ) )
{
// Get the record
@@ -1409,7 +1386,7 @@
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetImageObjPropL
+// CMmMtpDpMetadataVideoAccess::SetImageObjPropL
// set image specific properties specific to videos
// ---------------------------------------------------------------------------
//
@@ -1430,24 +1407,24 @@
TRAP( err, iRecordSet.SetColL( num, aWidth ) );
if ( err != KErrNone )
- {
- SetRecordL( aFullFileName, EFailedWrite );
- User::Leave( err );
- }
+ {
+ SetRecordL( aFullFileName, EFailedWrite );
+ User::Leave( err );
+ }
num = iColSet->ColNo( KMtpVideoHeight );
TRAP( err, iRecordSet.SetColL( num, aHeight ) );
if ( err != KErrNone )
- {
- SetRecordL( aFullFileName, EFailedWrite );
- User::Leave( err );
- }
+ {
+ SetRecordL( aFullFileName, EFailedWrite );
+ User::Leave( err );
+ }
PRINT( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::SetImageObjPropL()" ) );
}
// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::GetImageObjPropL
+// CMmMtpDpMetadataVideoAccess::GetImageObjPropL
// Get image specific properties specific to videos
// ---------------------------------------------------------------------------
//
@@ -1476,35 +1453,34 @@
const TDesC& CMmMtpDpMetadataVideoAccess::ColumnNameFromPropCodeL( const TUint16 aPropCode )
{
const TColumnNameTable KColumnTable[] =
- {
- { EMTPObjectPropCodeName, KMtpVideoName },
- { EMTPObjectPropCodeArtist, KMtpVideoArtist },
- { EMTPObjectPropCodeTrack, KMtpVideoTrack },
- { EMTPObjectPropCodeGenre, KMtpVideoGenre },
- { EMTPObjectPropCodeAlbumName, KMtpVideoAlbumName },
- { EMTPObjectPropCodeComposer, KMtpVideoComposer },
- { EMTPObjectPropCodeOriginalReleaseDate, KMtpVideoOrigReleaseDate },
- { EMTPObjectPropCodeDescription, KMtpVideoComment },
- { EMTPObjectPropCodeWidth, KMtpVideoWidth },
- { EMTPObjectPropCodeHeight, KMtpVideoHeight },
- { EMTPObjectPropCodeDuration, KMtpVideoDuration },
- { EMTPObjectPropCodeSampleRate, KMtpVideoSampleRate },
- { EMTPObjectPropCodeNumberOfChannels, KMtpVideoNumberOfChannels },
- { EMTPObjectPropCodeAudioBitRate, KMtpVideoAudioBitrate },
- { EMTPObjectPropCodeVideoFourCCCodec, KMtpVideoVideoCodec },
- { EMTPObjectPropCodeVideoBitRate, KMtpVideoVideoBitrate },
- { EMTPObjectPropCodeFramesPerThousandSeconds,KMtpVideoFramesPer1000Sec },
- { EMTPObjectPropCodeKeyFrameDistance, KMtpVideoKeyFrameDistance },
- { EMTPObjectPropCodeScanType, KMtpVideoScanType },
- { EMTPObjectPropCodeEncodingProfile, KMtpVideoEncodingProfile },
- { EMTPObjectPropCodeParentalRating, KMtpVideoParentalRating },
- { EMTPObjectPropCodeUseCount, KMtpVideoUseCount },
- { EMTPObjectPropCodeAudioWAVECodec, KMtpVideoAudioCodec },
- { EMTPObjectPropCodeDRMStatus, KMtpVideoDRM },
- };
+ {
+ { EMTPObjectPropCodeName, KMtpVideoName },
+ { EMTPObjectPropCodeArtist, KMtpVideoArtist },
+ { EMTPObjectPropCodeTrack, KMtpVideoTrack },
+ { EMTPObjectPropCodeGenre, KMtpVideoGenre },
+ { EMTPObjectPropCodeAlbumName, KMtpVideoAlbumName },
+ { EMTPObjectPropCodeComposer, KMtpVideoComposer },
+ { EMTPObjectPropCodeOriginalReleaseDate, KMtpVideoOrigReleaseDate },
+ { EMTPObjectPropCodeDescription, KMtpVideoComment },
+ { EMTPObjectPropCodeWidth, KMtpVideoWidth },
+ { EMTPObjectPropCodeHeight, KMtpVideoHeight },
+ { EMTPObjectPropCodeDuration, KMtpVideoDuration },
+ { EMTPObjectPropCodeSampleRate, KMtpVideoSampleRate },
+ { EMTPObjectPropCodeNumberOfChannels, KMtpVideoNumberOfChannels },
+ { EMTPObjectPropCodeAudioBitRate, KMtpVideoAudioBitrate },
+ { EMTPObjectPropCodeVideoFourCCCodec, KMtpVideoVideoCodec },
+ { EMTPObjectPropCodeVideoBitRate, KMtpVideoVideoBitrate },
+ { EMTPObjectPropCodeFramesPerThousandSeconds,KMtpVideoFramesPer1000Sec },
+ { EMTPObjectPropCodeKeyFrameDistance, KMtpVideoKeyFrameDistance },
+ { EMTPObjectPropCodeScanType, KMtpVideoScanType },
+ { EMTPObjectPropCodeEncodingProfile, KMtpVideoEncodingProfile },
+ { EMTPObjectPropCodeParentalRating, KMtpVideoParentalRating },
+ { EMTPObjectPropCodeAudioWAVECodec, KMtpVideoAudioCodec },
+ { EMTPObjectPropCodeDRMStatus, KMtpVideoDRM },
+ };
TInt i = 0;
- TInt count = sizeof ( KColumnTable ) / sizeof ( KColumnTable[0] );
+ TInt count = sizeof( KColumnTable ) / sizeof( KColumnTable[0] );
while ( ( KColumnTable[i].iPropCode != aPropCode ) && ( i < count ) )
{
i++;
@@ -1513,7 +1489,7 @@
if ( i == count )
{
// Not supported by MPX, shouldn't call this function
- PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::MpxAttribFromPropL NOT SUPPORTED ATTRIBUTE" ) );
+ PRINT( _L( "MM MTP <> CMmMtpDpMetadataVideoAccess::ColumnNameFromPropCodeL NOT SUPPORTED ATTRIBUTE" ) );
User::Leave( KErrNotSupported );
}
return KColumnTable[i].iDbColumnName;
@@ -1521,15 +1497,14 @@
void CMmMtpDpMetadataVideoAccess::SetStorageRootL( const TDesC& aStorageRoot )
{
- PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetStorageRoot aStoreRoot = %S" ), &aStorageRoot );
+ PRINT1( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::SetStorageRoot aStoreRoot = %S" ), &aStorageRoot );
// get the drive number
- TParse pathParser;
- User::LeaveIfError( pathParser.Set( aStorageRoot, NULL, NULL ) );
+ TParsePtrC pathParser( aStorageRoot );
TChar driveChar( pathParser.Drive()[0] );
User::LeaveIfError( RFs::CharToDrive( driveChar, iStoreNum ) );
- PRINT1( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetStorageRoot drive number = %d" ), iStoreNum );
+ PRINT1( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::SetStorageRoot drive number = %d" ), iStoreNum );
}
void CMmMtpDpMetadataVideoAccess::CleanupDatabaseL()
--- a/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Mon May 03 12:58:40 2010 +0300
@@ -36,6 +36,7 @@
#include "mmmtpdputility.h"
#include "mmmtpdpfiledefs.h"
+#include "tobjectdescription.h"
#include "mmmtpdplogger.h"
using namespace ContentAccess;
@@ -44,6 +45,9 @@
_LIT( KHxMimeTypeWma, "audio/x-hx-wma" );
_LIT( KHxMimeTypeWmv, "video/x-hx-wmv" );
+const TInt KMaxRenameTimes = 10;
+const TInt KRenameThreshold = 100 * 1000; // (100 millisec)
+
// -----------------------------------------------------------------------------
// MmMtpDpUtility::FormatFromFilename
// Utility function to get the type of an object from the filename
@@ -60,6 +64,9 @@
TParsePtrC file( aFullFileName );
+ if ( !file.ExtPresent() )
+ return EMTPFormatCodeUndefined;
+
// need to do it in popularity of format, to optmize performance
if ( file.Ext().CompareF( KTxtExtensionMP3 ) == 0 )
return EMTPFormatCodeMP3;
@@ -68,23 +75,27 @@
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( KTxtExtension3G2 ) == 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;
@@ -112,6 +123,9 @@
}
}
+ if ( file.Ext().CompareF( KTxtExtensionALB ) == 0 )
+ return EMTPFormatCodeAbstractAudioAlbum;
+
if (( file.Ext().CompareF( KTxtExtensionPLA ) == 0 ) || ( file.Ext().CompareF( KTxtExtensionVIR ) == 0 ) )
return EMTPFormatCodeAbstractAudioVideoPlaylist;
@@ -144,101 +158,18 @@
}
// -----------------------------------------------------------------------------
-// MmMtpDpUtility::IsVideoL (Slow Version)
-// Utility function to determine whether a format is Video or not
+// MmMtpDpUtility::HasReference
+// Utility function to decide if there is any reference
// -----------------------------------------------------------------------------
//
-EXPORT_C TBool MmMtpDpUtility::IsVideoL( const TDesC& aFullFileName )
+TBool MmMtpDpUtility::HasReference( TUint16 aObjFormatCode )
{
- PRINT1( _L( "MM MTP => MmMtpDpUtility::IsVideoL (Slow Version) aFullFileName = %S" ), &aFullFileName );
-
- TParse pathParser;
- User::LeaveIfError( pathParser.Set( aFullFileName, NULL, NULL ) );
-
- TPtrC ext( pathParser.Ext() );
-
- if ( ext.Length() <= 0 )
- {
- PRINT( _L( "MM MTP <> MmMtpDpUtility::IsVideoL ext len <= 0, return false" ) );
- return EFalse;
- }
-
- // move WMV early to optmize comparison
- if ( ext.CompareF( KTxtExtensionWMV ) == 0 )
- {
- return ETrue;
- }
- else if ( ext.CompareF( KTxtExtensionMP4 ) == 0
- || ext.CompareF( KTxtExtension3GP ) == 0
- || ext.CompareF( KTxtExtensionODF ) == 0
- || ext.CompareF( KTxtExtensionASF ) == 0 )
- {
- HBufC8* mimetype = ContainerMimeType( aFullFileName );
- User::LeaveIfNull( mimetype );
-
- CleanupStack::PushL( mimetype ); // + mimetype
-
- TMmMtpSubFormatCode subFormatCode;
-
- User::LeaveIfError( SubFormatCodeFromMime( *mimetype, subFormatCode ) );
- CleanupStack::PopAndDestroy( mimetype ); // - mimetype
-
- if ( subFormatCode == EMTPSubFormatCodeVideo )
- {
- return ETrue;
- }
- else
- {
- return EFalse;
- }
- }
- else if ( ext.CompareF( KTxtExtensionO4V ) == 0 )
+ if ( aObjFormatCode == EMTPFormatCodeAbstractAudioAlbum
+ || aObjFormatCode == EMTPFormatCodeAbstractAudioVideoPlaylist
+ || aObjFormatCode == EMTPFormatCodeM3UPlaylist )
return ETrue;
-
- // other format, as audio
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// MmMtpDpUtility::IsVideoL (Fast Version)
-// Utility function to determine whether a format is Video or not
-// -----------------------------------------------------------------------------
-//
-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 );
-
- TUint formatCode = info->Uint( CMTPObjectMetaData::EFormatCode );
- TUint subFormatCode = info->Uint( CMTPObjectMetaData::EFormatSubCode );
-
- CleanupStack::PopAndDestroy( info ); // - info
-
- if ( formatCode == EMTPFormatCodeWMV )
- {
- return ETrue;
- }
- else if ( ( formatCode == EMTPFormatCodeMP4Container )
- || ( formatCode == EMTPFormatCode3GPContainer )
- || ( formatCode == EMTPFormatCodeASF ) )
- {
- if ( subFormatCode == EMTPSubFormatCodeAudio )
- {
- return EFalse;
- }
- else if ( subFormatCode == EMTPSubFormatCodeVideo )
- {
- return ETrue;
- }
- }
-
- PRINT( _L( "MM MTP <= MmMtpDpUtility::IsVideoL (Fast Version)" ) );
-
- // other format, as audio
- return EFalse;
+ else
+ return EFalse;
}
// -----------------------------------------------------------------------------
@@ -269,7 +200,7 @@
TEntry fileInfo;
// Shouldn't leave
User::LeaveIfError( aFs.Entry( aFileName, fileInfo ) );
- return fileInfo.iSize;
+ return fileInfo.FileSize();
}
// -----------------------------------------------------------------------------
@@ -277,16 +208,14 @@
// Get the file date modified.
// -----------------------------------------------------------------------------
//
-TTime MmMtpDpUtility::GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName )
+void MmMtpDpUtility::GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName, TDes& aDateModified )
{
- TTime dataModified;
+ TTime date;
TEntry fileInfo;
// Shouldn't leave
User::LeaveIfError( aFs.Entry( aFullFileName, fileInfo ) );
-
- dataModified = fileInfo.iModified;
-
- return dataModified;
+ date = fileInfo.iModified;
+ date.FormatL( aDateModified, KMtpDateTimeFormat );
}
// -----------------------------------------------------------------------------
@@ -306,6 +235,10 @@
protectionStatus = EMTPProtectionReadOnly;
}
+ PRINT2( _L( "MM MTP <> MmMtpDpUtility::GetProtectionStatusL aFullFileName = %S, protectionStatus = 0x%x" ),
+ &aFullFileName,
+ protectionStatus );
+
return protectionStatus;
}
@@ -314,10 +247,10 @@
// Check if property type match datatype.
// -----------------------------------------------------------------------------
//
-TMTPResponseCode MmMtpDpUtility::CheckPropType(TUint16 aPropertyCode, TUint16 aDataType)
+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,8 +266,11 @@
case EMTPObjectPropCodeDateCreated:
case EMTPObjectPropCodeDateModified:
case EMTPObjectPropCodeDateAdded:
- case EMTPObjectPropCodeNonConsumable:
case EMTPObjectPropCodeVideoBitRate:
+ case EMTPObjectPropCodeRepresentativeSampleFormat:
+ case EMTPObjectPropCodeRepresentativeSampleSize:
+ case EMTPObjectPropCodeRepresentativeSampleHeight:
+ case EMTPObjectPropCodeRepresentativeSampleWidth:
{
responseCode = EMTPRespCodeAccessDenied;
}
@@ -350,6 +286,7 @@
case EMTPObjectPropCodeOriginalReleaseDate: // 0xDC99
case EMTPObjectPropCodeAlbumName: // 0xDC9A
case EMTPObjectPropCodeEncodingProfile: // 0xDEA1
+ case EMTPObjectPropCodeAlbumArtist: // 0xDC9B
{
if ( aDataType != EMTPTypeString )
{
@@ -371,7 +308,6 @@
case EMTPObjectPropCodeWidth: // 0xDC87
case EMTPObjectPropCodeHeight: // 0xDC88
case EMTPObjectPropCodeDuration: // 0xDC89
- case EMTPObjectPropCodeUseCount: // 0xDC91
case EMTPObjectPropCodeSampleRate: // 0xDE93
case EMTPObjectPropCodeAudioWAVECodec: // 0xDE99
case EMTPObjectPropCodeAudioBitRate: // 0xDE9A
@@ -399,13 +335,33 @@
}
break;
+ // Uint8 properties
+ case EMTPObjectPropCodeNonConsumable:
+ case EMTPExtObjectPropCodeOmaDrmStatus: // 0xDB01
+ {
+ if ( aDataType != EMTPTypeUINT8 )
+ {
+ responseCode = EMTPRespCodeInvalidObjectPropFormat;
+ }
+ }
+ break;
+
+ case EMTPObjectPropCodeRepresentativeSampleData:
+ {
+ if ( aDataType != EMTPTypeAUINT8 )
+ {
+ 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;
}
@@ -433,9 +389,29 @@
aNewName.Insert( 0, ptr );
}
- return aFs.Rename( aFullFileName, aNewName );
+ TInt ret = KErrNone;
+ // Some other component might be holding on to the file (MDS background harvesting),
+ // try again after 100 millisec, up to 10 times, before give up
+ TInt count = KMaxRenameTimes;
+ while ( count > 0 )
+ {
+ ret = aFs.Rename( aFullFileName, aNewName );
+ if ( ( ret == KErrInUse ) && ( count > 1 ) )
+ {
+ User::After( KRenameThreshold );
+ count--;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ PRINT1( _L( "MM MTP <> MmMtpDpUtility::UpdateObjectFileName, ret = %d" ), ret );
+
+ return ret;
}
-
+
// -----------------------------------------------------------------------------
// MetadataAccessWrapper::ContainerMimeType
// Get mime type from file
@@ -446,13 +422,7 @@
PRINT( _L( "MM MTP => MmMtpDpUtility::ContainerMimeType" ) );
// parse the file path
- TParse pathParser;
- TInt retCode = pathParser.Set( aFullPath, NULL, NULL );
- if ( retCode != KErrNone )
- {
- PRINT( _L( "MM MTP <> MmMtpDpUtility::ContainerMimeType parse path failed" ) );
- return NULL;
- }
+ TParsePtrC pathParser( aFullPath );
// get the extension of file
TPtrC ext( pathParser.Ext() );
@@ -467,14 +437,15 @@
// MP4/3GP
if ( ext.CompareF( KTxtExtensionMP4 ) == 0
- || ext.CompareF( KTxtExtension3GP ) == 0 )
+ || ext.CompareF( KTxtExtension3GP ) == 0
+ || ext.CompareF( KTxtExtension3G2 ) == 0 )
{
TRAP( err, mimebuf = Mp4MimeTypeL( aFullPath ) );
PRINT1( _L("MM MTP <> MmMtpDpUtility::ContainerMimeType, Mp4MimeTypeL err = %d"), err );
}
else if ( ext.CompareF( KTxtExtensionODF ) == 0 )
{
- TRAP( err, mimebuf = Mp4MimeTypeL( aFullPath ) );
+ TRAP( err, mimebuf = OdfMimeTypeL( aFullPath ) );
PRINT1( _L("MM MTP <> MmMtpDpUtility::ContainerMimeType, OdfMimeTypeL err = %d"), err );
}
#ifdef __WINDOWS_MEDIA
@@ -484,7 +455,7 @@
PRINT1( _L("MM MTP <> MmMtpDpUtility::ContainerMimeType, AsfMimeTypeL err = %d"), err );
}
#endif
-
+
PRINT( _L( "MM MTP <= MmMtpDpUtility::ContainerMimeType" ) );
return mimebuf;
}
@@ -499,9 +470,10 @@
PRINT( _L( "MM MTP => MmMtpDpUtility::Mp4MimeTypeL" ) );
HBufC8* mimebuf = NULL;
TParsePtrC file( aFullPath );
-
+
if ( file.Ext().CompareF( KTxtExtensionMP4 ) == 0
- || file.Ext().CompareF( KTxtExtension3GP ) == 0 )
+ || file.Ext().CompareF( KTxtExtension3GP ) == 0
+ || file.Ext().CompareF( KTxtExtension3G2 ) == 0 )
{
// get mime from file
MP4Handle mp4Handle = NULL;
@@ -537,7 +509,8 @@
if ( mp4err == MP4_OK )
{
- if ( file.Ext().CompareF( KTxtExtension3GP ) == 0 )
+ if ( file.Ext().CompareF( KTxtExtension3GP ) == 0
+ || file.Ext().CompareF( KTxtExtension3G2 ) == 0 )
{
mimebuf = KMimeTypeAudio3gpp().Alloc();
}
@@ -550,7 +523,8 @@
// is video file
else if ( mp4err == MP4_OK )
{
- if ( file.Ext().CompareF( KTxtExtension3GP ) == 0 )
+ if ( file.Ext().CompareF( KTxtExtension3GP ) == 0
+ || file.Ext().CompareF( KTxtExtension3G2 ) == 0 )
{
mimebuf = KMimeTypeVideo3gpp().Alloc();
}
@@ -573,7 +547,7 @@
{
User::Leave( KErrNotSupported );
}
-
+
if ( mimebuf == NULL )
{
User::Leave( KErrNotFound );
@@ -591,38 +565,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 +604,7 @@
{
User::Leave( KErrNotSupported );
}
-
+
PRINT( _L( "MM MTP <= MmMtpDpUtility::OdfMimeTypeL" ) );
return mimebuf;
}
@@ -642,33 +616,34 @@
//
HBufC8* MmMtpDpUtility::AsfMimeTypeL( const TDesC& aFullPath )
{
- PRINT( _L( "MM MTP => MmMtpDpUtility::AsfMimeTypeL" ) );
-
+ PRINT1( _L( "MM MTP => MmMtpDpUtility::AsfMimeTypeL, aFullPath = %S" ), &aFullPath );
+
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 );
-
+ PRINT( _L( "MM MTP <> MmMtpDpUtility::AsfMimeTypeL OpenFileL" ) );
+
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 +670,7 @@
}
hxUtility->ResetL();
- CleanupStack::PopAndDestroy( hxUtility );
+ CleanupStack::PopAndDestroy( hxUtility );
}
else
{
@@ -705,7 +680,7 @@
#else
User::Leave( KErrNotSupported );
#endif
-
+
PRINT( _L( "MM MTP <= MmMtpDpUtility::AsfMimeTypeL" ) );
return mimebuf;
}
@@ -715,11 +690,12 @@
// Get subformat code from mime string
// -----------------------------------------------------------------------------
//
-TInt MmMtpDpUtility::SubFormatCodeFromMime( const TDesC8& aMimeType,
- TMmMtpSubFormatCode& aSubFormatCode )
+TMmMtpSubFormatCode MmMtpDpUtility::SubFormatCodeFromMime( const TDesC8& aMimeType )
{
PRINT( _L( "MM MTP => MmMtpDpUtility::SubFormatCodeFromMime" ) );
+ TMmMtpSubFormatCode subFormatCode = EMTPSubFormatCodeUnknown;
+
if ( aMimeType.CompareF( KMimeTypeVideoMp4 ) == 0
|| aMimeType.CompareF( KMimeTypeVideo3gpp ) == 0
#ifdef __WINDOWS_MEDIA
@@ -727,7 +703,7 @@
#endif
)
{
- aSubFormatCode = EMTPSubFormatCodeVideo;
+ subFormatCode = EMTPSubFormatCodeVideo;
}
else if ( aMimeType.CompareF( KMimeTypeAudioMp4 ) == 0
|| aMimeType.CompareF( KMimeTypeAudio3gpp ) == 0
@@ -736,16 +712,17 @@
#endif
)
{
- aSubFormatCode = EMTPSubFormatCodeAudio;
+ subFormatCode = EMTPSubFormatCodeAudio;
}
else
{
PRINT( _L( "MM MTP <= MmMtpDpUtility::SubFormatCodeFromMime format not supported" ) );
- return KErrNotFound;
+ subFormatCode = EMTPSubFormatCodeUndefine;
}
- PRINT( _L( "MM MTP <= MmMtpDpUtility::SubFormatCodeFromMime" ) );
- return KErrNone;
+ PRINT1( _L( "MM MTP <= MmMtpDpUtility::SubFormatCodeFromMime SubFormatCode = %d" ), subFormatCode );
+
+ return subFormatCode;
}
// -----------------------------------------------------------------------------
@@ -791,8 +768,8 @@
}
PRINT1( _L( "MM MTP <= MmMtpDpUtility::GetDrmStatus, drmStatus: %d" ), drmStatus );
-
+
return drmStatus;
}
-//end of file
+// end of file
--- a/mmappcomponents/playbackhelper/group/playbackhelper.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/playbackhelper/group/playbackhelper.mmp Mon May 03 12:58:40 2010 +0300
@@ -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,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
#include <data_caging_paths.hrh>
@@ -52,8 +52,8 @@
#endif
#if defined(ARMCC)
-deffile ../eabi/
+deffile ../eabi/
#elif defined(WINSCW)
-deffile ../bwinscw/
+deffile ../bwinscw/
#endif
--- a/mmappcomponents/playbackhelper/inc/playbackhelper_log.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/playbackhelper/inc/playbackhelper_log.h Mon May 03 12:58:40 2010 +0300
@@ -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,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
#ifndef PLAYBACKHELPER_LOG_H
--- a/mmappcomponents/videoplaylistutility/group/videoplaylistutility.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/videoplaylistutility/group/videoplaylistutility.mmp Mon May 03 12:58:40 2010 +0300
@@ -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: 4 %
+// Version : %version: 5 %
#include <data_caging_paths.hrh>
--- a/mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h Mon May 03 12:58:40 2010 +0300
@@ -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,13 +15,14 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
+
+
#ifndef VIDEOPLAYLISTUTILITY_LOG_H
#define VIDEOPLAYLISTUTILITY_LOG_H
-
// INCLUDES
#include <e32std.h>
#include <e32svr.h>
@@ -45,7 +46,6 @@
class TVideoPlaylistUtilityLog : public TDes16Overflow
{
public:
-
inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... )
{
}
@@ -53,7 +53,7 @@
inline static void VideoPlaylistUtilityLog( TRefByValue<const TDesC16> aFmt, ... )
{
TBuf< 512 > buffer;
-
+
VA_LIST list;
VA_START( list, aFmt );
buffer.AppendFormatList( aFmt, list );
@@ -76,14 +76,14 @@
TRefByValue<const TDesC> 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 );
@@ -91,11 +91,11 @@
RDebug::Print(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer );
}
-
+
TEnterExitLog( TRefByValue<const TDesC> aFunctionName )
{
iFunctionName = HBufC::New( TDesC(aFunctionName).Length() );
-
+
if ( iFunctionName )
{
iFunctionName->Des().Copy(aFunctionName);
@@ -103,18 +103,17 @@
RDebug::Print(_L("#VideoPlaylistUtility# --> %S"), iFunctionName );
}
-
+
~TEnterExitLog()
{
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)
--- a/mmappfw_plat/collection_helper_api/tsrc/CollectionHelperTestClass/inc/CollectionHelperTestClass.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/collection_helper_api/tsrc/CollectionHelperTestClass/inc/CollectionHelperTestClass.h Mon May 03 12:58:40 2010 +0300
@@ -73,6 +73,28 @@
_LIT( KRenameOldUri, "c:\\Blackbird.aac");
_LIT( KRenameNewUri, "c:\\data\\Blackbird.aac");
+_LIT( KFileWmaSong, "f:\\1.wma");
+
+_LIT( KFile1, "e:\\data\\sounds\\digital\\1.mp3"); //ok
+_LIT( KOldAbstractAlbumName, "1.wma"); //ok
+_LIT( KNewAbstractAlbumName, "The 99 Most Essential Beethoven MasterpiecesVarious Artists"); //ok
+_LIT( KFile3, "e:\\data\\sounds\\digital\\(01) Amber - Yes.mp3"); //ok
+_LIT( KFilet, "e:\\data\\sounds\\digital\\02 What A Wonderful World.mp3"); //ok
+
+
+_LIT( KTestFile3, "e:\\data\\sounds\\digital\\Atomic Kitten - It's Ok.mp3"); //ok
+_LIT( KSongtest, "e:\\data\\sounds\\digital\\02 What A Wonderful World.mp3"); //ok
+
+_LIT( KAbstractalbum1, "f:\\1.alb");
+_LIT( KAbstractalbum2, "f:\\2.alb");
+_LIT( KAbstractalbum3, "f:\\3.alb");
+_LIT( KStoreRoot, "f:\\");
+
+_LIT( KAbstractAlbumName, "The 99 Most Essential Beethoven MasterpiecesVarious Artists");
+
+_LIT( KAlbumArtistShort, "testAlbumArtist");
+
+
// FORWARD DECLARATIONS
class CCollectionHelperTestClass;
@@ -300,7 +322,6 @@
TInt SetAllowedPanic( CStifItemParser& aItem );
void CreateTestMediaL( CMPXMedia*& aNewProperty );
-
/**
* Connect to the default client to the server
* @since S60 3.2
@@ -316,8 +337,21 @@
virtual TInt CloseUiHelperL(CStifItemParser& aItem);
virtual TInt CloseHelperL(CStifItemParser& aItem);
virtual TInt CloseCachedHelperL(CStifItemParser& aItem);
-
+ virtual TInt AddSongL(CStifItemParser& aItem);
+ TInt FindMediaL(const TDesC& aPath, TMPXGeneralCategory aCategory);
+ virtual TInt RemoveSongL(CStifItemParser& aItem );
+ virtual TInt AddAbstractAlbumL(CStifItemParser& aItem);
+ virtual TInt RemoveAbstractAlbumL(CStifItemParser& aItem);
+ virtual TInt SetAbstractAlbumL(CStifItemParser& aItem);
+ virtual TInt SetSongAlbumArtistL(CStifItemParser& aItem);
+ virtual TInt GetSongAlbumArtistL(CStifItemParser& aItem);
+ virtual TInt SetAbstractAlbumArtistL(CStifItemParser& aItem);
+ virtual TInt GetAbstractAlbumArtistL(CStifItemParser& aItem);
+ virtual TInt UpdateAbstractAlbumNameL(CStifItemParser& aItem);
+ virtual TInt GetAbstractAlbumAndSongsL(CStifItemParser& aItem);
+ virtual TInt RenameAbstractAlbumL(CStifItemParser& aItem);
+ void AttachSongsL(CMPXMediaArray* aAbstractalbumArray, const TDesC& aPath);
/**
* From MMPXCollectionRemoveObserver
* Handles removing a collection path
@@ -339,7 +373,8 @@
* @param aError error code
*/
void HandleFindAllL(const CMPXMedia& aResults, TBool aComplete,TInt aError);
-
+
+
public: // Data
protected: // Data
--- a/mmappfw_plat/collection_helper_api/tsrc/CollectionHelperTestClass/src/CollectionHelperTestClassBlocks.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/collection_helper_api/tsrc/CollectionHelperTestClass/src/CollectionHelperTestClassBlocks.cpp Mon May 03 12:58:40 2010 +0300
@@ -30,6 +30,7 @@
#include <mpxmediacontainerdefs.h>
#include <mpxattribute.h>
#include "debug.h"
+#include <mpxmediamtpdefs.h>
// EXTERNAL DATA STRUCTURES
//extern ?external_data;
@@ -134,6 +135,18 @@
ENTRY( "NewUiHelper", CCollectionHelperTestClass::NewUiHelperL ),
ENTRY( "NewHelper", CCollectionHelperTestClass::NewHelperL ),
ENTRY( "NewCachedHelper", CCollectionHelperTestClass::NewCachedHelperL ),
+ ENTRY( "AddSong", CCollectionHelperTestClass::AddSongL ),
+ ENTRY( "RemoveSong", CCollectionHelperTestClass::RemoveSongL ),
+ ENTRY( "AddAbstractAlbum", CCollectionHelperTestClass::AddAbstractAlbumL ),
+ ENTRY( "RemoveAbstractAlbum", CCollectionHelperTestClass::RemoveAbstractAlbumL ),
+ ENTRY( "SetAbstractAlbum", CCollectionHelperTestClass::SetAbstractAlbumL ),
+ ENTRY( "SetSongAlbumArtist", CCollectionHelperTestClass::SetSongAlbumArtistL ),
+ ENTRY( "GetSongAlbumArtist", CCollectionHelperTestClass::GetSongAlbumArtistL ),
+ ENTRY( "SetAbstractAlbumArtist", CCollectionHelperTestClass::SetAbstractAlbumArtistL ),
+ ENTRY( "GetAbstractAlbumArtist", CCollectionHelperTestClass::GetAbstractAlbumArtistL ),
+ ENTRY( "UpdateAbstractAlbumName", CCollectionHelperTestClass::UpdateAbstractAlbumNameL ),
+ ENTRY("GetAbstractAlbumAndSongs",CCollectionHelperTestClass::GetAbstractAlbumAndSongsL),
+ ENTRY( "RenameAbstractAlbum", CCollectionHelperTestClass::RenameAbstractAlbumL ),
ENTRY( "CloseUiHelper", CCollectionHelperTestClass::CloseUiHelperL ),
ENTRY( "CloseHelper", CCollectionHelperTestClass::CloseHelperL ),
ENTRY( "CloseCachedHelper", CCollectionHelperTestClass::CloseCachedHelperL ),
@@ -511,6 +524,640 @@
return result;
}
+
+
+//Removing song from collection
+//By calling CMPXCollectionCachedHelper API RemoveL
+TInt CCollectionHelperTestClass::RemoveSongL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::RemoveSongL")));
+ TRAPD(result, iCachedHelper->RemoveL(KFileWmaSong, EMPXSong));
+ iLog->Log(_L("CCollectionHelperTestClass::RemoveSong done with result=[%d]"), result);
+ return result;
+ }
+
+//Removing AbstractAlbum from collection
+//By calling CMPXCollectionCachedHelper API RemoveL
+//precondition: e:\\data\\sounds\\digital\\1.alb on test HW
+//output: 1.alb is delete from MPX DB
+TInt CCollectionHelperTestClass::RemoveAbstractAlbumL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::RemoveAbstractAlbumL")));
+ TRAPD(result, iCachedHelper->RemoveL(KAbstractalbum1, EMPXAbstractAlbum));
+ iLog->Log(_L("CCollectionHelperTestClass::RemoveAbstractAlbumL done with result=[%d]"), result);
+ return result;
+ }
+//Adds song to the database
+//WMP to MTP step1
+//By calling CMPXCollectionCachedHelper API AddL
+//precondition: c:\\data\\sounds\\digital\\1.wma on test emulator
+//precondition: e:\\data\\sounds\\digital\\1.wma on test HW
+//output: 1.wma is added into MPX DB
+TInt CCollectionHelperTestClass::AddSongL(CStifItemParser& /*aItem*/ )
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::AddSongL")));
+ //Does a record already exist for this abstractalbum?
+ //this is the part to check if the song already exist in db?
+ TInt result;
+ TPtrC name(KFileWmaSong);
+ TInt mediafound = FindMediaL(name, EMPXSong);
+
+ //media already in collection DB, no need to add
+ if (mediafound == 1)
+ {
+ return 0;
+ }
+
+ else if (mediafound == 0) //media not in collection DB, continue to add*/
+ {
+ // Create media properties for the song will added
+ iLog->Log(_L("Create media properties"));
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL(KMPXMediaIdGeneral);
+ contentIDs.AppendL(KMPXMediaIdAudio);
+ contentIDs.AppendL(KMPXMediaIdMusic);
+ contentIDs.AppendL(KMPXMediaIdMTP);
+
+ CMPXMedia* media = CMPXMedia::NewL(contentIDs.Array());
+ CleanupStack::PushL(media);
+ contentIDs.Close();
+
+ // MPXMedia default types
+ media->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem);
+ media->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXSong);
+
+ // File Path
+ TParsePtrC parse(name);
+
+ media->SetTextValueL(KMPXMediaGeneralUri, name);
+ media->SetTextValueL(KMPXMediaGeneralDrive, parse.Drive());
+
+ // Title
+ media->SetTextValueL(KMPXMediaGeneralTitle, parse.NameAndExt());
+ // Comment
+ media->SetTextValueL(KMPXMediaGeneralComment, KNullDesC);
+ // Artist
+ media->SetTextValueL(KMPXMediaMusicArtist, KNullDesC);
+ // Album
+ media->SetTextValueL(KMPXMediaMusicAlbum, KNullDesC);
+ //AlbumArtist
+ media->SetTextValueL(KMPXMediaMusicAlbumArtist, KAlbumArtistShort);
+ // Track
+ media->SetTextValueL(KMPXMediaMusicAlbumTrack, KNullDesC);
+ // Genre
+ media->SetTextValueL(KMPXMediaMusicGenre, KNullDesC);
+ // Composer
+ media->SetTextValueL(KMPXMediaMusicComposer, KNullDesC);
+ // URL
+ media->SetTextValueL(KMPXMediaMusicURL, KNullDesC);
+ iLog->Log(_L("Default values set to Media"));
+
+ // Update MPX WMP Roundtrip Metadata of the media object
+ media->SetTObjectValueL<TBool>(KMPXMediaGeneralDeleted, EFalse);
+ media->SetTObjectValueL<TBool>(KMPXMediaGeneralModified, EFalse);
+ media->SetTObjectValueL<TBool>(KMPXMediaGeneralSynchronized, ETrue);
+
+ media->SetTObjectValueL<TUint>(KMPXMediaGeneralFlags, KMPXMediaGeneralFlagsIsInvalid|KMPXMediaGeneralFlagsIsCorrupted);
+
+ // Add new media to collection
+ TRAP(result, iCachedHelper->AddL(media));
+ FTRACE(FPrint(_L("CCollectionHelperTestClass::AddSongL, Media added into collection")));
+
+ CleanupStack::PopAndDestroy(media);
+ }
+ iLog->Log(_L("CCollectionHelperTestClass::AddSongL done with result=[%d]"), result);
+
+ return result;
+ }
+
+//Adds abstractalbum to the database, *.alb file
+//WMP to MTP step2
+//By calling CMPXCollectionCachedHelper API AddL
+//precondition: c:\\data\\sounds\\digital\\1.alb on test emulator
+//precondition: e:\\data\\sounds\\digital\\1.alb on test HW
+//output: 1.alb is added into MPX DB
+TInt CCollectionHelperTestClass::AddAbstractAlbumL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTestClass::AddAbstractAlbumL")));
+ TInt result;
+ TPtrC name(KAbstractalbum1);
+ TInt mediafound = FindMediaL(name, EMPXAbstractAlbum);
+
+ //media already in collection DB, no need to add
+ if (mediafound == 1)
+ {
+ return 0;
+ }
+
+ else if(mediafound == 0) // media not in collection DB, continue to add*/
+ {
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL(KMPXMediaIdGeneral);
+
+ CMPXMediaArray* abstractalbumArray = CMPXMediaArray::NewL();
+ CleanupStack::PushL(abstractalbumArray);
+
+ CMPXMedia* media = CMPXMedia::NewL(contentIDs.Array());
+ CleanupStack::PushL(media);
+ contentIDs.Close();
+
+ // MPXMedia default types
+ media->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem);
+ //EMPXAbstractAlbum is the new category added for non-embedded art
+ media->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXAbstractAlbum);
+
+ // File Path
+ media->SetTextValueL(KMPXMediaGeneralUri, name);
+ TParsePtrC parse(name);
+ media->SetTextValueL(KMPXMediaGeneralDrive, parse.Drive());
+ media->SetTextValueL(KMPXMediaGeneralTitle, parse.Name());
+
+ //AlbumArtist
+ media->SetTextValueL(KMPXMediaMusicAlbumArtist, KAlbumArtistShort);
+ media->SetTObjectValueL<TBool>(KMPXMediaGeneralSynchronized, ETrue);
+ media->SetTObjectValueL( KMPXMediaMTPSampleDataFlag, EFalse );
+ media->SetCObjectValueL(KMPXMediaArrayContents, abstractalbumArray);
+ media->SetTObjectValueL(KMPXMediaArrayCount, abstractalbumArray->Count());
+
+ // Add new media to collection
+ TRAP( result, iCachedHelper->AddL(media));
+ CleanupStack::PopAndDestroy(media);
+
+ // Clear the array
+ CleanupStack::PopAndDestroy(abstractalbumArray);
+ }
+ iLog->Log(_L("CCollectionHelperTestClass::AddAbstractAlbumL done with result=[%d]"), result);
+ return result;
+ }
+
+//Associate abstractalbum with songs
+//WMP to MTP step3
+//By calling CMPXCollectionCachedHelper API SetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.wma
+// c:\\data\\sounds\\digital\\1.alb
+//precondition on HW : f:\\1.wma
+// f:\\1.alb
+//output: 1.wma and 1.alb is associated
+TInt CCollectionHelperTestClass::SetAbstractAlbumL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::SetAbstractAlbumL")));
+
+ CMPXMediaArray* mediaArray = CMPXMediaArray::NewL();
+ CleanupStack::PushL(mediaArray);
+ //add songs to media array
+ AttachSongsL(mediaArray, KFileWmaSong());
+ iLog->Log(_L("song added to abstractalbumArray, mediaArray->Count()=%d"), mediaArray->Count() );
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL(KMPXMediaIdGeneral);
+
+ CMPXMedia* abstractalbumMedia = CMPXMedia::NewL(contentIDs.Array());
+ CleanupStack::PushL(abstractalbumMedia);
+ contentIDs.Close();
+
+ abstractalbumMedia->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem);
+ abstractalbumMedia->SetTObjectValueL(KMPXMediaGeneralCategory, EMPXAbstractAlbum);
+
+ abstractalbumMedia->SetTextValueL(KMPXMediaGeneralUri, KAbstractalbum1());
+
+ TParsePtrC parse(KAbstractalbum1());
+ abstractalbumMedia->SetTextValueL(KMPXMediaGeneralDrive, parse.Drive());
+ abstractalbumMedia->SetTObjectValueL<TBool>(KMPXMediaGeneralSynchronized, ETrue);
+
+ abstractalbumMedia->SetCObjectValueL(KMPXMediaArrayContents, mediaArray);
+ abstractalbumMedia->SetTObjectValueL(KMPXMediaArrayCount, mediaArray->Count());
+
+ TRAPD( result, iCachedHelper->SetL(abstractalbumMedia));
+ CleanupStack::PopAndDestroy(abstractalbumMedia);
+
+ // Clear the array
+ CleanupStack::PopAndDestroy(mediaArray);
+ iLog->Log(_L("CCollectionHelperTestClass::SetAbstractAlbumL done with result=[%d]"), result);
+
+ return result;
+}
+
+//Update AlbumArtist field in Music table
+//By calling CMPXCollectionCachedHelper API SetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.wma
+//precondition on HW: f:\\1.wma
+//output: MUSIC.AlbumArtist field of song 1.wma is changed
+TInt CCollectionHelperTestClass::SetSongAlbumArtistL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::SetSongAlbumArtistL")));
+
+ CMPXMedia* media = NULL;
+
+ // Creat media properties for the song
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL( KMPXMediaIdGeneral );
+ contentIDs.AppendL( KMPXMediaIdAudio );
+ contentIDs.AppendL( KMPXMediaIdMusic );
+ contentIDs.AppendL( KMPXMediaIdMTP );
+
+ media = CMPXMedia::NewL( contentIDs.Array() );
+ CleanupStack::PushL( media ); // + media
+ contentIDs.Close();
+
+ media->SetTObjectValueL<TMPXGeneralCategory>(
+ KMPXMediaGeneralCategory,
+ EMPXSong );
+
+ // MPXMedia default types
+ media->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXItem );
+
+ // Get file path
+ media->SetTextValueL( KMPXMediaGeneralUri, KFileWmaSong() ); //wma test file
+
+ media->SetTextValueL( KMPXMediaGeneralDrive, KStoreRoot() );
+ media->SetTextValueL( KMPXMediaMusicAlbumArtist, KAlbumArtistShort());
+
+ TRAPD( result, iCachedHelper->SetL(media));
+
+ CleanupStack::PopAndDestroy( media ); // - media
+ iLog->Log(_L("CCollectionHelperTestClass::SetSongAlbumArtistL done with result=[%d]"), result);
+
+ return result;
+}
+//Retrive MUSIC.AlbumArtist field
+//By calling CMPXCollectionCachedHelper GetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.wma
+//precondition on HW: f:\\1.wma
+//output: song 1.wma is returned and MUSIC.AlbumArtist field of song 1.wma is retrived.
+TInt CCollectionHelperTestClass::GetSongAlbumArtistL(CStifItemParser& /*aItem*/)
+{
+ FTRACE(FPrint(_L("CCollectionHelperTest::GetSongAlbumArtistL")));
+ TMPXGeneralCategory category = EMPXSong;
+ // CMPXMedia* foundMedia= NULL;
+
+ const CMPXMedia& foundMedia = iCachedHelper->GetL( KFileWmaSong(), category );
+
+ if (foundMedia.IsSupported(KMPXMediaMusicAlbumArtist))
+ {
+ const TDesC& albumartist = foundMedia.ValueText( KMPXMediaMusicAlbumArtist );
+ }
+ iLog->Log(_L("CCollectionHelperTestClass::GetSongAlbumArtistL done "));
+
+ return 1;
+}
+
+
+
+//Update ABSTRACTALBUM.AlbumArtist
+//Update AlbumArtist field in Abstractalbum table
+//By calling CMPXCollectionCachedHelper API SetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.alb
+//precondition on HW: f:\\1.alb
+//output: ABSTRACTALBUM.AlbumArtist field of abstractalbum 1.alb is changed
+TInt CCollectionHelperTestClass::SetAbstractAlbumArtistL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::SetAbstractAlbumArtistL")));
+
+ CMPXMedia* media = NULL;
+
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL( KMPXMediaIdGeneral );
+
+ media = CMPXMedia::NewL( contentIDs.Array() );
+ CleanupStack::PushL( media ); // + media
+ contentIDs.Close();
+ media->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory,
+ EMPXAbstractAlbum );
+ media->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXItem );
+
+ media->SetTextValueL( KMPXMediaGeneralUri, KAbstractalbum1() );
+ media->SetTextValueL( KMPXMediaGeneralDrive, KStoreRoot() );
+
+ media->SetTextValueL( KMPXMediaMusicAlbumArtist, KAlbumArtistShort() );
+
+ TRAPD( result, iCachedHelper->SetL(media));
+
+ CleanupStack::PopAndDestroy(media);
+ iLog->Log(_L("CCollectionHelperTestClass::SetAbstractAlbumArtistL done with result=[%d]"), result);
+
+
+ return result;
+}
+
+//Retrieve ABSTRACTALBUM.AlbumArtist
+//By calling CMPXCollectionCachedHelper API GetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.alb
+//precondition on HW: f:\\1.alb
+//output: abstractalbum 1.alb is returned and ABSTRACTALBUM.AlbumArtist field of 1.alb is retrived.
+TInt CCollectionHelperTestClass::GetAbstractAlbumArtistL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::GetAbstractAlbumArtistL")));
+ TMPXGeneralCategory category = EMPXAbstractAlbum;
+ const CMPXMedia& foundMedia = iCachedHelper->GetL( KAbstractalbum1(), category ); //wma test file
+
+
+ //print out foundMedia attributes
+ if (foundMedia.IsSupported(KMPXMediaMusicAlbumArtist))
+ {
+ iLog->Log(_L("CCollectionHelperTestClass::GetAbstractAlbumArtistL, ABSTRACTALBUM.AlbumArtist retrived"));
+
+
+
+
+ const TDesC& albumartist = foundMedia.ValueText( KMPXMediaMusicAlbumArtist );
+
+ }
+
+ if (foundMedia.IsSupported(KMPXMediaGeneralTitle))
+ {
+
+
+ // HBufC* albumartist;
+ // albumartist = foundMedia.ValueText( KMPXMediaMusicAlbumArtist ).AllocLC(); // + data
+ const TDesC& name = foundMedia.ValueText( KMPXMediaGeneralTitle );
+ iLog->Log(_L("CCollectionHelperTestClass::GetAbstractAlbumArtistL, ABSTRACTALBUM.name retrived"));
+
+
+
+ }
+ if (foundMedia.IsSupported(KMPXMediaGeneralUri))
+ {
+
+
+ // HBufC* albumartist;
+ // albumartist = foundMedia.ValueText( KMPXMediaMusicAlbumArtist ).AllocLC(); // + data
+ const TDesC& uri = foundMedia.ValueText( KMPXMediaGeneralUri );
+ iLog->Log(_L("CCollectionHelperTestClass::GetAbstractAlbumArtistL, ABSTRACTALBUM.uri retrived"));
+
+ }
+ iLog->Log(_L("CCollectionHelperTestClass::GetAbstractAlbumArtistL done"));
+ return 1;
+ }
+
+
+//Update ABSTRACTALBUM.Name
+//Update Name field in Abstractalbum table
+//By calling CMPXCollectionCachedHelper API SetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.alb
+//precondition on HW: f:\\1.alb
+//output: ABSTRACTALBUM.name field of 1.alb is changed.
+TInt CCollectionHelperTestClass::UpdateAbstractAlbumNameL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::UpdateAbstractAlbumNameL")));
+ CMPXMedia* media = NULL;
+
+ // Creat media properties for the song
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL( KMPXMediaIdGeneral );
+
+ media = CMPXMedia::NewL( contentIDs.Array() );
+
+ CleanupStack::PushL( media ); // + media
+ contentIDs.Close(); //- contentIDs
+
+ media->SetTObjectValueL<TMPXGeneralCategory>(
+ KMPXMediaGeneralCategory,
+ EMPXAbstractAlbum );
+
+ media->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXItem );
+
+ media->SetTextValueL( KMPXMediaGeneralUri, KAbstractalbum1() );
+ media->SetTextValueL( KMPXMediaGeneralDrive, KStoreRoot() );
+
+ //media->SetTextValueL( KMPXMediaMusicAlbumArtist, KAbstractAlbumName() );
+ media->SetTextValueL( KMPXMediaGeneralTitle, KAbstractAlbumName() );
+ // media->SetTextValueL( KMPXMediaMusicAlbumArtFileName, KNewAbstractAlbumName() );
+
+ TRAPD( result, iCachedHelper->SetL(media));
+ CleanupStack::PopAndDestroy(media); // - media
+
+ iLog->Log(_L("CCollectionHelperTestClass::UpdateAbstractAlbumNameL, done with result[%d]"), result);
+ return result;
+}
+
+
+//Find all abstractalbums on KStoreRoot
+//Find all songs associated with the found Abstractalbums
+//By calling CMPXCollectionCachedHelper API GetL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.wma
+// c:\\data\\sounds\\digital\\1.alb
+//1.wma and 1.alb are associated
+//precondition on HW : f:\\1.wma
+// f:\\1.alb
+//1.wma and 1.alb are associated
+//all AbstractAlbum on drive c: (e:) is returned, all songs associated with the returned AbstractAlbum are returned.
+TInt CCollectionHelperTestClass::GetAbstractAlbumAndSongsL(CStifItemParser& /*aItem*/)
+ {
+ FTRACE(FPrint(_L("CCollectionHelperTest::GetAlbumAndSongsL")));
+ TUint32 abstractalbumId(0);
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL(KMPXMediaIdGeneral);
+
+ CMPXMedia* searchMedia = CMPXMedia::NewL(contentIDs.Array());
+ CleanupStack::PushL(searchMedia);
+ contentIDs.Close();
+
+ searchMedia->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem);
+ searchMedia->SetTObjectValueL(KMPXMediaGeneralCategory, EMPXAbstractAlbum);
+ searchMedia->SetTextValueL(KMPXMediaGeneralDrive, KStoreRoot());
+
+ RArray<TMPXAttribute> abstractalbumAttributes;
+ CleanupClosePushL(abstractalbumAttributes);
+ abstractalbumAttributes.AppendL(KMPXMediaGeneralId);
+ abstractalbumAttributes.AppendL(KMPXMediaGeneralTitle);
+ abstractalbumAttributes.AppendL(KMPXMediaGeneralUri);
+
+ //foundMedia will hold all .alb on KStoreRoot()
+ CMPXMedia* foundMedia = NULL;
+ TRAPD( err, foundMedia = iCachedHelper->FindAllL(
+ *searchMedia, abstractalbumAttributes.Array()));
+
+ iLog->Log(_L("CCollectionHelperTestClass::GetAlbumAndSongsL, foundMedia assigned from FindAllL"));
+
+ CleanupStack::PopAndDestroy(&abstractalbumAttributes);
+ CleanupStack::PopAndDestroy(searchMedia);
+ CleanupStack::PushL(foundMedia); //+ foundMedia
+
+ if ( err != KErrNone )
+ {
+ iLog->Log(_L("CCollectionHelperTestClass::GetAlbumAndSongsL, err = [%d]"), err );
+ iCachedHelper->Close();
+ iCachedHelper = NULL;
+ User::Leave( KErrGeneral );
+ }
+
+ if (!foundMedia->IsSupported(KMPXMediaArrayCount))
+ {
+ User::Leave(KErrNotSupported);
+ }
+
+ TInt foundItemCount = *foundMedia->Value<TInt>(KMPXMediaArrayCount);
+ iLog->Log(_L("CCollectionHelperTestClass::GetAlbumAndSongsL, foundItemCount=%d"), foundItemCount );
+
+ CMPXMediaArray* foundArray =
+ foundMedia->Value<CMPXMediaArray>(KMPXMediaArrayContents);
+ CleanupStack::PopAndDestroy(foundMedia);
+
+ for (TInt j = 0; j < foundItemCount; ++j)
+ {
+ CMPXMedia* abstractalbumMedia = CMPXMedia::NewL(*(*foundArray)[j]);
+ CleanupStack::PushL(abstractalbumMedia);
+
+ //to print out founded media attributes
+ if (abstractalbumMedia->IsSupported(KMPXMediaGeneralTitle))
+ {
+ const TDesC& name = abstractalbumMedia->ValueText( KMPXMediaGeneralTitle );
+ iLog->Log(_L("CCollectionHelperTestClass::GetAlbumAndSongsL, found abstractalbumName = [%s]"), name );
+ }
+
+ if (abstractalbumMedia->IsSupported(KMPXMediaGeneralId))
+ {
+ abstractalbumId = abstractalbumMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
+ abstractalbumMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
+ }
+
+ // find the media object that contains a list of songs in the abstractalbum
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL(KMPXMediaIdGeneral);
+
+ CMPXMedia* searchMediaSong = CMPXMedia::NewL(contentIDs.Array());
+ CleanupStack::PushL(searchMediaSong);
+ contentIDs.Close();
+
+ searchMediaSong->SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup);
+
+ searchMediaSong->SetTObjectValueL(KMPXMediaGeneralCategory, EMPXSong);
+ searchMediaSong->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, abstractalbumId);
+
+ RArray<TMPXAttribute> songAttributes;
+ CleanupClosePushL(songAttributes);
+ songAttributes.AppendL(KMPXMediaGeneralId);
+ songAttributes.AppendL(KMPXMediaGeneralUri);
+
+ //search from MPX collection to get all songs associated with .alb
+ CMPXMedia* foundSongs = NULL;
+ TRAPD( err, foundSongs = iCachedHelper->FindAllL(
+ *searchMediaSong, songAttributes.Array()));
+
+ CleanupStack::PopAndDestroy(&songAttributes);
+ CleanupStack::PopAndDestroy(searchMediaSong);
+ CleanupStack::PopAndDestroy(abstractalbumMedia);
+
+ CleanupStack::PushL( foundSongs ); // + foundSongs
+ if ( err != KErrNone )
+ {
+ iLog->Log(_L("CCollectionHelperTestClass::GetAlbumAndSongsL, err = [%d]"), err );
+ iCachedHelper->Close();
+ iCachedHelper = NULL;
+ User::Leave( KErrGeneral );
+ }
+
+ if (!foundSongs->IsSupported(KMPXMediaArrayCount))
+ {
+ User::Leave(KErrNotSupported);
+ }
+
+ // Number of references
+ TInt numOfSongsRefs = *foundSongs->Value<TInt>(KMPXMediaArrayCount);
+ iLog->Log(_L("CCollectionHelperTestClass::GetAlbumAndSongsL, numOfSongsRefs=%d"), numOfSongsRefs );
+ CleanupStack::PopAndDestroy( foundSongs ); // - foundSong
+ }
+ return 1;
+ }
+
+
+//By calling CMPXCollectionCachedHelper API RenameL
+//precondition on emulator: c:\\data\\sounds\\digital\\1.wma
+// c:\\data\\sounds\\digital\\1.alb
+//1.wma and 1.alb are associated
+//precondition on HW : f:\\1.wma
+// f:\\1.alb
+//output: 1.alb is renamed to 2.alb and all songs associated with 1.alb are updated in MUSIC table
+TInt CCollectionHelperTestClass::RenameAbstractAlbumL(CStifItemParser& /*aItem*/)
+ {
+ TRAPD( result, iCachedHelper->RenameL( KAbstractalbum1, KAbstractalbum2, EMPXAbstractAlbum ) );
+ iLog->Log(_L("CCollectionHelperTestClass::RenameAbstractAlbumL, done with result=[%d]"));
+
+ return result;
+ }
+
+//Helper function for Finding in the MPX DB
+//By calling CMPXCollectionCachedHelper API FindAllL
+//output: all media with filename: aPath and aCategory is returned
+TInt CCollectionHelperTestClass::FindMediaL(const TDesC& aPath, TMPXGeneralCategory aCategory)
+{
+ FTRACE(FPrint(_L("CCollectionHelperTestClass::FindL")));
+ // Check does a record already exist for this aPath(URI)?
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL( KMPXMediaIdGeneral );
+
+ CMPXMedia* searchMedia = CMPXMedia::NewL( contentIDs.Array() );
+ CleanupStack::PushL( searchMedia ); // + searchMedia
+ contentIDs.Close();
+ searchMedia->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
+ searchMedia->SetTObjectValueL( KMPXMediaGeneralCategory, aCategory );
+ searchMedia->SetTextValueL( KMPXMediaGeneralUri, aPath );
+
+//note: some of the attributes are not needed
+ RArray<TMPXAttribute> mediaAttributes;
+ CleanupClosePushL( mediaAttributes ); // + mediaAttributes
+ mediaAttributes.AppendL( KMPXMediaGeneralId );
+ mediaAttributes.AppendL( KMPXMediaGeneralTitle );
+ mediaAttributes.AppendL( KMPXMediaGeneralUri );
+
+ CMPXMedia* foundMedia = iCachedHelper->FindAllL( *searchMedia,
+ mediaAttributes.Array() );
+
+ CleanupStack::PopAndDestroy( &mediaAttributes ); // - mediaAttributes
+ CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia
+ CleanupStack::PushL( foundMedia ); // + foundMedia
+
+ if ( !foundMedia->IsSupported( KMPXMediaArrayCount ) )
+ {
+ CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia
+ return KErrNotSupported;
+ }
+ TInt foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount );
+ CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia
+
+ iLog->Log(_L("CCollectionHelperTestClass::FindMediaL, foundItemCount=[%d]"), foundItemCount);
+ if ( foundItemCount >1) //more than 1 same item in collection
+ {
+ iLog->Log(_L("CCollectionHelperTestClass::FindMediaL, error, find more than 1 same media in collection"));
+ return KErrGeneral;
+ }
+
+ else if ( foundItemCount ==0 || foundItemCount ==1 ) //no such item in collection
+ {
+ iLog->Log(_L("CCollectionHelperTestClass::FindMediaL, error, no this item in collection"));
+ return foundItemCount;
+ }
+
+ return KErrNone;
+ }
+
+
+
+//Helper function for appending songs for SetAbstractAlbumL()
+void CCollectionHelperTestClass::AttachSongsL(CMPXMediaArray* aAbstractAlbumArray, const TDesC& aPath)
+{
+ FTRACE(FPrint(_L("CCollectionHelperTestClass::AttachSongsL")));
+ RArray<TInt> contentIDs;
+ contentIDs.AppendL(KMPXMediaIdGeneral);
+ contentIDs.AppendL(KMPXMediaIdAudio);
+ contentIDs.AppendL(KMPXMediaIdMusic);
+ contentIDs.AppendL(KMPXMediaIdMTP);
+ CMPXMedia* media = CMPXMedia::NewL(contentIDs.Array());
+ CleanupStack::PushL(media);
+ contentIDs.Close();
+
+ // MPXMedia default types
+ media->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem);
+ media->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXSong);
+ // File Path
+ TParsePtrC parse(aPath);
+ media->SetTextValueL(KMPXMediaGeneralUri, aPath);
+ media->SetTextValueL(KMPXMediaGeneralDrive, parse.Drive());
+
+ // Add media into array contents
+ aAbstractAlbumArray->AppendL(media);
+ CleanupStack::Pop(media);
+}
+
// -----------------------------------------------------------------------------
// CCollectionHelperTestClass::CloseUiHelperL()
// Returns: Symbian OS errors.
--- a/mmappfw_plat/collection_helper_api/tsrc/conf/CollectionHelperTestClass.cfg Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/collection_helper_api/tsrc/conf/CollectionHelperTestClass.cfg Mon May 03 12:58:40 2010 +0300
@@ -66,4 +66,165 @@
[Endtest]
+[Test]
+title 4. Add Song
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test AddSong
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+title 5. Remove Song
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test RemoveSong
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 6. AddAbstractAlbum
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test AddAbstractAlbum
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 7. Remove AbstractAlbum
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test RemoveAbstractAlbum
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+RemoveAbstractAlbumL
+
+
+[Test]
+title 8. Associate Song with AbstractAlbum
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test SetAbstractAlbum
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+
+
+[Test]
+title 9. Set SongAlbumArtist
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test SetSongAlbumArtist
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+
+
+[Test]
+title 10. Get SongAlbumArtist
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test GetSongAlbumArtist
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 11. set AbstractAlbumArtist
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test SetAbstractAlbumArtist
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+
+[Test]
+title 12. Get AbstractAlbumArtist
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test GetAbstractAlbumArtist
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+
+
+[Test]
+title 13. Update AbstractAlbumName
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test UpdateAbstractAlbumName
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+
+
+title 14. Get AbstractAlbum and Songs
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test GetAbstractAlbumAndSongs
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+
+title 15. Rename AbstractAlbum
+create CollectionHelperTestClass test
+test OpenCollectionUtility
+waittestclass test
+test NewCachedHelper
+test RenameAbstractAlbum
+test CloseCachedHelper
+delete test
+pause 1000
+[Endtest]
+[Test]
+
+
+
+
+
+
+
+
+
\ No newline at end of file
--- a/mmappfw_plat/collection_helper_api/tsrc/group/bld.inf Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/collection_helper_api/tsrc/group/bld.inf Mon May 03 12:58:40 2010 +0300
@@ -28,5 +28,3 @@
PRJ_TESTMMPFILES
#include "../CollectionHelperTestClass/group/bld.inf"
-
-PRJ_TESTMMPFILES
--- a/mmappfw_plat/collection_helper_api/tsrc/init/TestFramework.ini Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/collection_helper_api/tsrc/init/TestFramework.ini Mon May 03 12:58:40 2010 +0300
@@ -1,5 +1,5 @@
#
-# This is STIF initialization file
+# This is STIFTestFramework initialization file
# Comment lines start with '#'-character.
# See STIF TestFramework users guide.doc for instructions
@@ -29,15 +29,12 @@
#
# - File Creation Mode indicates test report overwriting if file exist.
# + OVERWRITE, Overwrites if the Test report file exist.
-# + APPEND, Continue logging after the old Test report information if
+# + APPEND, Continue logging after the old Test report information if
# report exist.
# - Sets a device reset module's dll name(Reboot).
# + If Nokia specific reset module is not available or it is not correct one
# StifHWResetStub module may use as a template for user specific reset
-# module.
-# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
-# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
-#
+# module.
[Engine_Defaults]
@@ -46,8 +43,9 @@
CreateTestReport= YES # Possible values: YES or NO
-TestReportFilePath= C:\LOGS\TestFramework\
-TestReportFileName= TestReport_CollectionHelperTestClass
+#TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFilePath= c:\testing\log\
+TestReportFileName= TestReport
TestReportFormat= TXT # Possible values: TXT or HTML
TestReportOutput= FILE # Possible values: FILE or RDEBUG
@@ -55,14 +53,6 @@
DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-DisableMeasurement= stifmeasurementdisablenone # Possible values are:
- # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
- # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
- # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
- # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
-
-Timeout= 0 # Default timeout value for each test case. In milliseconds
-UITestingSupport= YES
[End_Defaults]
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
@@ -88,29 +78,28 @@
# In the simplest case it is enough to specify only the
# name of the test module when adding new test module
-[New_Module]
-ModuleName= testscripter
-TestCaseFile= c:\testframework\CollectionHelperTestClass.cfg
-[End_Module]
+#[New_Module]
+#ModuleName= demomodule
+#[End_Module]
# Load testmoduleXXX, optionally with initialization file and/or test case files
-#[New_Module]
-#ModuleName= testmodulexxx
+[New_Module]
+ModuleName= testscripter
#TestModuleXXX used initialization file
#IniFile= c:\testframework\init.txt
#TestModuleXXX used configuration file(s)
-#TestCaseFile= c:\testframework\testcases1.cfg
-#TestCaseFile= c:\testframework\testcases2.cfg
-#TestCaseFile= c:\testframework\manualtestcases.cfg
-
-#[End_Module]
+#TestCaseFile= c:\testframework\epos_omasuplpostestercfg.cfg
+TestCaseFile= c:\testframework\CollectionHelperTestClass.cfg
+[End_Module]
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIF logging overwrite parameters for Logger.
+# Set STIFTestFramework logging overwrite parameters for Logger.
# Hardware and emulator environment logging path and styles can
# be configured from here to overwrite the Logger's implemented values.
#
@@ -155,40 +144,33 @@
# + NO, No line break(s).
#
# - Will event ranking include to the log file.
-# + YES, Event ranking number added to each line in log file(s). Ranking number
+# + YES, Event ranking number added to each line in log file(s). Ranking number
# depends on environment's tics, for example(includes time stamp also)
# '012 12.Nov.2003 115958 LOGGING INFO'
# + NO, No event ranking.
#
-# - Will write log file in unicode format.
-# + YES, Log file will be written in unicode format
-# + NO, Log will be written as normal, not unicode, file.
-#
[Logger_Defaults]
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-#NOTE: TestEngine and TestServer logging settings cannot change here
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-#CreateLogDirectories= YES # Possible values: YES or NO
+#CreateLogDirectories= YES # Possible values: YES or NO
#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML # Possible values: TXT or HTML
-#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
+#EmulatorFormat= HTML # Possible values: TXT or HTML
+#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
#HardwareBasePath= D:\LOGS\TestFramework\
-#HardwareFormat= HTML # Possible values: TXT or HTML
-#HardwareOutput= FILE # Possible values: FILE or RDEBUG
+#HardwareFormat= HTML # Possible values: TXT or HTML
+#HardwareOutput= FILE # Possible values: FILE or RDEBUG
-#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-#ThreadIdToLogFile= YES # Possible values: YES or NO
-#WithTimeStamp= YES # Possible values: YES or NO
-#WithLineBreak= YES # Possible values: YES or NO
-#WithEventRanking= YES # Possible values: YES or NO
+#ThreadIdToLogFile= YES # Possible values: YES or NO
+#WithTimeStamp= YES # Possible values: YES or NO
+#WithLineBreak= YES # Possible values: YES or NO
+#WithEventRanking= YES # Possible values: YES or NO
-#FileUnicode= YES # Possible values: YES or NO
-#AddTestCaseTitle= YES # Possible values: YES or NO
[End_Logger_Defaults]
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--- a/mmappfw_plat/group/bld.inf Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/group/bld.inf Mon May 03 12:58:40 2010 +0300
@@ -13,7 +13,7 @@
*
* Description: Includes all the Domain API specific bld.inf files, which
* export files.
-* Version : %version: da1ido#1.1.4.1.3.3.5 %
+* Version : %version: 1.1.4.1.3.3.6 %
*
*/
--- a/mmappfw_plat/harvester_collection_mediator_api/inc/mpxcollectionmediator.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/harvester_collection_mediator_api/inc/mpxcollectionmediator.h Mon May 03 12:58:40 2010 +0300
@@ -89,6 +89,14 @@
IMPORT_C void AddItemL( CMPXMedia*& aMediaProp );
/**
+ * Add a media to the collection asynchronously.
+ *
+ * @param aMediaProp media item.
+ * @leave KErrArgument leave if not a supported media type
+ */
+ IMPORT_C void AddItemAsyncL( CMPXMedia*& aMediaProp );
+
+ /**
* Add a list of files to the collection db.
* @since S60 v3.2.3
* @param aArray list of media item.
--- a/mmappfw_plat/harvester_collection_mediator_api/tsrc/group/bld.inf Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/harvester_collection_mediator_api/tsrc/group/bld.inf Mon May 03 12:58:40 2010 +0300
@@ -29,4 +29,4 @@
PRJ_TESTMMPFILES
#include "../HarvesterCollectionMediatorTest/group/bld.inf"
-PRJ_TESTMMPFILES
+
--- a/mmappfw_plat/harvester_metadata_extractor_api/inc/mpxmetadataextractor.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/harvester_metadata_extractor_api/inc/mpxmetadataextractor.h Mon May 03 12:58:40 2010 +0300
@@ -168,6 +168,13 @@
const TDesC& aFile,
TDesC8& aValue);
+ /**
+ * Check if can send request to TNM or not.
+ * @since 5.0
+ *
+ */
+ void CheckBeforeSendRequest();
+
private:
/**
--- a/mmappfw_plat/harvester_server_api/group/bld.inf Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/harvester_server_api/group/bld.inf Mon May 03 12:58:40 2010 +0300
@@ -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)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappfw_plat/harvester_server_api/inc/mpxharvestercrkeys.h Mon May 03 12:58:40 2010 +0300
@@ -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
--- a/mmappfw_plat/mpx_albumart_utility_api/inc/mpxalbumartutility.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_albumart_utility_api/inc/mpxalbumartutility.h Mon May 03 12:58:40 2010 +0300
@@ -21,7 +21,7 @@
#include <e32def.h>
#include <gdi.h>
-#include <metadatafield.hrh>
+#include <MetaDataField.hrh>
class CMPXMedia;
class CMPXImageUtil;
--- a/mmappfw_plat/mpx_common_api/inc/mpxmediageneraldefs.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_common_api/inc/mpxmediageneraldefs.h Mon May 03 12:58:40 2010 +0300
@@ -451,7 +451,7 @@
EMPXFile,
EMPXImage,
EMPXVideo,
- EMPXRadio,
+ EMPXAbstractAlbum,
EMPXMessage,
EMPXTag,
EMPXCommand,
--- a/mmappfw_plat/mpx_common_api/inc/mpxmediamtpdefs.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_common_api/inc/mpxmediamtpdefs.h Mon May 03 12:58:40 2010 +0300
@@ -34,6 +34,7 @@
* Attributes supported for KMPXMediaIdMTP
*/
const TMPXAttributeData KMPXMediaMTPDrmStatus = {KMPXMediaIdMTP, 0x0001}; // TUint16
+const TMPXAttributeData KMPXMediaMTPSampleDataFlag = {KMPXMediaIdMTP, 0x0002}; // TBool
const TMPXAttributeData KMPXMediaMTPAll = {KMPXMediaIdMTP, 0xffffffff};
#endif // MPXMEDIAMTPDEFS_H
--- a/mmappfw_plat/mpx_common_api/inc/mpxmediamusicdefs.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_common_api/inc/mpxmediamusicdefs.h Mon May 03 12:58:40 2010 +0300
@@ -44,6 +44,8 @@
const TMPXAttributeData KMPXMediaMusicOriginalAlbumArtFileName={KMPXMediaIdMusic,0x200}; // Text
const TMPXAttributeData KMPXMediaMusicAlbumArtThumbnail={KMPXMediaIdMusic,0x400}; // CFbsImage
const TMPXAttributeData KMPXMediaMusicAlbumArtThumbnailSize={KMPXMediaIdMusic,0x800}; // TSint
+const TMPXAttributeData KMPXMediaMusicAlbumArtChanged={KMPXMediaIdMusic,0x1000}; // TInt
+const TMPXAttributeData KMPXMediaMusicAlbumArtist={KMPXMediaIdMusic,0x2000}; // Text
const TMPXAttributeData KMPXMediaMusicAll={KMPXMediaIdMusic,0xffffffff}; // Text
/**
@@ -65,6 +67,7 @@
EMPXMediaMusicOriginalAlbumArtFileName=0x200, // Text
EMPXMediaMusicAlbumArtThumbnail=0x400,
EMPXMediaMusicAlbumArtThumbnailSize=0x800,
+ EMPXMediaMusicAlbumArtist=0x2000,
EMPXMediaMusicAll=0xffffffff
};
--- a/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackframeworkdefs.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackframeworkdefs.h Mon May 03 12:58:40 2010 +0300
@@ -164,7 +164,8 @@
EPbAccessoryLoopset = 0x00000020,
EPbAccessoryMusicStand = 0x00000040,
EPbAccessoryTVOut = 0x00000080,
- EPbAccessoryHeadphones = 0x00000100
+ EPbAccessoryHeadphones = 0x00000100,
+ EPbAccessoryHDMI = 0x00000200
};
#else
/**
--- a/mmappfw_plat/mpx_playback_utility_api/tsrc/conf/mpxplaybackutilitytest.cfg Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/conf/mpxplaybackutilitytest.cfg Mon May 03 12:58:40 2010 +0300
@@ -1,40 +1,253 @@
+
+[Define]
+KErrNotFound -1
+KErrNotSupported -5
+KErrArgument -6
+KErrNotReady -18
+KErrAccessDenied -21
+
+KTrue 1
+KFalse 0
+
+// UID definition for playback mode
+KPbModeDefault 271067440 // 0x10282930 Uses same player as any other player running in same.
+KPbModeActivePlayer 271067441 // 0x10282931 Currently active player or any player if no active player.
+KPbModeNewPlayer 271067442 // 0x10282932 New player
+KPbModeAppUID 111 // Application UID
+
+// Category for playback utility creation.
+KMPXCategoryUndefined 0
+KMPXCategoryMusic 1
+KMPXCategoryVideo 2
+
+// UID for Helix Plugin
+KVideoHelixPlaybackPluginUid 271066449 // 0x10282551
+
+// Timers
+KTimerEndTest 5000 // 5 sec
+
+[Enddefine]
+
[Test]
+//
+// Test NewL
+// - Mode NewPlayer
+// - Category Default(Music)
+//
title 1 MMPXPlaybackUtilityNewL
-create mpxplaybackutilitytest foobar
-foobar MMPXPlaybackUtilityNewL
-delete foobar
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityNewL KPbModeNewPlayer
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test NewL
+// - Mode ActivePlayer
+// - Category Video
+//
+title 2 MMPXPlaybackUtilityNewL with category video
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityNewWithCatL KMPXCategoryVideo KPbModeActivePlayer
+pbutil EndTest
+delete pbutil
[Endtest]
[Test]
-title 2 MMPXPlaybackUtilityUtilityL
-create mpxplaybackutilitytest foobar
-foobar MMPXPlaybackUtilityUtilityL
-delete foobar
+//
+// Test UtilityL
+// - Mode UID
+// - Category Default(Music)
+//
+title 3 MMPXPlaybackUtilityUtilityL
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityL KPbModeAppUID
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test UtilityL
+// - Mode Default
+// - Category Video
+//
+title 4 MMPXPlaybackUtilityUtilityL with category video
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeDefault
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test InitL with Playlist
+// - Mode NewPlayer
+// - Category Default (Music)
+//
+title 5 MMPXPlaybackUtilityInitL(playlist)
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityL KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityInitWithPlaylistL
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test InitL with URI
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - InitL with URI, File Battle_160x100_30kbps.rm
+//
+title 6 MMPXPlaybackUtilityInitL(uri)
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
[Endtest]
[Test]
-title 3 MMPXPlaybackUtilityInit64L
-create mpxplaybackutilitytest foobar
-foobar MMPXPlaybackUtilityNewL
-foobar MMPXPlaybackUtilityInit64L Battle_160x100_30kbps.rm
-delete foobar
+//
+// Test InitL with URI
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - InitL with URI, File XVID_176x144_15fps_261Kbps.avi
+//
+title 7 MMPXPlaybackUtilityInitL(uri)
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInitWithUriL XVID_176x144_15fps_261Kbps.avi
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test InitL with RFile
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - InitL with RFile, File 20k_H263_WB_176x144_15fps.3gp
+//
+title 8 MMPXPlaybackUtilityInitL(rfile)
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInitWithRFileL 20k_H263_WB_176x144_15fps.3gp
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test InitStreamingL with URI
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - InitStreamingL with URI, File 30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4
+//
+title 9 MMPXPlaybackUtilityInitStreamingL(uri)
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInitStreamingWithUriL 30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
[Endtest]
[Test]
-title 4 MMPXPlaybackUtilityInitStreaming64L
-create mpxplaybackutilitytest foobar
-foobar MMPXPlaybackUtilityNewL
-foobar MMPXPlaybackUtilityInitStreaming64L Battle_160x100_30kbps.rm
-delete foobar
+//
+// Test InitStreamingL with RFile
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - InitStreamingL with RFile, File 80k_H264_AAC16M22_176x144_15fps.3gp
+//
+title 10 MMPXPlaybackUtilityInitStreamingL(rfile)
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInitStreamingWithRFileL 80k_H264_AAC16M22_176x144_15fps.3gp
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
+[Endtest]
+
+[Test]
+//
+// Test Init64L
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - Init64L with RFile64, File DivX_MP3_256x112_30fps_300Kbps.avi
+//
+title 11 MMPXPlaybackUtilityInit64L
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInit64L DivX_MP3_256x112_30fps_300Kbps.avi
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
[Endtest]
[Test]
-title 5 MMPXPlaybackUtilityFile64L
-create mpxplaybackutilitytest foobar
-foobar MMPXPlaybackUtilityNewL
-foobar MMPXPlaybackUtilityInit64L Battle_160x100_30kbps.rm
-foobar MMPXPlaybackUtilityFile64L
-delete foobar
+//
+// Test InitStreaming64L
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - InitStreaming64L with RFile64, File honey_im_home_horror_ad.avi
+//
+title 12 MMPXPlaybackUtilityInitStreaming64L
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInitStreaming64L honey_im_home_horror_ad.avi
+pause KTimerEndTest
+pbutil EndTest
+delete pbutil
[Endtest]
+[Test]
+//
+// Test File64L
+// - UtilityL with Mode NewPlayer, Category Video
+// - Add Observer
+// - SelectPlayerL with HelixPlugin UID
+// - Init64L with RFile64, File MPEG4_VBR_176x144_15fps.3gp
+// - File64L to get RFile64 file handler
+//
+title 13 MMPXPlaybackUtilityFile64L
+create mpxplaybackutilitytest pbutil
+pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer
+pbutil MMPXPlaybackUtilityAddObserverL
+pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid
+pbutil MMPXPlaybackUtilityInit64L MPEG4_VBR_176x144_15fps.3gp
+pause KTimerEndTest
+pbutil MMPXPlaybackUtilityFile64L
+pbutil EndTest
+delete pbutil
+[Endtest]
+
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/20k_H263_WB_176x144_15fps.3gp has changed
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4 has changed
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/80k_H264_AAC16M22_176x144_15fps.3gp has changed
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/DivX_MP3_256x112_30fps_300Kbps.avi has changed
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/MPEG4_VBR_176x144_15fps.3gp has changed
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/XVID_176x144_15fps_261Kbps.avi has changed
Binary file mmappfw_plat/mpx_playback_utility_api/tsrc/data/mmc/honey_im_home_horror_ad.avi has changed
--- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.mmp Mon May 03 12:58:40 2010 +0300
@@ -54,6 +54,7 @@
LIBRARY stiftestengine.lib
LIBRARY mpxplaybackutility.lib
LIBRARY mpxcommon.lib
+LIBRARY mpxcollectionutility.lib
LANG SC
--- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.pkg Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.pkg Mon May 03 12:58:40 2010 +0300
@@ -21,7 +21,7 @@
&EN
; Provide value for uid
-#{"STIF mpxplaybackutilitytest Application"},(0x10005942),1,1,0,TYPE=SA
+#{"MPX PlaybackUtility STIF"}, (0x101FB3E3), 1, 0, 1, TYPE=SA, RU
; Series60 product id for S60 3.0
[0x101F7961], 0, 0, 0, {"Series60ProductID"}
@@ -32,35 +32,16 @@
; Unique Vendor name
:"Nokia"
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
+; Install files
+"\epoc32\release\armv5\udeb\mpxplaybackutilitytest.dll" - "!:\Sys\Bin\mpxplaybackutilitytest.dll"
+"..\..\init\TestFramework.ini" - "c:\testframework\TestFramework.ini"
+"..\..\conf\mpxplaybackutilitytest.cfg" - "c:\testframework\mpxplaybackutilitytest.cfg"
-; Install files
-"..\..\data\mmc\Battle_160x100_30kbps.rm" - "e:\testing\data\Battle_160x100_30kbps.rm"
-
-"..\..\init\TestFramework.ini" - "c:\testframework\TestFramework.ini"
-"..\..\conf\mpxplaybackutilitytest.cfg" - "c:\testframework\mpxplaybackutilitytest.cfg"
-
-"\epoc32\release\armv5\udeb\mpxplaybackutilitytest.dll" - "c:\Sys\Bin\mpxplaybackutilitytest.dll"
-
-; Embedded SIS
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
+"..\..\data\mmc\Battle_160x100_30kbps.rm" - "f:\testing\data\Battle_160x100_30kbps.rm"
+"..\..\data\mmc\20k_H263_WB_176x144_15fps.3gp" - "f:\testing\data\20k_H263_WB_176x144_15fps.3gp"
+"..\..\data\mmc\30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4" - "f:\testing\data\30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4"
+"..\..\data\mmc\80k_H264_AAC16M22_176x144_15fps.3gp" - "f:\testing\data\80k_H264_AAC16M22_176x144_15fps.3gp"
+"..\..\data\mmc\DivX_MP3_256x112_30fps_300Kbps.avi" - "f:\testing\data\DivX_MP3_256x112_30fps_300Kbps.avi"
+"..\..\data\mmc\honey_im_home_horror_ad.avi" - "f:\testing\data\honey_im_home_horror_ad.avi"
+"..\..\data\mmc\MPEG4_VBR_176x144_15fps.3gp" - "f:\testing\data\MPEG4_VBR_176x144_15fps.3gp"
+"..\..\data\mmc\XVID_176x144_15fps_261Kbps.avi" - "f:\testing\data\XVID_176x144_15fps_261Kbps.avi"
--- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytest.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytest.h Mon May 03 12:58:40 2010 +0300
@@ -27,11 +27,8 @@
#include <TestclassAssert.h>
#include <mpxplaybackutility.h>
#include <mpxplaybackobserver.h>
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
// MACROS
-//#define ?macro ?macro_def
#define TEST_CLASS_VERSION_MAJOR 0
#define TEST_CLASS_VERSION_MINOR 0
#define TEST_CLASS_VERSION_BUILD 0
@@ -45,26 +42,29 @@
// data file
_LIT( KmpxplaybackutilityTestFilePath, "C:\\testing\\data\\" );
#else
-_LIT( KmpxplaybackutilitytestLogPath, "\\logs\\testframework\\mpxplaybackutilitytest\\" );
+_LIT( KmpxplaybackutilitytestLogPath, "f:\\logs\\testframework\\mpxplaybackutilitytest\\" );
// Log file
_LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" );
_LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" );
// data file
-_LIT( KmpxplaybackutilityTestFilePath, "e:\\testing\\data\\" );
+_LIT( KmpxplaybackutilityTestFilePath, "f:\\testing\\data\\" );
#endif
+
// FUNCTION PROTOTYPES
//?type ?function_name(?arg_list);
// FORWARD DECLARATIONS
//class ?FORWARD_CLASSNAME;
-class Cmpxplaybackutilitytest;
-class MMPXPlaybackUtility;
-class MMPXPlaybackObserver;
// DATA TYPES
-//enum ?declaration
-//typedef ?declaration
-//extern ?data_type;
+typedef struct
+{
+ TInt iEvent;
+ TInt iType;
+ TInt iData;
+} TMpxPlaybackTestEvent;
+
+typedef CArrayPtrFlat<TMpxPlaybackTestEvent> CMpxPlaybackTestEventArray;
// CLASS DECLARATION
@@ -76,82 +76,151 @@
* @since ?Series60_version
*/
NONSHARABLE_CLASS(Cmpxplaybackutilitytest) : public CScriptBase,
- public MMPXPlaybackObserver
+ public MMPXPlaybackObserver,
+ public MMPXPlaybackCallback
{
- public: // Constructors and destructor
+public: // Constructors and destructor
- /**
- * Two-phased constructor.
- */
- static Cmpxplaybackutilitytest* NewL( CTestModuleIf& aTestModuleIf );
+ /**
+ * Two-phased constructor.
+ */
+ static Cmpxplaybackutilitytest* NewL( CTestModuleIf& aTestModuleIf );
- /**
- * Destructor.
- */
- virtual ~Cmpxplaybackutilitytest();
+ /**
+ * Destructor.
+ */
+ virtual ~Cmpxplaybackutilitytest();
-
- public: // Functions from base classes
+public: // Functions from base classes
- /**
- * From CScriptBase Runs a script line.
- * @since ?Series60_version
- * @param aItem Script line containing method name and parameters
- * @return Symbian OS error code
- */
- virtual TInt RunMethodL( CStifItemParser& aItem );
-
- // From base class MMPXPlaybackObserver
- /**
- * Handle playback message
- *
- * @since 3.1
- * @param aMessage playback message
- * @param aErr system error code.
- */
- void HandlePlaybackMessage(
- CMPXMessage* aMessage, TInt aError );
- private:
+ /**
+ * From CScriptBase Runs a script line.
+ * @since ?Series60_version
+ * @param aItem Script line containing method name and parameters
+ * @return Symbian OS error code
+ */
+ virtual TInt RunMethodL( CStifItemParser& aItem );
+
+ // From base class MMPXPlaybackObserver
+ /**
+ * Handle playback message
+ *
+ * @since 3.1
+ * @param aMessage playback message
+ * @param aErr system error code.
+ */
+ void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
+
+ /**
+ * Handle playback property.
+ *
+ * @since S60 3.2.3
+ * @param aProperty the property
+ * @param aValue the value of the property
+ * @param aError error code
+ */
+ void HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError);
- /**
- * C++ default constructor.
- */
- Cmpxplaybackutilitytest( CTestModuleIf& aTestModuleIf );
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
- // Prohibit copy constructor if not deriving from CBase.
- // ?classname( const ?classname& );
- // Prohibit assigment operator if not deriving from CBase.
- // ?classname& operator=( const ?classname& );
- /**
- * Frees all resources allocated from test methods.
- * @since ?Series60_version
- */
- void Delete();
- /**
- * Test methods are listed below.
- */
- TInt MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/);
- TInt MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/);
- TInt MMPXPlaybackUtilityInit64L(CStifItemParser& /*aItem*/);
- TInt MMPXPlaybackUtilityInitStreaming64L(CStifItemParser& /*aItem*/);
- TInt MMPXPlaybackUtilityFile64L(CStifItemParser& /*aItem*/);
-
- /**
- * Method used to log version of test class
- */
- void SendTestClassVersion();
- //ADD NEW METHOD DEC HERE
- //[TestMethods] - Do not remove
- private: // Friend classes
- //From mpxplaybackutility.h
- MMPXPlaybackUtility* iMPXPlaybackUtility;
- RFs iFs;
+ /**
+ * Method is called continously until aComplete=ETrue, signifying that
+ * it is done and there will be no more callbacks.
+ * Only new items are passed each time.
+ *
+ * @since S60 3.2.3
+ * @param aPlayer UID of the subplayer
+ * @param aSubPlayers a list of sub players
+ * @param aComplete ETrue no more sub players. EFalse more subplayer
+ * expected
+ * @param aError error code
+ */
+ void HandleSubPlayerNamesL(TUid aPlayer,
+ const MDesCArray* aSubPlayers,
+ TBool aComplete,
+ TInt aError);
+
+ /**
+ * Call back of media request.
+ *
+ * @since S60 3.2.3
+ * @param aMedia media
+ * @param aError error code
+ */
+ void HandleMediaL(const CMPXMedia& aProperties, TInt aError);
+
+ /**
+ * Handle completion of a asynchronous command.
+ * Note: All clients should implement this callback.
+ *
+ * @since S60 3.2.3
+ * @param aCommandResult result of the command, NULL if error
+ * @param aError error code
+ */
+ void HandlePlaybackCommandComplete(CMPXCommand* aCommandResult, TInt aError);
+
+private: // functions
+
+ /**
+ * C++ default constructor.
+ */
+ Cmpxplaybackutilitytest( CTestModuleIf& aTestModuleIf );
+ /**
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+ // Prohibit copy constructor if not deriving from CBase.
+ // ?classname( const ?classname& );
+ // Prohibit assigment operator if not deriving from CBase.
+ // ?classname& operator=( const ?classname& );
+ /**
+ * Frees all resources allocated from test methods.
+ * @since ?Series60_version
+ */
+ void Delete();
+
+ /*
+ * Create resources
+ */
+ void CreateL();
+
+ void AddExpectedEventL(TInt aEvent, TInt aType, TInt aData);
+ void RemoveExpectedEventL(TInt aEvent, TInt aType, TInt aData);
+
+ /**
+ * Test methods are listed below.
+ */
+ TInt MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityNewWithCatL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityUtilityWithCatL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInitWithPlaylistL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInitWithUriL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInitWithRFileL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInitStreamingWithUriL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInitStreamingWithRFileL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInit64L(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityInitStreaming64L(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityFile64L(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityAddObserverL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityRemoveObserverL(CStifItemParser& /*aItem*/);
+ TInt MMPXPlaybackUtilityPlayerManagerSelectPlayerL(CStifItemParser& /*aItem*/);
+ TInt EndTest(CStifItemParser& /*aItem*/);
+
+ /**
+ * Method used to log version of test class
+ */
+ void SendTestClassVersion();
+ //ADD NEW METHOD DEC HERE
+ //[TestMethods] - Do not remove
+
+private: // data
+ MMPXPlaybackUtility* iMPXPlaybackUtility;
+ CMpxPlaybackTestEventArray* iExpectedEventArray;
+ RFs iFs;
+ TInt iCallbackError;
+ RFile iFile;
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- RFile64 iFile64;
+ RFile64 iFile64;
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytestdefs.h Mon May 03 12:58:40 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2002 - 2007 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: mpxplaybackutilitytestdefs header for STIF Test Framework TestScripter.
+*
+*/
+
+#ifndef MPXPLAYBACKUTILITYTESTDEFS_H
+#define MPXPLAYBACKUTILITYTESTDEFS_H
+
+const TInt KGeneralPlaybackMsgOffset = 0;
+const TInt KVideoPlaybackMsgOffset = 100;
+const TInt KStifPlaybackMsgOffset = 200;
+const TInt KMPXMessageStif = 0x20011397;
+
+
+#endif // MPXPLAYBACKUTILITYTESTDEFS_H
+
+// End of File
--- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytest.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytest.cpp Mon May 03 12:58:40 2010 +0300
@@ -131,10 +131,8 @@
EFalse );
SendTestClassVersion();
-
-
- iFs.Connect();
- iFs.ShareProtected();
+
+ CreateL();
}
// -----------------------------------------------------------------------------
--- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytestBlocks.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytestBlocks.cpp Mon May 03 12:58:40 2010 +0300
@@ -21,18 +21,105 @@
#include <e32svr.h>
#include <StifParser.h>
#include <Stiftestinterface.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcommand.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxlog.h>
+#include <mpxcollectionplaylist.h>
#include "mpxplaybackutilitytest.h"
+#include "mpxplaybackutilitytestdefs.h"
+
// ============================ MEMBER FUNCTIONS ===============================
// ---------------------------------------------------------------------------
// From MMPXPlaybackObserver
// Handle playback message.
// ---------------------------------------------------------------------------
//
-void Cmpxplaybackutilitytest::HandlePlaybackMessage(
- CMPXMessage* /*aMessage*/, TInt aError )
+void Cmpxplaybackutilitytest::HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError )
{
- iLog->Log(_L("Cmpxharvestertest::HandlePlaybackMessage: %d"), aError);
+ iLog->Log(_L("Cmpxharvestertest::HandlePlaybackMessage: Error %d"), aError);
+ if ( !aError )
+ {
+ TMPXMessageId id( *(aMessage->Value<TMPXMessageId>(KMPXMessageGeneralId)) );
+ TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) );
+ TInt type( *aMessage->Value<TInt>( KMPXMessageGeneralType ) );
+ TInt data( *aMessage->Value<TInt>( KMPXMessageGeneralData ) );
+
+ if ( KMPXMessageGeneral == id )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage() General event = %d type = %d value = %d"),
+ event, type, data );
+ RemoveExpectedEventL( KGeneralPlaybackMsgOffset + event, type, data );
+ }
+ else if ( KMPXMediaIdVideoPlayback == id )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage() Video event = %d type = %d value = %d"),
+ event, type, data );
+ RemoveExpectedEventL( KVideoPlaybackMsgOffset + event, type, data );
+ }
+ else if ( KMPXMessageStif )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage() STIF event = %d type = %d value = %d"),
+ event, type, data );
+ RemoveExpectedEventL( KStifPlaybackMsgOffset + event, type, data );
+ }
+ }
+ else
+ {
+ if ( !iCallbackError )
+ {
+ iCallbackError = aError;
+ }
+ }
}
+
+// ---------------------------------------------------------------------------
+// Handle playback property.
+// ---------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError )
+ {
+ iLog->Log(_L("Cmpxharvestertest::HandlePropertyL: Property %d, Value %d, Error %d"),
+ aProperty, aValue, aError);
+ }
+
+// ---------------------------------------------------------------------------
+// Method is called continously until aComplete=ETrue, signifying that
+// it is done and there will be no more callbacks.
+// Only new items are passed each time.
+// ---------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::HandleSubPlayerNamesL( TUid aPlayer,
+ const MDesCArray* aSubPlayers,
+ TBool aComplete,
+ TInt aError )
+ {
+ iLog->Log(_L("Cmpxharvestertest::HandleSubPlayerNamesL: Complete %d, Error %d"), aComplete, aError);
+ }
+
+// ---------------------------------------------------------------------------
+// Call back of media request.
+// ---------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::HandleMediaL( const CMPXMedia& aProperties, TInt aError )
+ {
+ iLog->Log(_L("Cmpxharvestertest::HandleMediaL: Error %d"), aError);
+ }
+
+// ---------------------------------------------------------------------------
+// Handle completion of a asynchronous command.
+// Note: All clients should implement this callback.
+// ---------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::HandlePlaybackCommandComplete( CMPXCommand* aCommandResult, TInt aError )
+ {
+ iLog->Log(_L("Cmpxharvestertest::HandlePlaybackCommandComplete: Error %d"), aError);
+ }
+
// -----------------------------------------------------------------------------
// Cmpxplaybackutilitytest::Delete
// Delete here all resources allocated and opened from test methods.
@@ -45,7 +132,58 @@
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
iFile64.Close();
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+ iFile.Close();
iFs.Close();
+ iExpectedEventArray->ResetAndDestroy();
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::CreateL
+// Create here all resources needed for test methods.
+// Called from ConstructL().
+// -----------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::CreateL()
+ {
+ iFs.Connect();
+ iFs.ShareProtected();
+
+ iExpectedEventArray = new (ELeave) CArrayPtrFlat<TMpxPlaybackTestEvent>( 1 );
+ iCallbackError = KErrNone;
+ iMPXPlaybackUtility = NULL;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::AddExpectedEventL
+// -----------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::AddExpectedEventL( TInt aEvent, TInt aType, TInt aData )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::AddExpectedEventL() event = %d type = %d value = %d"),
+ aEvent, aType, aData );
+
+ TMpxPlaybackTestEvent* event = new (ELeave) TMpxPlaybackTestEvent;
+ event->iEvent = aEvent;
+ event->iType = aType;
+ event->iData = aData;
+ iExpectedEventArray->AppendL( event );
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::RemoveExpectedEventL
+// -----------------------------------------------------------------------------
+//
+void Cmpxplaybackutilitytest::RemoveExpectedEventL( TInt aEvent, TInt aType, TInt aData )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::RemoveExpectedEventL() event = %d type = %d value = %d"),
+ aEvent, aType, aData );
+
+ if ( (iExpectedEventArray->Count() > 0) &&
+ ((*iExpectedEventArray)[0]->iEvent == aEvent) )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::RemoveExpectedEventL() event = %d removed."), aEvent);
+ iExpectedEventArray->Delete( 0 );
+ }
}
// -----------------------------------------------------------------------------
@@ -53,32 +191,38 @@
// Run specified method. Contains also table of test mothods and their names.
// -----------------------------------------------------------------------------
//
-TInt Cmpxplaybackutilitytest::RunMethodL(
- CStifItemParser& aItem )
+TInt Cmpxplaybackutilitytest::RunMethodL( CStifItemParser& aItem )
{
-
static TStifFunctionInfo const KFunctions[] =
{
// Copy this line for every implemented function.
// First string is the function name used in TestScripter script file.
// Second is the actual implementation member function.
-
+
+ //ADD NEW ENTRY HERE
+ // [test cases entries] - Do not remove
ENTRY( "MMPXPlaybackUtilityNewL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL ),
+ ENTRY( "MMPXPlaybackUtilityNewWithCatL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL ),
ENTRY( "MMPXPlaybackUtilityUtilityL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL ),
+ ENTRY( "MMPXPlaybackUtilityUtilityWithCatL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL ),
+ ENTRY( "MMPXPlaybackUtilityInitWithPlaylistL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL ),
+ ENTRY( "MMPXPlaybackUtilityInitWithUriL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL ),
+ ENTRY( "MMPXPlaybackUtilityInitWithRFileL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL ),
+ ENTRY( "MMPXPlaybackUtilityInitStreamingWithUriL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL ),
+ ENTRY( "MMPXPlaybackUtilityInitStreamingWithRFileL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL ),
ENTRY( "MMPXPlaybackUtilityInit64L", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L ),
ENTRY( "MMPXPlaybackUtilityInitStreaming64L", Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L ),
ENTRY( "MMPXPlaybackUtilityFile64L", Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L ),
-
- //ADD NEW ENTRY HERE
- // [test cases entries] - Do not remove
-
+ ENTRY( "MMPXPlaybackUtilityAddObserverL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL ),
+ ENTRY( "MMPXPlaybackUtilityRemoveObserverL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL ),
+ ENTRY( "MMPXPlaybackUtilityPlayerManagerSelectPlayerL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL ),
+ ENTRY( "EndTest", Cmpxplaybackutilitytest::EndTest ),
};
const TInt count = sizeof( KFunctions ) /
sizeof( TStifFunctionInfo );
return RunInternalL( KFunctions, count, aItem );
-
}
// -----------------------------------------------------------------------------
@@ -87,49 +231,325 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/)
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL( CStifItemParser& aItem )
{
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL"));
TInt err = KErrNone;
-
- TRAP( err,iMPXPlaybackUtility = MMPXPlaybackUtility::NewL(KPbModeDefault,this ));
+ TInt mode;
+
+ if ( aItem.GetNextInt(mode) != KErrNone )
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityNewL - Missing playback mode."));
+ err = KErrArgument;
+ return err;
+ }
+
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewL: mode %d"), mode);
+ TRAP( err,iMPXPlaybackUtility = MMPXPlaybackUtility::NewL(TUid::Uid(mode), this ));
if (err!= KErrNone)
{
- iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewL: %d"), err);
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewL: error %d"), err);
}
return err;
}
// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL
+// NewL test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL( CStifItemParser& aItem )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL"));
+ TInt err = KErrNone;
+ TInt mode;
+ TInt category;
+ if ( aItem.GetNextInt(category) != KErrNone )
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityNewWithCatL - Missing category."));
+ err = KErrArgument;
+ return err;
+ }
+
+ if ( aItem.GetNextInt(mode) != KErrNone )
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityNewWithCatL - Missing playback mode."));
+ err = KErrArgument;
+ return err;
+ }
+
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewWithCatL: category %d"), category);
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewWithCatL: mode %d"), mode);
+ TRAP( err,iMPXPlaybackUtility = MMPXPlaybackUtility::NewL((TMPXCategory)category, TUid::Uid(mode), this ));
+
+ if (err!= KErrNone)
+ {
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewWithCatL: error %d"), err);
+ }
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
// Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL
// UtilityL test method function.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/)
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL( CStifItemParser& aItem )
{
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL"));
TInt err = KErrNone;
+ TInt mode = 0;
- TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL());
+ aItem.GetNextInt(mode);
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityL: mode %d"), mode);
+ if ( mode )
+ {
+ TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL(TUid::Uid(mode)));
+ }
+ else
+ {
+ TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL());
+ }
- if (err!= KErrNone)
- {
- iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityL: %d"), err);
- }
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityL: error %d"), err);
return err;
}
// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL
+// UtilityL test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL( CStifItemParser& aItem )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL"));
+ TInt err = KErrNone;
+ TInt category;
+ TInt mode = 0;
+
+ if ( aItem.GetNextInt(category) != KErrNone )
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityNewWithCatL - Missing category."));
+ err = KErrArgument;
+ return err;
+ }
+
+ aItem.GetNextInt(mode);
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityWithCatL: category %d"), category);
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityWithCatL: mode %d"), mode);
+ if ( mode )
+ {
+ TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL((TMPXCategory)category, TUid::Uid(mode)));
+ }
+ else
+ {
+ TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL((TMPXCategory)category));
+ }
+
+ iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityWithCatL: error %d"), err);
+
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL
+// InitL(CMPXCollectionPlaylist) test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL( CStifItemParser& /*aItem*/ )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL"));
+ TInt err = KErrNone;
+ CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL();
+ CleanupStack::PushL(playlist);
+ TRAP(err,iMPXPlaybackUtility->InitL(*playlist));
+ CleanupStack::PopAndDestroy(playlist);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL - error=%d"),err);
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL
+// InitL(Uri) test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL( CStifItemParser& aItem )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL"));
+ TInt err = KErrNone;
+ TPtrC string;
+
+ if( aItem.GetNextString( string ) == KErrNone )
+ {
+ TBuf<120> uri;
+ uri.Append(KmpxplaybackutilityTestFilePath);
+ uri.Append(string);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL - uri = %S."), &uri);
+ TRAP(err,iMPXPlaybackUtility->InitL(uri));
+
+ if ( !err )
+ {
+ TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged;
+ AddExpectedEventL(event, 0, 0);
+ event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete;
+ AddExpectedEventL(event, 0, 0);
+ }
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL - error=%d"),err);
+ }
+ else
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityInitWithUriL - Missing file name."));
+ err = KErrArgument;
+ }
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL
+// Init64L test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL( CStifItemParser& aItem )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL"));
+ TInt err = KErrNone;
+ TPtrC string;
+
+ if( aItem.GetNextString( string ) == KErrNone )
+ {
+ TBuf<120> KFrom;
+ KFrom.Append(KmpxplaybackutilityTestFilePath);
+ KFrom.Append(string);
+ if ( iFile.SubSessionHandle() )
+ {
+ iFile.Close();
+ }
+ err = iFile.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters);
+ if ( err == KErrNone )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL - Open passed."));
+ TRAP(err,iMPXPlaybackUtility->InitL(iFile));
+
+ if ( !err )
+ {
+ TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged;
+ AddExpectedEventL(event, 0, 0);
+ event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete;
+ AddExpectedEventL(event, 0, 0);
+ }
+ }
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL - error=%d"),err);
+ }
+ else
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityInitWithRFileL - Missing file name."));
+ err = KErrArgument;
+ }
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL
+// InitStreamingL(Uri) test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL( CStifItemParser& aItem )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL"));
+ TInt err = KErrNone;
+ TPtrC string;
+ TInt accessPoint = 1;
+
+ if( aItem.GetNextString( string ) == KErrNone )
+ {
+ TBuf<120> uri;
+ uri.Append(KmpxplaybackutilityTestFilePath);
+ uri.Append(string);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL - uri = %S."), &uri);
+ TRAP(err,iMPXPlaybackUtility->InitStreamingL(uri, NULL, accessPoint));
+
+ if ( !err )
+ {
+ TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged;
+ AddExpectedEventL(event, 0, 0);
+ event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete;
+ AddExpectedEventL(event, 0, 0);
+ }
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL - error=%d"),err);
+ }
+ else
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityInitStreamingWithUriL - Missing file name."));
+ err = KErrArgument;
+ }
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL
+// InitStreamingL(RFile) test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL( CStifItemParser& aItem )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL"));
+ TInt err = KErrNone;
+ TPtrC string;
+ TInt accessPoint = 1;
+
+ if( aItem.GetNextString( string ) == KErrNone )
+ {
+ TBuf<120> KFrom;
+ KFrom.Append(KmpxplaybackutilityTestFilePath);
+ KFrom.Append(string);
+ if ( iFile.SubSessionHandle() )
+ {
+ iFile.Close();
+ }
+ err = iFile.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters);
+ if ( err == KErrNone )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL - Open passed."));
+ TRAP(err,iMPXPlaybackUtility->InitStreamingL(iFile, accessPoint));
+
+ if ( !err )
+ {
+ TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged;
+ AddExpectedEventL(event, 0, 0);
+ event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete;
+ AddExpectedEventL(event, 0, 0);
+ }
+ }
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL - error=%d"),err);
+ }
+ else
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityInitStreamingWithRFileL - Missing file name."));
+ err = KErrArgument;
+ }
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
// Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L
// Init64L test method function.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L(CStifItemParser& aItem)
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L( CStifItemParser& aItem )
{
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L testing Init64L() begin"));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L"));
TInt err = KErrNone;
#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
err = KErrNotSupported;
@@ -149,10 +569,18 @@
err = iFile64.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters);
if ( err == KErrNone )
{
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L testing Init64L() Open passed."));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L - Open passed."));
TRAP(err,iMPXPlaybackUtility->Init64L(iFile64));
+
+ if ( !err )
+ {
+ TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged;
+ AddExpectedEventL(event, 0, 0);
+ event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete;
+ AddExpectedEventL(event, 0, 0);
+ }
}
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L testing Init64L() error=%d"),err);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L - error=%d"),err);
}
else
{
@@ -169,13 +597,13 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L(CStifItemParser& aItem)
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L( CStifItemParser& aItem )
{
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L testing InitStreaming64L() begin"));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L"));
TInt err = KErrNone;
#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
err = KErrNotSupported;
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L testing InitStreaming64L() error=%d"),err);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L - error=%d"),err);
#else // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
TPtrC string;
TInt accessPoint = 1;
@@ -192,10 +620,18 @@
err = iFile64.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters);
if ( err == KErrNone )
{
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L testing InitStreaming64L() Open passed."));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L - Open passed."));
TRAP(err,iMPXPlaybackUtility->InitStreaming64L(iFile64, accessPoint));
+
+ if ( !err )
+ {
+ TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged;
+ AddExpectedEventL(event, 0, 0);
+ event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete;
+ AddExpectedEventL(event, 0, 0);
+ }
}
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L testing InitStreaming64L() error=%d"),err);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L - error=%d"),err);
}
else
{
@@ -212,22 +648,106 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L(CStifItemParser& /*aItem*/)
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L( CStifItemParser& /*aItem*/ )
{
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L testing File64L() begin"));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L"));
TInt err = KErrNone;
#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
err = KErrNotSupported;
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L testing File64L() error=%d"),err);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L - error=%d"),err);
#else // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- RFile64* file64Ptr;
+ RFile64* file64Ptr=NULL;
TRAP(err, file64Ptr=iMPXPlaybackUtility->Source()->File64L());
if ( !file64Ptr->SubSessionHandle() )
{
iLog->Log(_L("MMPXPlaybackUtilityFile64L - file64 = NULL."));
}
- iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L testing File64L() error=%d"),err);
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L - error=%d"),err);
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
return err;
}
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL
+// AddObserverL test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL( CStifItemParser& /*aItem*/ )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL"));
+ TInt err = KErrNone;
+ TRAP(err, iMPXPlaybackUtility->AddObserverL(*this));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL - error=%d"),err);
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL
+// RemoveObserverL test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL( CStifItemParser& /*aItem*/ )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL"));
+ TInt err = KErrNone;
+ TRAP(err, iMPXPlaybackUtility->RemoveObserverL(*this));
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL - error=%d"),err);
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL
+// RemoveObserverL test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL(CStifItemParser& aItem)
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL"));
+ TInt uidInt;
+ TInt err = KErrNone;
+
+ // read in UID
+ if ( aItem.GetNextInt(uidInt) != KErrNone )
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - Missing UID."));
+ err = KErrArgument;
+ return err;
+ }
+
+ iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - UID = 0x%x."), uidInt);
+ if ( iMPXPlaybackUtility )
+ {
+ MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager();
+ TRAP( err, manager.SelectPlayerL( TUid::Uid(uidInt) ) );
+ iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - SelectPlayer err = %d."), err);
+ }
+ else
+ {
+ iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - MPX Playback Utility not created."));
+ err = KErrGeneral;
+ }
+ return err;
+ }
+
+// -----------------------------------------------------------------------------
+// Cmpxplaybackutilitytest::EndTest
+// -----------------------------------------------------------------------------
+//
+TInt Cmpxplaybackutilitytest::EndTest( CStifItemParser& /*aItem*/ )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::EndTest"));
+ TInt err = iCallbackError;
+
+ // check if event queue is empty
+ if ( !err && (iExpectedEventArray->Count() > 0 ) )
+ {
+ iLog->Log(_L("Cmpxplaybackutilitytest::EndTest error = KErrTimedOut"));
+ err = KErrTimedOut;
+ }
+ return err;
+ }
+
+// end of file
--- a/mmappfw_plat/mtp_keys_api/group/bld.inf Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/mtp_keys_api/group/bld.inf Mon May 03 12:58:40 2010 +0300
@@ -23,4 +23,4 @@
DEFAULT
PRJ_EXPORTS
-../inc/MtpPrivatePSKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(MtpPrivatePSKeys.h)
+../inc/mtpprivatepskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(mtpprivatepskeys.h)
--- a/mmappfw_plat/videoplaylist_utility_api/tsrc/videoplaylistutilitytest/group/videoplaylistutilitytest.mmp Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/videoplaylistutilitytest/group/videoplaylistutilitytest.mmp Mon May 03 12:58:40 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
#include <platform_paths.hrh>
Binary file mpx/Conf/mpx.confml has changed
Binary file mpx/Conf/mpx_101FFCD2.crml has changed
Binary file mpx/cenrep/101FFCD2.txt has changed
--- a/mpx/collectionframework/collectionengine/inc/mpxcollectionengine.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/collectionframework/collectionengine/inc/mpxcollectionengine.h Mon May 03 12:58:40 2010 +0300
@@ -391,6 +391,8 @@
* If not KNullUid, indicates the plugin that is currently being upgraded.
*/
TUid iUpdatedPluginUid;
+
+ CMPXMedia* iMediaForHeapKeepAlive; // own
};
#include "mpxcollectionengine.inl"
--- a/mpx/collectionframework/collectionengine/src/mpxcollectionclientcontext.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/collectionframework/collectionengine/src/mpxcollectionclientcontext.cpp Mon May 03 12:58:40 2010 +0300
@@ -2440,7 +2440,11 @@
// Check for open playlist only mode. If in that mode, do not return the media
// from the cache but call the plugin to open, as that will callback a
// different HandleOpenL() with the collection path instead.
- TMPXOpenMode mode( iBrowsePath->OpenNextMode() );
+ TMPXOpenMode mode = EMPXOpenDefault;
+ if(iBrowsePath)
+ {
+ mode = iBrowsePath->OpenNextMode();
+ }
CMPXCollectionPlugin* plugin = LoadedPlugin(EContextBrowse);
if ( !iFilter && mode != EMPXOpenPlaylistOnly )
{
--- a/mpx/collectionframework/collectionengine/src/mpxcollectionengine.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/collectionframework/collectionengine/src/mpxcollectionengine.cpp Mon May 03 12:58:40 2010 +0300
@@ -102,6 +102,7 @@
//
void CMPXCollectionEngine::ConstructL()
{
+ iMediaForHeapKeepAlive = CMPXMedia::NewL(); // To avoid continuous heap
iPluginHandler=CMPXCollectionPluginHandler::NewL(*this, *this);
iCache = CMPXCollectionCache::NewL(KMPXMaxCacheSizeRatio);
}
@@ -112,6 +113,7 @@
//
EXPORT_C CMPXCollectionEngine::~CMPXCollectionEngine()
{
+ delete iMediaForHeapKeepAlive;
iCleanupStack.Close();
iContexts.ResetAndDestroy();
--- a/mpx/commonframework/common/src/mpxclientlist.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/commonframework/common/src/mpxclientlist.cpp Mon May 03 12:58:40 2010 +0300
@@ -24,6 +24,41 @@
#include "mpxclientlist.h"
#include <mpxsubscription.h>
+// ============================ LOCAL FUNCTIONS ==============================
+
+// ----------------------------------------------------------------------------
+// Searches process id for target selector plugin.
+// When the player has been opened in a mode, which is bound to the same engine
+// than certain application's engine, then need to fetch its process id.
+// (As a reference for parameter aMode see MMPXPlaybackUtility modes.)
+// Otherwise target selector plugin is notified wrongly about registered client
+// and key events are not propagated to correct application.
+// ----------------------------------------------------------------------------
+//
+static void FindProcessIdForTsp( TInt aMode, TProcessId& aProcessId )
+ {
+ TBool processFound( EFalse );
+ TFindProcess processFinder;
+ TFullName processName;
+
+ while ( processFinder.Next( processName ) == KErrNone && !processFound )
+ {
+ RProcess process;
+ TInt err = process.Open( processFinder );
+ if( err == KErrNone )
+ {
+ if( process.SecureId().iId == aMode && process.ExitType() == EExitPending )
+ {
+ MPX_DEBUG4("FindProcessIdForTsp(): pid changed from %d to %d (mode 0x%x)",
+ TUint(aProcessId), TUint(process.Id()), aMode);
+ aProcessId = process.Id();
+ processFound = ETrue;
+ }
+ process.Close();
+ }
+ }
+ }
+
// ============================ MEMBER FUNCTIONS ==============================
// ----------------------------------------------------------------------------
@@ -109,6 +144,7 @@
iClientProcesses.AppendL(pid);
if (iObserver)
{
+ FindProcessIdForTsp(aMode, pid);
iObserver->HandleClientChange(pid, MMPXClientlistObserver::EAdd);
}
}
@@ -140,6 +176,7 @@
iClientProcesses.AppendL(pid);
if (iObserver)
{
+ FindProcessIdForTsp(aMode, pid);
iObserver->HandleClientChange(pid, MMPXClientlistObserver::EAdd);
}
}
@@ -176,7 +213,9 @@
{
if (iObserver)
{
- iObserver->HandleClientChange(id->iPid, MMPXClientlistObserver::ERemove);
+ TProcessId pid(id->iPid);
+ FindProcessIdForTsp(id->iMode, pid);
+ iObserver->HandleClientChange(pid, MMPXClientlistObserver::ERemove);
}
iClientProcesses.Remove(i);
}
@@ -493,8 +532,8 @@
: iTid(aTid),
iPid(aPid),
iMode(aMode),
- iMsgQueue(aMsgQueue),
- iCategory(aCategory)
+ iCategory(aCategory),
+ iMsgQueue(aMsgQueue)
{}
// -----------------------------------------------------------------------------
--- a/mpx/commonframework/common/src/mpxdataarray.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/commonframework/common/src/mpxdataarray.cpp Mon May 03 12:58:40 2010 +0300
@@ -55,7 +55,10 @@
//
void RMPXDataItem::Copy(TUint aClientHandle,TAny* aSrc,TInt aSize)
{
- MPX_ASSERT(aSrc&&aClientHandle);
+ //The source could be zero-length descriptor: aSize is 0 and aSrc is NULL
+ //ASSERT if aSrc is NULL while aSize is not zero, invalid descriptor
+ MPX_ASSERT(((aSrc!=NULL)?ETrue:(aSize==0))&&aClientHandle);
+
//
Reset(aClientHandle);
RMPXHeapManager& m=RMPXHeapManager::HeapManager(aClientHandle);
--- a/mpx/playbackframework/playbackengine/inc/mpxautoresumehandler.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackengine/inc/mpxautoresumehandler.h Mon May 03 12:58:40 2010 +0300
@@ -136,6 +136,11 @@
* in that case
*/
TBool IsPlaybackRemote();
+
+ /**
+ * Handle change in voice command state.
+ */
+ void DoHandleVoiceCmdChange();
private: // data
CMPXPlaybackEngine& iEngine;
@@ -148,6 +153,10 @@
// Timer for resume operation. Owned.
CPeriodic* iResumeTimer;
+
+ CMPXPSKeyWatcher* iVoiceCmdObserver; // owned
+ TBool iPausedForVoiceCmd;
+ TBool iVoiceCmdResumeOngoing;
};
#endif // CMPXAUTORESUMEHANDLER_H
--- a/mpx/playbackframework/playbackengine/src/mpxaccessoryobserver.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackengine/src/mpxaccessoryobserver.cpp Mon May 03 12:58:40 2010 +0300
@@ -211,6 +211,9 @@
case EAccModeHeadphones:
mode = EPbAccessoryHeadphones;
break;
+ case EAccModeHDMI:
+ mode = EPbAccessoryHDMI;
+ break;
default:
break;
}
--- a/mpx/playbackframework/playbackengine/src/mpxautoresumehandler.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackengine/src/mpxautoresumehandler.cpp Mon May 03 12:58:40 2010 +0300
@@ -29,6 +29,20 @@
// Time to wait before resume after call has ended.
const TInt KMPXResumeWaitTime = 3000000; // 3.0s
+// TODO: the following constants and definitions are copied from nssvascoreconstant.h, which is not
+// included directly because it is an App layer API. Way to fix this is to ask Speechsrv to move the header file to MW layer.
+const TUid KSINDUID = {KUidSystemCategoryValue};
+const TInt ERecognitionState=0;
+
+// Recognition state values for the P&S key ERecognitionState
+enum TRecognitionStateValues
+ {
+ ERecognitionStarted = 0,
+ ERecognitionSpeechEnd,
+ ERecognitionSuccess,
+ ERecognitionFail
+ };
+// End TODO
// ================= MEMBER FUNCTIONS =======================
@@ -60,6 +74,9 @@
// Listen to call type changes
iTypeObserver = CMPXPSKeyWatcher::NewL(KPSUidCtsyCallInformation,
KCTsyCallType,this);
+
+ iVoiceCmdObserver = CMPXPSKeyWatcher::NewL( KSINDUID, ERecognitionState, this );
+
iResumeTimer = CPeriodic::NewL(CActive::EPriorityStandard);
}
@@ -88,6 +105,7 @@
//
CMPXAutoResumeHandler::~CMPXAutoResumeHandler()
{
+ delete iVoiceCmdObserver;
delete iStateObserver;
delete iTypeObserver;
if ( iResumeTimer )
@@ -135,13 +153,15 @@
MPX_DEBUG2("CMPXAutoResumeHandler::HandlePlaybackComplete(%d) entering", aError);
iPausedForCall = EFalse;
if ( KErrDied == aError ||
- KErrAccessDenied == aError )
+ KErrAccessDenied == aError ||
+ KErrInUse == aError )
{
iKErrDiedTime.HomeTime();
TInt callType = EPSCTsyCallTypeNone;
TInt callState = EPSCTsyCallStateNone;
-
+ TInt voiceCmdState(0);
+
if (!iTypeObserver->GetValue(callType) &&
!iStateObserver->GetValue(callState))
{
@@ -155,8 +175,16 @@
iPausedForCall = ETrue;
}
}
+
+ if ( !iPausedForCall && !iVoiceCmdObserver->GetValue( voiceCmdState ) ) // key exist if voice commanding is in progress
+ {
+ // Paused due voice command activity
+ iPausedForVoiceCmd = ETrue;
+ }
}
- MPX_DEBUG1("CMPXAutoResumeHandler::HandlePlaybackComplete() exiting");
+
+ MPX_DEBUG3("CMPXAutoResumeHandler::HandlePlaybackComplete() exiting: iPausedForCall=%d, iPausedForVoiceCmd=%d",
+ iPausedForCall, iPausedForVoiceCmd);
}
// -----------------------------------------------------------------------------
@@ -175,10 +203,18 @@
// CMPXAutoResumeHandler::HandlePSEvent
// -----------------------------------------------------------------------------
//
-void CMPXAutoResumeHandler::HandlePSEvent(TUid /*aUid*/, TInt /*aKey*/)
+void CMPXAutoResumeHandler::HandlePSEvent(TUid aUid, TInt /*aKey*/)
{
MPX_FUNC("CMPXAutoResumeHandler::HandlePSEvent()");
- TRAP_IGNORE(DoHandleStateChangeL());
+
+ if ( aUid == KSINDUID )
+ {
+ DoHandleVoiceCmdChange();
+ }
+ else
+ {
+ TRAP_IGNORE(DoHandleStateChangeL());
+ }
}
// -----------------------------------------------------------------------------
@@ -246,6 +282,19 @@
iPausedForCall = ETrue;
}
}
+
+ if ( shouldPause && iVoiceCmdResumeOngoing )
+ {
+ // Resume timer has been started after a voice command, cancel it now
+ // so that playback is not resumed while calling
+ if ( iResumeTimer->IsActive() )
+ {
+ iResumeTimer->Cancel();
+ }
+ iVoiceCmdResumeOngoing = EFalse;
+ iPausedForCall = ETrue; // resume playback once call has been ended
+ }
+
MPX_DEBUG2("CMPXAutoResumeHandler::DoHandleStateChangeL(): iPausedForCall = %d", iPausedForCall);
}
@@ -317,6 +366,8 @@
{
MPX_FUNC("CMPXAutoResumeHandler::HandleResumeTimerCallback() entering");
+ iVoiceCmdResumeOngoing = EFalse;
+
CancelResumeTimer();
TRAP_IGNORE( iEngine.HandleCommandL( EPbCmdPlayWithFadeIn ));
}
@@ -374,4 +425,39 @@
iAutoResume = aAutoResume;
}
+// -----------------------------------------------------------------------------
+// CMPXAutoResumeHandler::DoHandleVoiceCmdChange
+// -----------------------------------------------------------------------------
+//
+void CMPXAutoResumeHandler::DoHandleVoiceCmdChange()
+ {
+ MPX_FUNC("CMPXAutoResumeHandler::DoHandleVoiceCmdChange()");
+
+ TInt voiceCmdState( 0 );
+ TInt err( iVoiceCmdObserver->GetValue( voiceCmdState ) );
+
+ MPX_DEBUG4("CMPXAutoResumeHandler::DoHandleVoiceCmdChange(): iPausedForVoiceCmd = %d, err=%d, state=%d",
+ iPausedForVoiceCmd, err, voiceCmdState);
+
+ if ( iPausedForVoiceCmd && !iPausedForCall )
+ {
+ if ( err == KErrNotFound ) // voice command has been finished once the P&S key is deleted
+ {
+ if ( iResumeTimer->IsActive() )
+ iResumeTimer->Cancel();
+
+ iResumeTimer->Start( KMPXResumeWaitTime, KMPXResumeWaitTime, TCallBack(ResumeTimerCallback, this) );
+
+ iPausedForVoiceCmd = EFalse;
+
+ iVoiceCmdResumeOngoing = ETrue; // flag for cancelling resume timer due to a call
+ }
+ }
+
+ if ( iPausedForCall ) // ensure that not interfering with call handling in any circumstances
+ {
+ iPausedForVoiceCmd = EFalse;
+ }
+ }
+
// End of File
--- a/mpx/playbackframework/playbackengine/src/mpxplaybackengine.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackengine/src/mpxplaybackengine.cpp Mon May 03 12:58:40 2010 +0300
@@ -315,10 +315,10 @@
TMPXPlaybackMessage::EInitializeComplete,
0,
EFalse));
-
+
if ( iPluginHandler->PlayerFound() )
{
- iPluginUid = iPluginHandler->Plugin()->Uid();
+ iPluginUid = iPluginHandler->Plugin()->Uid();
}
RArray<TMPXAttribute> dummy;
@@ -984,7 +984,8 @@
TMPXPlaybackMessage(
TMPXPlaybackMessage::EStateChanged, iState, aError ));
if ( KErrDied == aError ||
- KErrAccessDenied == aError )
+ KErrAccessDenied == aError ||
+ KErrInUse == aError )
{
iPluginState = EPbStateNotInitialised;
// fixed
@@ -1476,7 +1477,7 @@
if ( iProperties[EPbPropertyPosition] >= iProperties[EPbPropertyDuration] )
{
iProperties[EPbPropertyPosition] = 0;
- }
+ }
iAutoResumeHandler->HandleOpenFileComplete();
--- a/mpx/playbackframework/playbackengine/src/mpxplaybackinitializer.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackengine/src/mpxplaybackinitializer.cpp Mon May 03 12:58:40 2010 +0300
@@ -621,9 +621,7 @@
{
iHandler->SelectPlayersL(t);
}
- }
-
-
+ }
HBufC8* mimeType =
MPXUser::Alloc8L(aMedia.ValueText(KMPXMediaGeneralMimeType));
@@ -866,8 +864,7 @@
// if cast was successful, then init streaming with access point
if (plugin)
- {
-
+ {
TInt accessPoint = 0;
if ( iMedia->IsSupported(KMPXMediaGeneralExtAccessPoint) )
{
--- a/mpx/playbackframework/playbackserver/inc/mpxplaybackserver.h Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackserver/inc/mpxplaybackserver.h Mon May 03 12:58:40 2010 +0300
@@ -151,6 +151,15 @@
*/
void ConstructL();
+ /**
+ * Process id finder.
+ *
+ * @param aEngine pointer to active engine
+ * @param aProcessId process id of owning process
+ */
+ void FindProcessIdForTsp(const CMPXPlaybackEngine* aEngine,
+ TProcessId& aProcessId );
+
private: // from base class
/**
* From MMPXPlaybackActiveEngineObserver
--- a/mpx/playbackframework/playbackserver/src/mpxplaybackserver.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackserver/src/mpxplaybackserver.cpp Mon May 03 12:58:40 2010 +0300
@@ -129,6 +129,42 @@
}
// ----------------------------------------------------------------------------
+// Searches process id for target selector plugin.
+// When the player has been opened in a mode, which is bound to the same engine
+// than certain application's engine, then need to fetch its process id.
+// (As a reference for parameter aMode see MMPXPlaybackUtility modes.)
+// Otherwise target selector plugin is notified wrongly about client statuses
+// and key events are not propagated to correct application.
+// ----------------------------------------------------------------------------
+//
+void CMPXPlaybackServer::FindProcessIdForTsp(
+ const CMPXPlaybackEngine* aEngine,
+ TProcessId& aProcessId )
+ {
+ TBool processFound( EFalse );
+ TFindProcess processFinder;
+ TFullName processName;
+
+ while ( processFinder.Next( processName ) == KErrNone && !processFound )
+ {
+ RProcess process;
+ TInt err = process.Open( processFinder );
+ if( err == KErrNone )
+ {
+ if( process.SecureId().iId == aEngine->ModeId().iUid &&
+ process.ExitType() == EExitPending )
+ {
+ MPX_DEBUG4("CMPXPlaybackServer::FindProcessIdForTsp(): pid changed from %d to %d (mode 0x%x)",
+ TUint(aProcessId), TUint(process.Id()), aEngine->ModeId().iUid);
+ aProcessId = process.Id();
+ processFound = ETrue;
+ }
+ process.Close();
+ }
+ }
+ }
+
+// ----------------------------------------------------------------------------
// Increments number of sessions this server holds
// ----------------------------------------------------------------------------
//
@@ -386,12 +422,13 @@
if (!aActive)
{
#ifdef RD_TSP_CLIENT_MAPPER
+ TProcessId lastPid( aEngine->LastActiveProcessId() );
+ FindProcessIdForTsp( aEngine, lastPid );
iClientMapper->SetTspTargetClientToOtherType(
CTspClientMapper::EStoppedClients,
- aEngine->LastActiveProcessId());
- MPX_DEBUG2("CMPXPlaybackServer::HandleActiveEngineL(): Adding to stopped client %d",
- TUint( aEngine->LastActiveProcessId()));
-
+ lastPid);
+ MPX_DEBUG2("CMPXPlaybackServer::HandleActiveEngineL(): Added as stopped client %d",
+ TUint( lastPid));
#endif
if (EPbStatePaused != aEngine->State())
{
@@ -406,11 +443,20 @@
else
{// else aEngine is active player
#ifdef RD_TSP_CLIENT_MAPPER
- iClientMapper->SetTspTargetClientToOtherType(
- CTspClientMapper::EPlayingClients,
- aEngine->LastActiveProcessId());
- MPX_DEBUG2("CMPXPlaybackServer::HandleActiveEngineL(): Adding to playing client %d",
- TUint( aEngine->LastActiveProcessId()));
+ TProcessId lastPid( aEngine->LastActiveProcessId() );
+ FindProcessIdForTsp( aEngine, lastPid );
+ TInt err = iClientMapper->SetTspTargetClientToOtherType(
+ CTspClientMapper::EPlayingClients, lastPid );
+ if ( err != KErrNone && (TUint)lastPid != KNullProcessId )
+ {
+ // Setting target type failed probably because client PID could not be found.
+ // As a fallback set client as new playing client.
+ MPX_DEBUG2("CMPXPlaybackServer::HandleActiveEngineL(): Adding to playing client %d",
+ (TUint)lastPid );
+ iClientMapper->SetTspTargetClient( CTspClientMapper::EPlayingClients, lastPid );
+ }
+ MPX_DEBUG2("CMPXPlaybackServer::HandleActiveEngineL(): Added as playing client %d",
+ (TUint)lastPid );
#endif
}
@@ -466,9 +512,9 @@
if (MMPXClientlistObserver::EAdd == aChangeType)
{
iClientMapper->SetTspTargetClient(
- CTspClientMapper::EPlayingClients,
+ CTspClientMapper::ERegisteredClients,
aPid);
- MPX_DEBUG2("CMPXPlaybackServer::HandleClientChange(): Adding to registered client %d",
+ MPX_DEBUG2("CMPXPlaybackServer::HandleClientChange(): Added as registered client %d",
TUint( aPid ));
}
else
@@ -476,7 +522,7 @@
iClientMapper->RemoveTspTargetClient(
CTspClientMapper::EPlayingClients,
aPid);
- MPX_DEBUG2("CMPXPlaybackServer::HandleClientChange(): Adding to EPlayingClients client %d",
+ MPX_DEBUG2("CMPXPlaybackServer::HandleClientChange(): Removed from EPlayingClients client %d",
TUint( aPid ));
}
#else
--- a/mpx/playbackframework/playbackutility/src/mpxplaybackutilityimpl.cpp Fri Apr 16 15:28:14 2010 +0300
+++ b/mpx/playbackframework/playbackutility/src/mpxplaybackutilityimpl.cpp Mon May 03 12:58:40 2010 +0300
@@ -367,8 +367,11 @@
EPbCmdPlayPause == cmdType ||
EPbCmdStop == cmdType)
{
- aCmd.SetTObjectValueL<TProcessId>(KMPXCommandPlaybackGeneralClientPid,
- RProcess().Id()); // current process id
+ if( !aCmd.IsSupported( KMPXCommandPlaybackGeneralClientPid ) )
+ {
+ aCmd.SetTObjectValueL<TProcessId> (
+ KMPXCommandPlaybackGeneralClientPid, RProcess().Id()); // current process id
+ }
}
}