diff options
author | Matthew Gregan <[email protected]> | 2012-05-22 12:38:50 +1200 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2012-05-22 12:38:50 +1200 |
commit | fef0c99932ef7005d2acdb238feea56e94d66759 (patch) | |
tree | 7e4ad0f13c9071c1a0ed0bfcc449828a40be8929 | |
parent | 612118caa85bee3f0ed1e169d54f78305ad39c72 (diff) | |
download | cubeb-fef0c99932ef7005d2acdb238feea56e94d66759.tar.gz cubeb-fef0c99932ef7005d2acdb238feea56e94d66759.zip |
add cubeb_get_backend_id. fixes #5.
-rw-r--r-- | include/cubeb/cubeb.h | 5 | ||||
-rw-r--r-- | src/cubeb_alsa.c | 6 | ||||
-rw-r--r-- | src/cubeb_audioqueue.c | 6 | ||||
-rw-r--r-- | src/cubeb_audiounit.c | 6 | ||||
-rw-r--r-- | src/cubeb_directsound.cpp | 6 | ||||
-rw-r--r-- | src/cubeb_pulse.c | 6 | ||||
-rw-r--r-- | src/cubeb_winmm.c | 6 |
7 files changed, 41 insertions, 0 deletions
diff --git a/include/cubeb/cubeb.h b/include/cubeb/cubeb.h index fc9c102..1939bde 100644 --- a/include/cubeb/cubeb.h +++ b/include/cubeb/cubeb.h @@ -156,6 +156,11 @@ typedef int (* cubeb_state_callback)(cubeb_stream * stream, @retval CUBEB_ERROR */ int cubeb_init(cubeb ** context, char const * context_name); +/** Get a read-only string identifying this context's current backend. + @param context + @retval Read-only string identifying current backend. */ +char const * cubeb_get_backend_id(cubeb * context); + /** Destroy an application context. @param context */ void cubeb_destroy(cubeb * context); diff --git a/src/cubeb_alsa.c b/src/cubeb_alsa.c index 5305a4b..25f23dc 100644 --- a/src/cubeb_alsa.c +++ b/src/cubeb_alsa.c @@ -531,6 +531,12 @@ cubeb_init(cubeb ** context, char const * context_name UNUSED) return CUBEB_OK; } +char const * +cubeb_get_backend_id(cubeb * ctx UNUSED) +{ + return "alsa"; +} + void cubeb_destroy(cubeb * ctx) { diff --git a/src/cubeb_audioqueue.c b/src/cubeb_audioqueue.c index 9eac87a..e57cff0 100644 --- a/src/cubeb_audioqueue.c +++ b/src/cubeb_audioqueue.c @@ -79,6 +79,12 @@ cubeb_init(cubeb ** context, char const * context_name) return CUBEB_OK; } +char const * +cubeb_get_backend_id(cubeb * ctx) +{ + return "audioqueue"; +} + void cubeb_destroy(cubeb * ctx) { diff --git a/src/cubeb_audiounit.c b/src/cubeb_audiounit.c index dde1942..fff0130 100644 --- a/src/cubeb_audiounit.c +++ b/src/cubeb_audiounit.c @@ -87,6 +87,12 @@ cubeb_init(cubeb ** context, char const * context_name) return CUBEB_OK; } +char const * +cubeb_get_backend_id(cubeb * ctx) +{ + return "audiounit"; +} + void cubeb_destroy(cubeb * ctx) { diff --git a/src/cubeb_directsound.cpp b/src/cubeb_directsound.cpp index c3ee6fd..c1f49d5 100644 --- a/src/cubeb_directsound.cpp +++ b/src/cubeb_directsound.cpp @@ -309,6 +309,12 @@ cubeb_init(cubeb ** context, char const * context_name) return CUBEB_OK; } +char const * +cubeb_get_backend_id(cubeb * ctx) +{ + return "directsound"; +} + void cubeb_destroy(cubeb * ctx) { diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c index ad4c340..9de43be 100644 --- a/src/cubeb_pulse.c +++ b/src/cubeb_pulse.c @@ -211,6 +211,12 @@ cubeb_init(cubeb ** context, char const * context_name) return CUBEB_OK; } +char const * +cubeb_get_backend_id(cubeb * ctx) +{ + return "pulse"; +} + void cubeb_destroy(cubeb * ctx) { diff --git a/src/cubeb_winmm.c b/src/cubeb_winmm.c index ead4cdb..01e0fb0 100644 --- a/src/cubeb_winmm.c +++ b/src/cubeb_winmm.c @@ -227,6 +227,12 @@ cubeb_init(cubeb ** context, char const * context_name) return CUBEB_OK; } +char const * +cubeb_get_backend_id(cubeb * ctx) +{ + return "winmm"; +} + void cubeb_destroy(cubeb * ctx) { |