Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.0KB

  1. /**
  2. Copyright (C) 2011-2013 Robin Gareus <robin@gareus.org>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser Public License as published by
  5. the Free Software Foundation; either version 2.1, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. */
  15. #ifndef __AD_PLUGIN_H__
  16. #define __AD_PLUGIN_H__
  17. #include "ad.h"
  18. #define dbg(A, B, ...) ad_debug_printf(__func__, A, B, ##__VA_ARGS__)
  19. #ifndef __PRI64_PREFIX
  20. #if (defined __X86_64__ || defined __LP64__)
  21. # define __PRI64_PREFIX "l"
  22. #else
  23. # define __PRI64_PREFIX "ll"
  24. #endif
  25. #endif
  26. #ifndef PRIu64
  27. # define PRIu64 __PRI64_PREFIX "u"
  28. #endif
  29. #ifndef PRIi64
  30. # define PRIi64 __PRI64_PREFIX "i"
  31. #endif
  32. extern int ad_debug_level;
  33. void ad_debug_printf(const char* func, int level, const char* format, ...);
  34. typedef struct {
  35. int (*eval)(const char *);
  36. void * (*open)(const char *, struct adinfo *);
  37. int (*close)(void *);
  38. int (*info)(void *, struct adinfo *);
  39. int64_t (*seek)(void *, int64_t);
  40. ssize_t (*read)(void *, float *, size_t);
  41. int (*bitrate)(void *);
  42. } ad_plugin;
  43. int ad_eval_null(const char *);
  44. void * ad_open_null(const char *, struct adinfo *);
  45. int ad_close_null(void *);
  46. int ad_info_null(void *, struct adinfo *);
  47. int64_t ad_seek_null(void *, int64_t);
  48. ssize_t ad_read_null(void *, float*, size_t);
  49. int ad_bitrate_null(void *);
  50. /* hardcoded backends */
  51. const ad_plugin * adp_get_sndfile();
  52. const ad_plugin * adp_get_dr_mp3();
  53. const ad_plugin * adp_get_minimp3();
  54. const ad_plugin * adp_get_ffmpeg();
  55. #endif