|
1 // Copyright (c) 2008-2009 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 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef MEDIABROWSE_H |
|
25 #define MEDIABROWSE_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <remconmediainformationtargetobserver.h> |
|
29 #include <remconmediabrowsetypes.h> |
|
30 #include "avrcpipc.h" |
|
31 #include "browsingframe.h" |
|
32 #include "mediainformation.h" |
|
33 |
|
34 //-------------------------------------------------------------------------- |
|
35 // Interface Data |
|
36 //-------------------------------------------------------------------------- |
|
37 |
|
38 enum TRemConMediaBrowseOperationId |
|
39 { |
|
40 EGetFolderItemsOperationId, |
|
41 EChangePathOperationId, |
|
42 EGetItemAttributesOperationId, |
|
43 ESearchOperationId, |
|
44 ESetMaxResponseOperationId, |
|
45 ESetBrowsedPlayerOperationId, |
|
46 EUIDPersistency, |
|
47 EMediaLibraryStateCookieUpdateOperationId, |
|
48 }; |
|
49 |
|
50 /** |
|
51 * The UID identifying the RemCon NowPlaying interface. |
|
52 */ |
|
53 const TInt KRemConMediaBrowseApiUid = 0x10285bbb; |
|
54 |
|
55 // identifier (8bytes) NumAttributes (1) AttributeID (max is 4*7) = 37 + UID Counter + scope |
|
56 const TInt KMaxLengthMediaBrowseMsg = 400; |
|
57 |
|
58 //PDU ID(1 byte) + Parameter length(2 bytes) + Status(1 byte), |
|
59 //the total of which is 4 bytes |
|
60 const TInt KBrowseResponseBaseLength = 4; |
|
61 |
|
62 //KBrowseResponseBaseLength(4 bytes) + UID Counter(2 bytes) + Number of Items(2 bytes) |
|
63 //the total of which is 8 |
|
64 const TInt KGetFolderItemsResponseBaseSize = 8; |
|
65 |
|
66 //UID 8 + FolderType 1 + Is Playable 1 + Character set ID 2 + Name length 2 |
|
67 const TInt KFolderItemBaseLength = 14; |
|
68 |
|
69 //UID 8 + Type 1 + Character Set 2 + Name Length 2 + Number of attributes 1 |
|
70 const TInt KMediaElementItemBaseLength = 14; |
|
71 |
|
72 //ID 4 + Character Set 2 + Length filed 2 |
|
73 const TInt KAttributeBaseLength = 8; |
|
74 |
|
75 //Status 1 |
|
76 const TInt KErrResponseParameterLength = 1; |
|
77 |
|
78 /** |
|
79 This is the max length of a response used in media browse API for fix-length responses. |
|
80 For the response which have a fix-length the Search(PDU 0x80) has the maximum response |
|
81 which is KBrowseResponseBaseLength(4 bytes)+ UID Counter(2 bytes) + Number of Items(4 bytes) |
|
82 the total of which is 10 |
|
83 */ |
|
84 const TInt KMediaBrowseOutBufMaxLength = 10; |
|
85 |
|
86 class RItem |
|
87 { |
|
88 public: |
|
89 IMPORT_C void Close(); |
|
90 IMPORT_C TInt Size(); |
|
91 |
|
92 public: |
|
93 AvrcpBrowsing::TItemType iType; |
|
94 TUint16 iLength; |
|
95 TUint64 iUid; |
|
96 |
|
97 TUint16 iCharset; |
|
98 TUint16 iNameLength; |
|
99 HBufC8* iName; |
|
100 |
|
101 // Folder attributes |
|
102 AvrcpBrowsing::TFolderType iFolderType; |
|
103 AvrcpBrowsing::TPlayable iPlayable; |
|
104 |
|
105 // Media element attributes |
|
106 AvrcpBrowsing::TMediaType iMediaType; |
|
107 TInt iNumberAttributes; |
|
108 RArray<REAResponse> iAttributes; |
|
109 }; |
|
110 |
|
111 //-------------------------------------------------- |
|
112 // GetFolderItems 0x71 |
|
113 //-------------------------------------------------- |
|
114 class RRemConGetFolderItemsRequest : public RAvrcpIPC |
|
115 { |
|
116 public: |
|
117 AvrcpBrowsing::TScope iScope; |
|
118 TUint iStartItem; |
|
119 TUint iEndItem; |
|
120 TInt iNumberAttributes; |
|
121 RArray<TInt> iAttributes; |
|
122 |
|
123 public: |
|
124 IMPORT_C void ReadL(const TDesC8& aData); |
|
125 IMPORT_C void WriteL(TDes8& aOutData); |
|
126 IMPORT_C void Close(); |
|
127 IMPORT_C TInt CopyAttributes(RArray<TMediaAttributeId>& aOutAttributes); |
|
128 }; |
|
129 |
|
130 class RRemConGetFolderItemsResponse : public RAvrcpIPC |
|
131 { |
|
132 public: |
|
133 TUint8 iPduId; |
|
134 TUint16 iParamLength; |
|
135 TUint8 iStatus; |
|
136 TUint16 iUidCounter; |
|
137 TUint16 iNumberItems; |
|
138 RArray<RItem> iItems; |
|
139 |
|
140 TInt iMaxResponse; |
|
141 TInt iCurrentItem; |
|
142 TInt iCurrentListingSize; |
|
143 |
|
144 public: |
|
145 IMPORT_C void ReadL(const TDesC8& aData); |
|
146 IMPORT_C void WriteL(TDes8& aOutData); |
|
147 IMPORT_C TInt Size(); |
|
148 IMPORT_C void Close(); |
|
149 IMPORT_C TInt CopyItems(const TArray<TRemConItem>& aItems); |
|
150 IMPORT_C TBool RequestNextItem(TInt& aError, RBuf8& aOutBuf, TUint16 aCookie); |
|
151 |
|
152 private: |
|
153 void ReadItemL(); |
|
154 void WriteItemL(TInt aIndex); |
|
155 }; |
|
156 |
|
157 //-------------------------------------------------- |
|
158 // ChangePath 0x72 |
|
159 //-------------------------------------------------- |
|
160 class RRemConChangePathRequest : public RAvrcpIPC |
|
161 { |
|
162 public: |
|
163 TUint16 iUidCounter; |
|
164 AvrcpBrowsing::TDirection iDirection; |
|
165 TUint64 iElement; |
|
166 |
|
167 public: |
|
168 IMPORT_C void ReadL(const TDesC8& aData); |
|
169 IMPORT_C void WriteL(TDes8& aOutData); |
|
170 }; |
|
171 |
|
172 |
|
173 class RRemConChangePathResponse : public RAvrcpIPC |
|
174 { |
|
175 public: |
|
176 TUint8 iPduId; |
|
177 TUint16 iParamLength; |
|
178 TUint8 iStatus; |
|
179 TInt iNumberItems; |
|
180 |
|
181 public: |
|
182 IMPORT_C void ReadL(const TDesC8& aData); |
|
183 IMPORT_C void WriteL(TDes8& aOutData); |
|
184 }; |
|
185 |
|
186 //-------------------------------------------------- |
|
187 // GetItemAttributes 0x73 |
|
188 //-------------------------------------------------- |
|
189 class RRemConGetItemAttributesRequest : public RAvrcpIPC |
|
190 { |
|
191 public: |
|
192 AvrcpBrowsing::TScope iScope; |
|
193 TUint64 iElement; |
|
194 TUint16 iUidCounter; |
|
195 TInt iNumberAttributes; |
|
196 RArray<TInt> iAttributes; |
|
197 |
|
198 public: |
|
199 IMPORT_C void ReadL(const TDesC8& aData); |
|
200 IMPORT_C void WriteL(TDes8& aOutData); |
|
201 IMPORT_C void Close(); |
|
202 }; |
|
203 |
|
204 |
|
205 class RRemConGetItemAttributesResponse : public RAvrcpIPC |
|
206 { |
|
207 public: |
|
208 TUint8 iPduId; |
|
209 TUint16 iParamLength; |
|
210 TUint8 iStatus; |
|
211 TInt iNumberAttributes; |
|
212 RArray<REAResponse> iAttributes; |
|
213 |
|
214 public: |
|
215 IMPORT_C void ReadL(const TDesC8& aData); |
|
216 IMPORT_C void WriteL(TDes8& aOutData); |
|
217 IMPORT_C TInt Size(); |
|
218 IMPORT_C void Close(); |
|
219 }; |
|
220 |
|
221 //-------------------------------------------------- |
|
222 // Search 0x80 |
|
223 //-------------------------------------------------- |
|
224 class RRemConSearchRequest : public RAvrcpIPC |
|
225 { |
|
226 public: |
|
227 TUint16 iCharset; |
|
228 TUint16 iStringLen; |
|
229 RBuf8 iSearchString; |
|
230 |
|
231 public: |
|
232 IMPORT_C void ReadL(const TDesC8& aData); |
|
233 IMPORT_C void WriteL(TDes8& aOutData); |
|
234 IMPORT_C TInt Size(); |
|
235 IMPORT_C void Close(); |
|
236 }; |
|
237 |
|
238 class RRemConSearchResponse : public RAvrcpIPC |
|
239 { |
|
240 public: |
|
241 TUint8 iPduId; |
|
242 TUint16 iParamLength; |
|
243 TUint8 iStatus; |
|
244 TUint16 iUidCounter; |
|
245 TUint iNumberItems; |
|
246 |
|
247 public: |
|
248 IMPORT_C void ReadL(const TDesC8& aData); |
|
249 IMPORT_C void WriteL(TDes8& aOutData); |
|
250 }; |
|
251 |
|
252 //-------------------------------------------------- |
|
253 // SetBrowsedPlayer |
|
254 //-------------------------------------------------- |
|
255 class RRemConSetBrowsedPlayerRequest : public RAvrcpIPC |
|
256 { |
|
257 public: |
|
258 TInt iMaxResponse; |
|
259 TUint16 iPlayerId; |
|
260 |
|
261 public: |
|
262 IMPORT_C void ReadL(const TDesC8& aData); |
|
263 IMPORT_C void WriteL(TDes8& aOutData); |
|
264 }; |
|
265 |
|
266 class RRemConGetPathResponse : public RAvrcpIPC |
|
267 { |
|
268 public: |
|
269 TUint8 iPduId; |
|
270 TUint16 iParamLength; |
|
271 TUint8 iStatus; |
|
272 TUint16 iUidCounter; |
|
273 TUint iNumberItems; |
|
274 TUint16 iCharset; |
|
275 TUint8 iFolderDepth; |
|
276 RPointerArray<HBufC8> iPath; |
|
277 |
|
278 public: |
|
279 IMPORT_C void ReadL(const TDesC8& aData); |
|
280 IMPORT_C void WriteL(TDes8& aOutData); |
|
281 IMPORT_C TInt Size(); |
|
282 IMPORT_C void Close(); |
|
283 }; |
|
284 |
|
285 class RRemConMediaErrorResponse : public RAvrcpIPC |
|
286 { |
|
287 public: |
|
288 TUint8 iPduId; |
|
289 TUint16 iLength; |
|
290 TUint8 iStatus; |
|
291 |
|
292 public: |
|
293 IMPORT_C void ReadL(const TDesC8& aData); |
|
294 IMPORT_C void WriteL(TDes8& aOutData); |
|
295 }; |
|
296 |
|
297 class RRemConUidsChangedRequest : public RAvrcpIPC |
|
298 { |
|
299 public: |
|
300 TUint16 iInitialUidCounter; |
|
301 |
|
302 public: |
|
303 IMPORT_C void ReadL(const TDesC8& aData); |
|
304 IMPORT_C void WriteL(TDes8& aOutData); |
|
305 }; |
|
306 |
|
307 class RRemConUidsChangedResponse : public RAvrcpIPC |
|
308 { |
|
309 public: |
|
310 TUint16 iUidCounter; |
|
311 public: |
|
312 IMPORT_C void ReadL(const TDesC8& aData); |
|
313 IMPORT_C void WriteL(TDes8& aOutData); |
|
314 }; |
|
315 #endif //MEDIABROWSE_H |