Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 1 | #ifndef __SOUND_SEQ_OSS_H |
| 2 | #define __SOUND_SEQ_OSS_H |
| 3 | |
| 4 | /* |
| 5 | * OSS compatible sequencer driver |
| 6 | * |
| 7 | * Copyright (C) 1998,99 Takashi Iwai |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #include "asequencer.h" |
| 25 | #include "seq_kernel.h" |
| 26 | |
| 27 | /* |
| 28 | * type definitions |
| 29 | */ |
| 30 | typedef struct snd_seq_oss_arg_t snd_seq_oss_arg_t; |
| 31 | typedef struct snd_seq_oss_callback_t snd_seq_oss_callback_t; |
| 32 | |
| 33 | /* |
| 34 | * argument structure for synthesizer operations |
| 35 | */ |
| 36 | struct snd_seq_oss_arg_t { |
| 37 | /* given by OSS sequencer */ |
| 38 | int app_index; /* application unique index */ |
| 39 | int file_mode; /* file mode - see below */ |
| 40 | int seq_mode; /* sequencer mode - see below */ |
| 41 | |
| 42 | /* following must be initialized in open callback */ |
| 43 | snd_seq_addr_t addr; /* opened port address */ |
| 44 | void *private_data; /* private data for lowlevel drivers */ |
| 45 | |
| 46 | /* note-on event passing mode: initially given by OSS seq, |
| 47 | * but configurable by drivers - see below |
| 48 | */ |
| 49 | int event_passing; |
| 50 | }; |
| 51 | |
| 52 | |
| 53 | /* |
| 54 | * synthesizer operation callbacks |
| 55 | */ |
| 56 | struct snd_seq_oss_callback_t { |
| 57 | struct module *owner; |
| 58 | int (*open)(snd_seq_oss_arg_t *p, void *closure); |
| 59 | int (*close)(snd_seq_oss_arg_t *p); |
| 60 | int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg); |
| 61 | int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char __user *buf, int offs, int count); |
| 62 | int (*reset)(snd_seq_oss_arg_t *p); |
| 63 | int (*raw_event)(snd_seq_oss_arg_t *p, unsigned char *data); |
| 64 | }; |
| 65 | |
| 66 | /* flag: file_mode */ |
| 67 | #define SNDRV_SEQ_OSS_FILE_ACMODE 3 |
| 68 | #define SNDRV_SEQ_OSS_FILE_READ 1 |
| 69 | #define SNDRV_SEQ_OSS_FILE_WRITE 2 |
| 70 | #define SNDRV_SEQ_OSS_FILE_NONBLOCK 4 |
| 71 | |
| 72 | /* flag: seq_mode */ |
| 73 | #define SNDRV_SEQ_OSS_MODE_SYNTH 0 |
| 74 | #define SNDRV_SEQ_OSS_MODE_MUSIC 1 |
| 75 | |
| 76 | /* flag: event_passing */ |
| 77 | #define SNDRV_SEQ_OSS_PROCESS_EVENTS 0 /* key == 255 is processed as velocity change */ |
| 78 | #define SNDRV_SEQ_OSS_PASS_EVENTS 1 /* pass all events to callback */ |
| 79 | #define SNDRV_SEQ_OSS_PROCESS_KEYPRESS 2 /* key >= 128 will be processed as key-pressure */ |
| 80 | |
| 81 | /* default control rate: fixed */ |
| 82 | #define SNDRV_SEQ_OSS_CTRLRATE 100 |
| 83 | |
| 84 | /* default max queue length: configurable by module option */ |
| 85 | #define SNDRV_SEQ_OSS_MAX_QLEN 1024 |
| 86 | |
| 87 | |
| 88 | /* |
| 89 | * data pointer to snd_seq_register_device |
| 90 | */ |
| 91 | typedef struct snd_seq_oss_reg { |
| 92 | int type; |
| 93 | int subtype; |
| 94 | int nvoices; |
| 95 | snd_seq_oss_callback_t oper; |
| 96 | void *private_data; |
| 97 | } snd_seq_oss_reg_t; |
| 98 | |
| 99 | /* device id */ |
| 100 | #define SNDRV_SEQ_DEV_ID_OSS "seq-oss" |
| 101 | |
| 102 | #endif /* __SOUND_SEQ_OSS_H */ |