emux_voice.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef __EMUX_VOICE_H
  2. #define __EMUX_VOICE_H
  3. /*
  4. * A structure to keep track of each hardware voice
  5. *
  6. * Copyright (C) 1999 Steve Ratcliffe
  7. * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. #include <linux/wait.h>
  24. #include <linux/sched.h>
  25. #include <sound/core.h>
  26. #include <sound/emux_synth.h>
  27. /* Prototypes for emux_seq.c */
  28. int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index);
  29. void snd_emux_detach_seq(struct snd_emux *emu);
  30. struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name,
  31. int max_channels, int type,
  32. struct snd_seq_port_callback *callback);
  33. void snd_emux_reset_port(struct snd_emux_port *port);
  34. int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private,
  35. int atomic, int hop);
  36. int snd_emux_inc_count(struct snd_emux *emu);
  37. void snd_emux_dec_count(struct snd_emux *emu);
  38. int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card);
  39. int snd_emux_delete_virmidi(struct snd_emux *emu);
  40. /* Prototypes for emux_synth.c */
  41. void snd_emux_init_voices(struct snd_emux *emu);
  42. void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
  43. void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
  44. void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan);
  45. void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan);
  46. void snd_emux_control(void *p, int type, struct snd_midi_channel *chan);
  47. void snd_emux_sounds_off_all(struct snd_emux_port *port);
  48. void snd_emux_update_channel(struct snd_emux_port *port,
  49. struct snd_midi_channel *chan, int update);
  50. void snd_emux_update_port(struct snd_emux_port *port, int update);
  51. void snd_emux_timer_callback(unsigned long data);
  52. /* emux_effect.c */
  53. #ifdef SNDRV_EMUX_USE_RAW_EFFECT
  54. void snd_emux_create_effect(struct snd_emux_port *p);
  55. void snd_emux_delete_effect(struct snd_emux_port *p);
  56. void snd_emux_clear_effect(struct snd_emux_port *p);
  57. void snd_emux_setup_effect(struct snd_emux_voice *vp);
  58. void snd_emux_send_effect_oss(struct snd_emux_port *port,
  59. struct snd_midi_channel *chan, int type, int val);
  60. void snd_emux_send_effect(struct snd_emux_port *port,
  61. struct snd_midi_channel *chan, int type, int val, int mode);
  62. #endif
  63. /* emux_nrpn.c */
  64. void snd_emux_sysex(void *private_data, unsigned char *buf, int len,
  65. int parsed, struct snd_midi_channel_set *chset);
  66. int snd_emux_xg_control(struct snd_emux_port *port,
  67. struct snd_midi_channel *chan, int param);
  68. void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan,
  69. struct snd_midi_channel_set *chset);
  70. /* emux_oss.c */
  71. void snd_emux_init_seq_oss(struct snd_emux *emu);
  72. void snd_emux_detach_seq_oss(struct snd_emux *emu);
  73. /* emux_proc.c */
  74. #ifdef CONFIG_SND_PROC_FS
  75. void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device);
  76. void snd_emux_proc_free(struct snd_emux *emu);
  77. #else
  78. static inline void snd_emux_proc_init(struct snd_emux *emu,
  79. struct snd_card *card, int device) {}
  80. static inline void snd_emux_proc_free(struct snd_emux *emu) {}
  81. #endif
  82. #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON)
  83. /* emux_hwdep.c */
  84. int snd_emux_init_hwdep(struct snd_emux *emu);
  85. void snd_emux_delete_hwdep(struct snd_emux *emu);
  86. #endif