2001-11-29 12:44:06 +00:00
|
|
|
#ifndef __audio_plugin_h__
|
|
|
|
#define __audio_plugin_h__
|
|
|
|
|
|
|
|
// Functions supplied by plugins
|
2001-11-24 05:24:06 +00:00
|
|
|
typedef struct ao_plugin_functions_s
|
|
|
|
{
|
|
|
|
ao_info_t *info;
|
2003-03-21 16:42:50 +00:00
|
|
|
int (*control)(int cmd, void *arg);
|
2001-11-24 05:24:06 +00:00
|
|
|
int (*init)();
|
|
|
|
void (*uninit)();
|
|
|
|
void (*reset)();
|
|
|
|
int (*play)();
|
|
|
|
} ao_plugin_functions_t;
|
|
|
|
|
2001-11-29 12:44:06 +00:00
|
|
|
// Global data for all audio plugins
|
2001-11-24 05:24:06 +00:00
|
|
|
typedef struct ao_plugin_data_s
|
|
|
|
{
|
|
|
|
void* data; /* current data block read only ok to change */
|
|
|
|
int len; /* setup and current buffer length */
|
|
|
|
int rate; /* setup data rate */
|
|
|
|
int channels; /* setup number of channels */
|
|
|
|
int format; /* setup format */
|
|
|
|
double sz_mult; /* Buffer size multiplier */
|
2001-11-25 14:29:54 +00:00
|
|
|
double sz_fix; /* Fix (as in static) extra buffer size */
|
2001-11-24 05:24:06 +00:00
|
|
|
float delay_mult; /* Delay multiplier */
|
|
|
|
float delay_fix; /* Fix delay */
|
|
|
|
}ao_plugin_data_t;
|
|
|
|
|
2001-12-05 10:31:10 +00:00
|
|
|
extern volatile ao_plugin_data_t ao_plugin_data;
|
2001-11-24 05:24:06 +00:00
|
|
|
|
2001-11-29 12:44:06 +00:00
|
|
|
// Plugin confuguration data set by cmd-line parameters
|
|
|
|
typedef struct ao_plugin_cfg_s
|
|
|
|
{
|
|
|
|
char* plugin_list; // List of used plugins read from cfg
|
|
|
|
int pl_format_type; // Output format
|
|
|
|
int pl_delay_len; // Number of samples to delay sound output
|
2001-12-20 15:30:22 +00:00
|
|
|
int pl_resample_fout; // Output frequency from resampling
|
2002-02-25 13:31:26 +00:00
|
|
|
int pl_volume_volume; // Initial volume setting
|
2002-03-03 14:17:53 +00:00
|
|
|
float pl_extrastereo_mul; // Stereo enhancer multiplier
|
2002-03-13 12:32:42 +00:00
|
|
|
int pl_volume_softclip; // Enable soft clipping
|
2001-11-29 12:44:06 +00:00
|
|
|
} ao_plugin_cfg_t;
|
|
|
|
|
2002-02-25 13:31:26 +00:00
|
|
|
extern ao_plugin_cfg_t ao_plugin_cfg;
|
2001-11-29 12:44:06 +00:00
|
|
|
|
|
|
|
// Configuration defaults
|
|
|
|
#define CFG_DEFAULTS { \
|
|
|
|
NULL, \
|
|
|
|
AFMT_S16_LE, \
|
2001-12-20 15:30:22 +00:00
|
|
|
0, \
|
2002-02-25 13:31:26 +00:00
|
|
|
48000, \
|
2002-03-13 12:32:42 +00:00
|
|
|
101, \
|
|
|
|
2.5, \
|
|
|
|
0 \
|
2001-11-29 12:44:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// This block should not be available in the pl_xxxx files
|
|
|
|
// due to compilation issues
|
|
|
|
#ifndef PLUGIN
|
2002-06-15 06:15:07 +00:00
|
|
|
#define NPL 8+1 // Number of PLugins ( +1 list ends with NULL )
|
2001-11-29 12:44:06 +00:00
|
|
|
// List of plugins
|
|
|
|
extern ao_plugin_functions_t audio_plugin_delay;
|
|
|
|
extern ao_plugin_functions_t audio_plugin_format;
|
2001-12-04 15:44:04 +00:00
|
|
|
extern ao_plugin_functions_t audio_plugin_surround;
|
2001-12-20 15:30:22 +00:00
|
|
|
extern ao_plugin_functions_t audio_plugin_resample;
|
2002-02-25 13:31:26 +00:00
|
|
|
extern ao_plugin_functions_t audio_plugin_volume;
|
2002-03-03 14:17:53 +00:00
|
|
|
extern ao_plugin_functions_t audio_plugin_extrastereo;
|
2002-03-05 09:17:36 +00:00
|
|
|
extern ao_plugin_functions_t audio_plugin_volnorm;
|
2002-06-15 06:15:07 +00:00
|
|
|
extern ao_plugin_functions_t audio_plugin_eq;
|
2001-11-29 12:44:06 +00:00
|
|
|
|
|
|
|
#define AO_PLUGINS { \
|
|
|
|
&audio_plugin_delay, \
|
|
|
|
&audio_plugin_format, \
|
2001-12-04 15:44:04 +00:00
|
|
|
&audio_plugin_surround, \
|
2001-12-20 15:30:22 +00:00
|
|
|
&audio_plugin_resample, \
|
2002-02-25 13:31:26 +00:00
|
|
|
&audio_plugin_volume, \
|
2002-03-03 14:17:53 +00:00
|
|
|
&audio_plugin_extrastereo, \
|
2002-03-05 09:17:36 +00:00
|
|
|
&audio_plugin_volnorm, \
|
2002-06-15 06:15:07 +00:00
|
|
|
&audio_plugin_eq, \
|
2001-11-29 12:44:06 +00:00
|
|
|
NULL \
|
|
|
|
}
|
|
|
|
#endif /* PLUGIN */
|
|
|
|
|
|
|
|
|
|
|
|
// Control parameters used by the plugins
|
|
|
|
#define AOCONTROL_PLUGIN_SET_LEN 1 // All plugins must respond to this parameter
|
2002-07-25 20:28:47 +00:00
|
|
|
#define AOCONTROL_PLUGIN_ES_SET 4 // set extra stereo coefficient
|
|
|
|
#define AOCONTROL_PLUGIN_ES_GET 5 // get extra stereo coefficient
|
2001-11-25 14:29:54 +00:00
|
|
|
|
2001-11-29 12:44:06 +00:00
|
|
|
#endif
|
2001-11-25 14:29:54 +00:00
|
|
|
|