summaryrefslogtreecommitdiffstats
path: root/sydney.h
diff options
context:
space:
mode:
Diffstat (limited to 'sydney.h')
-rw-r--r--sydney.h55
1 files changed, 39 insertions, 16 deletions
diff --git a/sydney.h b/sydney.h
index 7f70add..ecb10bc 100644
--- a/sydney.h
+++ b/sydney.h
@@ -55,17 +55,25 @@ typedef enum {
SA_PCM_FORMAT_MAX
} sa_pcm_format_t;
-/* Native endianness definitions for PCM */
+/* Native/reverse endianness definitions for PCM */
#ifdef SA_LITTLE_ENDIAN
#define SA_PCM_FORMAT_S16_NE SA_PCM_FORMAT_S16_LE
#define SA_PCM_FORMAT_S24_NE SA_PCM_FORMAT_S24_LE
#define SA_PCM_FORMAT_S32_NE SA_PCM_FORMAT_S32_LE
#define SA_PCM_FORMAT_FLOAT32_NE SA_PCM_FORMAT_FLOAT32_LE
+#define SA_PCM_FORMAT_S16_RE SA_PCM_FORMAT_S16_BE
+#define SA_PCM_FORMAT_S24_RE SA_PCM_FORMAT_S24_BE
+#define SA_PCM_FORMAT_S32_RE SA_PCM_FORMAT_S32_BE
+#define SA_PCM_FORMAT_FLOAT32_RE SA_PCM_FORMAT_FLOAT32_BE
#else
#define SA_PCM_FORMAT_S16_NE SA_PCM_FORMAT_S16_BE
#define SA_PCM_FORMAT_S24_NE SA_PCM_FORMAT_S24_BE
#define SA_PCM_FORMAT_S32_NE SA_PCM_FORMAT_S32_BE
#define SA_PCM_FORMAT_FLOAT32_NE SA_PCM_FORMAT_FLOAT32_BE
+#define SA_PCM_FORMAT_S16_RE SA_PCM_FORMAT_S16_LE
+#define SA_PCM_FORMAT_S24_RE SA_PCM_FORMAT_S24_LE
+#define SA_PCM_FORMAT_S32_RE SA_PCM_FORMAT_S32_LE
+#define SA_PCM_FORMAT_FLOAT32_RE SA_PCM_FORMAT_FLOAT32_LE
#endif
#define SA_CODEC_MPEG "mpeg"
@@ -92,7 +100,10 @@ typedef enum {
SA_ERROR_NO_DRIVER = -6,
SA_ERROR_NO_CODEC = -7,
SA_ERROR_NO_PCM_FORMAT = -7,
- SA_ERROR_SYSTEM = -8
+ SA_ERROR_SYSTEM = -8,
+ SA_ERROR_NO_INIT = -9,
+ SA_ERROR_NO_META = -10,
+ SA_ERROR_MAX = -11
} sa_error_t;
/** Possible events for notifications */
@@ -201,14 +212,26 @@ typedef enum {
SA_ADJUST_NONE = 0,
} sa_adjust_t;
+/* Some kind of meta information. */
+#define SA_META_CLIENT_NAME "sydney.client-name" /* utf-8 */
+#define SA_META_PROCESS_ID "sydney.process-id" /* getpid() */
+#define SA_META_LANGUAGE "sydney.language" /* de_DE and similar */
+
+/* Some kind of meta information. Not filled in */
+#define SA_META_STREAM_NAME "sydney.stream-name" /* utf-8 */
+#define SA_META_ICON_NAME "sydney.icon-name" /* file name (no slashes) */
+#define SA_META_ICON_PNG "sydney.icon-png" /* PNG blob */
+#define SA_META_ROLE "sydney.role" /* one of: "music", "phone", "game", "event" */
+#define SA_META_XID "sydney.xid" /* X11 window id */
+
/** Main callback function */
typedef int (*sa_event_callback_t)(sa_device_t *dev, sa_event_t event);
/** Create an opaque (e.g. AC3) codec stream */
-int sa_device_create_opaque(sa_device_t **dev, const char *client_name, sa_mode_t mode, const char *codec);
+int sa_device_create_opaque(sa_device_t **dev, sa_mode_t mode, const char *codec);
/** Normal way to open a PCM device */
-int sa_device_create_pcm(sa_device_t **dev, const char *client_name, sa_mode_t mode, sa_pcm_format_t format, unsigned rate, unsigned nchannels);
+int sa_device_create_pcm(sa_device_t **dev, sa_mode_t mode, sa_pcm_format_t format, unsigned rate, unsigned nchannels);
/** Initialise the device */
int sa_device_open(sa_device_t *dev);
@@ -233,7 +256,7 @@ int sa_device_set_xrun_mode(sa_device_t *dev, sa_xrun_mode_t mode);
int sa_device_set_ni(sa_device_t *dev, int enable);
/** Require dynamic sample rate */
-int sa_device_set_dsr(sa_device_t *dev, int enable);
+int sa_device_set_dynamic_rate(sa_device_t *dev, int enable);
/** Select driver */
int sa_device_set_driver(sa_device_t *dev, const char *driver);
@@ -244,20 +267,17 @@ int sa_device_start_thread(sa_device_t *dev, sa_event_callback_t *callback);
/** Change the device connected to the stream */
int sa_device_change_device(sa_device_t *dev, const char *device_name);
-/** volume in hundreths of dB's*/
-int sa_device_change_input_volume(sa_device_t *dev, int *vol);
+/** volume in hundreths of dB*/
+int sa_device_change_input_volume(sa_device_t *dev, const int vol[]);
-/** volume in hundreths of dB's*/
-int sa_device_change_output_volume(sa_device_t *dev, int *vol);
+/** volume in hundreths of dB*/
+int sa_device_change_output_volume(sa_device_t *dev, const int vol[]);
/** Change the sampling rate */
-int sa_device_change_sampling_rate(sa_device_t *dev, unsigned rate);
+int sa_device_change_rate(sa_device_t *dev, unsigned rate);
-/** Change the name of the client application using the device */
-int sa_device_change_client_name(sa_device_t *dev, const char *client_name);
-
-/** Change the name of the stream being sent */
-int sa_device_change_stream_name(sa_device_t *dev, const char *stream_name);
+/** Change some meta data that is attached to the stream */
+int sa_device_change_meta_data(sa_device_t *dev, const char *name, const void *data, size_t len);
/** Associate opaque user data */
int sa_device_change_user_data(sa_device_t *dev, void *value);
@@ -275,7 +295,7 @@ int sa_device_adjust_pcm_format(sa_device_t *dev, sa_adjust_t direction);
int sa_device_get_state(sa_device_t *dev, sa_state_t *state);
/** Get current sampling rate */
-int sa_device_get_sampling_rate(sa_device_t *dev, unsigned *rate);
+int sa_device_get_rate(sa_device_t *dev, unsigned *rate);
/** Get number of channels */
int sa_device_get_nchannels(sa_device_t *dev, int *nchannels);
@@ -338,4 +358,7 @@ int sa_device_pause(sa_device_t *dev);
/** Block until all audio has been played */
int sa_device_drain(sa_device_t *dev);
+/** Return a human readable error */
+const char *sa_strerror(int code);
+
#endif