seq_oss.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef __SOUND_SEQ_OSS_H
  3. #define __SOUND_SEQ_OSS_H
  4. /*
  5. * OSS compatible sequencer driver
  6. *
  7. * Copyright (C) 1998,99 Takashi Iwai
  8. */
  9. #include <sound/asequencer.h>
  10. #include <sound/seq_kernel.h>
  11. /*
  12. * argument structure for synthesizer operations
  13. */
  14. struct snd_seq_oss_arg {
  15. /* given by OSS sequencer */
  16. int app_index; /* application unique index */
  17. int file_mode; /* file mode - see below */
  18. int seq_mode; /* sequencer mode - see below */
  19. /* following must be initialized in open callback */
  20. struct snd_seq_addr addr; /* opened port address */
  21. void *private_data; /* private data for lowlevel drivers */
  22. /* note-on event passing mode: initially given by OSS seq,
  23. * but configurable by drivers - see below
  24. */
  25. int event_passing;
  26. };
  27. /*
  28. * synthesizer operation callbacks
  29. */
  30. struct snd_seq_oss_callback {
  31. struct module *owner;
  32. int (*open)(struct snd_seq_oss_arg *p, void *closure);
  33. int (*close)(struct snd_seq_oss_arg *p);
  34. int (*ioctl)(struct snd_seq_oss_arg *p, unsigned int cmd, unsigned long arg);
  35. int (*load_patch)(struct snd_seq_oss_arg *p, int format, const char __user *buf, int offs, int count);
  36. int (*reset)(struct snd_seq_oss_arg *p);
  37. int (*raw_event)(struct snd_seq_oss_arg *p, unsigned char *data);
  38. };
  39. /* flag: file_mode */
  40. #define SNDRV_SEQ_OSS_FILE_ACMODE 3
  41. #define SNDRV_SEQ_OSS_FILE_READ 1
  42. #define SNDRV_SEQ_OSS_FILE_WRITE 2
  43. #define SNDRV_SEQ_OSS_FILE_NONBLOCK 4
  44. /* flag: seq_mode */
  45. #define SNDRV_SEQ_OSS_MODE_SYNTH 0
  46. #define SNDRV_SEQ_OSS_MODE_MUSIC 1
  47. /* flag: event_passing */
  48. #define SNDRV_SEQ_OSS_PROCESS_EVENTS 0 /* key == 255 is processed as velocity change */
  49. #define SNDRV_SEQ_OSS_PASS_EVENTS 1 /* pass all events to callback */
  50. #define SNDRV_SEQ_OSS_PROCESS_KEYPRESS 2 /* key >= 128 will be processed as key-pressure */
  51. /* default control rate: fixed */
  52. #define SNDRV_SEQ_OSS_CTRLRATE 100
  53. /* default max queue length: configurable by module option */
  54. #define SNDRV_SEQ_OSS_MAX_QLEN 1024
  55. /*
  56. * data pointer to snd_seq_register_device
  57. */
  58. struct snd_seq_oss_reg {
  59. int type;
  60. int subtype;
  61. int nvoices;
  62. struct snd_seq_oss_callback oper;
  63. void *private_data;
  64. };
  65. /* device id */
  66. #define SNDRV_SEQ_DEV_ID_OSS "seq-oss"
  67. #endif /* __SOUND_SEQ_OSS_H */