]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Initial proposal for simple PCM API extension
authorJaroslav Kysela <perex@perex.cz>
Sun, 14 Mar 2004 18:37:55 +0000 (18:37 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 14 Mar 2004 18:37:55 +0000 (18:37 +0000)
include/pcm.h

index b4d1fc3fd15f5a3a2aee366d39c35d3503ab9e10..b6d485f26d3af506b7707a9fb5ccc22d8992981a 100644 (file)
@@ -1213,6 +1213,55 @@ int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
 
 /** \} */
 
+/**
+ * \defgroup PCM_Simple Simple setup functions
+ * \ingroup PCM
+ * See the \ref pcm page for more details.
+ * \{
+ */
+
+/** Simple PCM latency type */
+typedef enum _snd_spcm_latency {
+       /** standard latency - for standard playback or capture
+            (estimated latency in one direction 350ms) */
+       SND_SPCM_LATENCY_STANDARD = 0,
+       /** medium latency - software phones etc.
+           (estimated latency in one direction maximally 25ms */
+       SND_SPCM_LATENCY_MEDIUM,
+       /** realtime latency - realtime applications (effect processors etc.)
+           (estimated latency in one direction 5ms and better) */
+       SND_SPCM_LATENCY_REALTIME
+} snd_spcm_latency_t;
+
+/** Simple PCM xrun type */
+typedef enum _snd_spcm_xrun_type {
+       /** driver / library will ignore all xruns, the stream runs forever */
+       SND_SPCM_XRUN_IGNORE = 0,
+       /** driver / library stops the stream when an xrun occurs */
+       SND_SPCM_XRUN_STOP
+} snd_spcm_xrun_type_t;
+
+int snd_spcm_init(snd_pcm_t *pcm,
+                 unsigned int rate,
+                 unsigned int channels,
+                 snd_pcm_format_t format,
+                 snd_pcm_subformat_t subformat,
+                 snd_spcm_latency_t latency,
+                 snd_pcm_access_t access,
+                 snd_spcm_xrun_type_t xrun_type);
+
+int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
+                        snd_pcm_t *capture_pcm,
+                        unsigned int rate,
+                        unsigned int channels,
+                        snd_pcm_format_t format,
+                        snd_pcm_subformat_t subformat,
+                        snd_spcm_latency_t latency,
+                        snd_pcm_access_t access,
+                        snd_spcm_xrun_type_t xrun_type);
+
+/** \} */
+
 /**
  * \defgroup PCM_Deprecated Deprecated Functions
  * \ingroup PCM