51
|
1 |
// Copyright (c) 2008-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 |
// TPlayerFeatureBitmask.cpp
|
|
15 |
//
|
|
16 |
|
|
17 |
#include <remconcoreapi.h>
|
|
18 |
#include "avrcplog.h"
|
|
19 |
#include "avrcputils.h"
|
|
20 |
#include "mediabrowse.h"
|
|
21 |
#include "nowplaying.h"
|
|
22 |
#include "playerbitmasks.h"
|
|
23 |
#include "remcongroupnavigation.h"
|
|
24 |
|
|
25 |
|
|
26 |
TPlayerFeatureBitmask::TPlayerFeatureBitmask()
|
|
27 |
{
|
|
28 |
iFeatureBitmask.FillZ(KFeatureBitmaskLength);
|
|
29 |
}
|
|
30 |
|
|
31 |
TPlayerFeatureBitmask::TPlayerFeatureBitmask(const TPlayerFeatureBitmask& aFeatureBitmask)
|
|
32 |
{
|
|
33 |
iFeatureBitmask.Copy(aFeatureBitmask.FeatureBitmask());
|
|
34 |
}
|
|
35 |
|
|
36 |
void TPlayerFeatureBitmask::SetCoreApiFeatures(const RArray<TUint>& aOperation)
|
|
37 |
{
|
|
38 |
if(aOperation.Count() > 0)
|
|
39 |
{
|
|
40 |
for(TInt j = 0; j< aOperation.Count() ; j++)
|
|
41 |
{
|
|
42 |
switch(aOperation[j])
|
|
43 |
{
|
|
44 |
case ERemConCoreApiSelect:
|
|
45 |
iFeatureBitmask[ESelectByteOffset] |= (1<<ESelectBitOffset);
|
|
46 |
break;
|
|
47 |
case ERemConCoreApiUp:
|
|
48 |
iFeatureBitmask[EUpByteOffset]|= (1<<EUpBitOffset);
|
|
49 |
break;
|
|
50 |
case ERemConCoreApiDown:
|
|
51 |
iFeatureBitmask[EDownByteOffset]|= (1<<EDownBitOffset);
|
|
52 |
break;
|
|
53 |
case ERemConCoreApiLeft:
|
|
54 |
iFeatureBitmask[ELeftByteOffset]|= (1<<ELeftBitOffset);
|
|
55 |
break;
|
|
56 |
case ERemConCoreApiRight:
|
|
57 |
iFeatureBitmask[ERightByteOffset]|= (1<<ERightBitOffset);
|
|
58 |
break;
|
|
59 |
case ERemConCoreApiRightUp:
|
|
60 |
iFeatureBitmask[ERightUpByteOffset]|= (1<<ERightUpBitOffset);
|
|
61 |
break;
|
|
62 |
case ERemConCoreApiRightDown:
|
|
63 |
iFeatureBitmask[ERightDownByteOffset]|= (1<<ERightDownBitOffset);
|
|
64 |
break;
|
|
65 |
case ERemConCoreApiLeftUp:
|
|
66 |
iFeatureBitmask[ELeftUpByteOffset]|= (1<<ELeftUpBitOffset);
|
|
67 |
break;
|
|
68 |
case ERemConCoreApiLeftDown:
|
|
69 |
iFeatureBitmask[ELeftDownByteOffset]|= (1<<ELeftDownBitOffset);
|
|
70 |
break;
|
|
71 |
case ERemConCoreApiRootMenu:
|
|
72 |
iFeatureBitmask[ERootMenuByteOffset]|= (1<<ERootMenuBitOffset);
|
|
73 |
break;
|
|
74 |
case ERemConCoreApiSetupMenu:
|
|
75 |
iFeatureBitmask[ESetupMenuByteOffset]|= (1<<ESetupMenuBitOffset);
|
|
76 |
break;
|
|
77 |
case ERemConCoreApiContentsMenu:
|
|
78 |
iFeatureBitmask[EContentsMenuByteOffset]|= (1<<EContentsMenuBitOffset);
|
|
79 |
break;
|
|
80 |
case ERemConCoreApiFavoriteMenu:
|
|
81 |
iFeatureBitmask[EFavoriteMenuByteOffset]|= (1<<EFavoriteMenuBitOffset);
|
|
82 |
break;
|
|
83 |
case ERemConCoreApiExit:
|
|
84 |
iFeatureBitmask[EExitByteOffset]|= (1<<EExitBitOffset);
|
|
85 |
break;
|
|
86 |
case ERemConCoreApi0:
|
|
87 |
iFeatureBitmask[E0ByteOffset]|= (1<<E0BitOffset);
|
|
88 |
break;
|
|
89 |
case ERemConCoreApi1:
|
|
90 |
iFeatureBitmask[E1ByteOffset]|= (1<<E1BitOffset);
|
|
91 |
break;
|
|
92 |
case ERemConCoreApi2:
|
|
93 |
iFeatureBitmask[E2ByteOffset]|= (1<<E2BitOffset);
|
|
94 |
break;
|
|
95 |
case ERemConCoreApi3:
|
|
96 |
iFeatureBitmask[E3ByteOffset]|= (1<<E3BitOffset);
|
|
97 |
break;
|
|
98 |
case ERemConCoreApi4:
|
|
99 |
iFeatureBitmask[E4ByteOffset]|= (1<<E4BitOffset);
|
|
100 |
break;
|
|
101 |
case ERemConCoreApi5:
|
|
102 |
iFeatureBitmask[E5ByteOffset]|= (1<<E5BitOffset);
|
|
103 |
break;
|
|
104 |
case ERemConCoreApi6:
|
|
105 |
iFeatureBitmask[E6ByteOffset]|= (1<<E6BitOffset);
|
|
106 |
break;
|
|
107 |
case ERemConCoreApi7:
|
|
108 |
iFeatureBitmask[E7ByteOffset]|= (1<<E7BitOffset);
|
|
109 |
break;
|
|
110 |
case ERemConCoreApi8:
|
|
111 |
iFeatureBitmask[E8ByteOffset]|= (1<<E8BitOffset);
|
|
112 |
break;
|
|
113 |
case ERemConCoreApi9:
|
|
114 |
iFeatureBitmask[E9ByteOffset]|= (1<<E9BitOffset);
|
|
115 |
break;
|
|
116 |
case ERemConCoreApiDot:
|
|
117 |
iFeatureBitmask[EDotByteOffset]|= (1<<EDotBitOffset);
|
|
118 |
break;
|
|
119 |
case ERemConCoreApiEnter:
|
|
120 |
iFeatureBitmask[EEnterByteOffset]|= (1<<EEnterBitOffset);
|
|
121 |
break;
|
|
122 |
case ERemConCoreApiClear:
|
|
123 |
iFeatureBitmask[EClearByteOffset]|= (1<<EClearBitOffset);
|
|
124 |
break;
|
|
125 |
case ERemConCoreApiChannelUp:
|
|
126 |
iFeatureBitmask[EChannelUpByteOffset]|= (1<<EChannelUpBitOffset);
|
|
127 |
break;
|
|
128 |
case ERemConCoreApiChannelDown:
|
|
129 |
iFeatureBitmask[EChannelDownByteOffset]|= (1<<EChannelDownBitOffset);
|
|
130 |
break;
|
|
131 |
case ERemConCoreApiPreviousChannel:
|
|
132 |
iFeatureBitmask[EPreviousChannelByteOffset]|= (1<<EPreviousChannelBitOffset);
|
|
133 |
break;
|
|
134 |
case ERemConCoreApiSoundSelect:
|
|
135 |
iFeatureBitmask[ESoundSelectByteOffset]|= (1<<ESoundSelectBitOffset);
|
|
136 |
break;
|
|
137 |
case ERemConCoreApiInputSelect:
|
|
138 |
iFeatureBitmask[EInputSelectByteOffset]|= (1<<EInputSelectBitOffset);
|
|
139 |
break;
|
|
140 |
case ERemConCoreApiDisplayInformation:
|
|
141 |
iFeatureBitmask[EDisplayInformationByteOffset]|= (1<<EDisplayInformationBitOffset);
|
|
142 |
break;
|
|
143 |
case ERemConCoreApiHelp:
|
|
144 |
iFeatureBitmask[EHelpByteOffset]|= (1<<EHelpBitOffset);
|
|
145 |
break;
|
|
146 |
case ERemConCoreApiPageUp:
|
|
147 |
iFeatureBitmask[EPageUpByteOffset]|= (1<<EPageUpBitOffset);
|
|
148 |
break;
|
|
149 |
case ERemConCoreApiPageDown:
|
|
150 |
iFeatureBitmask[EPageDownByteOffset]|= (1<<EPageDownBitOffset);
|
|
151 |
break;
|
|
152 |
case ERemConCoreApiPower:
|
|
153 |
iFeatureBitmask[EPowerByteOffset]|= (1<<EPowerBitOffset);
|
|
154 |
break;
|
|
155 |
case ERemConCoreApiVolumeUp:
|
|
156 |
iFeatureBitmask[EVolumeUpByteOffset]|= (1<<EVolumeUpBitOffset);
|
|
157 |
break;
|
|
158 |
case ERemConCoreApiVolumeDown:
|
|
159 |
iFeatureBitmask[EVolumeDownByteOffset]|= (1<<EVolumeDownBitOffset);
|
|
160 |
break;
|
|
161 |
case ERemConCoreApiMute:
|
|
162 |
iFeatureBitmask[EMuteByteOffset]|= (1<<EMuteBitOffset);
|
|
163 |
break;
|
|
164 |
case ERemConCoreApiPlay:
|
|
165 |
iFeatureBitmask[EPlayByteOffset]|= (1<<EPlayBitOffset);
|
|
166 |
break;
|
|
167 |
case ERemConCoreApiStop:
|
|
168 |
iFeatureBitmask[EStopByteOffset]|= (1<<EStopBitOffset);
|
|
169 |
break;
|
|
170 |
case ERemConCoreApiPause:
|
|
171 |
iFeatureBitmask[EPauseByteOffset]|= (1<<EPauseBitOffset);
|
|
172 |
break;
|
|
173 |
case ERemConCoreApiRecord:
|
|
174 |
iFeatureBitmask[ERecordByteOffset]|= (1<<ERecordBitOffset);
|
|
175 |
break;
|
|
176 |
case ERemConCoreApiRewind:
|
|
177 |
iFeatureBitmask[ERewindByteOffset]|= (1<<ERewindBitOffset);
|
|
178 |
break;
|
|
179 |
case ERemConCoreApiFastForward:
|
|
180 |
iFeatureBitmask[EFastForwardByteOffset]|= (1<<EFastForwardBitOffset);
|
|
181 |
break;
|
|
182 |
case ERemConCoreApiEject:
|
|
183 |
iFeatureBitmask[EEjectByteOffset]|= (1<<EEjectBitOffset);
|
|
184 |
break;
|
|
185 |
case ERemConCoreApiForward:
|
|
186 |
iFeatureBitmask[EForwardByteOffset]|= (1<<EForwardBitOffset);
|
|
187 |
break;
|
|
188 |
case ERemConCoreApiBackward:
|
|
189 |
iFeatureBitmask[EBackwardByteOffset]|= (1<<EBackwardBitOffset);
|
|
190 |
break;
|
|
191 |
case ERemConCoreApiAngle:
|
|
192 |
iFeatureBitmask[EAngleByteOffset]|= (1<<EAngleBitOffset);
|
|
193 |
break;
|
|
194 |
case ERemConCoreApiSubpicture:
|
|
195 |
iFeatureBitmask[ESubpictureByteOffset]|= (1<<ESubpictureBitOffset);
|
|
196 |
break;
|
|
197 |
case ERemConCoreApiF1:
|
|
198 |
iFeatureBitmask[EF1ByteOffset]|= (1<<EF1BitOffset);
|
|
199 |
break;
|
|
200 |
case ERemConCoreApiF2:
|
|
201 |
iFeatureBitmask[EF2ByteOffset]|= (1<<EF2BitOffset);
|
|
202 |
break;
|
|
203 |
case ERemConCoreApiF3:
|
|
204 |
iFeatureBitmask[EF3ByteOffset]|= (1<<EF3BitOffset);
|
|
205 |
break;
|
|
206 |
case ERemConCoreApiF4:
|
|
207 |
iFeatureBitmask[EF4ByteOffset]|= (1<<EF4BitOffset);
|
|
208 |
break;
|
|
209 |
case ERemConCoreApiF5:
|
|
210 |
iFeatureBitmask[EF5ByteOffset]|= (1<<EF5BitOffset);
|
|
211 |
break;
|
|
212 |
default:
|
|
213 |
// Ignore operations that aren't recorded in feature bitmask
|
|
214 |
break;
|
|
215 |
}
|
|
216 |
}
|
|
217 |
}
|
|
218 |
else
|
|
219 |
{
|
|
220 |
// Don't know specific info, set all operations
|
|
221 |
SetCoreApiFeatures();
|
|
222 |
}
|
|
223 |
}
|
|
224 |
|
|
225 |
void TPlayerFeatureBitmask::SetCoreApiFeatures()
|
|
226 |
{
|
|
227 |
iFeatureBitmask[ESelectByteOffset] |= (1<<ESelectBitOffset);
|
|
228 |
iFeatureBitmask[EUpByteOffset]|= (1<<EUpBitOffset);
|
|
229 |
iFeatureBitmask[EDownByteOffset]|= (1<<EDownBitOffset);
|
|
230 |
iFeatureBitmask[ELeftByteOffset]|= (1<<ELeftBitOffset);
|
|
231 |
iFeatureBitmask[ERightByteOffset]|= (1<<ERightBitOffset);
|
|
232 |
iFeatureBitmask[ERightUpByteOffset]|= (1<<ERightUpBitOffset);
|
|
233 |
iFeatureBitmask[ERightDownByteOffset]|= (1<<ERightDownBitOffset);
|
|
234 |
iFeatureBitmask[ELeftUpByteOffset]|= (1<<ELeftUpBitOffset);
|
|
235 |
iFeatureBitmask[ELeftDownByteOffset]|= (1<<ELeftDownBitOffset);
|
|
236 |
iFeatureBitmask[ERootMenuByteOffset]|= (1<<ERootMenuBitOffset);
|
|
237 |
iFeatureBitmask[ESetupMenuByteOffset]|= (1<<ESetupMenuBitOffset);
|
|
238 |
iFeatureBitmask[EContentsMenuByteOffset]|= (1<<EContentsMenuBitOffset);
|
|
239 |
iFeatureBitmask[EFavoriteMenuByteOffset]|= (1<<EFavoriteMenuBitOffset);
|
|
240 |
iFeatureBitmask[EExitByteOffset]|= (1<<EExitBitOffset);
|
|
241 |
iFeatureBitmask[E0ByteOffset]|= (1<<E0BitOffset);
|
|
242 |
iFeatureBitmask[E1ByteOffset]|= (1<<E1BitOffset);
|
|
243 |
iFeatureBitmask[E2ByteOffset]|= (1<<E2BitOffset);
|
|
244 |
iFeatureBitmask[E3ByteOffset]|= (1<<E3BitOffset);
|
|
245 |
iFeatureBitmask[E4ByteOffset]|= (1<<E4BitOffset);
|
|
246 |
iFeatureBitmask[E5ByteOffset]|= (1<<E5BitOffset);
|
|
247 |
iFeatureBitmask[E6ByteOffset]|= (1<<E6BitOffset);
|
|
248 |
iFeatureBitmask[E7ByteOffset]|= (1<<E7BitOffset);
|
|
249 |
iFeatureBitmask[E8ByteOffset]|= (1<<E8BitOffset);
|
|
250 |
iFeatureBitmask[E9ByteOffset]|= (1<<E9BitOffset);
|
|
251 |
iFeatureBitmask[EDotByteOffset]|= (1<<EDotBitOffset);
|
|
252 |
iFeatureBitmask[EEnterByteOffset]|= (1<<EEnterBitOffset);
|
|
253 |
iFeatureBitmask[EClearByteOffset]|= (1<<EClearBitOffset);
|
|
254 |
iFeatureBitmask[EChannelUpByteOffset]|= (1<<EChannelUpBitOffset);
|
|
255 |
iFeatureBitmask[EChannelDownByteOffset]|= (1<<EChannelDownBitOffset);
|
|
256 |
iFeatureBitmask[EPreviousChannelByteOffset]|= (1<<EPreviousChannelBitOffset);
|
|
257 |
iFeatureBitmask[ESoundSelectByteOffset]|= (1<<ESoundSelectBitOffset);
|
|
258 |
iFeatureBitmask[EInputSelectByteOffset]|= (1<<EInputSelectBitOffset);
|
|
259 |
iFeatureBitmask[EDisplayInformationByteOffset]|= (1<<EDisplayInformationBitOffset);
|
|
260 |
iFeatureBitmask[EHelpByteOffset]|= (1<<EHelpBitOffset);
|
|
261 |
iFeatureBitmask[EPageUpByteOffset]|= (1<<EPageUpBitOffset);
|
|
262 |
iFeatureBitmask[EPageDownByteOffset]|= (1<<EPageDownBitOffset);
|
|
263 |
iFeatureBitmask[EPowerByteOffset]|= (1<<EPowerBitOffset);
|
|
264 |
iFeatureBitmask[EVolumeUpByteOffset]|= (1<<EVolumeUpBitOffset);
|
|
265 |
iFeatureBitmask[EVolumeDownByteOffset]|= (1<<EVolumeDownBitOffset);
|
|
266 |
iFeatureBitmask[EMuteByteOffset]|= (1<<EMuteBitOffset);
|
|
267 |
iFeatureBitmask[EPlayByteOffset]|= (1<<EPlayBitOffset);
|
|
268 |
iFeatureBitmask[EStopByteOffset]|= (1<<EStopBitOffset);
|
|
269 |
iFeatureBitmask[EPauseByteOffset]|= (1<<EPauseBitOffset);
|
|
270 |
iFeatureBitmask[ERecordByteOffset]|= (1<<ERecordBitOffset);
|
|
271 |
iFeatureBitmask[ERewindByteOffset]|= (1<<ERewindBitOffset);
|
|
272 |
iFeatureBitmask[EFastForwardByteOffset]|= (1<<EFastForwardBitOffset);
|
|
273 |
iFeatureBitmask[EEjectByteOffset]|= (1<<EEjectBitOffset);
|
|
274 |
iFeatureBitmask[EForwardByteOffset]|= (1<<EForwardBitOffset);
|
|
275 |
iFeatureBitmask[EBackwardByteOffset]|= (1<<EBackwardBitOffset);
|
|
276 |
iFeatureBitmask[EAngleByteOffset]|= (1<<EAngleBitOffset);
|
|
277 |
iFeatureBitmask[ESubpictureByteOffset]|= (1<<ESubpictureBitOffset);
|
|
278 |
iFeatureBitmask[EF1ByteOffset]|= (1<<EF1BitOffset);
|
|
279 |
iFeatureBitmask[EF2ByteOffset]|= (1<<EF2BitOffset);
|
|
280 |
iFeatureBitmask[EF3ByteOffset]|= (1<<EF3BitOffset);
|
|
281 |
iFeatureBitmask[EF4ByteOffset]|= (1<<EF4BitOffset);
|
|
282 |
iFeatureBitmask[EF5ByteOffset]|= (1<<EF5BitOffset);
|
|
283 |
}
|
|
284 |
|
|
285 |
void TPlayerFeatureBitmask::SetAbsoluteVolumeApiFeatures(const RArray<TUint>& aOperation)
|
|
286 |
{
|
|
287 |
if(aOperation.Count())
|
|
288 |
{
|
|
289 |
iFeatureBitmask[EAdvancedControlPlayerByteOffset] |= (1<<EAdvancedControlPlayerBitOffset);
|
|
290 |
}
|
|
291 |
}
|
|
292 |
|
|
293 |
void TPlayerFeatureBitmask::SetGroupNavigationApiFeatures(const RArray<TUint>& aOperation)
|
|
294 |
{
|
|
295 |
if(aOperation.Count())
|
|
296 |
{
|
|
297 |
iFeatureBitmask[EVendorUniqueByteOffset] |= (1<<EVendorUniqueBitOffset);
|
|
298 |
iFeatureBitmask[EGroupNavigationByteOffset] |= (1<<EGroupNavigationBitOffset);
|
|
299 |
}
|
|
300 |
}
|
|
301 |
|
|
302 |
void TPlayerFeatureBitmask::SetNowPlayingApiFeatures(const RArray<TUint>& aOperation)
|
|
303 |
{
|
|
304 |
if(aOperation.Count())
|
|
305 |
{
|
|
306 |
iFeatureBitmask[EAdvancedControlPlayerByteOffset] |= (1<<EAdvancedControlPlayerBitOffset);
|
|
307 |
iFeatureBitmask[ENowPlayingByteOffset] |= (1<<ENowPlayingBitOffset);
|
|
308 |
|
|
309 |
if(aOperation.Find(EAddToNowPlaying) >= 0)
|
|
310 |
{
|
|
311 |
iFeatureBitmask[EAddToNowPlayingByteOffset] |= (1<<EAddToNowPlayingBitOffset);
|
|
312 |
}
|
|
313 |
}
|
|
314 |
}
|
|
315 |
|
|
316 |
void TPlayerFeatureBitmask::SetMediaBrowseApiFeatures(const RArray<TUint>& aOperation)
|
|
317 |
{
|
|
318 |
if(aOperation.Count())
|
|
319 |
{
|
|
320 |
iFeatureBitmask[EAdvancedControlPlayerByteOffset] |= (1<<EAdvancedControlPlayerBitOffset);
|
|
321 |
iFeatureBitmask[ENowPlayingByteOffset] |= (1<<ENowPlayingBitOffset);
|
|
322 |
iFeatureBitmask[EBrowsingByteOffset] |= (1<<EBrowsingBitOffset);
|
|
323 |
|
|
324 |
if(aOperation.Find(ESearchOperationId) >= 0)
|
|
325 |
{
|
|
326 |
iFeatureBitmask[ESearchByteOffset] |= (1<<ESearchBitOffset);
|
|
327 |
}
|
|
328 |
|
|
329 |
if(aOperation.Find(EUIDPersistency) >= 0)
|
|
330 |
{
|
|
331 |
iFeatureBitmask[EUidPersistencyByteOffset] |= (1<<EUidPersistencyBitOffset);
|
|
332 |
iFeatureBitmask[EDatabaseAwareByteOffset] |= (1<<EDatabaseAwareBitOffset);
|
|
333 |
}
|
|
334 |
}
|
|
335 |
}
|
|
336 |
|
|
337 |
|