linux/sound/isa/sb/emu8000_callback.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  synth callback routines for the emu8000 (AWE32/64)
 *
 *  Copyright (C) 1999 Steve Ratcliffe
 *  Copyright (C) 1999-2000 Takashi Iwai <[email protected]>
 */

#include "emu8000_local.h"
#include <linux/export.h>
#include <sound/asoundef.h>

/*
 * prototypes
 */
static struct snd_emux_voice *get_voice(struct snd_emux *emu,
					struct snd_emux_port *port);
static int start_voice(struct snd_emux_voice *vp);
static void trigger_voice(struct snd_emux_voice *vp);
static void release_voice(struct snd_emux_voice *vp);
static void update_voice(struct snd_emux_voice *vp, int update);
static void reset_voice(struct snd_emux *emu, int ch);
static void terminate_voice(struct snd_emux_voice *vp);
static void sysex(struct snd_emux *emu, char *buf, int len, int parsed,
		  struct snd_midi_channel_set *chset);
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
static int oss_ioctl(struct snd_emux *emu, int cmd, int p1, int p2);
#endif
static int load_fx(struct snd_emux *emu, int type, int mode,
		   const void __user *buf, long len);

static void set_pitch(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void set_volume(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void set_pan(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void set_tremfreq(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void set_fm2frq2(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void set_filterQ(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
static void snd_emu8000_tweak_voice(struct snd_emu8000 *emu, int ch);

/*
 * Ensure a value is between two points
 * macro evaluates its args more than once, so changed to upper-case.
 */
#define LIMITVALUE(x, a, b)
#define LIMITMAX(x, a)


/*
 * set up operators
 */
static const struct snd_emux_operators emu8000_ops =;

void
snd_emu8000_ops_setup(struct snd_emu8000 *hw)
{}



/*
 * Terminate a voice
 */
static void
release_voice(struct snd_emux_voice *vp)
{}


/*
 */
static void
terminate_voice(struct snd_emux_voice *vp)
{}


/*
 */
static void
update_voice(struct snd_emux_voice *vp, int update)
{}


/*
 * Find a channel (voice) within the EMU that is not in use or at least
 * less in use than other channels.  Always returns a valid pointer
 * no matter what.  If there is a real shortage of voices then one
 * will be cut. Such is life.
 *
 * The channel index (vp->ch) must be initialized in this routine.
 * In Emu8k, it is identical with the array index.
 */
static struct snd_emux_voice *
get_voice(struct snd_emux *emu, struct snd_emux_port *port)
{}

/*
 */
static int
start_voice(struct snd_emux_voice *vp)
{}

/*
 * Start envelope
 */
static void
trigger_voice(struct snd_emux_voice *vp)
{}

/*
 * reset voice parameters
 */
static void
reset_voice(struct snd_emux *emu, int ch)
{}

/*
 * Set the pitch of a possibly playing note.
 */
static void
set_pitch(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

/*
 * Set the volume of a possibly already playing note
 */
static void
set_volume(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

/*
 * Set pan and loop start address.
 */
static void
set_pan(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

#define MOD_SENSE

static void
set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

/* set tremolo (lfo1) volume & frequency */
static void
set_tremfreq(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

/* set lfo2 pitch & frequency */
static void
set_fm2frq2(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

/* set filterQ */
static void
set_filterQ(struct snd_emu8000 *hw, struct snd_emux_voice *vp)
{}

/*
 * set the envelope & LFO parameters to the default values
 */
static void
snd_emu8000_tweak_voice(struct snd_emu8000 *emu, int i)
{}

/*
 * sysex callback
 */
static void
sysex(struct snd_emux *emu, char *buf, int len, int parsed, struct snd_midi_channel_set *chset)
{}


#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
/*
 * OSS ioctl callback
 */
static int
oss_ioctl(struct snd_emux *emu, int cmd, int p1, int p2)
{}
#endif


/*
 * additional patch keys
 */

#define SNDRV_EMU8000_LOAD_CHORUS_FX
#define SNDRV_EMU8000_LOAD_REVERB_FX


/*
 * callback routine
 */

static int
load_fx(struct snd_emux *emu, int type, int mode, const void __user *buf, long len)
{}