summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo@alsa-project.org>2000-08-31 11:21:05 +0000
committerAbramo Bagnara <abramo@alsa-project.org>2000-08-31 11:21:05 +0000
commit4637f62ff5134cf9df4640b0ccc931d164024989 (patch)
treed89eb184f51d4b6c31f2a81dd6cf15a41ed90231 /include
parente94033141d96d27c60450f006d627766c884de34 (diff)
First version of ALSA client/server
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/aserver.h77
-rw-r--r--include/header.h10
-rw-r--r--include/pcm.h25
4 files changed, 91 insertions, 23 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 2761c59a..a930d93a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -6,7 +6,7 @@ sysinclude_HEADERS = asoundlib.h
header_files=header.h version.h error.h control.h mixer.h pcm.h rawmidi.h \
timer.h hwdep.h seq.h seqmid.h conv.h instr.h conf.h footer.h
-noinst_HEADERS=$(header_files) search.h
+noinst_HEADERS=$(header_files) search.h list.h aserver.h
asoundlib.h: $(header_files)
cat $^ > $@
diff --git a/include/aserver.h b/include/aserver.h
new file mode 100644
index 00000000..428ec286
--- /dev/null
+++ b/include/aserver.h
@@ -0,0 +1,77 @@
+/*
+ * ALSA client/server header file
+ * Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+
+#define SND_PCM_IOCTL_MMAP_DATA _IO ('A', 0xf0)
+#define SND_PCM_IOCTL_MMAP_CONTROL _IO ('A', 0xf1)
+#define SND_PCM_IOCTL_MMAP_STATUS _IO ('A', 0xf2)
+#define SND_PCM_IOCTL_MUNMAP_DATA _IO ('A', 0xf3)
+#define SND_PCM_IOCTL_MUNMAP_CONTROL _IO ('A', 0xf4)
+#define SND_PCM_IOCTL_MUNMAP_STATUS _IO ('A', 0xf5)
+#define SND_PCM_IOCTL_CLOSE _IO ('A', 0xf6)
+
+typedef struct {
+ int result;
+ int cmd;
+ union {
+ snd_pcm_info_t info;
+ snd_pcm_params_t params;
+ snd_pcm_params_info_t params_info;
+ snd_pcm_setup_t setup;
+ snd_pcm_status_t status;
+ int pause;
+ snd_pcm_channel_info_t channel_info;
+ snd_pcm_channel_params_t channel_params;
+ snd_pcm_channel_setup_t channel_setup;
+ off_t frame_data;
+ int frame_io;
+ int link;
+ snd_xfer_t read;
+ snd_xfer_t write;
+ snd_xferv_t readv;
+ snd_xferv_t writev;
+ } u;
+ char data[0];
+} snd_pcm_client_shm_t;
+
+#define PCM_SHM_SIZE 65536
+#define PCM_SHM_DATA_MAXLEN (PCM_SHM_SIZE - offsetof(snd_pcm_client_shm_t, data))
+
+typedef struct {
+ unsigned char dev_type;
+ unsigned char transport_type;
+ unsigned char stream;
+ unsigned char mode;
+ unsigned char namelen;
+ char name[0];
+} snd_client_open_request_t;
+
+typedef struct {
+ long result;
+ long cookie;
+} snd_client_open_answer_t;
+
+struct cmsg_fd
+{
+ int len; /* sizeof structure */
+ int level; /* SOL_SOCKET */
+ int type; /* SCM_RIGHTS */
+ int fd; /* fd to pass */
+};
diff --git a/include/header.h b/include/header.h
index 93531352..6c667bd2 100644
--- a/include/header.h
+++ b/include/header.h
@@ -35,3 +35,13 @@
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
+#define SND_DEV_TYPE_PCM 0
+#define SND_DEV_TYPE_CONTROL 1
+#define SND_DEV_TYPE_RAWMIDI 2
+#define SND_DEV_TYPE_TIMER 3
+#define SND_DEV_TYPE_HWDEP 4
+#define SND_DEV_TYPE_SEQ 5
+
+#define SND_TRANSPORT_TYPE_SHM 0
+#define SND_TRANSPORT_TYPE_TCP 1
+
diff --git a/include/pcm.h b/include/pcm.h
index 7750d9cc..0e67cf71 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -98,28 +98,7 @@ static inline size_t bitset_count(bitset_t *bitset, size_t nbits)
typedef struct snd_pcm snd_pcm_t;
typedef struct snd_pcm_loopback snd_pcm_loopback_t;
-typedef enum { SND_PCM_TYPE_HW, SND_PCM_TYPE_PLUG, SND_PCM_TYPE_MULTI } snd_pcm_type_t;
-
-#if 0
-typedef struct {
- snd_pcm_t *handle;
- snd_timestamp_t tstamp;
- int result;
- union {
- char reserved[256];
- } arg;
-} snd_pcm_synchro_request_t;
-
-typedef enum { SND_PCM_SYNCHRO_GO } snd_pcm_synchro_cmd_t;
-
-#define snd_pcm_synchro_mode_t snd_pcm_sync_mode_t
-#define SND_PCM_SYNCHRO_MODE_NORMAL SND_PCM_SYNC_MODE_NORMAL
-#define SND_PCM_SYNCHRO_MODE_HARDWARE SND_PCM_SYNC_MODE_HARDWARE
-#define SND_PCM_SYNCHRO_MODE_RELAXED SND_PCM_SYNC_MODE_RELAXED
-int snd_pcm_synchro(snd_pcm_synchro_cmd_t cmd,
- unsigned int reqs_count, snd_pcm_synchro_request_t *reqs,
- snd_pcm_synchro_mode_t mode);
-#endif
+typedef enum { SND_PCM_TYPE_HW, SND_PCM_TYPE_PLUG, SND_PCM_TYPE_MULTI, SND_PCM_TYPE_CLIENT } snd_pcm_type_t;
int snd_pcm_open(snd_pcm_t **handle, char *name,
@@ -384,6 +363,8 @@ int snd_pcm_multi_create(snd_pcm_t **handlep, size_t slaves_count,
unsigned int *binds_slave, unsigned int *binds_slave_channel,
int close_slaves);
+int snd_pcm_client_create(snd_pcm_t **handlep, char *host, int port, int transport, char *name, int stream, int mode);
+
#ifdef __cplusplus
}
#endif