summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-09-26 17:14:43 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-10-01 09:10:19 +1000
commitd85ab8af89b1efd47622fb04a5d8407416c9db19 (patch)
treef4611e89a55f0031f8c72c85afd251b8e2a854d3 /libs/ardour/audioengine.cc
parent9a7f96f15a08ece80288c4236f1de789ee72ea4d (diff)
Reinterpret the return value of AudioBackend::start as AudioBackend::ErrorCode
This will allow backends to return a more meaningful error message. Eventually an error code could be returned by AudioEngine::start and the GUI can then use AudioBackend::get_error_string to convert the error into a translated error message directly, or it may be desirable to define its own error messages. The reasons for not doing that right now is that this is a workable solution with the least change required.
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 8091e2516c..c5e2f17d47 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -835,8 +835,12 @@ AudioEngine::start (bool for_latency)
_processed_frames = 0;
last_monitor_check = 0;
-
- if (_backend->start (for_latency)) {
+
+ int error_code = _backend->start (for_latency);
+
+ if (error_code != 0) {
+ _last_backend_error_string =
+ AudioBackend::get_error_string((AudioBackend::ErrorCode)error_code);
return -1;
}