summaryrefslogtreecommitdiff
path: root/src/audioio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/audioio.h')
-rw-r--r--src/audioio.h86
1 files changed, 48 insertions, 38 deletions
diff --git a/src/audioio.h b/src/audioio.h
index 40a445b..7866751 100644
--- a/src/audioio.h
+++ b/src/audioio.h
@@ -36,27 +36,15 @@ extern "C" {
#define OUT_OF_MEMORY -101
#define MISSING_HANDLE -102
-
-#define COULD_NOT_OPEN_DEVICE -203
-#define COULD_NOT_SET_HW_PARAMS -204
-#define COULD_NOT_INIT_PARAMS -205
-#define COULD_NOT_SET_ACCESS_MODE -206
-#define COULD_NOT_SET_FORMAT -207
-#define COULD_NOT_SET_CHANNELS -208
-#define COULD_NOT_SET_SAMPLE_RATE -209
-#define COULD_NOT_SET_PERIOD_SIZE -210
-
-#define BUFFER_TOO_SMALL -305
-#define BUFFER_OVERRUN -306
-#define READ_ERROR -307
-#define SHORT_READ -308
-
-#define MIXER_INIT_FAILED -400
-
-#define MIXER_NOT_INITIALISED -401
-#define INVALID_MIXER_LEVEL -402
-#define INVALID_CHANNEL_NUMBER -403
-#define COULD_NOT_SET_MIXER_LEVEL -404
+#define MISSING_MIXER_HANDLE -102
+#define MISSING_PCM_HANDLE -104
+#define MIXER_INIT_FAILED -105
+#define NO_SUCH_CHANNEL -106
+#define SAMPLE_READ_ERROR -107
+#define SAMPLE_WRITE_ERROR -108
+#define MIXER_ERROR -109
+#define COULD_NOT_OPEN_DEVICE -110
+#define INVALID_MIXER_LEVEL -111
struct aio_t;
@@ -109,47 +97,69 @@ int aio_read(struct aio_t *handle, char *pcm, unsigned int maxsize);
*/
int aio_write(struct aio_t *handle, const char *pcm, unsigned int size);
-#if 0
/**
- * Adjust channel mixer levels.
- * @param err An int pointer containing error value if function is unsuccessful.
+ * Adjust playback channel mixer levels.
* @param handle A pointer to the handle to be used.
* @param channel The channel number to set mixer level of. 0 or 1 should be
* used for the two channels of a stereo interface.
* @param level The mixer level to set in dB
- * @return Returns -1 on error 0 otherwise.
+ * @return Returns error code.
*/
-int aio_set_mixer_level(struct ai_t *handle, unsigned int channel, float level);
+int aio_set_playback_mixer_level(struct aio_t *handle, unsigned int channel,
+ float level);
/**
- * Get channel mixer levels.
- * @param err An int pointer containing error value if function is unsuccessful.
+ * Get playback channel mixer levels.
* @param handle A pointer to the handle to be used.
* @param channel The channel number to get mixer level of. 0 or 1 should be
* used for the two channels of a stereo interface.
- * @return Returns the level in dB.
+ * @param level A pointer to a float which after a successful call will contain
+ * the channel amplification level in dB.
+ * @return Returns error code.
*/
-int aio_get_mixer_level(struct aio_t *handle, unsigned int channel,
- float *level);
-
-int aio_get_mixer_level_range(struct aio_t *handle, float *min, float *max);
-#endif
-
-int aio_set_playback_mixer_level(struct aio_t *handle, unsigned int channel,
- float level);
-
int aio_get_playback_mixer_level(struct aio_t *handle, unsigned int channel,
float *level);
+/**
+ * Get playback channel amplification range in dB.
+ * @param handle A pointer to the handle to be used.
+ * @param min A pointer to a float in which the min value will be returned.
+ * @param max A pointer to a float in which the max value will be returned.
+ * @return Returns error code.
+ */
int aio_get_playback_mixer_level_range(struct aio_t *handle,
float *min, float *max);
+/**
+ * Adjust capture channel mixer levels.
+ * @param handle A pointer to the handle to be used.
+ * @param channel The channel number to set mixer level of. 0 or 1 should be
+ * used for the two channels of a stereo interface.
+ * @param level The mixer level to set in dB
+ * @return Returns error code.
+ */
int aio_set_capture_mixer_level(struct aio_t *handle, unsigned int channel,
float level);
+/**
+ * Get channel mixer levels.
+ * @param handle A pointer to the handle to be used.
+ * @param channel The channel number to get mixer level of. 0 or 1 should be
+ * used for the two channels of a stereo interface.
+ * @param level A pointer to a float which after a successful call will contain
+ * the channel amplification level in dB.
+ * @return Returns error code.
+ */
int aio_get_capture_mixer_level(struct aio_t *handle, unsigned int channel,
float *level);
+/**
+ * Get capture channel amplification range in dB.
+ * @param handle A pointer to the handle to be used.
+ * @param min A pointer to a float in which the min value will be returned.
+ * @param max A pointer to a float in which the max value will be returned.
+ * @return Returns error code.
+ */
int aio_get_capture_mixer_level_range(struct aio_t *handle,
float *min, float *max);