/project/jni/sdl_mixer/timidity/output.h

https://github.com/aichunyu/FFPlayer · C Header · 75 lines · 31 code · 12 blank · 32 comment · 1 complexity · 9c9e3bb1e21c22f8dde677c7f996b0cc MD5 · raw file

  1. /*
  2. TiMidity -- Experimental MIDI to WAVE converter
  3. Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. output.h
  16. */
  17. /* Data format encoding bits */
  18. #define PE_MONO 0x01 /* versus stereo */
  19. #define PE_SIGNED 0x02 /* versus unsigned */
  20. #define PE_16BIT 0x04 /* versus 8-bit */
  21. #define PE_ULAW 0x08 /* versus linear */
  22. #define PE_BYTESWAP 0x10 /* versus the other way */
  23. typedef struct {
  24. int32 rate, encoding;
  25. char *id_name;
  26. } PlayMode;
  27. extern PlayMode *play_mode_list[], *play_mode;
  28. extern int init_buffers(int kbytes);
  29. /* Conversion functions -- These overwrite the int32 data in *lp with
  30. data in another format */
  31. /* The size of the output buffers */
  32. extern int AUDIO_BUFFER_SIZE;
  33. /* Actual copy function */
  34. extern void (*s32tobuf)(void *dp, int32 *lp, int32 c);
  35. /* 8-bit signed and unsigned*/
  36. extern void s32tos8(void *dp, int32 *lp, int32 c);
  37. extern void s32tou8(void *dp, int32 *lp, int32 c);
  38. /* 16-bit */
  39. extern void s32tos16(void *dp, int32 *lp, int32 c);
  40. extern void s32tou16(void *dp, int32 *lp, int32 c);
  41. /* byte-exchanged 16-bit */
  42. extern void s32tos16x(void *dp, int32 *lp, int32 c);
  43. extern void s32tou16x(void *dp, int32 *lp, int32 c);
  44. /* uLaw (8 bits) */
  45. extern void s32toulaw(void *dp, int32 *lp, int32 c);
  46. /* little-endian and big-endian specific */
  47. #if SDL_BYTEORDER == SDL_LIL_ENDIAN
  48. #define s32tou16l s32tou16
  49. #define s32tou16b s32tou16x
  50. #define s32tos16l s32tos16
  51. #define s32tos16b s32tos16x
  52. #else
  53. #define s32tou16l s32tou16x
  54. #define s32tou16b s32tou16
  55. #define s32tos16l s32tos16x
  56. #define s32tos16b s32tos16
  57. #endif