seq_oss.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef __SOUND_SEQ_OSS_H
  2. #define __SOUND_SEQ_OSS_H
  3. /*
  4. * OSS compatible sequencer driver
  5. *
  6. * Copyright (C) 1998,99 Takashi Iwai
  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. #include "asequencer.h"
  23. #include "seq_kernel.h"
  24. /*
  25. * type definitions
  26. */
  27. typedef struct snd_seq_oss_arg_t snd_seq_oss_arg_t;
  28. typedef struct snd_seq_oss_callback_t snd_seq_oss_callback_t;
  29. /*
  30. * argument structure for synthesizer operations
  31. */
  32. struct snd_seq_oss_arg_t {
  33. /* given by OSS sequencer */
  34. int app_index; /* application unique index */
  35. int file_mode; /* file mode - see below */
  36. int seq_mode; /* sequencer mode - see below */
  37. /* following must be initialized in open callback */
  38. snd_seq_addr_t addr; /* opened port address */
  39. void *private_data; /* private data for lowlevel drivers */
  40. /* note-on event passing mode: initially given by OSS seq,
  41. * but configurable by drivers - see below
  42. */
  43. int event_passing;
  44. };
  45. /*
  46. * synthesizer operation callbacks
  47. */
  48. struct snd_seq_oss_callback_t {
  49. struct module *owner;
  50. int (*open)(snd_seq_oss_arg_t *p, void *closure);
  51. int (*close)(snd_seq_oss_arg_t *p);
  52. int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg);
  53. int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char __user *buf, int offs, int count);
  54. int (*reset)(snd_seq_oss_arg_t *p);
  55. int (*raw_event)(snd_seq_oss_arg_t *p, unsigned char *data);
  56. };
  57. /* flag: file_mode */
  58. #define SNDRV_SEQ_OSS_FILE_ACMODE 3
  59. #define SNDRV_SEQ_OSS_FILE_READ 1
  60. #define SNDRV_SEQ_OSS_FILE_WRITE 2
  61. #define SNDRV_SEQ_OSS_FILE_NONBLOCK 4
  62. /* flag: seq_mode */
  63. #define SNDRV_SEQ_OSS_MODE_SYNTH 0
  64. #define SNDRV_SEQ_OSS_MODE_MUSIC 1
  65. /* flag: event_passing */
  66. #define SNDRV_SEQ_OSS_PROCESS_EVENTS 0 /* key == 255 is processed as velocity change */
  67. #define SNDRV_SEQ_OSS_PASS_EVENTS 1 /* pass all events to callback */
  68. #define SNDRV_SEQ_OSS_PROCESS_KEYPRESS 2 /* key >= 128 will be processed as key-pressure */
  69. /* default control rate: fixed */
  70. #define SNDRV_SEQ_OSS_CTRLRATE 100
  71. /* default max queue length: configurable by module option */
  72. #define SNDRV_SEQ_OSS_MAX_QLEN 1024
  73. /*
  74. * data pointer to snd_seq_register_device
  75. */
  76. typedef struct snd_seq_oss_reg {
  77. int type;
  78. int subtype;
  79. int nvoices;
  80. snd_seq_oss_callback_t oper;
  81. void *private_data;
  82. } snd_seq_oss_reg_t;
  83. /* device id */
  84. #define SNDRV_SEQ_DEV_ID_OSS "seq-oss"
  85. #endif /* __SOUND_SEQ_OSS_H */