Qt 4.8
qt-4.8.6
src
multimedia
audio
qaudioinput_mac_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 QAUDIOINPUT_MAC_P_H
55
#define QAUDIOINPUT_MAC_P_H
56
57
#include <CoreServices/CoreServices.h>
58
#include <CoreAudio/CoreAudio.h>
59
#include <AudioUnit/AudioUnit.h>
60
#include <AudioToolbox/AudioToolbox.h>
61
62
#include <QtCore/qobject.h>
63
#include <QtCore/qmutex.h>
64
#include <QtCore/qwaitcondition.h>
65
#include <QtCore/qatomic.h>
66
67
#include <QtMultimedia/qaudio.h>
68
#include <QtMultimedia/qaudioformat.h>
69
#include <QtMultimedia/qaudioengine.h>
70
71
QT_BEGIN_HEADER
72
73
QT_BEGIN_NAMESPACE
74
75
class
QTimer
;
76
class
QIODevice
;
77
class
QAbstractAudioDeviceInfo
;
78
79
namespace
QtMultimediaInternal
80
{
81
class
QAudioInputBuffer;
82
}
83
84
class
QAudioInputPrivate
:
public
QAbstractAudioInput
85
{
86
Q_OBJECT
87
88
public
:
89
bool
isOpen
;
90
int
periodSizeBytes
;
91
int
internalBufferSize
;
92
qint64
totalFrames
;
93
QAudioFormat
audioFormat
;
94
QIODevice
*
audioIO
;
95
AudioUnit
audioUnit
;
96
AudioDeviceID
audioDeviceId
;
97
Float64
clockFrequency
;
98
UInt64
startTime
;
99
QAudio::Error
errorCode
;
100
QAudio::State
stateCode
;
101
QtMultimediaInternal::QAudioInputBuffer
*
audioBuffer
;
102
QMutex
mutex
;
103
QWaitCondition
threadFinished
;
104
QAtomicInt
audioThreadState
;
105
QTimer
*
intervalTimer
;
106
AudioStreamBasicDescription
streamFormat
;
107
AudioStreamBasicDescription
deviceFormat
;
108
QAbstractAudioDeviceInfo
*
audioDeviceInfo
;
109
110
QAudioInputPrivate
(
const
QByteArray
& device,
QAudioFormat
const
&
format
);
111
~
QAudioInputPrivate
();
112
113
bool
open
();
114
void
close();
115
116
QAudioFormat
format
()
const
;
117
118
QIODevice
* start(
QIODevice
* device);
119
void
stop();
120
void
reset
();
121
void
suspend();
122
void
resume();
123
void
idle();
124
125
int
bytesReady()
const
;
126
int
periodSize()
const
;
127
128
void
setBufferSize(
int
value);
129
int
bufferSize()
const
;
130
131
void
setNotifyInterval(
int
milliSeconds);
132
int
notifyInterval()
const
;
133
134
qint64
processedUSecs()
const
;
135
qint64
elapsedUSecs()
const
;
136
137
QAudio::Error
error
()
const
;
138
QAudio::State
state()
const
;
139
140
void
audioThreadStart();
141
void
audioThreadStop();
142
143
void
audioDeviceStop();
144
void
audioDeviceFull();
145
void
audioDeviceError();
146
147
void
startTimers();
148
void
stopTimers();
149
150
private
slots
:
151
void
deviceStopped();
152
153
private
:
154
enum
{ Running, Stopped };
155
156
// Input callback
157
static
OSStatus
inputCallback(
void
* inRefCon,
158
AudioUnitRenderActionFlags* ioActionFlags,
159
const
AudioTimeStamp* inTimeStamp,
160
UInt32 inBusNumber,
161
UInt32 inNumberFrames,
162
AudioBufferList* ioData);
163
};
164
165
QT_END_NAMESPACE
166
167
QT_END_HEADER
168
169
#endif // QAUDIOINPUT_MAC_P_H
QAudio::Error
Error
Definition:
qaudio.h:58
QT_END_NAMESPACE
#define QT_END_NAMESPACE
This macro expands to.
Definition:
qglobal.h:90
QMutex
The QMutex class provides access serialization between threads.
Definition:
qmutex.h:60
QAudioInputPrivate::periodSizeBytes
int periodSizeBytes
Definition:
qaudioinput_mac_p.h:90
QT_BEGIN_HEADER
#define QT_BEGIN_HEADER
Definition:
qglobal.h:136
QAtomicInt
The QAtomicInt class provides platform-independent atomic operations on integers. ...
Definition:
qatomic.h:55
QAudioInputPrivate::threadFinished
QWaitCondition threadFinished
Definition:
qaudioinput_mac_p.h:103
error
#define error(msg)
Definition:
qabstractduration.cpp:58
QByteArray
The QByteArray class provides an array of bytes.
Definition:
qbytearray.h:135
reset
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
QAudioInputPrivate::audioFormat
QAudioFormat audioFormat
Definition:
qaudioinput_mac_p.h:93
QAudioInputPrivate::isOpen
bool isOpen
Definition:
qaudioinput_mac_p.h:89
QAudioInputPrivate::stateCode
QAudio::State stateCode
Definition:
qaudioinput_mac_p.h:100
QWaitCondition
Definition:
qwaitcondition.h:61
QAudioInputPrivate::deviceFormat
AudioStreamBasicDescription deviceFormat
Definition:
qaudioinput_mac_p.h:107
QtMultimediaInternal::QAudioInputBuffer
Definition:
qaudioinput_mac_p.cpp:224
QAudioInputPrivate::streamFormat
AudioStreamBasicDescription streamFormat
Definition:
qaudioinput_mac_p.h:106
QAudioInputPrivate
Definition:
qaudioinput_alsa_p.h:75
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition:
qglobal.h:89
QAudioInputPrivate::internalBufferSize
int internalBufferSize
Definition:
qaudioinput_mac_p.h:91
QAudioInputPrivate::errorCode
QAudio::Error errorCode
Definition:
qaudioinput_mac_p.h:99
qint64
__int64 qint64
Definition:
qglobal.h:942
QAbstractAudioInput
The QAbstractAudioInput class provides access for QAudioInput to access the audio device provided by ...
Definition:
qaudioengine.h:100
QAudioInputPrivate::intervalTimer
QTimer * intervalTimer
Definition:
qaudioinput_mac_p.h:105
OSStatus
signed long OSStatus
Definition:
qmacdefines_mac.h:105
QAudioInputPrivate::audioDeviceId
AudioDeviceID audioDeviceId
Definition:
qaudioinput_mac_p.h:96
Q_OBJECT
#define Q_OBJECT
Definition:
qobjectdefs.h:157
QAudioInputPrivate::audioBuffer
QtMultimediaInternal::QAudioInputBuffer * audioBuffer
Definition:
qaudioinput_mac_p.h:101
QAudioInputPrivate::audioUnit
AudioUnit audioUnit
Definition:
qaudioinput_mac_p.h:95
QAudioInputPrivate::clockFrequency
Float64 clockFrequency
Definition:
qaudioinput_mac_p.h:97
format
format
Definition:
qprintengine_ps.cpp:286
QAudio::State
State
Definition:
qaudio.h:59
QAudioInputPrivate::mutex
QMutex mutex
Definition:
qaudioinput_mac_p.h:102
QAudioInputPrivate::audioIO
QIODevice * audioIO
Definition:
qaudioinput_mac_p.h:94
QAudioInputPrivate::audioThreadState
QAtomicInt audioThreadState
Definition:
qaudioinput_mac_p.h:104
QAbstractAudioDeviceInfo
The QAbstractAudioDeviceInfo class provides access for QAudioDeviceInfo to access the audio device pr...
Definition:
qaudioengine.h:56
QAudioInputPrivate::audioDeviceInfo
QAbstractAudioDeviceInfo * audioDeviceInfo
Definition:
qaudioinput_mac_p.h:108
QAudioInputPrivate::totalFrames
qint64 totalFrames
Definition:
qaudioinput_mac_p.h:92
QAudioFormat
The QAudioFormat class stores audio parameter information.
Definition:
qaudioformat.h:60
QTimer
The QTimer class provides repetitive and single-shot timers.
Definition:
qtimer.h:56
slots
#define slots
Definition:
qobjectdefs.h:68
QIODevice
The QIODevice class is the base interface class of all I/O devices in Qt.
Definition:
qiodevice.h:66
QT_END_HEADER
#define QT_END_HEADER
Definition:
qglobal.h:137
QAudioInputPrivate::startTime
UInt64 startTime
Definition:
qaudioinput_mac_p.h:98
open
int open(const char *, int,...)
Definition:
qfunctions_nacl.cpp:123
QtMultimediaInternal
Definition:
qaudioinput_mac_p.cpp:66
Qt 4.8 Source Code Browser