From ee6fd4b4609a1c05a3f4ded4c8022b5ba84d7afd Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Tue, 7 Aug 2018 22:12:06 +0200 Subject: Add the C interface for the name API --- rtaudio_c.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'rtaudio_c.cpp') 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; -- cgit v1.2.3