summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_backend.cc
blob: 6a2b341f61d7111abf791c1d90912bcb7263b5b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
    Copyright (C) 2015 Tim Mayberry

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#include "ardour/audio_backend.h"

#include "pbd/i18n.h"

namespace ARDOUR {

std::string
AudioBackend::get_error_string (ErrorCode error_code)
{
	switch (error_code) {
	case NoError: // to stop compiler warning
		return _("No Error occurred");
	case BackendInitializationError:
		return _("Failed to initialize audio backend");
	case BackendDeinitializationError:
		return _("Failed to deinitialize audio backend");
	case BackendReinitializationError:
		return _("Failed to reinitialize audio backend");
	case AudioDeviceOpenError:
		return _("Failed to open audio device");
	case AudioDeviceCloseError:
		return _("Failed to close audio device");
	case AudioDeviceInvalidError:
		return _("Audio device not valid");
	case AudioDeviceNotAvailableError:
		return _("Audio device unavailable");
	case AudioDeviceNotConnectedError:
		return _("Audio device not connected");
	case AudioDeviceReservationError:
		return _("Failed to request and reserve audio device");
	case AudioDeviceIOError:
		return _("Audio device Input/Output error");
	case MidiDeviceOpenError:
		return _("Failed to open MIDI device");
	case MidiDeviceCloseError:
		return _("Failed to close MIDI device");
	case MidiDeviceNotAvailableError:
		return _("MIDI device unavailable");
	case MidiDeviceNotConnectedError:
		return _("MIDI device not connected");
	case MidiDeviceIOError:
		return _("MIDI device Input/Output error");
	case SampleFormatNotSupportedError:
		return _("Sample format is not supported");
	case SampleRateNotSupportedError:
		return _("Sample rate is not supported");
	case RequestedInputLatencyNotSupportedError:
		return _("Requested input latency is not supported");
	case RequestedOutputLatencyNotSupportedError:
		return _("Requested output latency is not supported");
	case PeriodSizeNotSupportedError:
		return _("Period size is not supported");
	case PeriodCountNotSupportedError:
		return _("Period count is not supported");
	case DeviceConfigurationNotSupportedError:
		return _("Device configuration not supported");
	case ChannelCountNotSupportedError:
		return _("Channel count configuration not supported");
	case InputChannelCountNotSupportedError:
		return _("Input channel count configuration not supported");
	case OutputChannelCountNotSupportedError:
		return _("Output channel count configuration not supported");
	case AquireRealtimePermissionError:
		return _("Unable to acquire realtime permissions");
	case SettingAudioThreadPriorityError:
		return _("Setting audio device thread priorities failed");
	case SettingMIDIThreadPriorityError:
		return _("Setting MIDI device thread priorities failed");
	case ProcessThreadStartError:
		return _("Failed to start process thread");
	case FreewheelThreadStartError:
		return _("Failed to start freewheel thread");
	case PortRegistrationError:
		return _("Failed to register audio/midi ports");
	case PortReconnectError:
		return _("Failed to re-connect audio/midi ports");
	case OutOfMemoryError:
		return _("Out Of Memory Error");
	}
	return _("Could not reconnect to Audio/MIDI engine");
}

std::string
AudioBackend::get_standard_device_name (StandardDeviceName device_name)
{
	switch (device_name) {
	case DeviceNone:
		return _("None");
	case DeviceDefault:
		return _("Default");
	}
	return std::string();
}

} // namespace ARDOUR