diff options
| author | JP Cimalando <jpcima@users.noreply.github.com> | 2018-08-08 18:51:45 +0200 |
|---|---|---|
| committer | JP Cimalando <jpcima@users.noreply.github.com> | 2018-08-08 18:51:45 +0200 |
| commit | bc469fab7b18df4253db52f17726697ae5c9c564 (patch) | |
| tree | a8287acb4ccca6049ea49464056dab7aff536381 /RtAudio.cpp | |
| parent | 3d054aec68641b049c102d20632a1eb618355a6f (diff) | |
reference return for API names
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index 7b7c8ef..07a6314 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -160,22 +160,25 @@ const std::vector<RtAudio::Api>& RtAudio :: getCompiledApi() return compiledApis; } -const std::string RtAudio :: getCompiledApiName( RtAudio::Api api ) +static const std::string unknown_api_name = ""; +static const std::string unknown_api_display_name = "Unknown"; + +const std::string& RtAudio :: getCompiledApiName( RtAudio::Api api ) { ApiNameMap::const_iterator it; for (it = apiNames.begin(); it != apiNames.end(); it++) if (it->second.first == api) return it->first; - return ""; + return unknown_api_name; } -const std::string RtAudio :: getCompiledApiDisplayName( RtAudio::Api api ) +const std::string& RtAudio :: getCompiledApiDisplayName( RtAudio::Api api ) { ApiNameMap::const_iterator it; for (it = apiNames.begin(); it != apiNames.end(); it++) if (it->second.first == api) return it->second.second; - return "Unknown"; + return unknown_api_display_name; } RtAudio::Api RtAudio :: getCompiledApiByName( const std::string &name ) |
