| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef __SPD_AUDIO_PLUGIN_H |
| 24 |
#define __SPD_AUDIO_PLUGIN_H |
| 25 |
|
| 26 |
#define SPD_AUDIO_PLUGIN_ENTRY_STR "spd_audio_plugin_get" |
| 27 |
|
| 28 |
|
| 29 |
#ifdef __cplusplus |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
|
| 34 |
typedef enum { SPD_AUDIO_LE, SPD_AUDIO_BE } AudioFormat; |
| 35 |
|
| 36 |
typedef struct { |
| 37 |
int bits; |
| 38 |
int num_channels; |
| 39 |
int sample_rate; |
| 40 |
|
| 41 |
int num_samples; |
| 42 |
signed short *samples; |
| 43 |
} AudioTrack; |
| 44 |
|
| 45 |
struct spd_audio_plugin; |
| 46 |
|
| 47 |
typedef struct { |
| 48 |
|
| 49 |
int volume; |
| 50 |
AudioFormat format; |
| 51 |
|
| 52 |
struct spd_audio_plugin const *function; |
| 53 |
void *private_data; |
| 54 |
|
| 55 |
int working; |
| 56 |
} AudioID; |
| 57 |
|
| 58 |
typedef struct spd_audio_plugin { |
| 59 |
const char *name; |
| 60 |
AudioID *(*open) (void **pars); |
| 61 |
int (*play) (AudioID * id, AudioTrack track); |
| 62 |
int (*stop) (AudioID * id); |
| 63 |
int (*close) (AudioID * id); |
| 64 |
int (*set_volume) (AudioID * id, int); |
| 65 |
void (*set_loglevel) (int level); |
| 66 |
char const *(*get_playcmd) (void); |
| 67 |
} spd_audio_plugin_t; |
| 68 |
|
| 69 |
|
| 70 |
#ifdef __cplusplus |
| 71 |
} |
| 72 |
#endif |
| 73 |
|
| 74 |
|
| 75 |
#endif |