14 * Description: Implement opeartion setobjectpropvalue |
14 * Description: Implement opeartion setobjectpropvalue |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <mtp/mmtpdataproviderframework.h> |
|
20 #include <mtp/cmtptypestring.h> |
19 #include <mtp/cmtptypestring.h> |
21 #include <mtp/cmtptypearray.h> |
20 #include <mtp/cmtptypearray.h> |
22 #include <mtp/mmtpobjectmgr.h> |
21 #include <mtp/mmtpobjectmgr.h> |
23 |
22 |
24 #include "cmediamtpdataprovidersetobjectpropvalue.h" |
23 #include "cmediamtpdataprovidersetobjectpropvalue.h" |
52 // Two-phase construction method |
51 // Two-phase construction method |
53 // ----------------------------------------------------------------------------- |
52 // ----------------------------------------------------------------------------- |
54 // |
53 // |
55 void CMediaMtpDataProviderSetObjectPropValue::ConstructL() |
54 void CMediaMtpDataProviderSetObjectPropValue::ConstructL() |
56 { |
55 { |
57 |
56 // Do nothing |
58 } |
57 } |
59 |
58 |
60 // ----------------------------------------------------------------------------- |
59 // ----------------------------------------------------------------------------- |
61 // CMediaMtpDataProviderSetObjectPropValue::CMediaMtpDataProviderSetObjectPropValue |
60 // CMediaMtpDataProviderSetObjectPropValue::CMediaMtpDataProviderSetObjectPropValue |
62 // Standard c++ constructor |
61 // Standard c++ constructor |
63 // ----------------------------------------------------------------------------- |
62 // ----------------------------------------------------------------------------- |
64 // |
63 // |
65 CMediaMtpDataProviderSetObjectPropValue::CMediaMtpDataProviderSetObjectPropValue( MMTPDataProviderFramework& aFramework, |
64 CMediaMtpDataProviderSetObjectPropValue::CMediaMtpDataProviderSetObjectPropValue( MMTPDataProviderFramework& aFramework, |
66 MMTPConnection& aConnection, |
65 MMTPConnection& aConnection, |
67 MMmMtpDpConfig& aDpConfig ) : |
66 MMmMtpDpConfig& aDpConfig ) : |
68 CSetObjectPropValue( aFramework, aConnection, aDpConfig ) |
67 CSetObjectPropValue( aFramework, aConnection, aDpConfig ) |
69 { |
68 { |
70 |
69 // Do nothing |
71 } |
70 } |
72 |
71 |
73 // ----------------------------------------------------------------------------- |
72 // ----------------------------------------------------------------------------- |
74 // CMediaMtpDataProviderSetObjectPropValue::~CMediaMtpDataProviderSetObjectPropValue |
73 // CMediaMtpDataProviderSetObjectPropValue::~CMediaMtpDataProviderSetObjectPropValue |
75 // Destructor |
74 // Destructor |
76 // ----------------------------------------------------------------------------- |
75 // ----------------------------------------------------------------------------- |
77 // |
76 // |
78 CMediaMtpDataProviderSetObjectPropValue::~CMediaMtpDataProviderSetObjectPropValue() |
77 CMediaMtpDataProviderSetObjectPropValue::~CMediaMtpDataProviderSetObjectPropValue() |
79 { |
78 { |
80 |
79 // Do nothing |
81 } |
80 } |
82 |
81 |
83 TBool CMediaMtpDataProviderSetObjectPropValue::IsSpecificPropCodeReadOnly( TUint16 aPropCode ) const |
82 TBool CMediaMtpDataProviderSetObjectPropValue::IsSpecificPropCodeReadOnly( TUint16 aPropCode ) const |
84 { |
83 { |
85 TBool returnCode = EFalse; |
84 TBool returnCode = EFalse; |
130 |
129 |
131 //Get Data for Int32 objects |
130 //Get Data for Int32 objects |
132 case EMTPObjectPropCodeWidth: // 0xDC87 |
131 case EMTPObjectPropCodeWidth: // 0xDC87 |
133 case EMTPObjectPropCodeHeight: // 0xDC88 |
132 case EMTPObjectPropCodeHeight: // 0xDC88 |
134 case EMTPObjectPropCodeDuration: // 0xDC89 |
133 case EMTPObjectPropCodeDuration: // 0xDC89 |
135 case EMTPObjectPropCodeUseCount: // 0xDC91 |
|
136 case EMTPObjectPropCodeSampleRate: // 0xDE93 |
134 case EMTPObjectPropCodeSampleRate: // 0xDE93 |
137 case EMTPObjectPropCodeAudioWAVECodec: // 0xDE99 |
135 case EMTPObjectPropCodeAudioWAVECodec: // 0xDE99 |
138 case EMTPObjectPropCodeAudioBitRate: // 0xDE9A |
136 case EMTPObjectPropCodeAudioBitRate: // 0xDE9A |
139 case EMTPObjectPropCodeVideoFourCCCodec: // 0xDE9B |
137 case EMTPObjectPropCodeVideoFourCCCodec: // 0xDE9B |
140 case EMTPObjectPropCodeFramesPerThousandSeconds: // 0xDE9D |
138 case EMTPObjectPropCodeFramesPerThousandSeconds: // 0xDE9D |
183 break; |
181 break; |
184 |
182 |
185 case EMTPObjectPropCodeWidth: //0xDC87 |
183 case EMTPObjectPropCodeWidth: //0xDC87 |
186 case EMTPObjectPropCodeHeight: //0xDC88 |
184 case EMTPObjectPropCodeHeight: //0xDC88 |
187 case EMTPObjectPropCodeDuration: //0xDC89 |
185 case EMTPObjectPropCodeDuration: //0xDC89 |
188 case EMTPObjectPropCodeUseCount: //0xDC91 |
|
189 case EMTPObjectPropCodeSampleRate: //0xDE93 |
186 case EMTPObjectPropCodeSampleRate: //0xDE93 |
190 case EMTPObjectPropCodeAudioWAVECodec: //0xDE99 |
187 case EMTPObjectPropCodeAudioWAVECodec: //0xDE99 |
191 case EMTPObjectPropCodeAudioBitRate: //0xDE9A |
188 case EMTPObjectPropCodeAudioBitRate: //0xDE9A |
192 case EMTPObjectPropCodeVideoFourCCCodec: //0xDE9B |
189 case EMTPObjectPropCodeVideoFourCCCodec: //0xDE9B |
193 case EMTPObjectPropCodeFramesPerThousandSeconds: //0xDE9D |
190 case EMTPObjectPropCodeFramesPerThousandSeconds: //0xDE9D |
219 { |
216 { |
220 responseCode = EMTPRespCodeAccessDenied; |
217 responseCode = EMTPRespCodeAccessDenied; |
221 } |
218 } |
222 else |
219 else |
223 { |
220 { |
224 TMTPTypeUint8 newValue( iMTPTypeUint8 ); |
|
225 |
|
226 // there's no DB field to remember the value, so return an error |
221 // there's no DB field to remember the value, so return an error |
227 // if there's a mismatch to CAF protection status |
222 // if there's a mismatch to CAF protection status |
228 if ( ( ( drmStatus == EMTPDrmStatusProtected) && ( newValue.Value() == 0 ) ) || |
223 if ( ( ( drmStatus == EMTPDrmStatusProtected) && ( iMTPTypeUint8.Value() == 0 ) ) || |
229 ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( newValue.Value() == 1 ) ) ) |
224 ( ( drmStatus == EMTPDrmStatusNotProtected ) && ( iMTPTypeUint8.Value() == 1 ) ) ) |
230 { |
225 { |
231 responseCode = EMTPRespCodeAccessDenied; |
226 responseCode = EMTPRespCodeAccessDenied; |
232 } |
227 } |
233 } |
228 } |
234 } |
229 } |