comparison audioio/AudioTargetFactory.cpp @ 319:ccd3c927638b tonioni

CoreAudio play target was never actually implemented, we use PortAudio on OS/X
author Chris Cannam
date Thu, 09 Jan 2014 21:31:54 +0000
parents 068235cf5bf7
children
comparison
equal deleted inserted replaced
318:8611eb7be689 319:ccd3c927638b
14 */ 14 */
15 15
16 #include "AudioTargetFactory.h" 16 #include "AudioTargetFactory.h"
17 17
18 #include "AudioJACKTarget.h" 18 #include "AudioJACKTarget.h"
19 #include "AudioCoreAudioTarget.h"
20 #include "AudioPortAudioTarget.h" 19 #include "AudioPortAudioTarget.h"
21 #include "AudioPulseAudioTarget.h" 20 #include "AudioPulseAudioTarget.h"
22 21
23 #include "AudioCallbackPlayTarget.h" 22 #include "AudioCallbackPlayTarget.h"
24 23
52 51
53 #ifdef HAVE_LIBPULSE 52 #ifdef HAVE_LIBPULSE
54 names.push_back("pulse"); 53 names.push_back("pulse");
55 #endif 54 #endif
56 55
57 #ifdef HAVE_COREAUDIO
58 names.push_back("core");
59 #endif
60
61 #ifdef HAVE_PORTAUDIO_2_0 56 #ifdef HAVE_PORTAUDIO_2_0
62 names.push_back("port"); 57 names.push_back("port");
63 #endif 58 #endif
64 59
65 return names; 60 return names;
77 "JACK Audio Connection Kit"); 72 "JACK Audio Connection Kit");
78 } 73 }
79 if (name == "pulse") { 74 if (name == "pulse") {
80 return QCoreApplication::translate("AudioTargetFactory", 75 return QCoreApplication::translate("AudioTargetFactory",
81 "PulseAudio Server"); 76 "PulseAudio Server");
82 }
83 if (name == "core") {
84 return QCoreApplication::translate("AudioTargetFactory",
85 "Core Audio Device");
86 } 77 }
87 if (name == "port") { 78 if (name == "port") {
88 return QCoreApplication::translate("AudioTargetFactory", 79 return QCoreApplication::translate("AudioTargetFactory",
89 "Default Soundcard Device"); 80 "Default Soundcard Device");
90 } 81 }
124 115
125 #ifdef HAVE_LIBPULSE 116 #ifdef HAVE_LIBPULSE
126 if (m_default == "pulse") target = new AudioPulseAudioTarget(source); 117 if (m_default == "pulse") target = new AudioPulseAudioTarget(source);
127 #endif 118 #endif
128 119
129 #ifdef HAVE_COREAUDIO
130 if (m_default == "core") target = new AudioCoreAudioTarget(source);
131 #endif
132
133 #ifdef HAVE_PORTAUDIO_2_0 120 #ifdef HAVE_PORTAUDIO_2_0
134 if (m_default == "port") target = new AudioPortAudioTarget(source); 121 if (m_default == "port") target = new AudioPortAudioTarget(source);
135 #endif 122 #endif
136 123
137 if (!target || !target->isOK()) { 124 if (!target || !target->isOK()) {
158 else { 145 else {
159 cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open PulseAudio target" << endl; 146 cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open PulseAudio target" << endl;
160 delete target; 147 delete target;
161 } 148 }
162 #endif 149 #endif
163
164 #ifdef HAVE_COREAUDIO
165 target = new AudioCoreAudioTarget(source);
166 if (target->isOK()) return target;
167 else {
168 cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open CoreAudio target" << endl;
169 delete target;
170 }
171 #endif
172 150
173 #ifdef HAVE_PORTAUDIO_2_0 151 #ifdef HAVE_PORTAUDIO_2_0
174 target = new AudioPortAudioTarget(source); 152 target = new AudioPortAudioTarget(source);
175 if (target->isOK()) return target; 153 if (target->isOK()) return target;
176 else { 154 else {