Blame include/aserver.h

Packit 4a16fb
/*
Packit 4a16fb
 *  ALSA client/server header file
Packit 4a16fb
 *  Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
Packit 4a16fb
 *
Packit 4a16fb
 *   This library is free software; you can redistribute it and/or modify
Packit 4a16fb
 *   it under the terms of the GNU Lesser General Public License as
Packit 4a16fb
 *   published by the Free Software Foundation; either version 2.1 of
Packit 4a16fb
 *   the License, or (at your option) any later version.
Packit 4a16fb
 *
Packit 4a16fb
 *   This program is distributed in the hope that it will be useful,
Packit 4a16fb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4a16fb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 4a16fb
 *   GNU Lesser General Public License for more details.
Packit 4a16fb
 *
Packit 4a16fb
 *   You should have received a copy of the GNU Lesser General Public
Packit 4a16fb
 *   License along with this library; if not, write to the Free Software
Packit 4a16fb
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 4a16fb
 *
Packit 4a16fb
 */
Packit 4a16fb
  
Packit 4a16fb
#include <netdb.h>
Packit 4a16fb
#include "../src/pcm/pcm_local.h"
Packit 4a16fb
#include "../src/control/control_local.h"
Packit 4a16fb
Packit 4a16fb
int snd_receive_fd(int sock, void *data, size_t len, int *fd);
Packit 4a16fb
Packit 4a16fb
typedef enum _snd_dev_type {
Packit 4a16fb
	SND_DEV_TYPE_PCM,
Packit 4a16fb
	SND_DEV_TYPE_CONTROL,
Packit 4a16fb
	SND_DEV_TYPE_RAWMIDI,
Packit 4a16fb
	SND_DEV_TYPE_TIMER,
Packit 4a16fb
	SND_DEV_TYPE_HWDEP,
Packit 4a16fb
	SND_DEV_TYPE_SEQ,
Packit 4a16fb
} snd_dev_type_t;
Packit 4a16fb
Packit 4a16fb
typedef enum _snd_transport_type {
Packit 4a16fb
	SND_TRANSPORT_TYPE_SHM,
Packit 4a16fb
	SND_TRANSPORT_TYPE_TCP,
Packit 4a16fb
} snd_transport_type_t;
Packit 4a16fb
Packit 4a16fb
#define SND_PCM_IOCTL_HWSYNC		_IO ('A', 0x22)
Packit 4a16fb
#define SND_PCM_IOCTL_STATE		_IO ('A', 0xf1)
Packit 4a16fb
#define SND_PCM_IOCTL_MMAP		_IO ('A', 0xf2)
Packit 4a16fb
#define SND_PCM_IOCTL_MUNMAP		_IO ('A', 0xf3)
Packit 4a16fb
#define SND_PCM_IOCTL_MMAP_COMMIT	_IO ('A', 0xf4)
Packit 4a16fb
#define SND_PCM_IOCTL_AVAIL_UPDATE	_IO ('A', 0xf5)
Packit 4a16fb
#define SND_PCM_IOCTL_ASYNC		_IO ('A', 0xf6)
Packit 4a16fb
#define SND_PCM_IOCTL_CLOSE		_IO ('A', 0xf7)
Packit 4a16fb
#define SND_PCM_IOCTL_POLL_DESCRIPTOR	_IO ('A', 0xf8)
Packit 4a16fb
#define SND_PCM_IOCTL_HW_PTR_FD		_IO ('A', 0xf9)
Packit 4a16fb
#define SND_PCM_IOCTL_APPL_PTR_FD	_IO ('A', 0xfa)
Packit 4a16fb
#define SND_PCM_IOCTL_FORWARD		_IO ('A', 0xfb)
Packit 4a16fb
Packit 4a16fb
typedef struct {
Packit 4a16fb
	snd_pcm_uframes_t ptr;
Packit 4a16fb
	int use_mmap;
Packit 4a16fb
	off_t offset;		/* for mmap */
Packit 4a16fb
	int changed;
Packit 4a16fb
} snd_pcm_shm_rbptr_t;
Packit 4a16fb
Packit 4a16fb
typedef struct {
Packit 4a16fb
	long result;
Packit 4a16fb
	int cmd;
Packit 4a16fb
	snd_pcm_shm_rbptr_t hw;
Packit 4a16fb
	snd_pcm_shm_rbptr_t appl;
Packit 4a16fb
	union {
Packit 4a16fb
		struct {
Packit 4a16fb
			int sig;
Packit 4a16fb
			pid_t pid;
Packit 4a16fb
		} async;
Packit 4a16fb
		snd_pcm_info_t info;
Packit 4a16fb
		snd_pcm_hw_params_t hw_refine;
Packit 4a16fb
		snd_pcm_hw_params_t hw_params;
Packit 4a16fb
		snd_pcm_sw_params_t sw_params;
Packit 4a16fb
		snd_pcm_status_t status;
Packit 4a16fb
		struct {
Packit 4a16fb
			snd_pcm_uframes_t frames;
Packit 4a16fb
		} avail;
Packit 4a16fb
		struct {
Packit 4a16fb
			snd_pcm_sframes_t frames;
Packit 4a16fb
		} delay;
Packit 4a16fb
		struct {
Packit 4a16fb
			int enable;
Packit 4a16fb
		} pause;
Packit 4a16fb
		snd_pcm_channel_info_t channel_info;
Packit 4a16fb
		struct {
Packit 4a16fb
			snd_pcm_uframes_t frames;
Packit 4a16fb
		} rewind;
Packit 4a16fb
		struct {
Packit 4a16fb
			snd_pcm_uframes_t frames;
Packit 4a16fb
		} forward;
Packit 4a16fb
		struct {
Packit 4a16fb
			int fd;
Packit 4a16fb
		} link;
Packit 4a16fb
		struct {
Packit 4a16fb
			snd_pcm_uframes_t offset;
Packit 4a16fb
			snd_pcm_uframes_t frames;
Packit 4a16fb
		} mmap_commit;
Packit 4a16fb
		struct {
Packit 4a16fb
			char use_mmap;
Packit 4a16fb
			int shmid;
Packit 4a16fb
			off_t offset;
Packit 4a16fb
		} rbptr;
Packit 4a16fb
	} u;
Packit 4a16fb
	char data[0];
Packit 4a16fb
} snd_pcm_shm_ctrl_t;
Packit 4a16fb
Packit 4a16fb
#define PCM_SHM_SIZE sizeof(snd_pcm_shm_ctrl_t)
Packit 4a16fb
		
Packit 4a16fb
#define SND_CTL_IOCTL_READ		_IOR('U', 0xf1, snd_ctl_event_t)
Packit 4a16fb
#define SND_CTL_IOCTL_CLOSE		_IO ('U', 0xf2)
Packit 4a16fb
#define SND_CTL_IOCTL_POLL_DESCRIPTOR	_IO ('U', 0xf3)
Packit 4a16fb
#define SND_CTL_IOCTL_ASYNC		_IO ('U', 0xf4)
Packit 4a16fb
Packit 4a16fb
typedef struct {
Packit 4a16fb
	int result;
Packit 4a16fb
	int cmd;
Packit 4a16fb
	union {
Packit 4a16fb
		struct {
Packit 4a16fb
			int sig;
Packit 4a16fb
			pid_t pid;
Packit 4a16fb
		} async;
Packit 4a16fb
		int device;
Packit 4a16fb
		int subscribe_events;
Packit 4a16fb
		snd_ctl_card_info_t card_info;
Packit 4a16fb
		snd_ctl_elem_list_t element_list;
Packit 4a16fb
		snd_ctl_elem_info_t element_info;
Packit 4a16fb
		snd_ctl_elem_value_t element_read;
Packit 4a16fb
		snd_ctl_elem_value_t element_write;
Packit 4a16fb
		snd_ctl_elem_id_t element_lock;
Packit 4a16fb
		snd_ctl_elem_id_t element_unlock;
Packit 4a16fb
		snd_hwdep_info_t hwdep_info;
Packit 4a16fb
		snd_pcm_info_t pcm_info;
Packit 4a16fb
		int pcm_prefer_subdevice;
Packit 4a16fb
		snd_rawmidi_info_t rawmidi_info;
Packit 4a16fb
		int rawmidi_prefer_subdevice;
Packit 4a16fb
		unsigned int power_state;
Packit 4a16fb
		snd_ctl_event_t read;
Packit 4a16fb
	} u;
Packit 4a16fb
	char data[0];
Packit 4a16fb
} snd_ctl_shm_ctrl_t;
Packit 4a16fb
Packit 4a16fb
#define CTL_SHM_SIZE 65536
Packit 4a16fb
#define CTL_SHM_DATA_MAXLEN (CTL_SHM_SIZE - offsetof(snd_ctl_shm_ctrl_t, data))
Packit 4a16fb
Packit 4a16fb
typedef struct {
Packit 4a16fb
	unsigned char dev_type;
Packit 4a16fb
	unsigned char transport_type;
Packit 4a16fb
	unsigned char stream;
Packit 4a16fb
	unsigned char mode;
Packit 4a16fb
	unsigned char namelen;
Packit 4a16fb
	char name[0];
Packit 4a16fb
} snd_client_open_request_t;
Packit 4a16fb
Packit 4a16fb
typedef struct {
Packit 4a16fb
	long result;
Packit 4a16fb
	int cookie;
Packit 4a16fb
} snd_client_open_answer_t;
Packit 4a16fb