equal
deleted
inserted
replaced
56 #include "qaudioinput_mac_p.h" |
56 #include "qaudioinput_mac_p.h" |
57 #elif defined(HAS_ALSA) |
57 #elif defined(HAS_ALSA) |
58 #include "qaudiodeviceinfo_alsa_p.h" |
58 #include "qaudiodeviceinfo_alsa_p.h" |
59 #include "qaudiooutput_alsa_p.h" |
59 #include "qaudiooutput_alsa_p.h" |
60 #include "qaudioinput_alsa_p.h" |
60 #include "qaudioinput_alsa_p.h" |
|
61 #elif defined(Q_OS_SYMBIAN) |
|
62 #include "qaudiodeviceinfo_symbian_p.h" |
|
63 #include "qaudiooutput_symbian_p.h" |
|
64 #include "qaudioinput_symbian_p.h" |
61 #endif |
65 #endif |
62 #endif |
66 #endif |
63 |
67 |
64 QT_BEGIN_NAMESPACE |
68 QT_BEGIN_NAMESPACE |
65 |
69 |
126 |
130 |
127 QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode) |
131 QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode) |
128 { |
132 { |
129 QList<QAudioDeviceInfo> devices; |
133 QList<QAudioDeviceInfo> devices; |
130 #ifndef QT_NO_AUDIO_BACKEND |
134 #ifndef QT_NO_AUDIO_BACKEND |
131 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) |
135 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) |
132 foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode)) |
136 foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode)) |
133 devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); |
137 devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); |
134 #endif |
138 #endif |
135 #endif |
139 #endif |
136 QFactoryLoader* l = loader(); |
140 QFactoryLoader* l = loader(); |
156 QList<QByteArray> list = plugin->availableDevices(QAudio::AudioInput); |
160 QList<QByteArray> list = plugin->availableDevices(QAudio::AudioInput); |
157 if (list.size() > 0) |
161 if (list.size() > 0) |
158 return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); |
162 return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); |
159 } |
163 } |
160 #ifndef QT_NO_AUDIO_BACKEND |
164 #ifndef QT_NO_AUDIO_BACKEND |
161 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) |
165 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) |
162 return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); |
166 return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); |
163 #endif |
167 #endif |
164 #endif |
168 #endif |
165 return QAudioDeviceInfo(); |
169 return QAudioDeviceInfo(); |
166 } |
170 } |
173 QList<QByteArray> list = plugin->availableDevices(QAudio::AudioOutput); |
177 QList<QByteArray> list = plugin->availableDevices(QAudio::AudioOutput); |
174 if (list.size() > 0) |
178 if (list.size() > 0) |
175 return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); |
179 return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); |
176 } |
180 } |
177 #ifndef QT_NO_AUDIO_BACKEND |
181 #ifndef QT_NO_AUDIO_BACKEND |
178 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) |
182 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) |
179 return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); |
183 return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); |
180 #endif |
184 #endif |
181 #endif |
185 #endif |
182 return QAudioDeviceInfo(); |
186 return QAudioDeviceInfo(); |
183 } |
187 } |
185 QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode) |
189 QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode) |
186 { |
190 { |
187 QAbstractAudioDeviceInfo *rc = 0; |
191 QAbstractAudioDeviceInfo *rc = 0; |
188 |
192 |
189 #ifndef QT_NO_AUDIO_BACKEND |
193 #ifndef QT_NO_AUDIO_BACKEND |
190 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) |
194 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) |
191 if (realm == QLatin1String("builtin")) |
195 if (realm == QLatin1String("builtin")) |
192 return new QAudioDeviceInfoInternal(handle, mode); |
196 return new QAudioDeviceInfoInternal(handle, mode); |
193 #endif |
197 #endif |
194 #endif |
198 #endif |
195 QAudioEngineFactoryInterface* plugin = |
199 QAudioEngineFactoryInterface* plugin = |
214 QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) |
218 QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) |
215 { |
219 { |
216 if (deviceInfo.isNull()) |
220 if (deviceInfo.isNull()) |
217 return new QNullInputDevice(); |
221 return new QNullInputDevice(); |
218 #ifndef QT_NO_AUDIO_BACKEND |
222 #ifndef QT_NO_AUDIO_BACKEND |
219 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) |
223 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) |
220 if (deviceInfo.realm() == QLatin1String("builtin")) |
224 if (deviceInfo.realm() == QLatin1String("builtin")) |
221 return new QAudioInputPrivate(deviceInfo.handle(), format); |
225 return new QAudioInputPrivate(deviceInfo.handle(), format); |
222 #endif |
226 #endif |
223 #endif |
227 #endif |
224 QAudioEngineFactoryInterface* plugin = |
228 QAudioEngineFactoryInterface* plugin = |
233 QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) |
237 QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) |
234 { |
238 { |
235 if (deviceInfo.isNull()) |
239 if (deviceInfo.isNull()) |
236 return new QNullOutputDevice(); |
240 return new QNullOutputDevice(); |
237 #ifndef QT_NO_AUDIO_BACKEND |
241 #ifndef QT_NO_AUDIO_BACKEND |
238 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) |
242 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) |
239 if (deviceInfo.realm() == QLatin1String("builtin")) |
243 if (deviceInfo.realm() == QLatin1String("builtin")) |
240 return new QAudioOutputPrivate(deviceInfo.handle(), format); |
244 return new QAudioOutputPrivate(deviceInfo.handle(), format); |
241 #endif |
245 #endif |
242 #endif |
246 #endif |
243 QAudioEngineFactoryInterface* plugin = |
247 QAudioEngineFactoryInterface* plugin = |