seq_kernel.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 "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 events dequeued per schedule interval */
  28. #define SNDRV_SEQ_MAX_DEQUEUE 50
  29. /* maximum number of queues */
  30. #define SNDRV_SEQ_MAX_QUEUES 8
  31. /* max number of concurrent clients */
  32. #define SNDRV_SEQ_MAX_CLIENTS 192
  33. /* max number of concurrent ports */
  34. #define SNDRV_SEQ_MAX_PORTS 254
  35. /* max number of events in memory pool */
  36. #define SNDRV_SEQ_MAX_EVENTS 2000
  37. /* default number of events in memory chunk */
  38. #define SNDRV_SEQ_DEFAULT_CHUNK_EVENTS 64
  39. /* default number of events in memory pool */
  40. #define SNDRV_SEQ_DEFAULT_EVENTS 500
  41. /* max number of events in memory pool for one client (outqueue) */
  42. #define SNDRV_SEQ_MAX_CLIENT_EVENTS 2000
  43. /* default number of events in memory pool for one client (outqueue) */
  44. #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
  45. /* max delivery path length */
  46. #define SNDRV_SEQ_MAX_HOPS 10
  47. /* max size of event size */
  48. #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
  49. /* call-backs for kernel port */
  50. struct snd_seq_port_callback {
  51. struct module *owner;
  52. void *private_data;
  53. int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info);
  54. int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info);
  55. int (*use)(void *private_data, struct snd_seq_port_subscribe *info);
  56. int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info);
  57. int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
  58. void (*private_free)(void *private_data);
  59. unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */
  60. /*...*/
  61. };
  62. /* interface for kernel client */
  63. int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
  64. const char *name_fmt, ...)
  65. __attribute__ ((format (printf, 3, 4)));
  66. int snd_seq_delete_kernel_client(int client);
  67. int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
  68. int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
  69. int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
  70. #define SNDRV_SEQ_EXT_MASK 0xc0000000
  71. #define SNDRV_SEQ_EXT_USRPTR 0x80000000
  72. #define SNDRV_SEQ_EXT_CHAINED 0x40000000
  73. typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
  74. int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
  75. int in_kernel, int size_aligned);
  76. int snd_seq_dump_var_event(const struct snd_seq_event *event,
  77. snd_seq_dump_func_t func, void *private_data);
  78. /* interface for OSS emulation */
  79. int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
  80. /* port callback routines */
  81. void snd_port_init_callback(struct snd_seq_port_callback *p);
  82. struct snd_seq_port_callback *snd_port_alloc_callback(void);
  83. /* port attach/detach */
  84. int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
  85. int cap, int type, int midi_channels, int midi_voices, char *portname);
  86. int snd_seq_event_port_detach(int client, int port);
  87. #ifdef CONFIG_KMOD
  88. void snd_seq_autoload_lock(void);
  89. void snd_seq_autoload_unlock(void);
  90. #else
  91. #define snd_seq_autoload_lock()
  92. #define snd_seq_autoload_unlock()
  93. #endif
  94. #endif /* __SOUND_SEQ_KERNEL_H */