seq_kernel.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef __SOUND_SEQ_KERNEL_H
  2. #define __SOUND_SEQ_KERNEL_H
  3. /*
  4. * Main kernel header file for the ALSA sequencer
  5. * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #include <linux/time.h>
  24. #include <sound/asequencer.h>
  25. typedef struct snd_seq_real_time snd_seq_real_time_t;
  26. typedef union snd_seq_timestamp snd_seq_timestamp_t;
  27. /* maximum number of queues */
  28. #define SNDRV_SEQ_MAX_QUEUES 32
  29. /* max number of concurrent clients */
  30. #define SNDRV_SEQ_MAX_CLIENTS 192
  31. /* max number of concurrent ports */
  32. #define SNDRV_SEQ_MAX_PORTS 254
  33. /* max number of events in memory pool */
  34. #define SNDRV_SEQ_MAX_EVENTS 2000
  35. /* default number of events in memory pool */
  36. #define SNDRV_SEQ_DEFAULT_EVENTS 500
  37. /* max number of events in memory pool for one client (outqueue) */
  38. #define SNDRV_SEQ_MAX_CLIENT_EVENTS 2000
  39. /* default number of events in memory pool for one client (outqueue) */
  40. #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
  41. /* max delivery path length */
  42. /* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
  43. #define SNDRV_SEQ_MAX_HOPS 8
  44. /* max size of event size */
  45. #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
  46. /* call-backs for kernel port */
  47. struct snd_seq_port_callback {
  48. struct module *owner;
  49. void *private_data;
  50. int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info);
  51. int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info);
  52. int (*use)(void *private_data, struct snd_seq_port_subscribe *info);
  53. int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info);
  54. int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
  55. void (*private_free)(void *private_data);
  56. /*...*/
  57. };
  58. /* interface for kernel client */
  59. __printf(3, 4)
  60. int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
  61. const char *name_fmt, ...);
  62. int snd_seq_delete_kernel_client(int client);
  63. int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
  64. int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
  65. int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
  66. #define SNDRV_SEQ_EXT_MASK 0xc0000000
  67. #define SNDRV_SEQ_EXT_USRPTR 0x80000000
  68. #define SNDRV_SEQ_EXT_CHAINED 0x40000000
  69. typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
  70. int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
  71. int in_kernel, int size_aligned);
  72. int snd_seq_dump_var_event(const struct snd_seq_event *event,
  73. snd_seq_dump_func_t func, void *private_data);
  74. /* interface for OSS emulation */
  75. int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
  76. /* port callback routines */
  77. void snd_port_init_callback(struct snd_seq_port_callback *p);
  78. struct snd_seq_port_callback *snd_port_alloc_callback(void);
  79. /* port attach/detach */
  80. int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
  81. int cap, int type, int midi_channels, int midi_voices, char *portname);
  82. int snd_seq_event_port_detach(int client, int port);
  83. #ifdef CONFIG_MODULES
  84. void snd_seq_autoload_init(void);
  85. void snd_seq_autoload_exit(void);
  86. #else
  87. #define snd_seq_autoload_init()
  88. #define snd_seq_autoload_exit()
  89. #endif
  90. #endif /* __SOUND_SEQ_KERNEL_H */