aboutsummaryrefslogtreecommitdiffstats
path: root/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'core.h')
-rw-r--r--core.h49
1 files changed, 42 insertions, 7 deletions
diff --git a/core.h b/core.h
index e4fb7a4..c39002a 100644
--- a/core.h
+++ b/core.h
@@ -25,7 +25,7 @@ struct snd_avirt_core {
struct config_group *stream_group;
struct config_group *route_group;
unsigned int stream_count;
- bool streams_sealed;
+ bool streams_configured;
};
struct snd_avirt_audiopath_obj {
@@ -76,16 +76,18 @@ struct snd_avirt_audiopath_obj *snd_avirt_audiopath_create_obj(const char *uid);
void snd_avirt_audiopath_destroy_obj(struct snd_avirt_audiopath_obj *p);
/**
- * snd_avirt_streams_seal - Register the sound card to user space
+ * snd_avirt_streams_configure - Register the sound card to user space
* @return: 0 on success, negative ERRNO on failure
*/
-int snd_avirt_streams_seal(void);
+int snd_avirt_streams_configure(void);
+
+int snd_avirt_streams_unconfigure(void);
/**
- * snd_avirt_streams_sealed - Check if the streams have been sealed or not
- * @return: true if sealed, false otherwise
+ * snd_avirt_streams_configured - Check if streams have been configured or not
+ * @return: true if configured, false otherwise
*/
-bool snd_avirt_streams_sealed(void);
+bool snd_avirt_streams_configured(void);
/**
* snd_avirt_stream_find_by_device - Get audio stream from device number
@@ -99,10 +101,31 @@ struct snd_avirt_stream *snd_avirt_stream_find_by_device(unsigned int device);
* @name: The name designated to the audio stream
* @direction: The PCM direction (SNDRV_PCM_STREAM_PLAYBACK or
* SNDRV_PCM_STREAM_CAPTURE)
+ * @internal: Whether the PCM should be internal or not
* @return: The newly created audio stream if successful, or an error pointer
*/
struct snd_avirt_stream *snd_avirt_stream_create(const char *name,
- int direction);
+ int direction, bool internal);
+
+/**
+ * int snd_avirt_route_try_complete - Set up remaining parameters for a route.
+ * Channels, sink, and source Audio Paths
+ * should be set when calling this function.
+ * @stream: The route to attempt to finalize parameters for.
+ * @return: 0 on success, negative ERRNO on failure
+ */
+int snd_avirt_route_try_complete(struct snd_avirt_route *route);
+
+/**
+ * int snd_avirt_stream_try_complete - Set up remaining parameters for a stream.
+ * Channels and map should be set when
+ * calling this function.
+ * @stream: The stream to attempt to finalize parameters for.
+ * @return: 0 on success, negative ERRNO on failure
+ */
+int snd_avirt_stream_try_complete(struct snd_avirt_stream *stream);
+void snd_avirt_stream_try_destroy(struct snd_avirt_stream *stream);
+
/**
* snd_avirt_stream_set_map - Set Audio Path mapping for a given stream
* @stream: The stream to assign the mapping to.
@@ -128,6 +151,18 @@ struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid);
struct snd_avirt_route *snd_avirt_route_create(const char *name, int direction);
/**
+ * snd_avirt_route_endpoint_pos - get route endpoint position for Audio Path
+ * @pcm: The PCM whose route to inspect.
+ * @ap_uid: The Audio Path UID to get
+ * @endpoint: The route position (SND_AVIRT_ROUTE_SOURCE or SND_AVIRT_ROUTE_SINK)
+ * of the Audio Path in it's route (if any).
+ * @return: 0 if an Audio Path is found in the route, -1 if there is no route,
+ * or -2 otherwise.
+ */
+int snd_avirt_route_endpoint_pos(struct snd_pcm *pcm, const char *ap_uid,
+ snd_avirt_route_endpoint *endpoint);
+
+/**
* snd_avirt_stream_from_config_item - Convert config_item to a snd_avirt_stream
* @item: The config_item to convert from
* @return: The item's snd_avirt_stream if successful, NULL otherwise