1 /* |
|
2 * Copyright (c) 2005-2007 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: Group for Doppler controls |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAMMSDOPPLERCONTROLGROUP_H |
|
20 #define CAMMSDOPPLERCONTROLGROUP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "cammsaudio3dcontrolgroup.h" |
|
25 #include "ammsconstants.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CAMMSDopplerControl; |
|
29 |
|
30 // CONSTANTS |
|
31 _LIT(KAMMSDopplerControl, "DopplerControl"); |
|
32 _LIT(KAMMSDopplerControlClassName, ".amms.control.audio3d.DopplerControl"); |
|
33 |
|
34 // CLASS DECLARATION |
|
35 /** |
|
36 * Group for Doppler controls |
|
37 * |
|
38 * @since 3.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS(CAMMSDopplerControlGroup): public CAMMSAudio3DControlGroup |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CAMMSDopplerControlGroup* NewLC( |
|
48 TAMMSControlTypes aControlType); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CAMMSDopplerControlGroup(); |
|
54 |
|
55 public: // New functions |
|
56 /** |
|
57 * Returns the current velocity, used in calculations for the Doppler |
|
58 * effect |
|
59 * |
|
60 * @param aVelocity the current velocity |
|
61 */ |
|
62 void VelocityCartesianL(TInt aVelocity[ KAMMSVectorComponents ]); |
|
63 |
|
64 /** |
|
65 * Returns whether this Doppler effect is currently active. |
|
66 * |
|
67 * @return the enabled state of the control |
|
68 */ |
|
69 TBool Enabled(); |
|
70 |
|
71 /** |
|
72 * Specifies if this Doppler effect is active or ignored. |
|
73 * |
|
74 * @param aEnabled new enabled state |
|
75 */ |
|
76 void SetEnabledL(TBool aEnabled); |
|
77 |
|
78 /** |
|
79 * Sets the velocity, used in calculations for the Doppler effect. |
|
80 * |
|
81 * @param aX the x component of the new velocity |
|
82 * @param aY the y component of the new velocity |
|
83 * @param aZ the z component of the new velocity |
|
84 */ |
|
85 void SetVelocityCartesianL(TInt aX, TInt aY, TInt aZ); |
|
86 |
|
87 /** |
|
88 * Sets the velocity, used in calculations for the Doppler effect. |
|
89 * |
|
90 * @param aAzimuth the azimuth angle of the new velocity in degrees |
|
91 * @param aElevation the elevation angle of the new velocity in degrees |
|
92 * @param aRadius the magnitude of the new velocity |
|
93 */ |
|
94 void SetVelocitySphericalL(TInt aAzimuth, TInt aElevation, TInt aRadius); |
|
95 |
|
96 private: // New functions |
|
97 /** |
|
98 * Gets control. Ownership is not tranferred. |
|
99 * |
|
100 * @param aIndex Control index. |
|
101 */ |
|
102 CAMMSDopplerControl* TypeSafeControl(TInt aIndex) const; |
|
103 |
|
104 public: // Functions from base classes |
|
105 /** |
|
106 * Returns class name that identifies this control group. |
|
107 * |
|
108 * @return Control group name. |
|
109 */ |
|
110 const TDesC16& ClassName(); |
|
111 |
|
112 protected: |
|
113 /** |
|
114 * Transfers all the pending parameters to the audio processing system. |
|
115 * |
|
116 * @param aCommit variable id that need to be commited |
|
117 */ |
|
118 virtual void CommitL(TInt aCommit); |
|
119 |
|
120 /** |
|
121 * Called by when a new player is added |
|
122 * |
|
123 * @param aPlayer The player being added |
|
124 * @param aControl The player's control relevant to this group |
|
125 */ |
|
126 void NotifyPlayerAddedL(CMMAPlayer *aPlayer, CMMAControl* aControl); |
|
127 |
|
128 private: |
|
129 /** |
|
130 * C++ default constructor. |
|
131 */ |
|
132 CAMMSDopplerControlGroup(TAMMSControlTypes aControlType); |
|
133 |
|
134 /** |
|
135 * By default Symbian 2nd phase constructor is private. |
|
136 */ |
|
137 void ConstructL(); |
|
138 |
|
139 private: // Data |
|
140 |
|
141 class TVariables |
|
142 { |
|
143 public: |
|
144 |
|
145 TInt iVelocity[ KAMMSVectorComponents ]; |
|
146 TBool iEnabled; |
|
147 }; |
|
148 |
|
149 TVariables iCommited; // holder for variables after commit |
|
150 TVariables iUncommited; // holder for variables before commit |
|
151 |
|
152 enum TCommit { EEnabled = 1, EVelocity = 2 }; |
|
153 }; |
|
154 |
|
155 #endif // CAMMSDOPPLERCONTROLGROUP_H |
|
156 |
|
157 |
|