18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci#ifndef __EMUX_VOICE_H 38c2ecf20Sopenharmony_ci#define __EMUX_VOICE_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci/* 68c2ecf20Sopenharmony_ci * A structure to keep track of each hardware voice 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Copyright (C) 1999 Steve Ratcliffe 98c2ecf20Sopenharmony_ci * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/wait.h> 138c2ecf20Sopenharmony_ci#include <linux/sched.h> 148c2ecf20Sopenharmony_ci#include <sound/core.h> 158c2ecf20Sopenharmony_ci#include <sound/emux_synth.h> 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* Prototypes for emux_seq.c */ 188c2ecf20Sopenharmony_ciint snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index); 198c2ecf20Sopenharmony_civoid snd_emux_detach_seq(struct snd_emux *emu); 208c2ecf20Sopenharmony_cistruct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name, 218c2ecf20Sopenharmony_ci int max_channels, int type, 228c2ecf20Sopenharmony_ci struct snd_seq_port_callback *callback); 238c2ecf20Sopenharmony_civoid snd_emux_reset_port(struct snd_emux_port *port); 248c2ecf20Sopenharmony_ciint snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private, 258c2ecf20Sopenharmony_ci int atomic, int hop); 268c2ecf20Sopenharmony_ciint snd_emux_inc_count(struct snd_emux *emu); 278c2ecf20Sopenharmony_civoid snd_emux_dec_count(struct snd_emux *emu); 288c2ecf20Sopenharmony_ciint snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card); 298c2ecf20Sopenharmony_ciint snd_emux_delete_virmidi(struct snd_emux *emu); 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci/* Prototypes for emux_synth.c */ 328c2ecf20Sopenharmony_civoid snd_emux_init_voices(struct snd_emux *emu); 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_civoid snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); 358c2ecf20Sopenharmony_civoid snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); 368c2ecf20Sopenharmony_civoid snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); 378c2ecf20Sopenharmony_civoid snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan); 388c2ecf20Sopenharmony_civoid snd_emux_control(void *p, int type, struct snd_midi_channel *chan); 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_civoid snd_emux_sounds_off_all(struct snd_emux_port *port); 418c2ecf20Sopenharmony_civoid snd_emux_update_channel(struct snd_emux_port *port, 428c2ecf20Sopenharmony_ci struct snd_midi_channel *chan, int update); 438c2ecf20Sopenharmony_civoid snd_emux_update_port(struct snd_emux_port *port, int update); 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_civoid snd_emux_timer_callback(struct timer_list *t); 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci/* emux_effect.c */ 488c2ecf20Sopenharmony_ci#ifdef SNDRV_EMUX_USE_RAW_EFFECT 498c2ecf20Sopenharmony_civoid snd_emux_create_effect(struct snd_emux_port *p); 508c2ecf20Sopenharmony_civoid snd_emux_delete_effect(struct snd_emux_port *p); 518c2ecf20Sopenharmony_civoid snd_emux_clear_effect(struct snd_emux_port *p); 528c2ecf20Sopenharmony_civoid snd_emux_setup_effect(struct snd_emux_voice *vp); 538c2ecf20Sopenharmony_civoid snd_emux_send_effect_oss(struct snd_emux_port *port, 548c2ecf20Sopenharmony_ci struct snd_midi_channel *chan, int type, int val); 558c2ecf20Sopenharmony_civoid snd_emux_send_effect(struct snd_emux_port *port, 568c2ecf20Sopenharmony_ci struct snd_midi_channel *chan, int type, int val, int mode); 578c2ecf20Sopenharmony_ci#endif 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci/* emux_nrpn.c */ 608c2ecf20Sopenharmony_civoid snd_emux_sysex(void *private_data, unsigned char *buf, int len, 618c2ecf20Sopenharmony_ci int parsed, struct snd_midi_channel_set *chset); 628c2ecf20Sopenharmony_ciint snd_emux_xg_control(struct snd_emux_port *port, 638c2ecf20Sopenharmony_ci struct snd_midi_channel *chan, int param); 648c2ecf20Sopenharmony_civoid snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan, 658c2ecf20Sopenharmony_ci struct snd_midi_channel_set *chset); 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci/* emux_oss.c */ 688c2ecf20Sopenharmony_civoid snd_emux_init_seq_oss(struct snd_emux *emu); 698c2ecf20Sopenharmony_civoid snd_emux_detach_seq_oss(struct snd_emux *emu); 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci/* emux_proc.c */ 728c2ecf20Sopenharmony_ci#ifdef CONFIG_SND_PROC_FS 738c2ecf20Sopenharmony_civoid snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device); 748c2ecf20Sopenharmony_civoid snd_emux_proc_free(struct snd_emux *emu); 758c2ecf20Sopenharmony_ci#else 768c2ecf20Sopenharmony_cistatic inline void snd_emux_proc_init(struct snd_emux *emu, 778c2ecf20Sopenharmony_ci struct snd_card *card, int device) {} 788c2ecf20Sopenharmony_cistatic inline void snd_emux_proc_free(struct snd_emux *emu) {} 798c2ecf20Sopenharmony_ci#endif 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON) 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci/* emux_hwdep.c */ 848c2ecf20Sopenharmony_ciint snd_emux_init_hwdep(struct snd_emux *emu); 858c2ecf20Sopenharmony_civoid snd_emux_delete_hwdep(struct snd_emux *emu); 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci#endif 88