summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/audio_backend.h
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-08-20 22:37:50 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-09-02 12:07:14 +1000
commit94f3e3029aa66822e6ec4fa48eff1a31dcfc845e (patch)
tree8306c5a8c5612ba75dcf3e56622b2d392c16b496 /libs/ardour/ardour/audio_backend.h
parent451e35002c6478e9e27b55186db3b691fabbbb50 (diff)
Add enums to AudioBackend class for getting standard error and device name strings
These could also be used for return values but are initially intended for shared translations of error messages between backends. Ideally IMO translation should occur in the GUI(as there may be more than one) in response to these(or similar) error codes but that would take agreement and a fair bit of refactoring. As it is there are errors that occur in the backends that users will want to know about this at least allows consistent translations to be shared between backends.
Diffstat (limited to 'libs/ardour/ardour/audio_backend.h')
-rw-r--r--libs/ardour/ardour/audio_backend.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h
index ba8e244fcd..2bbd891e98 100644
--- a/libs/ardour/ardour/audio_backend.h
+++ b/libs/ardour/ardour/audio_backend.h
@@ -86,6 +86,43 @@ class LIBARDOUR_API AudioBackend : public PortEngine {
AudioBackend (AudioEngine& e, AudioBackendInfo& i) : PortEngine (e), _info (i), engine (e) {}
virtual ~AudioBackend () {}
+ enum ErrorCode {
+ NoError = 0,
+ BackendInitializationError = -64,
+ BackendDeinitializationError,
+ AudioDeviceOpenError,
+ AudioDeviceCloseError,
+ AudioDeviceNotAvailableError,
+ AudioDeviceNotConnectedError,
+ AudioDeviceReservationError,
+ AudioDeviceIOError,
+ MidiDeviceOpenError,
+ MidiDeviceCloseError,
+ MidiDeviceNotAvailableError,
+ MidiDeviceNotConnectedError,
+ MidiDeviceIOError,
+ SampleRateNotSupportedError,
+ RequestedInputLatencyNotSupportedError,
+ RequestedOutputLatencyNotSupportedError,
+ PeriodSizeNotSupportedError,
+ PeriodCountNotSupportedError,
+ DeviceConfigurationNotSupportedError,
+ InputChannelCountNotSupportedError,
+ OutputChannelCountNotSupportedError,
+ AquireRealtimePermissionError,
+ SettingAudioThreadPriorityError,
+ SettingMIDIThreadPriorityError
+ };
+
+ static std::string get_error_string (ErrorCode);
+
+ enum StandardDeviceName {
+ DeviceNone,
+ DeviceDefault
+ };
+
+ static std::string get_standard_device_name (StandardDeviceName);
+
/** Return the AudioBackendInfo object from which this backend
was constructed.
*/