From d85ab8af89b1efd47622fb04a5d8407416c9db19 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 26 Sep 2015 17:14:43 +1000 Subject: 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. --- libs/ardour/audioengine.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/ardour/audioengine.cc') 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; } -- cgit v1.2.3