|
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 #ifndef HGVGCONSTANTS_H_ |
|
19 #define HGVGCONSTANTS_H_ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 namespace HgVgConstants |
|
25 { |
|
26 |
|
27 // maximum velocity of the spring (max velocity of view movement) |
|
28 const TReal KMaxSpringVelocity(300.0f); |
|
29 |
|
30 // |
|
31 const TReal KSpringVelocityToAnimationFactor(10.0f); |
|
32 |
|
33 |
|
34 // maximum quads in coverflow |
|
35 const TInt KMaxCoversVisible(17); |
|
36 |
|
37 // selected item index |
|
38 const TInt KSelectedItemIndex(8); |
|
39 |
|
40 // fi |
|
41 const TReal KMinFlickSpeed(0.5f); |
|
42 |
|
43 const TInt KViewUpdateInterval( 15000 ); // > ~60 fps |
|
44 |
|
45 // The amound of pixels one item (virtually) takes on the screen (if you think coverflow as uniform list) |
|
46 const TReal KRowHeight(1.0f); |
|
47 const TInt KRowHeightStep(10); |
|
48 |
|
49 // PI |
|
50 const TReal PI(3.1415926535897932f); |
|
51 |
|
52 // Spring constant |
|
53 const TReal KSpringK(20.0f); |
|
54 |
|
55 // Spring damping |
|
56 const TReal KSpringDamping(11.0f); |
|
57 |
|
58 // maximum distance from target to snap |
|
59 const TReal KPositionSnap(0.01); |
|
60 |
|
61 // maximum speed where to snap to item |
|
62 const TReal KMinSpringVelocity(0.01); |
|
63 |
|
64 // how far user must have dragged an item before |
|
65 // we move to next item when user has stopped dragging gesture. |
|
66 const TReal KDragForwardThreshold(0.2f); |
|
67 |
|
68 // how many albums it is threoretically possible to go forward/backward |
|
69 // if the distance of a drag is fullscreen in length |
|
70 const TReal KItemsToDragOnFullScreenDrag(5.0f); |
|
71 |
|
72 // Physics update timestep |
|
73 const TReal KTimeStep(0.008333333333f); // we update physics 120 fps |
|
74 |
|
75 // Width of one quad in 3d space |
|
76 const TReal KWorldQuadWidth(1); |
|
77 |
|
78 // size of default icon in pixels |
|
79 const TInt KDefaultIconWidth(240); |
|
80 const TInt KDefaultIconHeight(240); |
|
81 |
|
82 // duration of album cover flip selection animation |
|
83 const TInt KSelectionAnimationDuration(400000); // 0.4 seconds |
|
84 |
|
85 // EGL surface bits |
|
86 const TInt KSurfaceRedBits(8); |
|
87 const TInt KSurfaceGreenBits(8); |
|
88 const TInt KSurfaceBlueBits(8); |
|
89 const TInt KSurfaceAlphaBits(8); |
|
90 |
|
91 // used for conversions |
|
92 const TInt KOneSecondInMicroSeconds(1000000); |
|
93 // how long a flick gesture can tage before it is interpreted as dragging only |
|
94 const TInt KMaxFlickDuration(200000); // 2 ms |
|
95 // how long it user must press to move one index further |
|
96 const TInt KKeyPressDuration(800000); |
|
97 // factor used for converting swipe speed to view movement |
|
98 const TReal KSwipeSpeedFactor(0.5f); |
|
99 |
|
100 // Camera rotation factor to use in animation |
|
101 // when swiping |
|
102 const TReal KCameraRotationFactor(PI/12.0f); |
|
103 |
|
104 // zooming factor to use in animation |
|
105 const TReal KCameraZoomFactor(0); |
|
106 |
|
107 // maximum opacity of the letter popup (1.0 would be fully opaque) |
|
108 const TReal KMaxLetterPopupOpacity(0.85); |
|
109 |
|
110 // update rate for the key scrolling timer |
|
111 const TInt KMediaWallKeyScrollingUpdateInterval( 50000 ); |
|
112 |
|
113 // number of rows in grid mediawall |
|
114 const TInt KGridRowCount(3); |
|
115 |
|
116 // flipping angle in flip animation in grid mediawall |
|
117 const TReal KGridFlipAngle(PI * 2); |
|
118 |
|
119 // space between items in grid mediawall |
|
120 const TReal KSpaceBetweenGridItems(0.02f); |
|
121 |
|
122 // blur deviation factor for blur in zoom animation |
|
123 const TReal KDefaultBlurDeviation(4); |
|
124 |
|
125 // |
|
126 const TReal KSpringVelocityToZAlpha(10.0f); |
|
127 |
|
128 const TInt KFramesToZeroVelocity(60); |
|
129 |
|
130 const TReal KHalfItemWidth(0.5); |
|
131 |
|
132 // Specific constants for full screen coverflow mediawall |
|
133 const TInt KMediaWallFullScreenItemsOnScreen(5); |
|
134 const TReal KMediaWallFullScreenCameraZoomFactor(1.5); |
|
135 const TReal KMediaWallFullScreenCameraRotationFactor(KCameraRotationFactor*1.5); |
|
136 const TReal KMediaWallFullScreenSpringVelocityToAnimationFactor(10); |
|
137 const TReal KMediaWallFullScreenZOffset(1); |
|
138 const TInt KMediaWallFullScreenRowCount(1); |
|
139 const TReal KMediaWallFullScreenSpringK(KSpringK); |
|
140 const TReal KMediaWallFullScreenSpringDamping(KSpringDamping); |
|
141 const TReal KMediaWallFullScreenSpringMaxVelocity(KMaxSpringVelocity); |
|
142 const TReal KMediaWallFullScreenItemsToMoveOnFullScreenDrag(5); |
|
143 |
|
144 // distance to target item where titles get rendered in fullscreen mediawall |
|
145 // eg. if distance is greater than this, titles are not rendered |
|
146 const TReal KTitleDrawDistance(2.0); |
|
147 |
|
148 // Specific constants for tbone "portrait" mediawall |
|
149 const TInt KMediaWallTBoneItemsOnScreen(3); |
|
150 const TReal KMediaWallTBoneCameraZoomFactor(2); |
|
151 const TReal KMediaWallTBoneCameraRotationFactor(KCameraRotationFactor); |
|
152 const TReal KMediaWallTBoneSpringVelocityToAnimationFactor(KSpringVelocityToAnimationFactor); |
|
153 const TInt KMediaWallTBonePopupFontSize(100); |
|
154 const TInt KMediaWallTBoneLabelFontSize(18); |
|
155 const TReal KMediaWallTBoneZOffset(0.5); |
|
156 const TInt KMediaWallTBoneRowCount(1); |
|
157 const TReal KMediaWallTBoneSpringK(KSpringK); |
|
158 const TReal KMediaWallTBoneSpringDamping(KSpringDamping); |
|
159 const TReal KMediaWallTBoneSpringMaxVelocity(KMaxSpringVelocity); |
|
160 const TReal KMediaWallTBoneItemsToMoveOnFullScreenDrag(3); |
|
161 |
|
162 // if distance to target item is over this in tbone mediawall, it shows letter popup |
|
163 const TReal KDrawLetterPopupDistance(2.0); |
|
164 |
|
165 // Specific constants for mediawall grid (for photos application) |
|
166 const TInt KMediaWallGridItemsOnScreen(3*7); |
|
167 const TReal KMediaWallGridCameraZoomFactor(0.2); |
|
168 const TReal KMediaWallGridCameraRotationFactor(KCameraRotationFactor); |
|
169 const TReal KMediaWallGridSpringVelocityToAnimationFactor(KSpringVelocityToAnimationFactor/3); |
|
170 const TInt KMediaWallGridPopupFontSize(30); |
|
171 const TReal KMediaWallGridZOffset(0.5); |
|
172 const TInt KMediaWallGridRowCount(3); |
|
173 const TReal KMediaWallGridSpringK(KSpringK); |
|
174 const TReal KMediaWallGridSpringDamping(KSpringDamping*2); |
|
175 const TReal KMediaWallGridSpringMaxVelocity(KMaxSpringVelocity/3); |
|
176 const TReal KMediaWallGridItemsToMoveOnFullScreenDrag(15); |
|
177 |
|
178 } |
|
179 |
|
180 #endif /* HGVGCONSTANTS */ |