voicemgr.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. **********************************************************************
  3. * sblive_voice.h -- EMU Voice Resource Manager header file
  4. * Copyright 1999, 2000 Creative Labs, Inc.
  5. *
  6. **********************************************************************
  7. *
  8. * Date Author Summary of changes
  9. * ---- ------ ------------------
  10. * October 20, 1999 Bertrand Lee base code release
  11. *
  12. **********************************************************************
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public
  25. * License along with this program; if not, write to the Free
  26. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  27. * USA.
  28. *
  29. **********************************************************************
  30. */
  31. #ifndef _VOICEMGR_H
  32. #define _VOICEMGR_H
  33. #include "hwaccess.h"
  34. /* struct emu_voice.usage flags */
  35. #define VOICE_USAGE_FREE 0x01
  36. #define VOICE_USAGE_MIDI 0x02
  37. #define VOICE_USAGE_PLAYBACK 0x04
  38. /* struct emu_voice.flags flags */
  39. #define VOICE_FLAGS_STEREO 0x02
  40. #define VOICE_FLAGS_16BIT 0x04
  41. struct voice_param
  42. {
  43. /* FX bus amount send */
  44. u32 send_routing;
  45. // audigy only:
  46. u32 send_routing2;
  47. u32 send_dcba;
  48. // audigy only:
  49. u32 send_hgfe;
  50. u32 initial_fc;
  51. u32 fc_target;
  52. u32 initial_attn;
  53. u32 volume_target;
  54. u32 byampl_env_sustain;
  55. u32 byampl_env_decay;
  56. };
  57. struct voice_mem {
  58. int emupageindex;
  59. void *addr[BUFMAXPAGES];
  60. dma_addr_t dma_handle[BUFMAXPAGES];
  61. u32 pages;
  62. };
  63. struct emu_voice
  64. {
  65. struct emu10k1_card *card;
  66. u8 usage; /* Free, MIDI, playback */
  67. u8 num; /* Voice ID */
  68. u8 flags; /* Stereo/mono, 8/16 bit */
  69. u32 startloop;
  70. u32 endloop;
  71. u32 start;
  72. u32 initial_pitch;
  73. u32 pitch_target;
  74. struct voice_param params[2];
  75. struct voice_mem mem;
  76. };
  77. int emu10k1_voice_alloc_buffer(struct emu10k1_card *, struct voice_mem *, u32);
  78. void emu10k1_voice_free_buffer(struct emu10k1_card *, struct voice_mem *);
  79. int emu10k1_voice_alloc(struct emu10k1_card *, struct emu_voice *);
  80. void emu10k1_voice_free(struct emu_voice *);
  81. void emu10k1_voice_playback_setup(struct emu_voice *);
  82. void emu10k1_voices_start(struct emu_voice *, unsigned int, int);
  83. void emu10k1_voices_stop(struct emu_voice *, int);
  84. #endif /* _VOICEMGR_H */