mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp
branchRCL_3
changeset 30 6f9f6e99a23e
parent 28 f56ec6ce2732
child 52 b034b1c214c2
equal deleted inserted replaced
28:f56ec6ce2732 30:6f9f6e99a23e
    25 #include <caf/content.h>
    25 #include <caf/content.h>
    26 #include <mtp/cmtpobjectmetadata.h>
    26 #include <mtp/cmtpobjectmetadata.h>
    27 #include <mtp/mmtpdataproviderframework.h>
    27 #include <mtp/mmtpdataproviderframework.h>
    28 #include <mtp/mmtpobjectmgr.h>
    28 #include <mtp/mmtpobjectmgr.h>
    29 #include <mtp/tmtptypeuint32.h>
    29 #include <mtp/tmtptypeuint32.h>
       
    30 #include <e32property.h>    // for RProperty
    30 
    31 
    31 // for asf mimetype parsing
    32 // for asf mimetype parsing
    32 #ifdef __WINDOWS_MEDIA
    33 #ifdef __WINDOWS_MEDIA
    33 #include <hxmetadatakeys.h>
    34 #include <hxmetadatakeys.h>
    34 #include <hxmetadatautil.h>
    35 #include <hxmetadatautil.h>
    37 #include "mmmtpdputility.h"
    38 #include "mmmtpdputility.h"
    38 #include "mmmtpdpfiledefs.h"
    39 #include "mmmtpdpfiledefs.h"
    39 #include "tobjectdescription.h"
    40 #include "tobjectdescription.h"
    40 #include "mmmtpdplogger.h"
    41 #include "mmmtpdplogger.h"
    41 #include "mmmtpdp_variant.hrh"
    42 #include "mmmtpdp_variant.hrh"
       
    43 #include "cmmmtpdpaccesssingleton.h"
    42 
    44 
    43 using namespace ContentAccess;
    45 using namespace ContentAccess;
    44 
    46 
    45 // local to this file, non standard mimetype used for ASF parsing with helix
    47 // local to this file, non standard mimetype used for ASF parsing with helix
    46 _LIT( KHxMimeTypeWma, "audio/x-hx-wma" );
    48 _LIT( KHxMimeTypeWma, "audio/x-hx-wma" );
   700     PRINT1( _L( "MM MTP <= MmMtpDpUtility::GetDrmStatus, drmStatus: %d" ), drmStatus );
   702     PRINT1( _L( "MM MTP <= MmMtpDpUtility::GetDrmStatus, drmStatus: %d" ), drmStatus );
   701 
   703 
   702     return drmStatus;
   704     return drmStatus;
   703     }
   705     }
   704 
   706 
       
   707 EXPORT_C void MmMtpDpUtility::SetPSStatus( TMtpPSStatus aStatus )
       
   708     {
       
   709     TBool changeScheduled = EFalse;
       
   710     CMmMtpDpAccessSingleton::CancelActiveToIdleStatusChange();  // cancel any outstanding delay status change
       
   711     
       
   712     if ( aStatus == EMtpPSStatusReadyToSync )
       
   713         {
       
   714         TInt mtpStatus;
       
   715         RProperty::Get( KMtpPSUid, KMtpPSStatus, mtpStatus );
       
   716         
       
   717         if ( mtpStatus == EMtpPSStatusActive )
       
   718             {
       
   719             CMmMtpDpAccessSingleton::ActiveToIdleStatusChange();
       
   720             changeScheduled = ETrue;
       
   721             }
       
   722         }
       
   723 
       
   724     if ( !changeScheduled )
       
   725         DoSetPSStatus( aStatus );
       
   726     }
       
   727 
       
   728 void MmMtpDpUtility::DoSetPSStatus( TMtpPSStatus aStatus )
       
   729     {
       
   730     TInt mtpStatus;
       
   731     RProperty::Get( KMtpPSUid, KMtpPSStatus, mtpStatus );
       
   732 
       
   733     if ( mtpStatus != aStatus )
       
   734         {
       
   735         TInt err = RProperty::Set( KMtpPSUid, KMtpPSStatus, aStatus );
       
   736         PRINT3( _L("MM MTP <> CRequestProcessor::DoSetPSStatus err = %d, previous = %d, current = %d" ), err , mtpStatus, aStatus);
       
   737         }
       
   738     }
   705 // end of file
   739 // end of file