11da177e4SLinus Torvalds #ifndef __EMUX_VOICE_H 21da177e4SLinus Torvalds #define __EMUX_VOICE_H 31da177e4SLinus Torvalds 41da177e4SLinus Torvalds /* 51da177e4SLinus Torvalds * A structure to keep track of each hardware voice 61da177e4SLinus Torvalds * 71da177e4SLinus Torvalds * Copyright (C) 1999 Steve Ratcliffe 81da177e4SLinus Torvalds * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 91da177e4SLinus Torvalds * 101da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify 111da177e4SLinus Torvalds * it under the terms of the GNU General Public License as published by 121da177e4SLinus Torvalds * the Free Software Foundation; either version 2 of the License, or 131da177e4SLinus Torvalds * (at your option) any later version. 141da177e4SLinus Torvalds * 151da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, 161da177e4SLinus Torvalds * but WITHOUT ANY WARRANTY; without even the implied warranty of 171da177e4SLinus Torvalds * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 181da177e4SLinus Torvalds * GNU General Public License for more details. 191da177e4SLinus Torvalds * 201da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License 211da177e4SLinus Torvalds * along with this program; if not, write to the Free Software 221da177e4SLinus Torvalds * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #include <sound/driver.h> 261da177e4SLinus Torvalds #include <linux/wait.h> 271da177e4SLinus Torvalds #include <linux/sched.h> 281da177e4SLinus Torvalds #include <sound/core.h> 291da177e4SLinus Torvalds #include <sound/emux_synth.h> 301da177e4SLinus Torvalds 311da177e4SLinus Torvalds /* Prototypes for emux_seq.c */ 32*03da312aSTakashi Iwai int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index); 33*03da312aSTakashi Iwai void snd_emux_detach_seq(struct snd_emux *emu); 34*03da312aSTakashi Iwai struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name, 35*03da312aSTakashi Iwai int max_channels, int type, 36*03da312aSTakashi Iwai struct snd_seq_port_callback *callback); 37*03da312aSTakashi Iwai void snd_emux_reset_port(struct snd_emux_port *port); 38*03da312aSTakashi Iwai int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private, 39*03da312aSTakashi Iwai int atomic, int hop); 40*03da312aSTakashi Iwai int snd_emux_inc_count(struct snd_emux *emu); 41*03da312aSTakashi Iwai void snd_emux_dec_count(struct snd_emux *emu); 42*03da312aSTakashi Iwai int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card); 43*03da312aSTakashi Iwai int snd_emux_delete_virmidi(struct snd_emux *emu); 441da177e4SLinus Torvalds 451da177e4SLinus Torvalds /* Prototypes for emux_synth.c */ 46*03da312aSTakashi Iwai void snd_emux_init_voices(struct snd_emux *emu); 471da177e4SLinus Torvalds 481da177e4SLinus Torvalds void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); 491da177e4SLinus Torvalds void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); 501da177e4SLinus Torvalds void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); 51*03da312aSTakashi Iwai void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan); 521da177e4SLinus Torvalds void snd_emux_control(void *p, int type, struct snd_midi_channel *chan); 531da177e4SLinus Torvalds 54*03da312aSTakashi Iwai void snd_emux_sounds_off_all(struct snd_emux_port *port); 55*03da312aSTakashi Iwai void snd_emux_update_channel(struct snd_emux_port *port, 56*03da312aSTakashi Iwai struct snd_midi_channel *chan, int update); 57*03da312aSTakashi Iwai void snd_emux_update_port(struct snd_emux_port *port, int update); 581da177e4SLinus Torvalds 591da177e4SLinus Torvalds void snd_emux_timer_callback(unsigned long data); 601da177e4SLinus Torvalds 611da177e4SLinus Torvalds /* emux_effect.c */ 621da177e4SLinus Torvalds #ifdef SNDRV_EMUX_USE_RAW_EFFECT 63*03da312aSTakashi Iwai void snd_emux_create_effect(struct snd_emux_port *p); 64*03da312aSTakashi Iwai void snd_emux_delete_effect(struct snd_emux_port *p); 65*03da312aSTakashi Iwai void snd_emux_clear_effect(struct snd_emux_port *p); 66*03da312aSTakashi Iwai void snd_emux_setup_effect(struct snd_emux_voice *vp); 67*03da312aSTakashi Iwai void snd_emux_send_effect_oss(struct snd_emux_port *port, 68*03da312aSTakashi Iwai struct snd_midi_channel *chan, int type, int val); 69*03da312aSTakashi Iwai void snd_emux_send_effect(struct snd_emux_port *port, 70*03da312aSTakashi Iwai struct snd_midi_channel *chan, int type, int val, int mode); 711da177e4SLinus Torvalds #endif 721da177e4SLinus Torvalds 731da177e4SLinus Torvalds /* emux_nrpn.c */ 74*03da312aSTakashi Iwai void snd_emux_sysex(void *private_data, unsigned char *buf, int len, 75*03da312aSTakashi Iwai int parsed, struct snd_midi_channel_set *chset); 76*03da312aSTakashi Iwai int snd_emux_xg_control(struct snd_emux_port *port, 77*03da312aSTakashi Iwai struct snd_midi_channel *chan, int param); 78*03da312aSTakashi Iwai void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan, 79*03da312aSTakashi Iwai struct snd_midi_channel_set *chset); 801da177e4SLinus Torvalds 811da177e4SLinus Torvalds /* emux_oss.c */ 82*03da312aSTakashi Iwai void snd_emux_init_seq_oss(struct snd_emux *emu); 83*03da312aSTakashi Iwai void snd_emux_detach_seq_oss(struct snd_emux *emu); 841da177e4SLinus Torvalds 851da177e4SLinus Torvalds /* emux_proc.c */ 861da177e4SLinus Torvalds #ifdef CONFIG_PROC_FS 87*03da312aSTakashi Iwai void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device); 88*03da312aSTakashi Iwai void snd_emux_proc_free(struct snd_emux *emu); 891da177e4SLinus Torvalds #endif 901da177e4SLinus Torvalds 911da177e4SLinus Torvalds #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) 921da177e4SLinus Torvalds 931da177e4SLinus Torvalds /* emux_hwdep.c */ 94*03da312aSTakashi Iwai int snd_emux_init_hwdep(struct snd_emux *emu); 95*03da312aSTakashi Iwai void snd_emux_delete_hwdep(struct snd_emux *emu); 961da177e4SLinus Torvalds 971da177e4SLinus Torvalds #endif 98