Exemple #1
0
void OPL::writeOplReg(int c, int r, int v) {
	if (r == 0x04 && c == 1 && _type == Config::kOpl3) {
		snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_CONNECTION, reinterpret_cast<void *>(v & 0x3f));
	} else if (r == 0x08 && c == 0) {
		_params.kbd_split = (v >> 6) & 0x1;
		snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_PARAMS, (void *)&_params);
	} else if (r == 0xbd && c == 0) {
Exemple #2
0
void OPL::reset() {
	snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_RESET, nullptr);
	if (_iface == SND_HWDEP_IFACE_OPL3)
		snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_MODE, (void *)SNDRV_DM_FM_MODE_OPL3);

	clear();

	// Sync up with the hardware
	snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_PARAMS, (void *)&_params);
	for (uint i = 0; i < (_iface == SND_HWDEP_IFACE_OPL3 ? kVoices : kOpl2Voices); ++i)
		snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_PLAY_NOTE, (void *)&_voice[i]);
	for (uint i = 0; i < (_iface == SND_HWDEP_IFACE_OPL3 ? kOperators : kOpl2Operators); ++i)
		snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_VOICE, (void *)&_oper[i]);
}
Exemple #3
0
static int bt_sco_set_fd(snd_hwdep_t * handle, int sco_fd)
{
	if (snd_hwdep_ioctl(handle, SNDRV_BT_SCO_IOCTL_SET_SCO_SOCKET, (void *) sco_fd) < 0) {
		perror("Unable to set SCO fd");
		return -1;
	}

	return 0;
}
static long snd_hwdep_ioctl_compat(struct file * file, unsigned int cmd,
                                   unsigned long arg)
{
    struct snd_hwdep *hw = file->private_data;
    void __user *argp = compat_ptr(arg);
    switch (cmd) {
    case SNDRV_HWDEP_IOCTL_PVERSION:
    case SNDRV_HWDEP_IOCTL_INFO:
    case SNDRV_HWDEP_IOCTL_DSP_STATUS:
        return snd_hwdep_ioctl(file, cmd, (unsigned long)argp);
    case SNDRV_HWDEP_IOCTL_DSP_LOAD32:
        return snd_hwdep_dsp_load_compat(hw, argp);
    }
    if (hw->ops.ioctl_compat)
        return hw->ops.ioctl_compat(hw, file, cmd, arg);
    return -ENOIOCTLCMD;
}