6#include "zrythm-config.h"
10# include "utils/utf8_string.h"
14# include "weakjack/weak_libjack.h"
16using namespace Qt::StringLiterals;
18namespace zrythm::utils::jack
21static inline utils::Utf8String
22get_error_message (jack_status_t status)
24 return utils::Utf8String::from_qstring ([status] () -> QString {
25 if (status & JackFailure)
29 QObject::tr (
"Overall operation failed");
31 if (status & JackInvalidOption)
34 "The operation contained an invalid or unsupported option");
36 if (status & JackNameNotUnique)
38 return QObject::tr (
"The desired client name was not unique");
40 if (status & JackServerFailed)
42 return QObject::tr (
"Unable to connect to the JACK server");
44 if (status & JackServerError)
46 return QObject::tr (
"Communication error with the JACK server");
48 if (status & JackNoSuchClient)
50 return QObject::tr (
"Requested client does not exist");
52 if (status & JackLoadFailure)
54 return QObject::tr (
"Unable to load internal client");
56 if (status & JackInitFailure)
58 return QObject::tr (
"Unable to initialize client");
60 if (status & JackShmFailure)
62 return QObject::tr (
"Unable to access shared memory");
64 if (status & JackVersionError)
66 return QObject::tr (
"Client's protocol version does not match");
68 if (status & JackBackendError)
70 return QObject::tr (
"Backend error");
72 if (status & JackClientZombie)
74 return QObject::tr (
"Client zombie");
77 z_return_val_if_reached (u
"unknown JACK error"_s);