Qt 4.8
qaudiodeviceinfo_alsa_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtMultimedia module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists for the convenience
47 // of other Qt classes. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 //
52 
53 
54 #ifndef QAUDIODEVICEINFOALSA_H
55 #define QAUDIODEVICEINFOALSA_H
56 
57 #include <alsa/asoundlib.h>
58 
59 #include <QtCore/qbytearray.h>
60 #include <QtCore/qstringlist.h>
61 #include <QtCore/qlist.h>
62 #include <QtCore/qdebug.h>
63 
64 #include <QtMultimedia/qaudio.h>
65 #include <QtMultimedia/qaudiodeviceinfo.h>
66 #include <QtMultimedia/qaudioengine.h>
67 
69 
70 const unsigned int MAX_SAMPLE_RATES = 5;
71 const unsigned int SAMPLE_RATES[] =
72  { 8000, 11025, 22050, 44100, 48000 };
73 
75 {
76  Q_OBJECT
77 public:
80 
81  bool testSettings(const QAudioFormat& format) const;
82  void updateLists();
84  bool isFormatSupported(const QAudioFormat& format) const;
85  QAudioFormat nearestFormat(const QAudioFormat& format) const;
86  QString deviceName() const;
96 
97 private:
98  bool open();
99  void close();
100 
101 #if (SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
102  void checkSurround();
103  bool surround40;
104  bool surround51;
105  bool surround71;
106 #endif
107 
117  snd_pcm_t* handle;
118  snd_pcm_hw_params_t *params;
119 };
120 
122 
123 #endif
124 
static QByteArray defaultOutputDevice()
const unsigned int MAX_SAMPLE_RATES
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
const unsigned int SAMPLE_RATES[]
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QString deviceName() const
Returns the audio device name.
The QString class provides a Unicode character string.
Definition: qstring.h:83
QList< QAudioFormat::SampleType > typez
static QByteArray defaultInputDevice()
QAudioFormat preferredFormat() const
Returns the nearest settings.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QList< int > channelsList()
Returns the list of currently available channels.
bool isFormatSupported(const QAudioFormat &format) const
Returns true if format is available from audio device.
#define Q_OBJECT
Definition: qobjectdefs.h:157
QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode mode)
Mode
Definition: qaudio.h:60
QStringList codecList()
Returns the list of currently available codecs.
QList< QAudioFormat::SampleType > sampleTypeList()
Returns the list of currently available sample types.
QAudioFormat nearestFormat(const QAudioFormat &format) const
Returns the nearest settings format.
QList< QAudioFormat::Endian > byteOrderz
QList< QAudioFormat::Endian > byteOrderList()
Returns the list of currently available byte orders.
QList< int > sampleSizeList()
Returns the list of currently available sample sizes.
The QAbstractAudioDeviceInfo class provides access for QAudioDeviceInfo to access the audio device pr...
Definition: qaudioengine.h:56
QList< int > frequencyList()
Returns the list of currently available frequencies.
The QAudioFormat class stores audio parameter information.
Definition: qaudioformat.h:60
static QList< QByteArray > availableDevices(QAudio::Mode)
bool testSettings(const QAudioFormat &format) const