1*1da177e4SLinus Torvalds #ifndef __EMUX_VOICE_H 2*1da177e4SLinus Torvalds #define __EMUX_VOICE_H 3*1da177e4SLinus Torvalds 4*1da177e4SLinus Torvalds /* 5*1da177e4SLinus Torvalds * A structure to keep track of each hardware voice 6*1da177e4SLinus Torvalds * 7*1da177e4SLinus Torvalds * Copyright (C) 1999 Steve Ratcliffe 8*1da177e4SLinus Torvalds * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 9*1da177e4SLinus Torvalds * 10*1da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify 11*1da177e4SLinus Torvalds * it under the terms of the GNU General Public License as published by 12*1da177e4SLinus Torvalds * the Free Software Foundation; either version 2 of the License, or 13*1da177e4SLinus Torvalds * (at your option) any later version. 14*1da177e4SLinus Torvalds * 15*1da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, 16*1da177e4SLinus Torvalds * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*1da177e4SLinus Torvalds * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*1da177e4SLinus Torvalds * GNU General Public License for more details. 19*1da177e4SLinus Torvalds * 20*1da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License 21*1da177e4SLinus Torvalds * along with this program; if not, write to the Free Software 22*1da177e4SLinus Torvalds * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23*1da177e4SLinus Torvalds */ 24*1da177e4SLinus Torvalds 25*1da177e4SLinus Torvalds #include <sound/driver.h> 26*1da177e4SLinus Torvalds #include <linux/wait.h> 27*1da177e4SLinus Torvalds #include <linux/sched.h> 28*1da177e4SLinus Torvalds #include <sound/core.h> 29*1da177e4SLinus Torvalds #include <sound/emux_synth.h> 30*1da177e4SLinus Torvalds 31*1da177e4SLinus Torvalds /* Prototypes for emux_seq.c */ 32*1da177e4SLinus Torvalds int snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index); 33*1da177e4SLinus Torvalds void snd_emux_detach_seq(snd_emux_t *emu); 34*1da177e4SLinus Torvalds snd_emux_port_t *snd_emux_create_port(snd_emux_t *emu, char *name, int max_channels, int type, snd_seq_port_callback_t *callback); 35*1da177e4SLinus Torvalds void snd_emux_reset_port(snd_emux_port_t *port); 36*1da177e4SLinus Torvalds int snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); 37*1da177e4SLinus Torvalds int snd_emux_inc_count(snd_emux_t *emu); 38*1da177e4SLinus Torvalds void snd_emux_dec_count(snd_emux_t *emu); 39*1da177e4SLinus Torvalds int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card); 40*1da177e4SLinus Torvalds int snd_emux_delete_virmidi(snd_emux_t *emu); 41*1da177e4SLinus Torvalds 42*1da177e4SLinus Torvalds /* Prototypes for emux_synth.c */ 43*1da177e4SLinus Torvalds void snd_emux_init_voices(snd_emux_t *emu); 44*1da177e4SLinus Torvalds 45*1da177e4SLinus Torvalds void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); 46*1da177e4SLinus Torvalds void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); 47*1da177e4SLinus Torvalds void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); 48*1da177e4SLinus Torvalds void snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan); 49*1da177e4SLinus Torvalds void snd_emux_control(void *p, int type, struct snd_midi_channel *chan); 50*1da177e4SLinus Torvalds 51*1da177e4SLinus Torvalds void snd_emux_sounds_off_all(snd_emux_port_t *port); 52*1da177e4SLinus Torvalds void snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update); 53*1da177e4SLinus Torvalds void snd_emux_update_port(snd_emux_port_t *port, int update); 54*1da177e4SLinus Torvalds 55*1da177e4SLinus Torvalds void snd_emux_timer_callback(unsigned long data); 56*1da177e4SLinus Torvalds 57*1da177e4SLinus Torvalds /* emux_effect.c */ 58*1da177e4SLinus Torvalds #ifdef SNDRV_EMUX_USE_RAW_EFFECT 59*1da177e4SLinus Torvalds void snd_emux_create_effect(snd_emux_port_t *p); 60*1da177e4SLinus Torvalds void snd_emux_delete_effect(snd_emux_port_t *p); 61*1da177e4SLinus Torvalds void snd_emux_clear_effect(snd_emux_port_t *p); 62*1da177e4SLinus Torvalds void snd_emux_setup_effect(snd_emux_voice_t *vp); 63*1da177e4SLinus Torvalds void snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val); 64*1da177e4SLinus Torvalds void snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode); 65*1da177e4SLinus Torvalds #endif 66*1da177e4SLinus Torvalds 67*1da177e4SLinus Torvalds /* emux_nrpn.c */ 68*1da177e4SLinus Torvalds void snd_emux_sysex(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 69*1da177e4SLinus Torvalds int snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param); 70*1da177e4SLinus Torvalds void snd_emux_nrpn(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); 71*1da177e4SLinus Torvalds 72*1da177e4SLinus Torvalds /* emux_oss.c */ 73*1da177e4SLinus Torvalds void snd_emux_init_seq_oss(snd_emux_t *emu); 74*1da177e4SLinus Torvalds void snd_emux_detach_seq_oss(snd_emux_t *emu); 75*1da177e4SLinus Torvalds 76*1da177e4SLinus Torvalds /* emux_proc.c */ 77*1da177e4SLinus Torvalds #ifdef CONFIG_PROC_FS 78*1da177e4SLinus Torvalds void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device); 79*1da177e4SLinus Torvalds void snd_emux_proc_free(snd_emux_t *emu); 80*1da177e4SLinus Torvalds #endif 81*1da177e4SLinus Torvalds 82*1da177e4SLinus Torvalds #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) 83*1da177e4SLinus Torvalds 84*1da177e4SLinus Torvalds /* emux_hwdep.c */ 85*1da177e4SLinus Torvalds int snd_emux_init_hwdep(snd_emux_t *emu); 86*1da177e4SLinus Torvalds void snd_emux_delete_hwdep(snd_emux_t *emu); 87*1da177e4SLinus Torvalds 88*1da177e4SLinus Torvalds #endif 89