spd_audio_plugin.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * spd_audio_plugin.h -- The SPD Audio Plugin Header
  3. *
  4. * Copyright (C) 2004 Brailcom, o.p.s.
  5. *
  6. * This is free software; you can redistribute it and/or modify it under the
  7. * terms of the GNU Lesser General Public License as published by the Free
  8. * Software Foundation; either version 2.1, or (at your option) any later
  9. * version.
  10. *
  11. * This software is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this package; see the file COPYING. If not, write to the Free
  18. * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301, USA.
  20. *
  21. */
  22. #ifndef __SPD_AUDIO_PLUGIN_H
  23. #define __SPD_AUDIO_PLUGIN_H
  24. #define SPD_AUDIO_PLUGIN_ENTRY_STR "spd_audio_plugin_get"
  25. /* *INDENT-OFF* */
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /* *INDENT-ON* */
  30. typedef enum { SPD_AUDIO_LE, SPD_AUDIO_BE } AudioFormat;
  31. typedef struct {
  32. int bits;
  33. int num_channels;
  34. int sample_rate;
  35. int num_samples;
  36. signed short *samples;
  37. } AudioTrack;
  38. struct spd_audio_plugin;
  39. typedef struct {
  40. int volume;
  41. AudioFormat format;
  42. struct spd_audio_plugin const *function;
  43. void *private_data;
  44. int working;
  45. } AudioID;
  46. typedef struct spd_audio_plugin {
  47. const char *name;
  48. AudioID *(*open) (void **pars);
  49. int (*play) (AudioID * id, AudioTrack track);
  50. int (*stop) (AudioID * id);
  51. int (*close) (AudioID * id);
  52. int (*set_volume) (AudioID * id, int);
  53. void (*set_loglevel) (int level);
  54. char const *(*get_playcmd) (void);
  55. } spd_audio_plugin_t;
  56. /* *INDENT-OFF* */
  57. #ifdef __cplusplus
  58. }
  59. #endif /* __cplusplus */
  60. /* *INDENT-ON* */
  61. #endif /* ifndef #__SPD_AUDIO_PLUGIN_H */