|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <mtp/cmtptypeobjectproplist.h> |
|
19 #include <mtp/mtpprotocolconstants.h> |
|
20 #include <mtp/mtpdatatypeconstants.h> |
|
21 #include <mtp/cmtptypearray.h> |
|
22 |
|
23 #include "cabstractmediamtpdataproviderpropertysettingutility.h" |
|
24 #include "mmmtpdplogger.h" |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CAbstractMediaMtpDataProviderPropertySettingUtility::NewL |
|
28 // Two-phase construction method |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CAbstractMediaMtpDataProviderPropertySettingUtility* CAbstractMediaMtpDataProviderPropertySettingUtility::NewL() |
|
32 { |
|
33 CAbstractMediaMtpDataProviderPropertySettingUtility* self = |
|
34 new ( ELeave ) CAbstractMediaMtpDataProviderPropertySettingUtility(); |
|
35 |
|
36 return self; |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CAbstractMediaMtpDataProviderPropertySettingUtility::~CAbstractMediaMtpDataProviderPropertySettingUtility |
|
41 // Destructor |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CAbstractMediaMtpDataProviderPropertySettingUtility::~CAbstractMediaMtpDataProviderPropertySettingUtility() |
|
45 { |
|
46 // Do nothing |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CAbstractMediaMtpDataProviderPropertySettingUtility::CAbstractMediaMtpDataProviderPropertySettingUtility |
|
51 // Standard C++ Constructor |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 CAbstractMediaMtpDataProviderPropertySettingUtility::CAbstractMediaMtpDataProviderPropertySettingUtility() |
|
55 { |
|
56 // Do nothing |
|
57 } |
|
58 |
|
59 TMTPResponseCode CAbstractMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL( MMmMtpDpConfig& aDpConfig, |
|
60 TUint16 aPropCode, |
|
61 const CMTPObjectMetaData& aObject, |
|
62 const CMTPTypeObjectPropListElement& aElement ) |
|
63 { |
|
64 PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL" ) ); |
|
65 |
|
66 TMTPResponseCode responseCode = EMTPRespCodeOK; |
|
67 |
|
68 switch ( aPropCode ) |
|
69 { |
|
70 case EMTPObjectPropCodeRepresentativeSampleData: |
|
71 { |
|
72 CMTPTypeArray* desData = CMTPTypeArray::NewLC( EMTPTypeAUINT8 ); |
|
73 desData->SetByDesL( aElement.ArrayL( CMTPTypeObjectPropListElement::EValue ) ); |
|
74 responseCode = SetMetaDataToWrapper( aDpConfig, aPropCode, *desData, aObject ); |
|
75 CleanupStack::PopAndDestroy( desData ); |
|
76 } |
|
77 break; |
|
78 |
|
79 case EMTPObjectPropCodeRepresentativeSampleFormat: |
|
80 case EMTPObjectPropCodeRepresentativeSampleSize: |
|
81 case EMTPObjectPropCodeRepresentativeSampleHeight: |
|
82 case EMTPObjectPropCodeRepresentativeSampleWidth: |
|
83 // no place to store, do nothing. reserve here for future usage |
|
84 break; |
|
85 |
|
86 default: |
|
87 // Should not happen, property code should have been checked before set to store. |
|
88 User::Leave( KErrNotSupported ); |
|
89 } |
|
90 |
|
91 PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderPropertySettingUtility::SetSpecificObjectPropertyL" ) ); |
|
92 return responseCode; |
|
93 } |
|
94 |
|
95 // end of file |