resampler.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _RESAMPLER_H_
  2. #define _RESAMPLER_H_
  3. // Ugglay
  4. #ifdef RESAMPLER_DECORATE
  5. #define PASTE(a,b) a ## b
  6. #define EVALUATE(a,b) PASTE(a,b)
  7. #define resampler_init EVALUATE(RESAMPLER_DECORATE,_resampler_init)
  8. #define resampler_create EVALUATE(RESAMPLER_DECORATE,_resampler_create)
  9. #define resampler_delete EVALUATE(RESAMPLER_DECORATE,_resampler_delete)
  10. #define resampler_dup EVALUATE(RESAMPLER_DECORATE,_resampler_dup)
  11. #define resampler_dup_inplace EVALUATE(RESAMPLER_DECORATE,_resampler_dup_inplace)
  12. #define resampler_set_quality EVALUATE(RESAMPLER_DECORATE,_resampler_set_quality)
  13. #define resampler_get_free_count EVALUATE(RESAMPLER_DECORATE,_resampler_get_free_count)
  14. #define resampler_write_sample EVALUATE(RESAMPLER_DECORATE,_resampler_write_sample)
  15. #define resampler_write_sample_fixed EVALUATE(RESAMPLER_DECORATE,_resampler_write_sample_fixed)
  16. #define resampler_set_rate EVALUATE(RESAMPLER_DECORATE,_resampler_set_rate)
  17. #define resampler_ready EVALUATE(RESAMPLER_DECORATE,_resampler_ready)
  18. #define resampler_clear EVALUATE(RESAMPLER_DECORATE,_resampler_clear)
  19. #define resampler_get_sample_count EVALUATE(RESAMPLER_DECORATE,_resampler_get_sample_count)
  20. #define resampler_get_sample EVALUATE(RESAMPLER_DECORATE,_resampler_get_sample)
  21. #define resampler_remove_sample EVALUATE(RESAMPLER_DECORATE,_resampler_remove_sample)
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. void resampler_init(void);
  27. void * resampler_create(void);
  28. void resampler_delete(void *);
  29. void * resampler_dup(const void *);
  30. void resampler_dup_inplace(void *, const void *);
  31. enum
  32. {
  33. RESAMPLER_QUALITY_MIN = 0,
  34. RESAMPLER_QUALITY_ZOH = 0,
  35. RESAMPLER_QUALITY_BLEP = 1,
  36. RESAMPLER_QUALITY_LINEAR = 2,
  37. RESAMPLER_QUALITY_CUBIC = 3,
  38. RESAMPLER_QUALITY_SINC = 4,
  39. RESAMPLER_QUALITY_MAX = 4
  40. };
  41. void resampler_set_quality(void *, int quality);
  42. int resampler_get_free_count(void *);
  43. void resampler_write_sample(void *, short sample);
  44. void resampler_write_sample_fixed(void *, int sample, unsigned char depth);
  45. void resampler_set_rate( void *, double new_factor );
  46. int resampler_ready(void *);
  47. void resampler_clear(void *);
  48. int resampler_get_sample_count(void *);
  49. int resampler_get_sample(void *);
  50. void resampler_remove_sample(void *);
  51. short resampler_get_and_remove_sample(void *_r);
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #endif