diff options
| author | JP Cimalando <jpcima@users.noreply.github.com> | 2018-08-07 22:12:06 +0200 |
|---|---|---|
| committer | JP Cimalando <jpcima@users.noreply.github.com> | 2018-08-07 22:12:16 +0200 |
| commit | ee6fd4b4609a1c05a3f4ded4c8022b5ba84d7afd (patch) | |
| tree | 2d90de0573d378d3db1cd26c4b1af8f838404127 /rtaudio_c.cpp | |
| parent | f7b624ba819036b9ebfb3f4d0517fd45e01919b2 (diff) | |
Add the C interface for the name API
Diffstat (limited to 'rtaudio_c.cpp')
| -rw-r--r-- | rtaudio_c.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rtaudio_c.cpp b/rtaudio_c.cpp index 699d2ce..f831655 100644 --- a/rtaudio_c.cpp +++ b/rtaudio_c.cpp @@ -50,6 +50,19 @@ const char *rtaudio_version() { return RTAUDIO_VERSION; } const rtaudio_api_t *rtaudio_compiled_api() { return compiled_api; } +const char *rtaudio_compiled_api_name(rtaudio_api_t api) { + const std::string &name = RtAudio::getCompiledApiName((RtAudio::Api)api); + return name.empty() ? NULL : name.c_str(); +} + +rtaudio_api_t rtaudio_compiled_api_by_name(const char *name) { + RtAudio::Api api = RtAudio::UNSPECIFIED; + if (name) { + api = RtAudio::getCompiledApiByName(name); + } + return (rtaudio_api_t)api; +} + const char *rtaudio_error(rtaudio_t audio) { if (audio->has_error) { return audio->errmsg; |
