|
1 // Copyright (c) 2006-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 @publishedPartner |
|
21 @released |
|
22 */ |
|
23 |
|
24 |
|
25 #ifndef A3FBASE_H |
|
26 #define A3FBASE_H |
|
27 |
|
28 #include <e32base.h> |
|
29 |
|
30 /** |
|
31 * Provides the process id of the original application. |
|
32 */ |
|
33 class TClientContextSettings |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * Application Process Id. |
|
38 */ |
|
39 TProcessId iProcessId; |
|
40 }; |
|
41 |
|
42 |
|
43 /** |
|
44 * States of a stream. |
|
45 */ |
|
46 enum TAudioState |
|
47 { |
|
48 /**Uninitialized state */ |
|
49 EUninitialized = 0, |
|
50 /**Initialized state */ |
|
51 EInitialized, |
|
52 /**Idle state */ |
|
53 EIdle, |
|
54 /**Primed state */ |
|
55 EPrimed, |
|
56 /**Active state */ |
|
57 EActive, |
|
58 /**Dead state */ |
|
59 EDead |
|
60 }; |
|
61 |
|
62 /** |
|
63 * Audio type of a stream. |
|
64 */ |
|
65 class TAudioTypeSettings |
|
66 { |
|
67 public: |
|
68 /** |
|
69 * Priority of client. |
|
70 */ |
|
71 TInt iPriority; |
|
72 |
|
73 /** |
|
74 * The priority preference of client. |
|
75 */ |
|
76 TInt iPref; |
|
77 }; |
|
78 |
|
79 |
|
80 /** |
|
81 * Mode setting available. |
|
82 * |
|
83 * "Mode" in this context refers to the number of channels (i.e. mono or stereo). |
|
84 * The modes are given as UIDs. |
|
85 * |
|
86 */ |
|
87 |
|
88 /** Mono data */ |
|
89 const TInt KA3FModeMonoValue = 0x1028348D; |
|
90 const TUid KA3FModeMono = {KA3FModeMonoValue}; |
|
91 /** Stereo data, non-interleaved */ |
|
92 const TInt KA3FModeStereoNonInterleavedValue = 0x1028348E; |
|
93 const TUid KA3FModeStereoNonInterleaved = {KA3FModeStereoNonInterleavedValue}; |
|
94 /** Interleaved Stereo data */ |
|
95 const TInt KA3FModeStereoInterleavedValue = 0x1028348F; |
|
96 const TUid KA3FModeStereoInterleaved = {KA3FModeStereoInterleavedValue}; |
|
97 /** 5.1 encoded data */ |
|
98 const TInt KA3FMode51Value = 0x10283490; |
|
99 const TUid KA3FMode51 = {KA3FMode51Value}; |
|
100 |
|
101 |
|
102 /** |
|
103 * Type class for audio channel. |
|
104 */ |
|
105 class TAudioChannelGain |
|
106 { |
|
107 public: |
|
108 /** |
|
109 * Location of the channel in degrees on a circle located on the same plane as the listener, |
|
110 * with listener in the center of the circle. |
|
111 * Negative values are used for channels the location of which is not important. |
|
112 */ |
|
113 TInt iLocation; |
|
114 |
|
115 /** |
|
116 * Absolute gain value of channel. |
|
117 * Allowed values are 0 - MaxGain(). |
|
118 */ |
|
119 TInt iGain; |
|
120 |
|
121 /** |
|
122 * Mapping of common channels to location degrees. |
|
123 */ |
|
124 enum TStandardChannels |
|
125 { |
|
126 /** Low Frequency Effects Channels */ |
|
127 ELowFrequencyEffects = -1, |
|
128 /** Center Channels*/ |
|
129 ECenter = 0, |
|
130 /** Right Channels */ |
|
131 ERight = 45, |
|
132 /** Right Surround Channels */ |
|
133 ERightSurround = 90, |
|
134 /** Right Rear Channels */ |
|
135 ERightRear = 135, |
|
136 /** Rear Surround Channels */ |
|
137 ERearSurround = 180, |
|
138 /** Left Rear Channels */ |
|
139 ELeftRear = 225, |
|
140 /** Left Surround Channels */ |
|
141 ELeftSurround = 270, |
|
142 /** Left Channels */ |
|
143 ELeft = 315 |
|
144 }; |
|
145 }; |
|
146 |
|
147 |
|
148 /** |
|
149 * KGainSawTooth – an explicit 0->aGain sweep, rising linearly. |
|
150 * If the channel is active, the effective gain drops to 0 ASAP after the request. |
|
151 * If used when the stream is not in EActive state, this acts as fade-in during the subsequent Activate() transistion. |
|
152 */ |
|
153 const TInt KUidGainSawToothValue = 0x10285CDC; |
|
154 const TUid KUidGainSawTooth = {KUidGainSawToothValue}; |
|
155 |
|
156 /** |
|
157 * KGainFadeOut – drop from current to 0, |
|
158 * dropping linearly over aRampDuration period. |
|
159 */ |
|
160 const TInt KUidGainFadeOutValue = 0x10285CDD; |
|
161 const TUid KUidGainFadeOut = {KUidGainFadeOutValue}; |
|
162 |
|
163 /** |
|
164 * KGainRamped – (gradual) change from current gain values to those given in aGain over aRampDuration period |
|
165 */ |
|
166 const TInt KUidGainRampedValue = 0x10285CDE; |
|
167 const TUid KUidGainRamped = {KUidGainRampedValue}; |
|
168 |
|
169 /** |
|
170 * KGainContinue – if a previous ramped operation is in progress, |
|
171 * this continues but the concept of “target gain” is updated |
|
172 * using the new values. aRampDuration is ignored |
|
173 * – the previous ramp duration is reused, minus the time already spent ramping. |
|
174 * The smoothness of this operation will depend on the implementation. |
|
175 * If no ramped operation is in progress, this is the same as KNullUid. |
|
176 * This is intended as a way of changing gain values without stopping an ongoing ramp operation. |
|
177 */ |
|
178 const TInt KUidGainContinueValue = 0x10285CDF; |
|
179 const TUid KUidGainContinue = {KUidGainContinueValue}; |
|
180 |
|
181 |
|
182 const TInt KErrA3fUnsupportedRamp = (-12250); |
|
183 |
|
184 /** |
|
185 * Represents an unique Id for a specific context at runtime. |
|
186 */ |
|
187 class TAudioContextId : public TObjectId |
|
188 { |
|
189 public: |
|
190 /** |
|
191 *Default constructor. |
|
192 */ |
|
193 TAudioContextId() {} |
|
194 |
|
195 /** |
|
196 *Unique Id for a specific context at runtime. |
|
197 *@param aId Unique id to be set. |
|
198 */ |
|
199 inline TAudioContextId(TUint64 aId) : TObjectId(aId) {} |
|
200 }; |
|
201 |
|
202 /** |
|
203 * Represents an unique Id for a specific audio processing unit at runtime. |
|
204 */ |
|
205 class TAudioComponentId : public TObjectId |
|
206 { |
|
207 public: |
|
208 /** |
|
209 * Default constructor. |
|
210 */ |
|
211 TAudioComponentId() {} |
|
212 |
|
213 /** |
|
214 *Unique Id for a specific audio processing unit at runtime. |
|
215 *@param aId Unique id to be set. |
|
216 */ |
|
217 inline TAudioComponentId(TUint64 aId) : TObjectId(aId) {} |
|
218 }; |
|
219 |
|
220 /** |
|
221 * Represents an unique Id for a specific audio stream unit at runtime. |
|
222 */ |
|
223 class TAudioStreamId : public TObjectId |
|
224 { |
|
225 public: |
|
226 /** |
|
227 * Default constructor. |
|
228 */ |
|
229 TAudioStreamId() {} |
|
230 |
|
231 /** |
|
232 *Unique Id for a specific stream at runtime. |
|
233 *@param aId Unique id to be set. |
|
234 */ |
|
235 inline TAudioStreamId(TUint64 aId) : TObjectId(aId) {} |
|
236 }; |
|
237 |
|
238 |
|
239 #endif // A3FBASE_H |