Qt 4.8
qt-4.8.6
src
multimedia
audio
qaudiooutput_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
#ifndef QAUDIOOUTPUT_MAC_P_H
54
#define QAUDIOOUTPUT_MAC_P_H
55
56
#include <CoreServices/CoreServices.h>
57
#include <CoreAudio/CoreAudio.h>
58
#include <AudioUnit/AudioUnit.h>
59
#include <AudioToolbox/AudioToolbox.h>
60
61
#include <QtCore/qobject.h>
62
#include <QtCore/qmutex.h>
63
#include <QtCore/qwaitcondition.h>
64
#include <QtCore/qtimer.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
QIODevice
;
76
class
QAbstractAudioDeviceInfo
;
77
78
namespace
QtMultimediaInternal
79
{
80
class
QAudioOutputBuffer;
81
}
82
83
class
QAudioOutputPrivate
:
public
QAbstractAudioOutput
84
{
85
Q_OBJECT
86
87
public
:
88
bool
isOpen
;
89
int
internalBufferSize
;
90
int
periodSizeBytes
;
91
qint64
totalFrames
;
92
QAudioFormat
audioFormat
;
93
QIODevice
*
audioIO
;
94
AudioDeviceID
audioDeviceId
;
95
AudioUnit
audioUnit
;
96
Float64
clockFrequency
;
97
UInt64
startTime
;
98
AudioStreamBasicDescription
deviceFormat
;
99
AudioStreamBasicDescription
streamFormat
;
100
QtMultimediaInternal::QAudioOutputBuffer
*
audioBuffer
;
101
QAtomicInt
audioThreadState
;
102
QWaitCondition
threadFinished
;
103
QMutex
mutex
;
104
QTimer
*
intervalTimer
;
105
QAbstractAudioDeviceInfo
*
audioDeviceInfo
;
106
107
QAudio::Error
errorCode
;
108
QAudio::State
stateCode
;
109
110
QAudioOutputPrivate
(
const
QByteArray
& device,
const
QAudioFormat
&
format
);
111
~
QAudioOutputPrivate
();
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
124
int
bytesFree()
const
;
125
int
periodSize()
const
;
126
127
void
setBufferSize(
int
value);
128
int
bufferSize()
const
;
129
130
void
setNotifyInterval(
int
milliSeconds);
131
int
notifyInterval()
const
;
132
133
qint64
processedUSecs()
const
;
134
qint64
elapsedUSecs()
const
;
135
136
QAudio::Error
error
()
const
;
137
QAudio::State
state()
const
;
138
139
void
audioThreadStart();
140
void
audioThreadStop();
141
void
audioThreadDrain();
142
143
void
audioDeviceStop();
144
void
audioDeviceIdle();
145
void
audioDeviceError();
146
147
void
startTimers();
148
void
stopTimers();
149
150
private
slots
:
151
void
deviceStopped();
152
void
inputReady();
153
154
private
:
155
enum
{ Running, Draining, Stopped };
156
157
static
OSStatus
renderCallback(
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
QAudioOutputPrivate::mutex
QMutex mutex
Definition:
qaudiooutput_mac_p.h:103
QAudio::Error
Error
Definition:
qaudio.h:58
QAudioOutputPrivate::audioIO
QIODevice * audioIO
Definition:
qaudiooutput_mac_p.h:93
QT_END_NAMESPACE
#define QT_END_NAMESPACE
This macro expands to.
Definition:
qglobal.h:90
QAudioOutputPrivate::streamFormat
AudioStreamBasicDescription streamFormat
Definition:
qaudiooutput_mac_p.h:99
QMutex
The QMutex class provides access serialization between threads.
Definition:
qmutex.h:60
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
QAudioOutputPrivate::audioFormat
QAudioFormat audioFormat
Definition:
qaudiooutput_mac_p.h:92
QAudioOutputPrivate::internalBufferSize
int internalBufferSize
Definition:
qaudiooutput_mac_p.h:89
error
#define error(msg)
Definition:
qabstractduration.cpp:58
QByteArray
The QByteArray class provides an array of bytes.
Definition:
qbytearray.h:135
QAudioOutputPrivate::deviceFormat
AudioStreamBasicDescription deviceFormat
Definition:
qaudiooutput_mac_p.h:98
reset
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
QAbstractAudioOutput
The QAbstractAudioOutput class provides access for QAudioOutput to access the audio device provided b...
Definition:
qaudioengine.h:73
QAudioOutputPrivate::isOpen
bool isOpen
Definition:
qaudiooutput_mac_p.h:88
QAudioOutputPrivate::errorCode
QAudio::Error errorCode
Definition:
qaudiooutput_mac_p.h:107
QWaitCondition
Definition:
qwaitcondition.h:61
QAudioOutputPrivate::audioDeviceId
AudioDeviceID audioDeviceId
Definition:
qaudiooutput_mac_p.h:94
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition:
qglobal.h:89
QAudioOutputPrivate::totalFrames
qint64 totalFrames
Definition:
qaudiooutput_mac_p.h:91
QAudioOutputPrivate::audioDeviceInfo
QAbstractAudioDeviceInfo * audioDeviceInfo
Definition:
qaudiooutput_mac_p.h:105
qint64
__int64 qint64
Definition:
qglobal.h:942
QAudioOutputPrivate::clockFrequency
Float64 clockFrequency
Definition:
qaudiooutput_mac_p.h:96
QAudioOutputPrivate::threadFinished
QWaitCondition threadFinished
Definition:
qaudiooutput_mac_p.h:102
OSStatus
signed long OSStatus
Definition:
qmacdefines_mac.h:105
QAudioOutputPrivate::stateCode
QAudio::State stateCode
Definition:
qaudiooutput_mac_p.h:108
Q_OBJECT
#define Q_OBJECT
Definition:
qobjectdefs.h:157
QAudioOutputPrivate::audioBuffer
QtMultimediaInternal::QAudioOutputBuffer * audioBuffer
Definition:
qaudiooutput_mac_p.h:100
QtMultimediaInternal::QAudioOutputBuffer
Definition:
qaudiooutput_mac_p.cpp:79
QAudioOutputPrivate::periodSizeBytes
int periodSizeBytes
Definition:
qaudiooutput_mac_p.h:90
format
format
Definition:
qprintengine_ps.cpp:286
QAudio::State
State
Definition:
qaudio.h:59
QAudioOutputPrivate::startTime
UInt64 startTime
Definition:
qaudiooutput_mac_p.h:97
QAudioOutputPrivate::audioUnit
AudioUnit audioUnit
Definition:
qaudiooutput_mac_p.h:95
QAudioOutputPrivate::intervalTimer
QTimer * intervalTimer
Definition:
qaudiooutput_mac_p.h:104
QAbstractAudioDeviceInfo
The QAbstractAudioDeviceInfo class provides access for QAudioDeviceInfo to access the audio device pr...
Definition:
qaudioengine.h:56
QAudioOutputPrivate
Definition:
qaudiooutput_alsa_p.h:74
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
open
int open(const char *, int,...)
Definition:
qfunctions_nacl.cpp:123
QAudioOutputPrivate::audioThreadState
QAtomicInt audioThreadState
Definition:
qaudiooutput_mac_p.h:101
QtMultimediaInternal
Definition:
qaudioinput_mac_p.cpp:66
Qt 4.8 Source Code Browser