|
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef CMTPPLAYBACKMAP_H |
|
22 #define CMTPPLAYBACKMAP_H |
|
23 |
|
24 #include <mtp/tmtptypeint32.h> |
|
25 #include <mtp/tmtptypeuint32.h> |
|
26 #include "mtpplaybackcontroldpconst.h" |
|
27 #include "mmtpplaybackinterface.h" |
|
28 #include "mtpdebug.h" |
|
29 |
|
30 class CMTPPlaybackCommand; |
|
31 class CMTPPlaybackProperty; |
|
32 class MMTPDataProviderFramework; |
|
33 |
|
34 class TMTPPbCtrlData |
|
35 { |
|
36 public: |
|
37 TMTPOperationCode iOptCode; |
|
38 TMTPDevicePropertyCode iDevPropCode; |
|
39 TMTPTypeUint32 iPropValUint32; |
|
40 TMTPTypeInt32 iPropValInt32; |
|
41 }; |
|
42 |
|
43 |
|
44 /** |
|
45 Implements CMTPPlaybackMap. |
|
46 @internalComponent |
|
47 */ |
|
48 class CMTPPlaybackMap : public CBase |
|
49 { |
|
50 |
|
51 public: |
|
52 |
|
53 static CMTPPlaybackMap* NewL(MMTPDataProviderFramework& aFramework, CMTPPlaybackProperty& aProperty); |
|
54 ~CMTPPlaybackMap(); |
|
55 |
|
56 /** |
|
57 Factory meothod, map the MTP playback control data to playback control command, |
|
58 @param aData TMTPPbCtrlData, |
|
59 @param aCmd output the valid playback command if the return value if KErrNone |
|
60 @return KErrNone if request is valid, else an error code. |
|
61 */ |
|
62 TInt GetPlaybackControlCommand(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
63 |
|
64 /** |
|
65 Map the playback state to MTP playback rate, |
|
66 @param aState TMTPPlaybackState |
|
67 @return the playback rate. |
|
68 */ |
|
69 TInt32 PlaybackRateL(TMTPPlaybackState aState); |
|
70 |
|
71 /** |
|
72 Map the playback state to MTP playback rate, |
|
73 @param aSuid SUID |
|
74 @return the playback object handle. |
|
75 */ |
|
76 TUint32 ObjectHandleL(const TDesC& aSuid); |
|
77 |
|
78 private: |
|
79 CMTPPlaybackMap(MMTPDataProviderFramework& aFramework, CMTPPlaybackProperty& aProperty); |
|
80 void ConstructL(); |
|
81 |
|
82 TInt HandleSetDevicePropValue(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
83 void HandleSetDevicePropValueL(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
84 TInt HandleGetDevicePropValue(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
85 void HandleGetDevicePropValueL(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
86 TInt HandleSkip(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
87 void HandleSkipL(const TMTPPbCtrlData& aData, CMTPPlaybackCommand** aCmd); |
|
88 void GetObjecInfoFromHandleL(TUint32 aHandle, TDes& aSuid, TUint& aFormat) const; |
|
89 |
|
90 private: // Owned. |
|
91 |
|
92 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
93 MMTPDataProviderFramework& iFramework; |
|
94 CMTPPlaybackProperty& iProperty; |
|
95 }; |
|
96 |
|
97 #endif //CMTPPLAYBACKMAP_H |
|
98 |