xref: /openbmc/linux/sound/synth/emux/emux_voice.h (revision 52262b4a5d7c3d3549985a47d96fe7d661220162)
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 <linux/wait.h>
261da177e4SLinus Torvalds #include <linux/sched.h>
271da177e4SLinus Torvalds #include <sound/core.h>
281da177e4SLinus Torvalds #include <sound/emux_synth.h>
291da177e4SLinus Torvalds 
301da177e4SLinus Torvalds /* Prototypes for emux_seq.c */
3103da312aSTakashi Iwai int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index);
3203da312aSTakashi Iwai void snd_emux_detach_seq(struct snd_emux *emu);
3303da312aSTakashi Iwai struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name,
3403da312aSTakashi Iwai 					   int max_channels, int type,
3503da312aSTakashi Iwai 					   struct snd_seq_port_callback *callback);
3603da312aSTakashi Iwai void snd_emux_reset_port(struct snd_emux_port *port);
3703da312aSTakashi Iwai int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private,
3803da312aSTakashi Iwai 			 int atomic, int hop);
3903da312aSTakashi Iwai int snd_emux_inc_count(struct snd_emux *emu);
4003da312aSTakashi Iwai void snd_emux_dec_count(struct snd_emux *emu);
4103da312aSTakashi Iwai int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card);
4203da312aSTakashi Iwai int snd_emux_delete_virmidi(struct snd_emux *emu);
431da177e4SLinus Torvalds 
441da177e4SLinus Torvalds /* Prototypes for emux_synth.c */
4503da312aSTakashi Iwai void snd_emux_init_voices(struct snd_emux *emu);
461da177e4SLinus Torvalds 
471da177e4SLinus Torvalds void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
481da177e4SLinus Torvalds void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
491da177e4SLinus Torvalds void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan);
5003da312aSTakashi Iwai void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan);
511da177e4SLinus Torvalds void snd_emux_control(void *p, int type, struct snd_midi_channel *chan);
521da177e4SLinus Torvalds 
5303da312aSTakashi Iwai void snd_emux_sounds_off_all(struct snd_emux_port *port);
5403da312aSTakashi Iwai void snd_emux_update_channel(struct snd_emux_port *port,
5503da312aSTakashi Iwai 			     struct snd_midi_channel *chan, int update);
5603da312aSTakashi Iwai void snd_emux_update_port(struct snd_emux_port *port, int update);
571da177e4SLinus Torvalds 
581da177e4SLinus Torvalds void snd_emux_timer_callback(unsigned long data);
591da177e4SLinus Torvalds 
601da177e4SLinus Torvalds /* emux_effect.c */
611da177e4SLinus Torvalds #ifdef SNDRV_EMUX_USE_RAW_EFFECT
6203da312aSTakashi Iwai void snd_emux_create_effect(struct snd_emux_port *p);
6303da312aSTakashi Iwai void snd_emux_delete_effect(struct snd_emux_port *p);
6403da312aSTakashi Iwai void snd_emux_clear_effect(struct snd_emux_port *p);
6503da312aSTakashi Iwai void snd_emux_setup_effect(struct snd_emux_voice *vp);
6603da312aSTakashi Iwai void snd_emux_send_effect_oss(struct snd_emux_port *port,
6703da312aSTakashi Iwai 			      struct snd_midi_channel *chan, int type, int val);
6803da312aSTakashi Iwai void snd_emux_send_effect(struct snd_emux_port *port,
6903da312aSTakashi Iwai 			  struct snd_midi_channel *chan, int type, int val, int mode);
701da177e4SLinus Torvalds #endif
711da177e4SLinus Torvalds 
721da177e4SLinus Torvalds /* emux_nrpn.c */
7303da312aSTakashi Iwai void snd_emux_sysex(void *private_data, unsigned char *buf, int len,
7403da312aSTakashi Iwai 		    int parsed, struct snd_midi_channel_set *chset);
7503da312aSTakashi Iwai int snd_emux_xg_control(struct snd_emux_port *port,
7603da312aSTakashi Iwai 			struct snd_midi_channel *chan, int param);
7703da312aSTakashi Iwai void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan,
7803da312aSTakashi Iwai 		   struct snd_midi_channel_set *chset);
791da177e4SLinus Torvalds 
801da177e4SLinus Torvalds /* emux_oss.c */
8103da312aSTakashi Iwai void snd_emux_init_seq_oss(struct snd_emux *emu);
8203da312aSTakashi Iwai void snd_emux_detach_seq_oss(struct snd_emux *emu);
831da177e4SLinus Torvalds 
841da177e4SLinus Torvalds /* emux_proc.c */
85*52262b4aSTakashi Iwai #ifdef CONFIG_SND_PROC_FS
8603da312aSTakashi Iwai void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device);
8703da312aSTakashi Iwai void snd_emux_proc_free(struct snd_emux *emu);
88*52262b4aSTakashi Iwai #else
89*52262b4aSTakashi Iwai static inline void snd_emux_proc_init(struct snd_emux *emu,
90*52262b4aSTakashi Iwai 				      struct snd_card *card, int device) {}
91*52262b4aSTakashi Iwai static inline void snd_emux_proc_free(struct snd_emux *emu) {}
921da177e4SLinus Torvalds #endif
931da177e4SLinus Torvalds 
941da177e4SLinus Torvalds #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON)
951da177e4SLinus Torvalds 
961da177e4SLinus Torvalds /* emux_hwdep.c */
9703da312aSTakashi Iwai int snd_emux_init_hwdep(struct snd_emux *emu);
9803da312aSTakashi Iwai void snd_emux_delete_hwdep(struct snd_emux *emu);
991da177e4SLinus Torvalds 
1001da177e4SLinus Torvalds #endif
101