seq_oss.h 2.9 KB

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