#if defined(EXTERN)
#undef EXTERN
#endif
#if defined(_AUDIO_EX3D_CONTROL_C_)
#define EXTERN
#else
#define EXTERN  extern
#endif

#define NO_ERR                                                                          0

#ifndef TRUE
#define TRUE    1
#endif

#ifndef true
#define true    1
#endif

#ifndef FALSE
#define FALSE   0
#endif

#ifndef false
#define false   0
#endif

#ifndef DS_BOOL
        typedef int DS_BOOL;
#endif

#define EX3D_SET_CH_NUM             NUM_USB_CHAN_OUT
#ifndef EX3D_SF_NUM
#define EX3D_SF_NUM                 6
#endif
        
EXTERN void audio_ex3d_load_key(chanend_t c);
EXTERN int audio_ex3d_activate_key(chanend_t c);
EXTERN int audio_ex3d_init(uint32_t dwChannels, uint32_t dwSampleSize, uint32_t dwSRHz, uint32_t dwAudioDataSize);
EXTERN int audio_ex3d_change_parameter(uint32_t dwChannels, uint32_t dwSampleSize, uint32_t dwSRHz, uint32_t dwAudioDataSize);
EXTERN int audio_ex3d_conv_init(uint32_t dwTileNum, uint32_t dwChannels);
EXTERN int audio_ex3d_deinit(void);

EXTERN void audio_ex3d_set_onoff(DS_BOOL onoff);
EXTERN void audio_ex3d_set_sf(uint32_t SF_Idx);
#if 1
EXTERN void audio_ex3d_set_angle(uint32_t dwCh1Angle, uint32_t dwCh2Angle);
#else
EXTERN void audio_ex3d_set_angle(uint32_t dwCh1Angle, uint32_t dwCh2Angle,
                          uint32_t dwCh3Angle, uint32_t dwCh4Angle,
                          uint32_t dwCh5Angle, uint32_t dwCh6Angle,
                          uint32_t dwCh7Angle, uint32_t dwCh8Angle);
#endif
EXTERN void audio_ex3d_set_upmix(DS_BOOL onoff);

EXTERN void audio_ex3d_upmix_toggle(void);
EXTERN void audio_ex3d_toggle(void);

EXTERN void audio_ex3d_task(void);

EXTERN uint32_t EX3D_HAngle[EX3D_SET_CH_NUM];   // EX3D Channel 수평각
EXTERN uint32_t EX3D_VAngle[EX3D_SET_CH_NUM];   // EX3D Channel 수직각
EXTERN DS_BOOL EX3D_Mute[EX3D_SET_CH_NUM];      // EX3D Channel Mute
EXTERN uint8_t bEX3D_Open;                      // EX3D Open 유무 저장
EXTERN uint8_t bEX3D_On;                        // EX3D On 유무 저장
EXTERN int32_t Ex3dOnGain;                      // EX3D On Gain 값
EXTERN int32_t Ex3dOffGain;                     // EX3D Off Gain 값
EXTERN int32_t Ex3dLfeGain;                     // EX3D Lfe Gain 값
EXTERN uint8_t bEX3D_Upmix;                     // EX3D Upmix 유무 저장
EXTERN int32_t Ex3dLimiterThreshold;              // EX3D Limiter threshold 값
EXTERN int32_t Ex3dLimiterAttackTime;           // EX3D Limiter Attack Time 값
EXTERN int32_t Ex3dLimiterReleaseTime;          // EX3D Limiter Release Time 값

// dhlee++
EXTERN int32_t Ex3dExpandGain;              // EX3D Expand Gain 값
EXTERN int32_t Ex3dReduceGain;              // EX3D Reduce Gain 값

// dhlee--
