Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef __SOUND_SEQ_OSS_H
0003 #define __SOUND_SEQ_OSS_H
0004 
0005 /*
0006  * OSS compatible sequencer driver
0007  *
0008  * Copyright (C) 1998,99 Takashi Iwai
0009  */
0010 
0011 #include <sound/asequencer.h>
0012 #include <sound/seq_kernel.h>
0013 
0014 /*
0015  * argument structure for synthesizer operations
0016  */
0017 struct snd_seq_oss_arg {
0018     /* given by OSS sequencer */
0019     int app_index;  /* application unique index */
0020     int file_mode;  /* file mode - see below */
0021     int seq_mode;   /* sequencer mode - see below */
0022 
0023     /* following must be initialized in open callback */
0024     struct snd_seq_addr addr;   /* opened port address */
0025     void *private_data; /* private data for lowlevel drivers */
0026 
0027     /* note-on event passing mode: initially given by OSS seq,
0028      * but configurable by drivers - see below
0029      */
0030     int event_passing;
0031 };
0032 
0033 
0034 /*
0035  * synthesizer operation callbacks
0036  */
0037 struct snd_seq_oss_callback {
0038     struct module *owner;
0039     int (*open)(struct snd_seq_oss_arg *p, void *closure);
0040     int (*close)(struct snd_seq_oss_arg *p);
0041     int (*ioctl)(struct snd_seq_oss_arg *p, unsigned int cmd, unsigned long arg);
0042     int (*load_patch)(struct snd_seq_oss_arg *p, int format, const char __user *buf, int offs, int count);
0043     int (*reset)(struct snd_seq_oss_arg *p);
0044     int (*raw_event)(struct snd_seq_oss_arg *p, unsigned char *data);
0045 };
0046 
0047 /* flag: file_mode */
0048 #define SNDRV_SEQ_OSS_FILE_ACMODE       3
0049 #define SNDRV_SEQ_OSS_FILE_READ     1
0050 #define SNDRV_SEQ_OSS_FILE_WRITE        2
0051 #define SNDRV_SEQ_OSS_FILE_NONBLOCK 4
0052 
0053 /* flag: seq_mode */
0054 #define SNDRV_SEQ_OSS_MODE_SYNTH        0
0055 #define SNDRV_SEQ_OSS_MODE_MUSIC        1
0056 
0057 /* flag: event_passing */
0058 #define SNDRV_SEQ_OSS_PROCESS_EVENTS    0   /* key == 255 is processed as velocity change */
0059 #define SNDRV_SEQ_OSS_PASS_EVENTS       1   /* pass all events to callback */
0060 #define SNDRV_SEQ_OSS_PROCESS_KEYPRESS  2   /* key >= 128 will be processed as key-pressure */
0061 
0062 /* default control rate: fixed */
0063 #define SNDRV_SEQ_OSS_CTRLRATE      100
0064 
0065 /* default max queue length: configurable by module option */
0066 #define SNDRV_SEQ_OSS_MAX_QLEN      1024
0067 
0068 
0069 /*
0070  * data pointer to snd_seq_register_device
0071  */
0072 struct snd_seq_oss_reg {
0073     int type;
0074     int subtype;
0075     int nvoices;
0076     struct snd_seq_oss_callback oper;
0077     void *private_data;
0078 };
0079 
0080 /* device id */
0081 #define SNDRV_SEQ_DEV_ID_OSS        "seq-oss"
0082 
0083 #endif /* __SOUND_SEQ_OSS_H */