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