···3636 */3737#define SNDRV_EMUX_USE_RAW_EFFECT38383939-4040-/*4141- * typedefs4242- */4343-typedef struct snd_emux_effect_table snd_emux_effect_table_t;4444-typedef struct snd_emux_port snd_emux_port_t;4545-typedef struct snd_emux_voice snd_emux_voice_t;4646-typedef struct snd_emux snd_emux_t;4747-3939+struct snd_emux;4040+struct snd_emux_port;4141+struct snd_emux_voice;4242+struct snd_emux_effect_table;48434944/*5045 * operators5146 */5252-typedef struct snd_emux_operators {4747+struct snd_emux_operators {5348 struct module *owner;5454- snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port);5555- int (*prepare)(snd_emux_voice_t *vp);5656- void (*trigger)(snd_emux_voice_t *vp);5757- void (*release)(snd_emux_voice_t *vp);5858- void (*update)(snd_emux_voice_t *vp, int update);5959- void (*terminate)(snd_emux_voice_t *vp);6060- void (*free_voice)(snd_emux_voice_t *vp);6161- void (*reset)(snd_emux_t *emu, int ch);6262- /* the first parameters are snd_emux_t */6363- int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);6464- int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);6565- void (*sample_reset)(snd_emux_t *emu);6666- int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count);6767- void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset);4949+ struct snd_emux_voice *(*get_voice)(struct snd_emux *emu,5050+ struct snd_emux_port *port);5151+ int (*prepare)(struct snd_emux_voice *vp);5252+ void (*trigger)(struct snd_emux_voice *vp);5353+ void (*release)(struct snd_emux_voice *vp);5454+ void (*update)(struct snd_emux_voice *vp, int update);5555+ void (*terminate)(struct snd_emux_voice *vp);5656+ void (*free_voice)(struct snd_emux_voice *vp);5757+ void (*reset)(struct snd_emux *emu, int ch);5858+ /* the first parameters are struct snd_emux */5959+ int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp,6060+ struct snd_util_memhdr *hdr,6161+ const void __user *data, long count);6262+ int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp,6363+ struct snd_util_memhdr *hdr);6464+ void (*sample_reset)(struct snd_emux *emu);6565+ int (*load_fx)(struct snd_emux *emu, int type, int arg,6666+ const void __user *data, long count);6767+ void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,6868+ struct snd_midi_channel_set *chset);6869#ifdef CONFIG_SND_SEQUENCER_OSS6969- int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2);7070+ int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);7071#endif7171-} snd_emux_operators_t;7272+};727373747475/*···9190 */9291struct snd_emux {93929494- snd_card_t *card; /* assigned card */9393+ struct snd_card *card; /* assigned card */95949695 /* following should be initialized before registration */9796 int max_voices; /* Number of voices */9897 int mem_size; /* memory size (in byte) */9998 int num_ports; /* number of ports to be created */10099 int pitch_shift; /* pitch shift value (for Emu10k1) */101101- snd_emux_operators_t ops; /* operators */100100+ struct snd_emux_operators ops; /* operators */102101 void *hw; /* hardware */103102 unsigned long flags; /* other conditions */104103 int midi_ports; /* number of virtual midi devices */105104 int midi_devidx; /* device offset of virtual midi */106105 unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */107106 int hwdep_idx; /* hwdep device index */108108- snd_hwdep_t *hwdep; /* hwdep device */107107+ struct snd_hwdep *hwdep; /* hwdep device */109108110109 /* private */111110 int num_voices; /* current number of voices */112112- snd_sf_list_t *sflist; /* root of SoundFont list */113113- snd_emux_voice_t *voices; /* Voices (EMU 'channel') */111111+ struct snd_sf_list *sflist; /* root of SoundFont list */112112+ struct snd_emux_voice *voices; /* Voices (EMU 'channel') */114113 int use_time; /* allocation counter */115114 spinlock_t voice_lock; /* Lock for voice access */116115 struct semaphore register_mutex;117116 int client; /* For the sequencer client */118117 int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */119119- snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS];118118+ struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS];120119 int used; /* use counter */121120 char *name; /* name of the device (internal) */122122- snd_rawmidi_t **vmidi;121121+ struct snd_rawmidi **vmidi;123122 struct timer_list tlist; /* for pending note-offs */124123 int timer_active;125124126126- snd_util_memhdr_t *memhdr; /* memory chunk information */125125+ struct snd_util_memhdr *memhdr; /* memory chunk information */127126128127#ifdef CONFIG_PROC_FS129129- snd_info_entry_t *proc;128128+ struct snd_info_entry *proc;130129#endif131130132131#ifdef CONFIG_SND_SEQUENCER_OSS133133- snd_seq_device_t *oss_synth;132132+ struct snd_seq_device *oss_synth;134133#endif135134};136135···140139 */141140struct snd_emux_port {142141143143- snd_midi_channel_set_t chset;144144- snd_emux_t *emu;142142+ struct snd_midi_channel_set chset;143143+ struct snd_emux *emu;145144146145 char port_mode; /* operation mode */147146 int volume_atten; /* emuX raw attenuation */148147 unsigned long drum_flags; /* drum bitmaps */149148 int ctrls[EMUX_MD_END]; /* control parameters */150149#ifdef SNDRV_EMUX_USE_RAW_EFFECT151151- snd_emux_effect_table_t *effect;150150+ struct snd_emux_effect_table *effect;152151#endif153152#ifdef CONFIG_SND_SEQUENCER_OSS154154- snd_seq_oss_arg_t *oss_arg;153153+ struct snd_seq_oss_arg *oss_arg;155154#endif156155};157156···180179 unsigned char key;181180 unsigned char velocity; /* Velocity of current note */182181183183- snd_sf_zone_t *zone; /* Zone assigned to this note */182182+ struct snd_sf_zone *zone; /* Zone assigned to this note */184183 void *block; /* sample block pointer (optional) */185185- snd_midi_channel_t *chan; /* Midi channel for this note */186186- snd_emux_port_t *port; /* associated port */187187- snd_emux_t *emu; /* assigned root info */188188- void *hw; /* hardware pointer (emu8000_t or emu10k1_t) */184184+ struct snd_midi_channel *chan; /* Midi channel for this note */185185+ struct snd_emux_port *port; /* associated port */186186+ struct snd_emux *emu; /* assigned root info */187187+ void *hw; /* hardware pointer (emu8000 or emu10k1) */189188 unsigned long ontime; /* jiffies at note triggered */190189191190 /* Emu8k/Emu10k1 registers */192192- soundfont_voice_info_t reg;191191+ struct soundfont_voice_info reg;193192194193 /* additional registers */195194 int avol; /* volume attenuation */···230229/*231230 * prototypes - interface to Emu10k1 and Emu8k routines232231 */233233-int snd_emux_new(snd_emux_t **remu);234234-int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name);235235-int snd_emux_free(snd_emux_t *emu);232232+int snd_emux_new(struct snd_emux **remu);233233+int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name);234234+int snd_emux_free(struct snd_emux *emu);236235237236/*238237 * exported functions239238 */240240-void snd_emux_terminate_all(snd_emux_t *emu);241241-void snd_emux_lock_voice(snd_emux_t *emu, int voice);242242-void snd_emux_unlock_voice(snd_emux_t *emu, int voice);239239+void snd_emux_terminate_all(struct snd_emux *emu);240240+void snd_emux_lock_voice(struct snd_emux *emu, int voice);241241+void snd_emux_unlock_voice(struct snd_emux *emu, int voice);243242244243#endif /* __SOUND_EMUX_SYNTH_H */
+18-18
include/sound/sfnt_info.h
···3535#endif36363737/* patch interface header: 16 bytes */3838-typedef struct soundfont_patch_info_t {3838+struct soundfont_patch_info {3939 unsigned short key; /* use the key below */4040#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)4141···5959 short reserved; /* word alignment data */60606161 /* the actual patch data begins after this */6262-} soundfont_patch_info_t;6262+};636364646565/*···68686969#define SNDRV_SFNT_PATCH_NAME_LEN 3270707171-typedef struct soundfont_open_parm_t {7171+struct soundfont_open_parm {7272 unsigned short type; /* sample type */7373#define SNDRV_SFNT_PAT_TYPE_MISC 07474#define SNDRV_SFNT_PAT_TYPE_GUS 6···78787979 short reserved;8080 char name[SNDRV_SFNT_PATCH_NAME_LEN];8181-} soundfont_open_parm_t;8181+};828283838484/*···8686 */87878888/* wave table envelope & effect parameters to control EMU8000 */8989-typedef struct soundfont_voice_parm_t {8989+struct soundfont_voice_parm {9090 unsigned short moddelay; /* modulation delay (0x8000) */9191 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */9292 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */···108108 unsigned char chorus; /* chorus send (0x00) */109109 unsigned char reverb; /* reverb send (0x00) */110110 unsigned short reserved[4]; /* not used */111111-} soundfont_voice_parm_t;111111+};112112113113114114/* wave table parameters: 92 bytes */115115-typedef struct soundfont_voice_info_t {115115+struct soundfont_voice_info {116116 unsigned short sf_id; /* file id (should be zero) */117117 unsigned short sample; /* sample id */118118 int start, end; /* sample offset correction */···135135 unsigned char amplitude; /* sample volume (127 max) */136136 unsigned char attenuation; /* attenuation (0.375dB) */137137 short scaleTuning; /* pitch scale tuning(%), normally 100 */138138- soundfont_voice_parm_t parm; /* voice envelope parameters */138138+ struct soundfont_voice_parm parm; /* voice envelope parameters */139139 unsigned short sample_mode; /* sample mode_flag (set by driver) */140140-} soundfont_voice_info_t;140140+};141141142142143143/* instrument info header: 4 bytes */144144-typedef struct soundfont_voice_rec_hdr_t {144144+struct soundfont_voice_rec_hdr {145145 unsigned char bank; /* midi bank number */146146 unsigned char instr; /* midi preset number */147147 char nvoices; /* number of voices */···149149#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */150150#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */151151#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */152152-} soundfont_voice_rec_hdr_t;152152+};153153154154155155/*···157157 */158158159159/* wave table sample header: 32 bytes */160160-typedef struct soundfont_sample_info_t {160160+struct soundfont_sample_info {161161 unsigned short sf_id; /* file id (should be zero) */162162 unsigned short sample; /* sample id */163163 int start, end; /* start & end offset */···174174#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */175175#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */176176 unsigned int truesize; /* used memory size (set by driver) */177177-} soundfont_sample_info_t;177177+};178178179179180180/*181181 * voice preset mapping (aliasing)182182 */183183184184-typedef struct soundfont_voice_map_t {184184+struct soundfont_voice_map {185185 int map_bank, map_instr, map_key; /* key = -1 means all keys */186186 int src_bank, src_instr, src_key;187187-} soundfont_voice_map_t;187187+};188188189189190190/*···195195196196#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */197197198198-struct sndrv_emux_misc_mode {198198+struct snd_emux_misc_mode {199199 int port; /* -1 = all */200200 int mode;201201 int value;···204204205205enum {206206 SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),207207- SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t),207207+ SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info),208208 SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),209209 SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),210210 SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),211211- SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode),211211+ SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode),212212};213213214214#endif /* __SOUND_SFNT_INFO_H */
+37-38
include/sound/soundfont.h
···2929#define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */3030#define SF_IS_DRUM_BANK(z) ((z) == 128)31313232-typedef struct snd_sf_zone {3232+struct snd_sf_zone {3333 struct snd_sf_zone *next; /* Link to next */3434 unsigned char bank; /* Midi bank for this zone */3535 unsigned char instr; /* Midi program for this zone */3636 unsigned char mapped; /* True if mapped to something else */37373838- soundfont_voice_info_t v; /* All the soundfont parameters */3838+ struct soundfont_voice_info v; /* All the soundfont parameters */3939 int counter;4040 struct snd_sf_sample *sample; /* Link to sample */41414242 /* The following deals with preset numbers (programs) */4343 struct snd_sf_zone *next_instr; /* Next zone of this instrument */4444 struct snd_sf_zone *next_zone; /* Next zone in play list */4545-} snd_sf_zone_t;4545+};46464747-typedef struct snd_sf_sample {4848- soundfont_sample_info_t v;4747+struct snd_sf_sample {4848+ struct soundfont_sample_info v;4949 int counter;5050- snd_util_memblk_t *block; /* allocated data block */5050+ struct snd_util_memblk *block; /* allocated data block */5151 struct snd_sf_sample *next;5252-} snd_sf_sample_t;5252+};53535454/*5555 * This represents all the information relating to a soundfont.5656 */5757-typedef struct snd_soundfont {5757+struct snd_soundfont {5858 struct snd_soundfont *next; /* Link to next */5959 /*struct snd_soundfont *prev;*/ /* Link to previous */6060 short id; /* file id */6161 short type; /* font type */6262 unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */6363- snd_sf_zone_t *zones; /* Font information */6464- snd_sf_sample_t *samples; /* The sample headers */6565-} snd_soundfont_t;6363+ struct snd_sf_zone *zones; /* Font information */6464+ struct snd_sf_sample *samples; /* The sample headers */6565+};66666767/*6868 * Type of the sample access callback6969 */7070-typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp,7171- snd_util_memhdr_t *hdr, const void __user *buf, long count);7272-typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp,7373- snd_util_memhdr_t *hdr);7474-typedef void (*snd_sf_sample_reset_t)(void *private);7575-7676-typedef struct snd_sf_callback {7070+struct snd_sf_callback {7771 void *private_data;7878- snd_sf_sample_new_t sample_new;7979- snd_sf_sample_free_t sample_free;8080- snd_sf_sample_reset_t sample_reset;8181-} snd_sf_callback_t;7272+ int (*sample_new)(void *private_data, struct snd_sf_sample *sp,7373+ struct snd_util_memhdr *hdr,7474+ const void __user *buf, long count);7575+ int (*sample_free)(void *private_data, struct snd_sf_sample *sp,7676+ struct snd_util_memhdr *hdr);7777+ void (*sample_reset)(void *private);7878+};82798380/*8481 * List of soundfonts.8582 */8686-typedef struct snd_sf_list {8787- snd_soundfont_t *currsf; /* The currently open soundfont */8383+struct snd_sf_list {8484+ struct snd_soundfont *currsf; /* The currently open soundfont */8885 int open_client; /* client pointer for lock */8986 int mem_used; /* used memory size */9090- snd_sf_zone_t *presets[SF_MAX_PRESETS];9191- snd_soundfont_t *fonts; /* The list of soundfonts */8787+ struct snd_sf_zone *presets[SF_MAX_PRESETS];8888+ struct snd_soundfont *fonts; /* The list of soundfonts */9289 int fonts_size; /* number of fonts allocated */9390 int zone_counter; /* last allocated time for zone */9491 int sample_counter; /* last allocated time for sample */9592 int zone_locked; /* locked time for zone */9693 int sample_locked; /* locked time for sample */9797- snd_sf_callback_t callback; /* callback functions */9494+ struct snd_sf_callback callback; /* callback functions */9895 int presets_locked;9996 struct semaphore presets_mutex;10097 spinlock_t lock;101101- snd_util_memhdr_t *memhdr;102102-} snd_sf_list_t;9898+ struct snd_util_memhdr *memhdr;9999+};103100104101/* Prototypes for soundfont.c */105105-int snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client);106106-int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,102102+int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,103103+ long count, int client);104104+int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,107105 long count, int client);108108-int snd_soundfont_close_check(snd_sf_list_t *sflist, int client);106106+int snd_soundfont_close_check(struct snd_sf_list *sflist, int client);109107110110-snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr);111111-void snd_sf_free(snd_sf_list_t *sflist);108108+struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback,109109+ struct snd_util_memhdr *hdr);110110+void snd_sf_free(struct snd_sf_list *sflist);112111113113-int snd_soundfont_remove_samples(snd_sf_list_t *sflist);114114-int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist);112112+int snd_soundfont_remove_samples(struct snd_sf_list *sflist);113113+int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist);115114116116-int snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,115115+int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,117116 int preset, int bank,118117 int def_preset, int def_bank,119119- snd_sf_zone_t **table, int max_layers);118118+ struct snd_sf_zone **table, int max_layers);120119121120/* Parameter conversions */122121int snd_sf_calc_parm_hold(int msec);
+15-17
include/sound/util_mem.h
···2020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2121 */22222323-typedef struct snd_util_memblk snd_util_memblk_t;2424-typedef struct snd_util_memhdr snd_util_memhdr_t;2525-typedef unsigned int snd_util_unit_t;2626-2723/*2824 * memory block2925 */3026struct snd_util_memblk {3131- snd_util_unit_t size; /* size of this block */3232- snd_util_unit_t offset; /* zero-offset of this block */2727+ unsigned int size; /* size of this block */2828+ unsigned int offset; /* zero-offset of this block */3329 struct list_head list; /* link */3430};35313636-#define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(snd_util_memblk_t))3232+#define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(struct snd_util_memblk))37333834/*3935 * memory management information4036 */4137struct snd_util_memhdr {4242- snd_util_unit_t size; /* size of whole data */3838+ unsigned int size; /* size of whole data */4339 struct list_head block; /* block linked-list header */4440 int nblocks; /* # of allocated blocks */4545- snd_util_unit_t used; /* used memory size */4141+ unsigned int used; /* used memory size */4642 int block_extra_size; /* extra data size of chunk */4743 struct semaphore block_mutex; /* lock */4844};···4650/*4751 * prototypes4852 */4949-snd_util_memhdr_t *snd_util_memhdr_new(int memsize);5050-void snd_util_memhdr_free(snd_util_memhdr_t *hdr);5151-snd_util_memblk_t *snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size);5252-int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk);5353-int snd_util_mem_avail(snd_util_memhdr_t *hdr);5353+struct snd_util_memhdr *snd_util_memhdr_new(int memsize);5454+void snd_util_memhdr_free(struct snd_util_memhdr *hdr);5555+struct snd_util_memblk *snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);5656+int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);5757+int snd_util_mem_avail(struct snd_util_memhdr *hdr);54585559/* functions without mutex */5656-snd_util_memblk_t *__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size);5757-void __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk);5858-snd_util_memblk_t *__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, struct list_head *prev);6060+struct snd_util_memblk *__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);6161+void __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);6262+struct snd_util_memblk *__snd_util_memblk_new(struct snd_util_memhdr *hdr,6363+ unsigned int units,6464+ struct list_head *prev);59656066#endif /* __SOUND_UTIL_MEM_H */