include/AK/SoundEngine/Common/AkSpeakerConfig.h
浏览该文件的文档。00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _AK_SPEAKERCONFIG_H_
00029 #define _AK_SPEAKERCONFIG_H_
00030
00031 #include <AK/SoundEngine/Common/AkTypes.h>
00032
00033
00034 #define AK_SPEAKER_FRONT_LEFT 0x1 ///< Front left speaker bit mask
00035 #define AK_SPEAKER_FRONT_RIGHT 0x2 ///< Front right speaker bit mask
00036 #define AK_SPEAKER_FRONT_CENTER 0x4 ///< Front center speaker bit mask
00037 #define AK_SPEAKER_LOW_FREQUENCY 0x8 ///< Low-frequency speaker bit mask
00038 #define AK_SPEAKER_BACK_LEFT 0x10 ///< Rear left speaker bit mask
00039 #define AK_SPEAKER_BACK_RIGHT 0x20 ///< Rear right speaker bit mask
00040 #define AK_SPEAKER_BACK_CENTER 0x100 ///< Rear center speaker ("surround speaker") bit mask
00041 #define AK_SPEAKER_SIDE_LEFT 0x200 ///< Side left speaker bit mask
00042 #define AK_SPEAKER_SIDE_RIGHT 0x400 ///< Side right speaker bit mask
00043
00044
00045 #define AK_SPEAKER_TOP 0x800 ///< Top speaker bit mask
00046 #define AK_SPEAKER_HEIGHT_FRONT_LEFT 0x1000 ///< Front left speaker bit mask
00047 #define AK_SPEAKER_HEIGHT_FRONT_CENTER 0x2000 ///< Front center speaker bit mask
00048 #define AK_SPEAKER_HEIGHT_FRONT_RIGHT 0x4000 ///< Front right speaker bit mask
00049 #define AK_SPEAKER_HEIGHT_BACK_LEFT 0x8000 ///< Rear left speaker bit mask
00050 #define AK_SPEAKER_HEIGHT_BACK_CENTER 0x10000 ///< Rear center speaker bit mask
00051 #define AK_SPEAKER_HEIGHT_BACK_RIGHT 0x20000 ///< Rear right speaker bit mask
00052
00053
00054
00055
00056
00057 #define AK_SPEAKER_SETUP_MONO AK_SPEAKER_FRONT_CENTER ///< 1.0 setup channel mask
00058 #define AK_SPEAKER_SETUP_0POINT1 AK_SPEAKER_LOW_FREQUENCY ///< 0.1 setup channel mask
00059 #define AK_SPEAKER_SETUP_1POINT1 (AK_SPEAKER_FRONT_CENTER | AK_SPEAKER_LOW_FREQUENCY) ///< 1.1 setup channel mask
00060 #define AK_SPEAKER_SETUP_STEREO (AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT) ///< 2.0 setup channel mask
00061 #define AK_SPEAKER_SETUP_2POINT1 (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_LOW_FREQUENCY) ///< 2.1 setup channel mask
00062 #define AK_SPEAKER_SETUP_3STEREO (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_FRONT_CENTER) ///< 3.0 setup channel mask
00063 #define AK_SPEAKER_SETUP_3POINT1 (AK_SPEAKER_SETUP_3STEREO | AK_SPEAKER_LOW_FREQUENCY) ///< 3.1 setup channel mask
00064 #define AK_SPEAKER_SETUP_4 (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT) ///< 4.0 setup channel mask
00065 #define AK_SPEAKER_SETUP_4POINT1 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_LOW_FREQUENCY) ///< 4.1 setup channel mask
00066 #define AK_SPEAKER_SETUP_5 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_FRONT_CENTER) ///< 5.0 setup channel mask
00067 #define AK_SPEAKER_SETUP_5POINT1 (AK_SPEAKER_SETUP_5 | AK_SPEAKER_LOW_FREQUENCY) ///< 5.1 setup channel mask
00068 #define AK_SPEAKER_SETUP_6 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT) ///< 6.0 setup channel mask
00069 #define AK_SPEAKER_SETUP_6POINT1 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_LOW_FREQUENCY) ///< 6.1 setup channel mask
00070 #define AK_SPEAKER_SETUP_7 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_FRONT_CENTER) ///< 7.0 setup channel mask
00071 #define AK_SPEAKER_SETUP_7POINT1 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_LOW_FREQUENCY) ///< 7.1 setup channel mask
00072 #define AK_SPEAKER_SETUP_SURROUND (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_BACK_CENTER) ///< Legacy surround setup channel mask
00073
00074
00075 #define AK_SPEAKER_SETUP_DPL2 (AK_SPEAKER_SETUP_4) ///< Legacy DPL2 setup channel mask
00076
00077 #define AK_SPEAKER_SETUP_HEIGHT_4 (AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT) ///< 4 speaker height layer.
00078 #define AK_SPEAKER_SETUP_HEIGHT_5 (AK_SPEAKER_SETUP_HEIGHT_4 | AK_SPEAKER_HEIGHT_FRONT_CENTER) ///< 5 speaker height layer.
00079 #define AK_SPEAKER_SETUP_HEIGHT_ALL (AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_HEIGHT_BACK_CENTER) ///< All height speaker layer.
00080
00081
00082 #define AK_SPEAKER_SETUP_AURO_222 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT) ///< Auro-222 setup channel mask
00083 #define AK_SPEAKER_SETUP_AURO_8 (AK_SPEAKER_SETUP_AURO_222 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT) ///< Auro-8 setup channel mask
00084 #define AK_SPEAKER_SETUP_AURO_9 (AK_SPEAKER_SETUP_AURO_8 | AK_SPEAKER_FRONT_CENTER) ///< Auro-9.0 setup channel mask
00085 #define AK_SPEAKER_SETUP_AURO_9POINT1 (AK_SPEAKER_SETUP_AURO_9 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-9.1 setup channel mask
00086 #define AK_SPEAKER_SETUP_AURO_10 (AK_SPEAKER_SETUP_AURO_9 | AK_SPEAKER_TOP) ///< Auro-10.0 setup channel mask
00087 #define AK_SPEAKER_SETUP_AURO_10POINT1 (AK_SPEAKER_SETUP_AURO_10 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-10.1 setup channel mask
00088 #define AK_SPEAKER_SETUP_AURO_11 (AK_SPEAKER_SETUP_AURO_10 | AK_SPEAKER_HEIGHT_FRONT_CENTER) ///< Auro-11.0 setup channel mask
00089 #define AK_SPEAKER_SETUP_AURO_11POINT1 (AK_SPEAKER_SETUP_AURO_11 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-11.1 setup channel mask
00090 #define AK_SPEAKER_SETUP_AURO_11_740 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_SETUP_HEIGHT_4) ///< Auro-11.0 (7+4) setup channel mask
00091 #define AK_SPEAKER_SETUP_AURO_11POINT1_740 (AK_SPEAKER_SETUP_AURO_11_740 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-11.1 (7+4) setup channel mask
00092 #define AK_SPEAKER_SETUP_AURO_13_751 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_TOP) ///< Auro-13.0 setup channel mask
00093 #define AK_SPEAKER_SETUP_AURO_13POINT1_751 (AK_SPEAKER_SETUP_AURO_13_751 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-13.1 setup channel mask
00094
00095
00096 #define AK_SPEAKER_SETUP_DOLBY_5_0_2 (AK_SPEAKER_SETUP_5 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT ) ///< Dolby 5.0.2 setup channel mask
00097 #define AK_SPEAKER_SETUP_DOLBY_5_1_2 (AK_SPEAKER_SETUP_DOLBY_5_0_2 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 5.1.2 setup channel mask
00098 #define AK_SPEAKER_SETUP_DOLBY_6_0_2 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT ) ///< Dolby 6.0.2 setup channel mask
00099 #define AK_SPEAKER_SETUP_DOLBY_6_1_2 (AK_SPEAKER_SETUP_DOLBY_6_0_2 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 6.1.2 setup channel mask
00100 #define AK_SPEAKER_SETUP_DOLBY_6_0_4 (AK_SPEAKER_SETUP_DOLBY_6_0_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT ) ///< Dolby 6.0.4 setup channel mask
00101 #define AK_SPEAKER_SETUP_DOLBY_6_1_4 (AK_SPEAKER_SETUP_DOLBY_6_0_4 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 6.1.4 setup channel mask
00102 #define AK_SPEAKER_SETUP_DOLBY_7_0_2 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT ) ///< Dolby 7.0.2 setup channel mask
00103 #define AK_SPEAKER_SETUP_DOLBY_7_1_2 (AK_SPEAKER_SETUP_DOLBY_7_0_2 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 7.1.2 setup channel mask
00104 #define AK_SPEAKER_SETUP_DOLBY_7_0_4 (AK_SPEAKER_SETUP_DOLBY_7_0_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT ) ///< Dolby 7.0.4 setup channel mask
00105 #define AK_SPEAKER_SETUP_DOLBY_7_1_4 (AK_SPEAKER_SETUP_DOLBY_7_0_4 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 7.1.4 setup channel mask
00106
00107 #define AK_SPEAKER_SETUP_ALL_SPEAKERS (AK_SPEAKER_SETUP_7POINT1 | AK_SPEAKER_BACK_CENTER | AK_SPEAKER_SETUP_HEIGHT_ALL | AK_SPEAKER_TOP) ///< All speakers.
00108
00109
00110
00111
00112
00113 #define AK_IDX_SETUP_FRONT_LEFT (0) ///< Index of front-left channel in all configurations.
00114 #define AK_IDX_SETUP_FRONT_RIGHT (1) ///< Index of front-right channel in all configurations.
00115 #define AK_IDX_SETUP_CENTER (2) ///< Index of front-center channel in all configurations.
00116
00117 #define AK_IDX_SETUP_NOCENTER_BACK_LEFT (2) ///< Index of back-left channel in configurations with no front-center channel.
00118 #define AK_IDX_SETUP_NOCENTER_BACK_RIGHT (3) ///< Index of back-right channel in configurations with no front-center channel.
00119 #define AK_IDX_SETUP_NOCENTER_SIDE_LEFT (4) ///< Index of side-left channel in configurations with no front-center channel.
00120 #define AK_IDX_SETUP_NOCENTER_SIDE_RIGHT (5) ///< Index of side-right channel in configurations with no front-center channel.
00121
00122 #define AK_IDX_SETUP_WITHCENTER_BACK_LEFT (3) ///< Index of back-left channel in configurations with a front-center channel.
00123 #define AK_IDX_SETUP_WITHCENTER_BACK_RIGHT (4) ///< Index of back-right channel in configurations with a front-center channel.
00124 #define AK_IDX_SETUP_WITHCENTER_SIDE_LEFT (5) ///< Index of side-left channel in configurations with a front-center channel.
00125 #define AK_IDX_SETUP_WITHCENTER_SIDE_RIGHT (6) ///< Index of side-right channel in configurations with a front-center channel.
00126
00127
00128 #define AK_IDX_SETUP_0_LFE (0) ///< Index of low-frequency channel in 0.1 setup (use with AkAudioBuffer::GetChannel())
00129
00130 #define AK_IDX_SETUP_1_CENTER (0) ///< Index of center channel in 1.x setups (use with AkAudioBuffer::GetChannel())
00131 #define AK_IDX_SETUP_1_LFE (1) ///< Index of low-frequency channel in 1.1 setup (use with AkAudioBuffer::GetChannel())
00132
00133 #define AK_IDX_SETUP_2_LEFT (0) ///< Index of left channel in 2.x setups (use with AkAudioBuffer::GetChannel())
00134 #define AK_IDX_SETUP_2_RIGHT (1) ///< Index of right channel in 2.x setups (use with AkAudioBuffer::GetChannel())
00135 #define AK_IDX_SETUP_2_LFE (2) ///< Index of low-frequency channel in 2.1 setup (use with AkAudioBuffer::GetChannel())
00136
00137 #define AK_IDX_SETUP_3_LEFT (0) ///< Index of left channel in 3.x setups (use with AkAudioBuffer::GetChannel())
00138 #define AK_IDX_SETUP_3_RIGHT (1) ///< Index of right channel in 3.x setups (use with AkAudioBuffer::GetChannel())
00139 #define AK_IDX_SETUP_3_CENTER (2) ///< Index of center channel in 3.x setups (use with AkAudioBuffer::GetChannel())
00140 #define AK_IDX_SETUP_3_LFE (3) ///< Index of low-frequency channel in 3.1 setup (use with AkAudioBuffer::GetChannel())
00141
00142 #define AK_IDX_SETUP_4_FRONTLEFT (0) ///< Index of front left channel in 4.x setups (use with AkAudioBuffer::GetChannel())
00143 #define AK_IDX_SETUP_4_FRONTRIGHT (1) ///< Index of front right channel in 4.x setups (use with AkAudioBuffer::GetChannel())
00144 #define AK_IDX_SETUP_4_REARLEFT (2) ///< Index of rear left channel in 4.x setups (use with AkAudioBuffer::GetChannel())
00145 #define AK_IDX_SETUP_4_REARRIGHT (3) ///< Index of rear right channel in 4.x setups (use with AkAudioBuffer::GetChannel())
00146 #define AK_IDX_SETUP_4_LFE (4) ///< Index of low-frequency channel in 4.1 setup (use with AkAudioBuffer::GetChannel())
00147
00148 #define AK_IDX_SETUP_5_FRONTLEFT (0) ///< Index of front left channel in 5.x setups (use with AkAudioBuffer::GetChannel())
00149 #define AK_IDX_SETUP_5_FRONTRIGHT (1) ///< Index of front right channel in 5.x setups (use with AkAudioBuffer::GetChannel())
00150 #define AK_IDX_SETUP_5_CENTER (2) ///< Index of center channel in 5.x setups (use with AkAudioBuffer::GetChannel())
00151 #define AK_IDX_SETUP_5_REARLEFT (3) ///< Index of rear left channel in 5.x setups (use with AkAudioBuffer::GetChannel())
00152 #define AK_IDX_SETUP_5_REARRIGHT (4) ///< Index of rear right channel in 5.x setups (use with AkAudioBuffer::GetChannel())
00153 #define AK_IDX_SETUP_5_LFE (5) ///< Index of low-frequency channel in 5.1 setup (use with AkAudioBuffer::GetChannel())
00154
00155 #ifdef AK_71AUDIO
00156 #define AK_IDX_SETUP_6_FRONTLEFT (0) ///< Index of front left channel in 6.x setups (use with AkAudioBuffer::GetChannel())
00157 #define AK_IDX_SETUP_6_FRONTRIGHT (1) ///< Index of front right channel in 6x setups (use with AkAudioBuffer::GetChannel())
00158 #define AK_IDX_SETUP_6_REARLEFT (2) ///< Index of rear left channel in 6.x setups (use with AkAudioBuffer::GetChannel())
00159 #define AK_IDX_SETUP_6_REARRIGHT (3) ///< Index of rear right channel in 6.x setups (use with AkAudioBuffer::GetChannel())
00160 #define AK_IDX_SETUP_6_SIDELEFT (4) ///< Index of side left channel in 6.x setups (use with AkAudioBuffer::GetChannel())
00161 #define AK_IDX_SETUP_6_SIDERIGHT (5) ///< Index of side right channel in 6.x setups (use with AkAudioBuffer::GetChannel())
00162 #define AK_IDX_SETUP_6_LFE (6) ///< Index of low-frequency channel in 6.1 setup (use with AkAudioBuffer::GetChannel())
00163
00164 #define AK_IDX_SETUP_7_FRONTLEFT (0) ///< Index of front left channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00165 #define AK_IDX_SETUP_7_FRONTRIGHT (1) ///< Index of front right channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00166 #define AK_IDX_SETUP_7_CENTER (2) ///< Index of center channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00167 #define AK_IDX_SETUP_7_REARLEFT (3) ///< Index of rear left channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00168 #define AK_IDX_SETUP_7_REARRIGHT (4) ///< Index of rear right channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00169 #define AK_IDX_SETUP_7_SIDELEFT (5) ///< Index of side left channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00170 #define AK_IDX_SETUP_7_SIDERIGHT (6) ///< Index of side right channel in 7.x setups (use with AkAudioBuffer::GetChannel())
00171 #define AK_IDX_SETUP_7_LFE (7) ///< Index of low-frequency channel in 7.1 setup (use with AkAudioBuffer::GetChannel())
00172 #endif
00173
00174
00175
00176
00177
00178
00179 #define AK_SPEAKER_SETUP_0_1 ( AK_SPEAKER_LOW_FREQUENCY ) //0.1
00180
00181 #define AK_SPEAKER_SETUP_1_0_CENTER ( AK_SPEAKER_FRONT_CENTER ) //1.0 (C)
00182 #define AK_SPEAKER_SETUP_1_1_CENTER ( AK_SPEAKER_FRONT_CENTER | AK_SPEAKER_LOW_FREQUENCY ) //1.1 (C)
00183
00184 #define AK_SPEAKER_SETUP_2_0 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT ) //2.0
00185 #define AK_SPEAKER_SETUP_2_1 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT | AK_SPEAKER_LOW_FREQUENCY ) //2.1
00186
00187 #define AK_SPEAKER_SETUP_3_0 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT | AK_SPEAKER_FRONT_CENTER ) //3.0
00188 #define AK_SPEAKER_SETUP_3_1 ( AK_SPEAKER_SETUP_3_0 | AK_SPEAKER_LOW_FREQUENCY ) //3.1
00189
00190 #define AK_SPEAKER_SETUP_FRONT ( AK_SPEAKER_SETUP_3_0 )
00191
00192 #define AK_SPEAKER_SETUP_4_0 ( AK_SPEAKER_SETUP_4 )
00193 #define AK_SPEAKER_SETUP_4_1 ( AK_SPEAKER_SETUP_4POINT1 )
00194 #define AK_SPEAKER_SETUP_5_0 ( AK_SPEAKER_SETUP_5 )
00195 #define AK_SPEAKER_SETUP_5_1 ( AK_SPEAKER_SETUP_5POINT1 )
00196
00197 #define AK_SPEAKER_SETUP_6_0 ( AK_SPEAKER_SETUP_6 )
00198 #define AK_SPEAKER_SETUP_6_1 ( AK_SPEAKER_SETUP_6POINT1 )
00199 #define AK_SPEAKER_SETUP_7_0 ( AK_SPEAKER_SETUP_7 )
00200 #define AK_SPEAKER_SETUP_7_1 ( AK_SPEAKER_SETUP_7POINT1 )
00201
00202
00203 #if defined(AK_71AUDIO)
00204 #define AK_SPEAKER_SETUP_DEFAULT_PLANE (AK_SPEAKER_SETUP_7POINT1) ///< All speakers on the plane, supported on this platform.
00205 #define AK_SUPPORTED_STANDARD_CHANNEL_MASK (AK_SPEAKER_SETUP_ALL_SPEAKERS) ///< Platform supports all standard channels.
00206 #define AK_STANDARD_MAX_NUM_CHANNELS (8) ///< Legacy: Platform supports at least 7.1
00207 #elif defined(AK_LFECENTER) && defined(AK_REARCHANNELS)
00208 #define AK_SPEAKER_SETUP_DEFAULT_PLANE (AK_SPEAKER_SETUP_5POINT1) ///< All speakers on the plane, supported on this platform.
00209 #define AK_SUPPORTED_STANDARD_CHANNEL_MASK (AK_SPEAKER_SETUP_DEFAULT_PLANE) ///< Platform supports 5.1
00210 #define AK_VOICE_MAX_NUM_CHANNELS (6) ///< Legacy: Platform supports up to 5.1 configuration.
00211 #define AK_STANDARD_MAX_NUM_CHANNELS (AK_VOICE_MAX_NUM_CHANNELS) ///< Legacy: Platform supports 5.1
00212 #elif defined(AK_REARCHANNELS)
00213 #define AK_SPEAKER_SETUP_DEFAULT_PLANE (AK_SPEAKER_SETUP_4 | AK_SPEAKER_FRONT_CENTER) ///< All speakers on the plane, supported on this platform.
00214 #define AK_VOICE_MAX_NUM_CHANNELS (4) ///< Legacy: Platform supports up to 4.0 configuration.
00215 #define AK_SUPPORTED_STANDARD_CHANNEL_MASK (AK_SPEAKER_SETUP_DEFAULT_PLANE) ///< Most complete speaker configuration supported on this platform.
00216 #else
00217 #define AK_SPEAKER_SETUP_DEFAULT_PLANE (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_FRONT_CENTER) ///< All speakers on the plane, supported on this platform.
00218 #define AK_SUPPORTED_STANDARD_CHANNEL_MASK (AK_SPEAKER_SETUP_STEREO) ///< Most complete speaker configuration supported on this platform.
00219 #define AK_VOICE_MAX_NUM_CHANNELS (2) ///< Legacy: Platform supports up to stereo configuration.
00220 #define AK_STANDARD_MAX_NUM_CHANNELS (AK_VOICE_MAX_NUM_CHANNELS) ///< Legacy: Platform supports stereo.
00221
00222 #endif
00223
00224
00225 inline void AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER( AkUInt32 &io_uChannelMask )
00226 {
00227 if( !(io_uChannelMask & AK_SPEAKER_FRONT_CENTER)
00228 && !(io_uChannelMask & AK_SPEAKER_FRONT_RIGHT)
00229 && (io_uChannelMask & AK_SPEAKER_FRONT_LEFT) )
00230 {
00231 io_uChannelMask &= ~AK_SPEAKER_FRONT_LEFT;
00232 io_uChannelMask |= AK_SPEAKER_FRONT_CENTER;
00233 }
00234 }
00235
00236 inline void AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE( AkUInt32 &io_uChannelMask )
00237 {
00238 if( io_uChannelMask & ( AK_SPEAKER_BACK_LEFT ) && !( io_uChannelMask & AK_SPEAKER_SIDE_LEFT ) )
00239 {
00240 io_uChannelMask &= ~( AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT );
00241 io_uChannelMask |= ( AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT );
00242 }
00243 }
00244
00245 inline void AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED( AkUInt32 &io_uChannelMask )
00246 {
00247 AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER( io_uChannelMask );
00248 AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE( io_uChannelMask );
00249 }
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 namespace AK
00267 {
00268
00269
00270 static inline AkUInt8 ChannelMaskToNumChannels( AkChannelMask in_uChannelMask )
00271 {
00272 AkUInt8 num = 0;
00273 while( in_uChannelMask ){ ++num; in_uChannelMask &= in_uChannelMask-1; }
00274 return num;
00275 }
00276
00277
00278
00279 static inline AkChannelMask ChannelMaskFromNumChannels( unsigned int in_uNumChannels )
00280 {
00281 AkChannelMask uChannelMask = 0;
00282
00283 switch ( in_uNumChannels )
00284 {
00285 case 1:
00286 uChannelMask = AK_SPEAKER_SETUP_1_0_CENTER;
00287 break;
00288 case 2:
00289 uChannelMask = AK_SPEAKER_SETUP_2_0;
00290 break;
00291 case 3:
00292 uChannelMask = AK_SPEAKER_SETUP_2_1;
00293 break;
00294 case 4:
00295 uChannelMask = AK_SPEAKER_SETUP_4_0;
00296 break;
00297 case 5:
00298 uChannelMask = AK_SPEAKER_SETUP_5_0;
00299 break;
00300 case 6:
00301 uChannelMask = AK_SPEAKER_SETUP_5_1;
00302 break;
00303 case 7:
00304 uChannelMask = AK_SPEAKER_SETUP_7;
00305 break;
00306 case 8:
00307 uChannelMask = AK_SPEAKER_SETUP_7POINT1;
00308 break;
00309 }
00310
00311 return uChannelMask;
00312 }
00313
00314
00315
00316 static inline AkUInt8 ChannelBitToIndex(AkChannelMask in_uChannelBit, AkChannelMask in_uChannelMask)
00317 {
00318 #ifdef AKASSERT
00319 AKASSERT(ChannelMaskToNumChannels(in_uChannelBit) == 1);
00320 #endif
00321 if (in_uChannelBit == AK_SPEAKER_LOW_FREQUENCY)
00322 return ChannelMaskToNumChannels(in_uChannelMask) - 1;
00323 return ChannelMaskToNumChannels(in_uChannelMask & ((in_uChannelBit & ~AK_SPEAKER_LOW_FREQUENCY) - 1));
00324 }
00325
00326
00327
00328 AkForceInline bool HasLFE(AkChannelMask in_uChannelMask)
00329 {
00330 return (in_uChannelMask & AK_SPEAKER_LOW_FREQUENCY) > 0;
00331 }
00332
00333
00334
00335
00336
00337 AkForceInline bool HasCenter(AkChannelMask in_uChannelMask)
00338 {
00339
00340 return (in_uChannelMask & AK_SPEAKER_FRONT_CENTER) > 0;
00341 }
00342
00343
00344
00345
00346 AkForceInline AkUInt32 GetNumberOfAnglesForConfig(AkChannelMask in_uChannelMask)
00347 {
00348 #ifdef AKASSERT
00349 AKASSERT((in_uChannelMask & ~AK_SPEAKER_SETUP_DEFAULT_PLANE) == 0);
00350 #endif
00351
00352
00353 in_uChannelMask &= ~AK_SPEAKER_LOW_FREQUENCY;
00354
00355 in_uChannelMask &= ~AK_SPEAKER_FRONT_CENTER;
00356
00357
00358 #ifdef AKASSERT
00359 AKASSERT((in_uChannelMask & AK_SPEAKER_BACK_CENTER) || ((ChannelMaskToNumChannels(in_uChannelMask) % 2) == 0));
00360 #endif
00361 return ChannelMaskToNumChannels(in_uChannelMask) >> 1;
00362 }
00363
00364
00365 enum AkChannelOrdering
00366 {
00367 ChannelOrdering_Standard,
00368 ChannelOrdering_RunTime
00369 };
00370
00371
00372
00373 AkForceInline bool HasSurroundChannels( AkChannelMask in_uChannelMask )
00374 {
00375 return ( in_uChannelMask & AK_SPEAKER_BACK_LEFT || in_uChannelMask & AK_SPEAKER_SIDE_LEFT );
00376 }
00377
00378
00379
00380
00381 AkForceInline bool HasStrictlyOnePairOfSurroundChannels( AkChannelMask in_uChannelMask )
00382 {
00383 return ( ( ( in_uChannelMask & AK_SPEAKER_BACK_LEFT ) != 0 ) ^ ( ( in_uChannelMask & AK_SPEAKER_SIDE_LEFT ) != 0 ) );
00384 }
00385
00386
00387
00388
00389 AkForceInline bool HasSideAndRearChannels( AkChannelMask in_uChannelMask )
00390 {
00391 return ( in_uChannelMask & AK_SPEAKER_BACK_LEFT && in_uChannelMask & AK_SPEAKER_SIDE_LEFT );
00392 }
00393
00394
00395 AkForceInline bool HasHeightChannels(AkChannelMask in_uChannelMask)
00396 {
00397 return (in_uChannelMask & ~AK_SPEAKER_SETUP_DEFAULT_PLANE) > 0;
00398 }
00399
00400
00401
00402 AkForceInline AkChannelMask BackToSideChannels( AkChannelMask in_uChannelMask )
00403 {
00404 if ( HasStrictlyOnePairOfSurroundChannels( in_uChannelMask ) )
00405 {
00406 in_uChannelMask &= ~( AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT );
00407 in_uChannelMask |= ( AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT );
00408 }
00409 return in_uChannelMask;
00410 }
00411
00412
00413
00414
00415
00416 static inline unsigned int StdChannelIndexToDisplayIndex( AkChannelOrdering in_eOrdering, unsigned int in_uChannelMask, unsigned int in_uChannelIdx )
00417 {
00418 if ( in_eOrdering == ChannelOrdering_Standard )
00419 {
00420 unsigned int uNumChannelsFront = ChannelMaskToNumChannels( in_uChannelMask & AK_SPEAKER_SETUP_FRONT );
00421 if ( ( in_uChannelMask & AK_SPEAKER_LOW_FREQUENCY )
00422 && ( in_uChannelIdx == uNumChannelsFront ) )
00423 {
00424
00425 in_uChannelIdx = ChannelMaskToNumChannels( in_uChannelMask ) - 1;
00426 }
00427 else if ( in_uChannelIdx >= uNumChannelsFront )
00428 {
00429
00430 unsigned int uLfeOffset = ( in_uChannelMask & AK_SPEAKER_LOW_FREQUENCY ) ? 1 : 0;
00431
00432
00433 if ( HasSideAndRearChannels( in_uChannelMask ) )
00434 {
00435 unsigned int uRearIdx = uNumChannelsFront + uLfeOffset;
00436 unsigned int uSideIdx = uRearIdx + 2;
00437 unsigned int uAfterSideIdx = uSideIdx + 2;
00438 if ( in_uChannelIdx < uAfterSideIdx )
00439 {
00440 if ( in_uChannelIdx >= uSideIdx )
00441 in_uChannelIdx -= 2;
00442 else
00443 in_uChannelIdx += 2;
00444 }
00445 }
00446 in_uChannelIdx -= uLfeOffset;
00447 }
00448 }
00449 else
00450 {
00451
00452 if ( HasSideAndRearChannels( in_uChannelMask ) )
00453 {
00454 unsigned int uRearIdx = ChannelMaskToNumChannels( in_uChannelMask & AK_SPEAKER_SETUP_FRONT );
00455 unsigned int uMaxIdx = uRearIdx + 4;
00456
00457 if ( in_uChannelIdx >= uRearIdx
00458 && in_uChannelIdx < uMaxIdx )
00459 {
00460
00461 unsigned int uSideIdx = uRearIdx + 2;
00462 if ( in_uChannelIdx >= uSideIdx )
00463 in_uChannelIdx -= 2;
00464 else
00465 in_uChannelIdx += 2;
00466 }
00467 }
00468 }
00469
00470 return in_uChannelIdx;
00471 }
00472
00473 }
00474
00475
00476 enum AkChannelConfigType
00477 {
00478 AK_ChannelConfigType_Anonymous = 0x0,
00479 AK_ChannelConfigType_Standard = 0x1,
00480 AK_ChannelConfigType_Ambisonic = 0x2
00481 };
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502 struct AkChannelConfig
00503 {
00504
00505
00506
00507
00508 AkUInt32 uNumChannels : 8;
00509 AkUInt32 eConfigType : 4;
00510 AkUInt32 uChannelMask : 20;
00511
00512
00513 AkForceInline AkChannelConfig()
00514 : uNumChannels(0)
00515 , eConfigType(0)
00516 , uChannelMask(0)
00517 {
00518 }
00519
00520
00521 AkForceInline AkChannelConfig(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
00522 {
00523
00524 SetStandardOrAnonymous(in_uNumChannels, in_uChannelMask);
00525 }
00526
00527
00528 AkForceInline bool operator!=(AkUInt32 in_uBitField)
00529 {
00530 return (*((AkUInt32*)this) != in_uBitField);
00531 }
00532
00533
00534 AkForceInline void Clear()
00535 {
00536 uNumChannels = 0;
00537 eConfigType = 0;
00538 uChannelMask = 0;
00539 }
00540
00541
00542 AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
00543 {
00544 uNumChannels = AK::ChannelMaskToNumChannels(in_uChannelMask);
00545 eConfigType = AK_ChannelConfigType_Standard;
00546 uChannelMask = in_uChannelMask;
00547 }
00548
00549
00550 AkForceInline void SetStandardOrAnonymous(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
00551 {
00552 #ifdef AKASSERT
00553 AKASSERT(in_uChannelMask == 0 || in_uNumChannels == AK::ChannelMaskToNumChannels(in_uChannelMask));
00554 #endif
00555 uNumChannels = in_uNumChannels;
00556 eConfigType = (in_uChannelMask) ? AK_ChannelConfigType_Standard : AK_ChannelConfigType_Anonymous;
00557 uChannelMask = in_uChannelMask;
00558 }
00559
00560
00561 AkForceInline void SetAnonymous(AkUInt32 in_uNumChannels)
00562 {
00563 uNumChannels = in_uNumChannels;
00564 eConfigType = AK_ChannelConfigType_Anonymous;
00565 uChannelMask = 0;
00566 }
00567
00568
00569 AkForceInline void SetAmbisonic(AkUInt32 in_uNumChannels)
00570 {
00571 uNumChannels = in_uNumChannels;
00572 eConfigType = AK_ChannelConfigType_Ambisonic;
00573 uChannelMask = 0;
00574 }
00575
00576
00577 AkForceInline bool IsValid() const
00578 {
00579 return uNumChannels != 0;
00580 }
00581
00582
00583 AkForceInline AkUInt32 Serialize() const
00584 {
00585 return uNumChannels | (eConfigType << 8) | (uChannelMask << 12);
00586 }
00587
00588
00589 AkForceInline void Deserialize(AkUInt32 in_uChannelConfig)
00590 {
00591 uNumChannels = in_uChannelConfig & 0x000000ff;
00592 eConfigType = (in_uChannelConfig >> 8) & 0x0000000f;
00593 uChannelMask = (in_uChannelConfig >> 12) & 0x000fffff;
00594 }
00595
00596
00597 AkForceInline AkChannelConfig RemoveLFE() const
00598 {
00599 AkChannelConfig newConfig = *this;
00600 #ifdef AK_LFECENTER
00601 AkUInt32 uNewChannelMask = newConfig.uChannelMask & ~AK_SPEAKER_LOW_FREQUENCY;
00602 AkUInt32 uNumLFEChannel = (newConfig.uChannelMask - uNewChannelMask) >> 3;
00603 #ifdef AKASSERT
00604 AKASSERT(uNumLFEChannel == 0 || uNumLFEChannel == 1);
00605 #endif
00606 newConfig.uNumChannels -= uNumLFEChannel;
00607 newConfig.uChannelMask = uNewChannelMask;
00608 #endif
00609 return newConfig;
00610 }
00611
00612
00613 AkForceInline AkChannelConfig RemoveCenter() const
00614 {
00615 AkChannelConfig newConfig = *this;
00616 #ifdef AK_LFECENTER
00617 AkUInt32 uNewChannelMask = newConfig.uChannelMask & ~AK_SPEAKER_FRONT_CENTER;
00618 AkUInt32 uNumCenterChannel = (newConfig.uChannelMask - uNewChannelMask) >> 2;
00619 #ifdef AKASSERT
00620 AKASSERT(uNumCenterChannel == 0 || uNumCenterChannel == 1);
00621 #endif
00622 newConfig.uNumChannels -= uNumCenterChannel;
00623 newConfig.uChannelMask = uNewChannelMask;
00624 #endif
00625 return newConfig;
00626 }
00627
00628
00629 AkForceInline bool operator==(const AkChannelConfig & in_other) const
00630 {
00631 return uNumChannels == in_other.uNumChannels
00632 && eConfigType == in_other.eConfigType
00633 && uChannelMask == in_other.uChannelMask;
00634 }
00635
00636
00637 AkForceInline bool operator!=(const AkChannelConfig & in_other) const
00638 {
00639 return uNumChannels != in_other.uNumChannels
00640 || eConfigType != in_other.eConfigType
00641 || uChannelMask != in_other.uChannelMask;
00642 }
00643
00644
00645
00646 AkForceInline bool IsChannelConfigSupported() const
00647 {
00648 #ifdef AK_71AUDIO
00649 return true;
00650 #else
00651 if (eConfigType == AK_ChannelConfigType_Standard)
00652 {
00653 switch (uChannelMask)
00654 {
00655 case AK_SPEAKER_SETUP_MONO:
00656 case AK_SPEAKER_SETUP_STEREO:
00657 #ifdef AK_LFECENTER
00658 case AK_SPEAKER_SETUP_0POINT1:
00659 case AK_SPEAKER_SETUP_1POINT1:
00660 case AK_SPEAKER_SETUP_2POINT1:
00661 case AK_SPEAKER_SETUP_3STEREO:
00662 case AK_SPEAKER_SETUP_3POINT1:
00663 #ifdef AK_REARCHANNELS
00664 case AK_SPEAKER_SETUP_4:
00665 case AK_SPEAKER_SETUP_4POINT1:
00666 case AK_SPEAKER_SETUP_5:
00667 case AK_SPEAKER_SETUP_5POINT1:
00668 #endif
00669 #endif
00670 return true;
00671 }
00672 }
00673 return false;
00674 #endif
00675 }
00676
00677
00678
00679 AkForceInline bool HasLFE() const
00680 {
00681 #ifdef AK_LFECENTER
00682 return AK::HasLFE(uChannelMask);
00683 #else
00684 return false;
00685 #endif
00686 }
00687
00688
00689
00690
00691
00692 AkForceInline bool HasCenter() const
00693 {
00694 #ifdef AK_LFECENTER
00695 return AK::HasCenter(uChannelMask);
00696 #else
00697 return false;
00698 #endif
00699 }
00700 };
00701
00702 #endif //_AK_SPEAKERCONFIG_H_
介绍一下自己的项目。我们会竭力为您提供帮助。
来注册自己的项目,我们帮您快速入门,不带任何附加条件!
开始 Wwise 之旅