#ifndef __EFFECTS_ADJ__H #define __EFFECTS_ADJ__H #include "system/includes.h" #include "config/config_interface.h" #include "asm/crc16.h" #include "generic/log.h" #include "media/audio_eq.h" #include "media/audio_drc.h" #include "media/howling_api.h" #include "media/sw_drc.h" #include "media/DynamicEQ_api.h" #include "media/DynamicEQ_Detection_api.h" #include "media/reverb_api.h" #include "media/noisegate_api.h" #include "media/audio_gain_process.h" #include "media/voiceChanger_api.h" #include "media/audio_vbass.h" #define GAIN_PROCESS_EN 0 struct effect_adj { u8 eq_type; uint8_t password_ok; struct __effect_mode_cfg *parm; struct __tool_callback *cb; }; typedef struct { int cmd; /// byass 0 -> no bypass REVERBN_PARM_SET parm; } REVERBN_PARM_TOOL_SET; //reverb_palte 模块: typedef struct _Plate_reverb_TOOL_SET_ { int is_bypass; // 1-> byass 0 -> no bypass Plate_reverb_parm parm; } Plate_reverb_TOOL_SET; //reverb_filter模块: typedef struct _EF_REVERB0__TOOL_SET_ { int is_bypass; // 1-> byass 0 -> no bypass EF_REVERB0_PARM parm; } EF_REVERB0_TOOL_SET; //echo模块: typedef struct _EF_ECHO_TOOL_SET_ { int is_bypass; // 1-> byass 0 -> no bypass ECHO_PARM_SET parm; } EF_ECHO_TOOL_SET; //移频模块 HowlingPitchShift: typedef struct _HowlingPs_PARM_TOOL_SET_ { int is_bypass; // 1-> byass 0 -> no bypass HOWLING_PITCHSHIFT_PARM parm; } HowlingPs_PARM_TOOL_SET; typedef struct _NotchHowlingParam_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass NotchHowlingParam parm; } NotchHowlingParam_TOOL_SET; typedef struct _VoiceChangerParam_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass VOICECHANGER_PARM parm; } VoiceChangerParam_TOOL_SET; typedef struct _NoiseGateParam_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass noisegate_update_param parm; } NoiseGateParam_TOOL_SET; typedef struct _gain_process_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass struct aud_gain_parm_update parm; } Gain_Process_TOOL_SET; struct advance_iir { int fc; int order; int type; }; // #低通 LowPass: typedef struct _LowPassParam_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass struct advance_iir low_pass; } LowPassParam_TOOL_SET; // #高通 HighPass: typedef struct _HighPassParam_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass struct advance_iir high_pass; } HighPassParam_TOOL_SET; //虚拟低音 typedef struct _VirtualBass_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass VirtualBassUdateParam parm; } VirtualBass_TOOL_SET; //动态EQ DynamicEQ: typedef struct _DynamicEQParam_TOOL_SET { int is_bypass; // 1-> byass 0 -> no bypass DynamicEQEffectParam effect_param[4]; int nSection; //段数 int detect_mode; //检测模式 } DynamicEQParam_TOOL_SET; //实际发送这个结构体 #define OTHER_SECTION_MAX (5) struct eq_tool { float global_gain; int seg_num; //eq效果文件存储的段数 int enable_section; // struct eq_seg_info seg[OTHER_SECTION_MAX]; //eq系数存储地址 }; #define mSECTION_MAX (20) struct music_eq_tool { float global_gain; int seg_num; //eq效果文件存储的段数 int enable_section; // struct eq_seg_info seg[mSECTION_MAX]; //eq系数存储地址 }; #define mSECTION_MAX2 (10) struct music_eq2_tool { float global_gain; int seg_num; //eq效果文件存储的段数 int enable_section; // struct eq_seg_info seg[mSECTION_MAX2]; //eq系数存储地址 }; struct phone_parm_tool_set { struct eq_tool eq_parm; wdrc_struct_TOOL_SET drc_parm; }; struct nband_drc { CrossOverParam_TOOL_SET crossover; wdrc_struct_TOOL_SET wdrc_parm[4];//[0]low [1]mid [2]high [3]多带之后附加的全带 }; struct music_parm_tool_set { struct music_eq_tool eq_parm; struct nband_drc drc_parm; }; struct eff_parm { NoiseGateParam_TOOL_SET noise_gate_parm; HowlingPs_PARM_TOOL_SET howlingps_parm; NotchHowlingParam_TOOL_SET notchhowling_parm; VoiceChangerParam_TOOL_SET voicechanger_parm; Plate_reverb_TOOL_SET plate_reverb_parm; EF_ECHO_TOOL_SET echo_parm; struct eq_tool eq_parm[5]; wdrc_struct_TOOL_SET drc_parm[5]; #if GAIN_PROCESS_EN Gain_Process_TOOL_SET gain_parm;//增益 #endif }; void get_eff_mode(u16 mode_id, u16 group_id, u8 *mode_index, u8 *drc_index);//获取混响模式的index int get_phone_mode(u16 group_id); int get_group_id(u16 mode_name, u8 tar); int get_eq_nsection(u16 module_name); void noisegate_update_parm(void *parm, int bypass); void plate_reverb_update_parm(void *parm, int bypass); void echo_updata_parm(void *parm, int bypass); void howling_pitch_shift_update_parm(void *parm, int bypass); void notchhowline_update_parm(void *parm, int bypass); void audio_dynamic_eq_update_parm(void *parm, void *parm2, int bypass); void audio_dynamic_eq_detection_update_parm(void *parm, int bypas); void mic_gain_update_parm(u16 gain_name, void *parm, int bypass); void set_mic_reverb_mode_by_id(u8 mode); void phone_eff_default_parm(void); void music_eff_default_parm(void); void mic_eff_default_parm(u8 index); void linein_eff_default_parm(void); void cp_eq_file_seg_to_custom_tab(); struct cmd_interface { u32 cmd; int (*cmd_deal)(EFF_ONLINE_PACKET *packet, u8 id, u8 sq); }; #define REGISTER_CMD_TARGET(cmd_eff) \ const struct cmd_interface cmd_eff sec(.eff_cmd) extern const struct cmd_interface cmd_interface_begin[]; extern const struct cmd_interface cmd_interface_end[]; #define list_for_each_cmd_interface(p) \ for (p = (struct cmd_interface *)cmd_interface_begin; p < (struct cmd_interface *)cmd_interface_end; p++) #define phone_eq_nsection OTHER_SECTION_MAX #define music_eq_nsection 10 #define music_eq2_nsection 10 #define mic_eq_nsection OTHER_SECTION_MAX #endif/*__EFFECTS_ADJ__H*/