define more backend error-messages.
[ardour.git] / libs / ardour / ardour / audio_backend.h
index ba8e244fcd9b7edf866c25c72b007b36a8841c3a..a0893b846aba348cefed2da67f795ffde47f6b81 100644 (file)
@@ -86,6 +86,52 @@ 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,
+               BackendReinitializationError,
+               AudioDeviceOpenError,
+               AudioDeviceCloseError,
+               AudioDeviceInvalidError,
+               AudioDeviceNotAvailableError,
+               AudioDeviceNotConnectedError,
+               AudioDeviceReservationError,
+               AudioDeviceIOError,
+               MidiDeviceOpenError,
+               MidiDeviceCloseError,
+               MidiDeviceNotAvailableError,
+               MidiDeviceNotConnectedError,
+               MidiDeviceIOError,
+               SampleFormatNotSupportedError,
+               SampleRateNotSupportedError,
+               RequestedInputLatencyNotSupportedError,
+               RequestedOutputLatencyNotSupportedError,
+               PeriodSizeNotSupportedError,
+               PeriodCountNotSupportedError,
+               DeviceConfigurationNotSupportedError,
+               ChannelCountNotSupportedError,
+               InputChannelCountNotSupportedError,
+               OutputChannelCountNotSupportedError,
+               AquireRealtimePermissionError,
+               SettingAudioThreadPriorityError,
+               SettingMIDIThreadPriorityError,
+               ProcessThreadStartError,
+               FreewheelThreadStartError,
+               PortRegistrationError,
+               PortReconnectError,
+               OutOfMemoryError,
+       };
+
+       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.
     */
@@ -182,6 +228,20 @@ class LIBARDOUR_API AudioBackend : public PortEngine {
     virtual std::vector<DeviceStatus> enumerate_output_devices () const
     { return std::vector<DeviceStatus>(); }
 
+       /**
+        * @return true if backend supports requesting an update to the device list
+        * and any cached properties associated with the devices.
+        */
+       virtual bool can_request_update_devices () { return false; }
+
+       /**
+        * Request an update to the list of devices returned in the enumerations.
+        * The Backend must return true from can_request_update_devices to support
+        * this interface.
+        * @return true if the devices were updated
+        */
+       virtual bool update_devices () { return false; }
+
     /** Returns a collection of float identifying sample rates that are
      * potentially usable with the hardware identified by @param device.
      * Any of these values may be supplied in other calls to this backend