42 #include <QtCore/qdebug.h> 43 #include <QtMultimedia/qaudioengine.h> 44 #include <QtMultimedia/qaudioengineplugin.h> 45 #include <private/qfactoryloader_p.h> 48 #ifndef QT_NO_AUDIO_BACKEND 53 #elif defined(Q_OS_MAC) 57 #elif defined(HAS_ALSA) 61 #elif defined(Q_OS_SYMBIAN) 62 #include "qaudiodeviceinfo_symbian_p.h" 63 #include "qaudiooutput_symbian_p.h" 64 #include "qaudioinput_symbian_p.h" 71 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 136 #ifndef QT_NO_AUDIO_BACKEND 137 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) 142 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 149 devices << QAudioDeviceInfo(key, handle, mode);
160 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 170 #ifndef QT_NO_AUDIO_BACKEND 171 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) 180 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 190 #ifndef QT_NO_AUDIO_BACKEND 191 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) 202 #ifndef QT_NO_AUDIO_BACKEND 203 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) 208 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 215 return rc == 0 ?
new QNullDeviceInfo() : rc;
220 return createInputDevice(defaultInputDevice(), format);
225 return createOutputDevice(defaultOutputDevice(), format);
232 #ifndef QT_NO_AUDIO_BACKEND 233 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) 238 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 252 #ifndef QT_NO_AUDIO_BACKEND 253 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) 258 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) T qobject_cast(QObject *object)
static QByteArray defaultOutputDevice()
QByteArray handle() const
void setBufferSize(int)
Sets the audio buffer size to value in bytes.
#define QT_END_NAMESPACE
This macro expands to.
virtual QAbstractAudioDeviceInfo * createDeviceInfo(const QByteArray &device, QAudio::Mode mode)=0
static QList< QAudioDeviceInfo > availableDevices(QAudio::Mode mode)
The QByteArray class provides an array of bytes.
int bytesFree() const
Returns the free space available in bytes in the audio buffer.
The QAbstractAudioOutput class provides access for QAudioOutput to access the audio device provided b...
QAudio::State state() const
Returns the state of audio processing.
void setNotifyInterval(int)
Sets the interval for notify() signal to be emitted.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
virtual QList< int > sampleSizeList()=0
Returns the list of currently available sample sizes.
virtual QList< QByteArray > availableDevices(QAudio::Mode) const =0
The QString class provides a Unicode character string.
virtual QAbstractAudioInput * createInput(const QByteArray &device, const QAudioFormat &format=QAudioFormat())=0
virtual bool isFormatSupported(const QAudioFormat &format) const =0
Returns true if format is available from audio device.
void reset()
Drops all audio data in the buffers, resets buffers to zero.
static QByteArray defaultInputDevice()
int periodSize() const
Returns the period size in bytes.
QAudio::Error error() const
Returns the error state.
int bufferSize() const
Returns the audio buffer size in bytes.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QAudioFormat format() const
Returns the QAudioFormat being used.
qint64 elapsedUSecs() const
Returns the milliseconds since start() was called, including time in Idle and suspend states...
virtual QAudioFormat nearestFormat(const QAudioFormat &format) const =0
Returns the nearest settings format.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
The QAudioDeviceInfo class provides an interface to query audio devices and their functionality...
virtual QString deviceName() const =0
Returns the audio device name.
virtual QStringList codecList()=0
Returns the list of currently available codecs.
virtual QAudioFormat preferredFormat() const =0
Returns the nearest settings.
QIODevice * start(QIODevice *)
Uses the device as the QIODevice to transfer data.
int notifyInterval() const
Returns the notify interval in milliseconds.
QObject * instance(const QString &key) const
static QAudioDeviceInfo defaultInputDevice()
static QAbstractAudioInput * createDefaultInputDevice(QAudioFormat const &format)
#define QAudioEngineFactoryInterface_iid
void resume()
Resumes processing audio data after a suspend()
void stop()
Stops the audio output.
virtual QList< int > channelsList()=0
Returns the list of currently available channels.
int size() const
Returns the number of items in the list.
The QAbstractAudioDeviceInfo class provides access for QAudioDeviceInfo to access the audio device pr...
static QAbstractAudioInput * createInputDevice(QAudioDeviceInfo const &device, QAudioFormat const &format)
static QAudioDeviceInfo defaultOutputDevice()
bool isNull() const
Returns whether this QAudioDeviceInfo object holds a device definition.
qint64 processedUSecs() const
Returns the amount of audio data processed since start() was called in milliseconds.
static QList< QByteArray > availableDevices(QAudio::Mode)
static QAbstractAudioDeviceInfo * audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode)
The QIODevice class is the base interface class of all I/O devices in Qt.
void suspend()
Stops processing audio data, preserving buffered audio data.
virtual QAbstractAudioOutput * createOutput(const QByteArray &device, const QAudioFormat &format=QAudioFormat())=0
static QAbstractAudioOutput * createDefaultOutputDevice(QAudioFormat const &format)
virtual QList< QAudioFormat::SampleType > sampleTypeList()=0
Returns the list of currently available sample types.
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
Declares a global static variable with the specified type and name.
static QAbstractAudioOutput * createOutputDevice(QAudioDeviceInfo const &device, QAudioFormat const &format)
virtual QList< int > frequencyList()=0
Returns the list of currently available frequencies.
virtual QList< QAudioFormat::Endian > byteOrderList()=0
Returns the list of currently available byte orders.