Qt 4.8
Signals | Public Functions | Public Variables | Private Types | Private Slots | Private Functions | Static Private Functions | Properties | Friends | List of all members
QAudioOutputPrivate Class Reference

#include <qaudiooutput_alsa_p.h>

Inheritance diagram for QAudioOutputPrivate:
QAbstractAudioOutput QAbstractAudioOutput QAbstractAudioOutput QObject QObject QObject

Signals

void processMore ()
 
- Signals inherited from QAbstractAudioOutput
void notify ()
 This signal is emitted when x ms of audio data has been processed the interval set by setNotifyInterval(x). More...
 
void stateChanged (QAudio::State)
 This signal is emitted when the device state has changed. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

void audioDeviceError ()
 
void audioDeviceIdle ()
 
void audioDeviceStop ()
 
void audioThreadDrain ()
 
void audioThreadStart ()
 
void audioThreadStop ()
 
int bufferSize () const
 Returns the audio buffer size in bytes. More...
 
int bufferSize () const
 Returns the audio buffer size in bytes. More...
 
int bufferSize () const
 Returns the audio buffer size in bytes. More...
 
int bytesFree () const
 Returns the free space available in bytes in the audio buffer. More...
 
int bytesFree () const
 Returns the free space available in bytes in the audio buffer. More...
 
int bytesFree () const
 Returns the free space available in bytes in the audio buffer. More...
 
void close ()
 
qint64 elapsedUSecs () const
 Returns the milliseconds since start() was called, including time in Idle and suspend states. More...
 
qint64 elapsedUSecs () const
 Returns the milliseconds since start() was called, including time in Idle and suspend states. More...
 
qint64 elapsedUSecs () const
 Returns the milliseconds since start() was called, including time in Idle and suspend states. More...
 
QAudio::Error error () const
 Returns the error state. More...
 
QAudio::Error error () const
 Returns the error state. More...
 
QAudio::Error error () const
 Returns the error state. More...
 
QAudioFormat format () const
 Returns the QAudioFormat being used. More...
 
QAudioFormat format () const
 Returns the QAudioFormat being used. More...
 
QAudioFormat format () const
 Returns the QAudioFormat being used. More...
 
int notifyInterval () const
 Returns the notify interval in milliseconds. More...
 
int notifyInterval () const
 Returns the notify interval in milliseconds. More...
 
int notifyInterval () const
 Returns the notify interval in milliseconds. More...
 
bool open ()
 
int periodSize () const
 Returns the period size in bytes. More...
 
int periodSize () const
 Returns the period size in bytes. More...
 
int periodSize () const
 Returns the period size in bytes. More...
 
qint64 processedUSecs () const
 Returns the amount of audio data processed since start() was called in milliseconds. More...
 
qint64 processedUSecs () const
 Returns the amount of audio data processed since start() was called in milliseconds. More...
 
qint64 processedUSecs () const
 Returns the amount of audio data processed since start() was called in milliseconds. More...
 
 QAudioOutputPrivate (const QByteArray &device, const QAudioFormat &audioFormat)
 
 QAudioOutputPrivate (const QByteArray &device, const QAudioFormat &audioFormat)
 
 QAudioOutputPrivate (const QByteArray &device, const QAudioFormat &format)
 
void reset ()
 Drops all audio data in the buffers, resets buffers to zero. More...
 
void reset ()
 Drops all audio data in the buffers, resets buffers to zero. More...
 
void reset ()
 Drops all audio data in the buffers, resets buffers to zero. More...
 
void resume ()
 Resumes processing audio data after a suspend() More...
 
void resume ()
 Resumes processing audio data after a suspend() More...
 
void resume ()
 Resumes processing audio data after a suspend() More...
 
void setBufferSize (int value)
 Sets the audio buffer size to value in bytes. More...
 
void setBufferSize (int value)
 Sets the audio buffer size to value in bytes. More...
 
void setBufferSize (int value)
 Sets the audio buffer size to value in bytes. More...
 
void setNotifyInterval (int milliSeconds)
 Sets the interval for notify() signal to be emitted. More...
 
void setNotifyInterval (int milliSeconds)
 Sets the interval for notify() signal to be emitted. More...
 
void setNotifyInterval (int milliSeconds)
 Sets the interval for notify() signal to be emitted. More...
 
QIODevicestart (QIODevice *device=0)
 Uses the device as the QIODevice to transfer data. More...
 
QIODevicestart (QIODevice *device=0)
 Uses the device as the QIODevice to transfer data. More...
 
QIODevicestart (QIODevice *device)
 Uses the device as the QIODevice to transfer data. More...
 
void startTimers ()
 
QAudio::State state () const
 Returns the state of audio processing. More...
 
QAudio::State state () const
 Returns the state of audio processing. More...
 
QAudio::State state () const
 Returns the state of audio processing. More...
 
void stop ()
 Stops the audio output. More...
 
void stop ()
 Stops the audio output. More...
 
void stop ()
 Stops the audio output. More...
 
void stopTimers ()
 
void suspend ()
 Stops processing audio data, preserving buffered audio data. More...
 
void suspend ()
 Stops processing audio data, preserving buffered audio data. More...
 
void suspend ()
 Stops processing audio data, preserving buffered audio data. More...
 
qint64 write (const char *data, qint64 len)
 
qint64 write (const char *data, qint64 len)
 
 ~QAudioOutputPrivate ()
 
 ~QAudioOutputPrivate ()
 
 ~QAudioOutputPrivate ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Public Variables

QtMultimediaInternal::QAudioOutputBufferaudioBuffer
 
AudioDeviceID audioDeviceId
 
QAbstractAudioDeviceInfoaudioDeviceInfo
 
QAudioFormat audioFormat
 
QIODeviceaudioIO
 
QIODeviceaudioSource
 
QAtomicInt audioThreadState
 
AudioUnit audioUnit
 
Float64 clockFrequency
 
AudioStreamBasicDescription deviceFormat
 
QAudio::State deviceState
 
QAudio::Error errorCode
 
QAudio::Error errorState
 
int internalBufferSize
 
QTimerintervalTimer
 
bool isOpen
 
QMutex mutex
 
int periodSizeBytes
 
QAudioFormat settings
 
UInt64 startTime
 
QAudio::State stateCode
 
AudioStreamBasicDescription streamFormat
 
QWaitCondition threadFinished
 
qint64 totalFrames
 

Private Types

enum  { Running, Draining, Stopped }
 

Private Slots

bool deviceReady ()
 
bool deviceReady ()
 
void deviceStopped ()
 
void feedback ()
 
void feedback ()
 
void inputReady ()
 
void updateAvailable ()
 
void userFeed ()
 

Private Functions

WAVEHDR * allocateBlocks (int size, int count)
 
void close ()
 
void close ()
 
void freeBlocks (WAVEHDR *blockArray)
 
bool open ()
 
bool open ()
 
int setFormat ()
 
int xrun_recovery (int err)
 

Static Private Functions

static void async_callback (snd_async_handler_t *ahandler)
 
static OSStatus renderCallback (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
 
static void QT_WIN_CALLBACK waveOutProc (HWAVEOUT hWaveOut, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 

Properties

snd_pcm_access_t access
 
snd_async_handler_t * ahandler
 
char * audioBuffer
 
snd_pcm_uframes_t buffer_frames
 
qint32 buffer_size
 
int buffer_size
 
unsigned int buffer_time
 
int bytesAvailable
 
QElapsedTimer clockStamp
 
qint64 elapsedTimeOffset
 
volatile bool finished
 
snd_pcm_t * handle
 
WAVEHDR header
 
HWAVEOUT hWaveOut
 
snd_pcm_hw_params_t * hwparams
 
int intervalTime
 
QByteArray m_device
 
bool opened
 
snd_pcm_format_t pcmformat
 
snd_pcm_uframes_t period_frames
 
qint32 period_size
 
int period_size
 
unsigned int period_time
 
bool pullMode
 
MMRESULT result
 
bool resuming
 
QTimertimer
 
QTime timeStamp
 
QElapsedTimer timeStamp
 
snd_timestamp_t * timestamp
 
QTime timeStampOpened
 
qint64 totalTimeValue
 
WAVEHDR * waveBlocks
 
int waveCurrentBlock
 
volatile int waveFreeBlockCount
 
WAVEFORMATEX wfx
 

Friends

class OutputPrivate
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 74 of file qaudiooutput_alsa_p.h.

Enumerations

◆ anonymous enum

anonymous enum
private

Constructors and Destructors

◆ QAudioOutputPrivate() [1/3]

QAudioOutputPrivate::QAudioOutputPrivate ( const QByteArray device,
const QAudioFormat audioFormat 
)

Definition at line 61 of file qaudiooutput_alsa_p.cpp.

61  :
62  settings(audioFormat)
63 {
64  bytesAvailable = 0;
65  handle = 0;
66  ahandler = 0;
67  access = SND_PCM_ACCESS_RW_INTERLEAVED;
68  pcmformat = SND_PCM_FORMAT_S16;
69  buffer_frames = 0;
70  period_frames = 0;
71  buffer_size = 0;
72  period_size = 0;
73  buffer_time = 100000;
74  period_time = 20000;
75  totalTimeValue = 0;
76  intervalTime = 1000;
77  audioBuffer = 0;
80  audioSource = 0;
81  pullMode = true;
82  resuming = false;
83  opened = false;
84 
85  m_device = device;
86 
87  timer = new QTimer(this);
88  connect(timer,SIGNAL(timeout()),SLOT(userFeed()));
89 }
snd_async_handler_t * ahandler
#define SLOT(a)
Definition: qobjectdefs.h:226
snd_pcm_access_t access
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
snd_pcm_uframes_t period_frames
snd_pcm_format_t pcmformat
The QTimer class provides repetitive and single-shot timers.
Definition: qtimer.h:56
snd_pcm_uframes_t buffer_frames

◆ ~QAudioOutputPrivate() [1/3]

QAudioOutputPrivate::~QAudioOutputPrivate ( )

Definition at line 91 of file qaudiooutput_alsa_p.cpp.

92 {
93  close();
94  disconnect(timer, SIGNAL(timeout()));
96  delete timer;
97 }
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Processes all pending events for the calling thread according to the specified flags until there are ...
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
Definition: qobject.cpp:2895

◆ QAudioOutputPrivate() [2/3]

QAudioOutputPrivate::QAudioOutputPrivate ( const QByteArray device,
const QAudioFormat format 
)

◆ ~QAudioOutputPrivate() [2/3]

QAudioOutputPrivate::~QAudioOutputPrivate ( )

◆ QAudioOutputPrivate() [3/3]

QAudioOutputPrivate::QAudioOutputPrivate ( const QByteArray device,
const QAudioFormat audioFormat 
)

◆ ~QAudioOutputPrivate() [3/3]

QAudioOutputPrivate::~QAudioOutputPrivate ( )

Functions

◆ allocateBlocks()

WAVEHDR * QAudioOutputPrivate::allocateBlocks ( int  size,
int  count 
)
private

Definition at line 167 of file qaudiooutput_win32_p.cpp.

Referenced by freeBlocks().

168 {
169  int i;
170  unsigned char* buffer;
171  WAVEHDR* blocks;
172  DWORD totalBufferSize = (size + sizeof(WAVEHDR))*count;
173 
174  if((buffer=(unsigned char*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
175  totalBufferSize)) == 0) {
176  qWarning("QAudioOutput: Memory allocation error");
177  return 0;
178  }
179  blocks = (WAVEHDR*)buffer;
180  buffer += sizeof(WAVEHDR)*count;
181  for(i = 0; i < count; i++) {
182  blocks[i].dwBufferLength = size;
183  blocks[i].lpData = (LPSTR)buffer;
184  buffer += size;
185  }
186  return blocks;
187 }
Q_CORE_EXPORT void qWarning(const char *,...)

◆ async_callback()

void QAudioOutputPrivate::async_callback ( snd_async_handler_t *  ahandler)
staticprivate

Definition at line 109 of file qaudiooutput_alsa_p.cpp.

Referenced by open().

110 {
111  QAudioOutputPrivate* audioOut;
112 
113  audioOut = static_cast<QAudioOutputPrivate*>
114  (snd_async_handler_get_callback_private(ahandler));
115 
116  if((audioOut->deviceState==QAudio::ActiveState)||(audioOut->resuming))
117  audioOut->feedback();
118 }
snd_async_handler_t * ahandler

◆ audioDeviceError()

void QAudioOutputPrivate::audioDeviceError ( )

Definition at line 607 of file qaudiooutput_mac_p.cpp.

Referenced by renderCallback().

608 {
611  audioDeviceStop();
612 
615  QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection);
616  }
617 }
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
static QReadWriteLock lock
Definition: proxyconf.cpp:399
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.

◆ audioDeviceIdle()

void QAudioOutputPrivate::audioDeviceIdle ( )

Definition at line 595 of file qaudiooutput_mac_p.cpp.

Referenced by renderCallback().

596 {
599  audioDeviceStop();
600 
603  QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection);
604  }
605 }
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
static QReadWriteLock lock
Definition: proxyconf.cpp:399
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.

◆ audioDeviceStop()

void QAudioOutputPrivate::audioDeviceStop ( )

Definition at line 588 of file qaudiooutput_mac_p.cpp.

Referenced by renderCallback().

589 {
590  AudioOutputUnitStop(audioUnit);
593 }
QWaitCondition threadFinished

◆ audioThreadDrain()

void QAudioOutputPrivate::audioThreadDrain ( )

Definition at line 581 of file qaudiooutput_mac_p.cpp.

582 {
583  stopTimers();
586 }
bool testAndSetAcquire(int expectedValue, int newValue)
Atomic test-and-set.
QWaitCondition threadFinished
bool wait(QMutex *mutex, unsigned long time=ULONG_MAX)

◆ audioThreadStart()

void QAudioOutputPrivate::audioThreadStart ( )

Definition at line 567 of file qaudiooutput_mac_p.cpp.

568 {
569  startTimers();
571  AudioOutputUnitStart(audioUnit);
572 }

◆ audioThreadStop()

void QAudioOutputPrivate::audioThreadStop ( )

Definition at line 574 of file qaudiooutput_mac_p.cpp.

575 {
576  stopTimers();
579 }
bool testAndSetAcquire(int expectedValue, int newValue)
Atomic test-and-set.
QWaitCondition threadFinished
bool wait(QMutex *mutex, unsigned long time=ULONG_MAX)

◆ bufferSize() [1/3]

int QAudioOutputPrivate::bufferSize ( ) const
virtual

Returns the audio buffer size in bytes.

Implements QAbstractAudioOutput.

◆ bufferSize() [2/3]

int QAudioOutputPrivate::bufferSize ( ) const
virtual

Returns the audio buffer size in bytes.

Implements QAbstractAudioOutput.

Definition at line 584 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

585 {
586  return buffer_size;
587 }

◆ bufferSize() [3/3]

int QAudioOutputPrivate::bufferSize ( ) const
virtual

Returns the audio buffer size in bytes.

Implements QAbstractAudioOutput.

◆ bytesFree() [1/3]

int QAudioOutputPrivate::bytesFree ( ) const
virtual

Returns the free space available in bytes in the audio buffer.

Implements QAbstractAudioOutput.

◆ bytesFree() [2/3]

int QAudioOutputPrivate::bytesFree ( ) const
virtual

Returns the free space available in bytes in the audio buffer.

Implements QAbstractAudioOutput.

Definition at line 518 of file qaudiooutput_alsa_p.cpp.

Referenced by deviceReady(), freeBlocks(), open(), updateAvailable(), userFeed(), and write().

519 {
520  if(resuming)
521  return period_size;
522 
524  return 0;
525  int frames = snd_pcm_avail_update(handle);
526  if((int)frames > (int)buffer_frames)
527  frames = buffer_frames;
528 
529  return snd_pcm_frames_to_bytes(handle, frames);
530 }
snd_pcm_uframes_t buffer_frames

◆ bytesFree() [3/3]

int QAudioOutputPrivate::bytesFree ( ) const
virtual

Returns the free space available in bytes in the audio buffer.

Implements QAbstractAudioOutput.

◆ close() [1/3]

void QAudioOutputPrivate::close ( )

◆ close() [2/3]

void QAudioOutputPrivate::close ( )
private

◆ close() [3/3]

void QAudioOutputPrivate::close ( )
private

Definition at line 500 of file qaudiooutput_alsa_p.cpp.

Referenced by deviceReady(), freeBlocks(), start(), stop(), write(), xrun_recovery(), and ~QAudioOutputPrivate().

501 {
502  timer->stop();
503 
504  if ( handle ) {
505  snd_pcm_drain( handle );
506  snd_pcm_close( handle );
507  handle = 0;
508  delete [] audioBuffer;
509  audioBuffer=0;
510  }
511  if(!pullMode && audioSource) {
512  delete audioSource;
513  audioSource = 0;
514  }
515  opened = false;
516 }
void stop()
Stops the timer.
Definition: qtimer.cpp:284

◆ deviceReady [1/2]

bool QAudioOutputPrivate::deviceReady ( )
privateslot

◆ deviceReady [2/2]

bool QAudioOutputPrivate::deviceReady ( )
privateslot

Definition at line 674 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks(), and userFeed().

675 {
676  if(pullMode) {
677  int l = 0;
678  int chunks = bytesAvailable/period_size;
679  if(chunks==0) {
681  return false;
682  }
683 #ifdef DEBUG_AUDIO
684  qDebug()<<"deviceReady() avail="<<bytesAvailable<<" bytes, period size="<<period_size<<" bytes";
685  qDebug()<<"deviceReady() no. of chunks that can fit ="<<chunks<<", chunks in bytes ="<<period_size*chunks;
686 #endif
687  int input = period_frames*chunks;
688  if(input > (int)buffer_frames)
689  input = buffer_frames;
690  l = audioSource->read(audioBuffer,snd_pcm_frames_to_bytes(handle, input));
691  if(l > 0) {
692  // Got some data to output
694  return true;
695  qint64 bytesWritten = write(audioBuffer,l);
696  if (bytesWritten != l)
697  audioSource->seek(audioSource->pos()-(l-bytesWritten));
699 
700  } else if(l == 0) {
701  // Did not get any data to output
703  if(bytesAvailable > snd_pcm_frames_to_bytes(handle, buffer_frames-period_frames)) {
704  // Underrun
709  }
710  }
711 
712  } else if(l < 0) {
713  close();
717  }
718  } else {
720  if(bytesAvailable > snd_pcm_frames_to_bytes(handle, buffer_frames-period_frames)) {
721  // Underrun
726  }
727  }
728  }
729 
731  return true;
732 
734  emit notify();
736  timeStamp.restart();
737  }
738  return true;
739 }
qint64 write(const char *data, qint64 len)
void notify()
This signal is emitted when x ms of audio data has been processed the interval set by setNotifyInterv...
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from...
Definition: qiodevice.cpp:624
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
Definition: qiodevice.cpp:791
Q_CORE_EXPORT void qDebug(const char *,...)
qint64 restart()
Restarts the timer and returns the time elapsed since the previous start.
#define emit
Definition: qobjectdefs.h:76
__int64 qint64
Definition: qglobal.h:942
int bytesFree() const
Returns the free space available in bytes in the audio buffer.
snd_pcm_uframes_t period_frames
QFactoryLoader * l
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success...
Definition: qiodevice.cpp:659
snd_pcm_uframes_t buffer_frames

◆ deviceStopped

void QAudioOutputPrivate::deviceStopped ( )
privateslot

Definition at line 633 of file qaudiooutput_mac_p.cpp.

634 {
635  intervalTimer->stop();
637 }
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
#define emit
Definition: qobjectdefs.h:76
void stop()
Stops the timer.
Definition: qtimer.cpp:284

◆ elapsedUSecs() [1/3]

qint64 QAudioOutputPrivate::elapsedUSecs ( ) const
virtual

Returns the milliseconds since start() was called, including time in Idle and suspend states.

Implements QAbstractAudioOutput.

◆ elapsedUSecs() [2/3]

qint64 QAudioOutputPrivate::elapsedUSecs ( ) const
virtual

Returns the milliseconds since start() was called, including time in Idle and suspend states.

Implements QAbstractAudioOutput.

Definition at line 741 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

742 {
744  return 0;
745 
746  return clockStamp.elapsed()*1000;
747 }
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.

◆ elapsedUSecs() [3/3]

qint64 QAudioOutputPrivate::elapsedUSecs ( ) const
virtual

Returns the milliseconds since start() was called, including time in Idle and suspend states.

Implements QAbstractAudioOutput.

◆ error() [1/3]

QAudio::Error QAudioOutputPrivate::error ( ) const
virtual

Returns the error state.

Implements QAbstractAudioOutput.

◆ error() [2/3]

QAudio::Error QAudioOutputPrivate::error ( ) const
virtual

Returns the error state.

Implements QAbstractAudioOutput.

Definition at line 99 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

100 {
101  return errorState;
102 }

◆ error() [3/3]

QAudio::Error QAudioOutputPrivate::error ( ) const
virtual

Returns the error state.

Implements QAbstractAudioOutput.

◆ feedback [1/2]

void QAudioOutputPrivate::feedback ( )
privateslot

◆ feedback [2/2]

void QAudioOutputPrivate::feedback ( )
privateslot

Definition at line 659 of file qaudiooutput_alsa_p.cpp.

Referenced by async_callback(), freeBlocks(), and waveOutProc().

660 {
661  updateAvailable();
662 }

◆ format() [1/3]

QAudioFormat QAudioOutputPrivate::format ( ) const
virtual

Returns the QAudioFormat being used.

Implements QAbstractAudioOutput.

◆ format() [2/3]

QAudioFormat QAudioOutputPrivate::format ( ) const
virtual

Returns the QAudioFormat being used.

Implements QAbstractAudioOutput.

Definition at line 630 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

631 {
632  return settings;
633 }

◆ format() [3/3]

QAudioFormat QAudioOutputPrivate::format ( ) const
virtual

Returns the QAudioFormat being used.

Implements QAbstractAudioOutput.

◆ freeBlocks()

void QAudioOutputPrivate::freeBlocks ( WAVEHDR *  blockArray)
private

Definition at line 189 of file qaudiooutput_win32_p.cpp.

190 {
191  WAVEHDR* blocks = blockArray;
192 
193  int count = buffer_size/period_size;
194 
195  for(int i = 0; i < count; i++) {
196  waveOutUnprepareHeader(hWaveOut,blocks, sizeof(WAVEHDR));
197  blocks++;
198  }
199  HeapFree(GetProcessHeap(), 0, blockArray);
200 }

◆ inputReady

void QAudioOutputPrivate::inputReady ( )
privateslot

Definition at line 639 of file qaudiooutput_mac_p.cpp.

640 {
642  if (stateCode == QAudio::IdleState) {
644 
647 
649  }
650 }
#define Q_ARG(type, data)
Definition: qobjectdefs.h:246
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
State
Definition: qaudio.h:59
static QReadWriteLock lock
Definition: proxyconf.cpp:399
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.

◆ notifyInterval() [1/3]

int QAudioOutputPrivate::notifyInterval ( ) const
virtual

Returns the notify interval in milliseconds.

Implements QAbstractAudioOutput.

◆ notifyInterval() [2/3]

int QAudioOutputPrivate::notifyInterval ( ) const
virtual

Returns the notify interval in milliseconds.

Implements QAbstractAudioOutput.

Definition at line 594 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

595 {
596  return intervalTime;
597 }

◆ notifyInterval() [3/3]

int QAudioOutputPrivate::notifyInterval ( ) const
virtual

Returns the notify interval in milliseconds.

Implements QAbstractAudioOutput.

◆ open() [1/3]

bool QAudioOutputPrivate::open ( )

◆ open() [2/3]

bool QAudioOutputPrivate::open ( )
private

◆ open() [3/3]

bool QAudioOutputPrivate::open ( )
private

Definition at line 267 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks(), start(), and xrun_recovery().

268 {
269  if(opened)
270  return true;
271 
272 #ifdef DEBUG_AUDIO
273  QTime now(QTime::currentTime());
274  qDebug()<<now.second()<<"s "<<now.msec()<<"ms :open()";
275 #endif
276  timeStamp.restart();
277  elapsedTimeOffset = 0;
278 
279  int dir;
280  int err = 0;
281  int count=0;
282  unsigned int freakuency=settings.frequency();
283 
284  if (!settings.isValid()) {
285  qWarning("QAudioOutput: open error, invalid format.");
286  } else if (settings.frequency() <= 0) {
287  qWarning("QAudioOutput: open error, invalid sample rate (%d).",
288  settings.frequency());
289  } else {
290  err = -1;
291  }
292 
293  if (err == 0) {
296  return false;
297  }
298 
301  if(dev.compare(QLatin1String("default")) == 0) {
302 #if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
303  dev = QLatin1String(devices.first());
304 #else
305  dev = QLatin1String("hw:0,0");
306 #endif
307  } else {
308 #if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
309  dev = QLatin1String(m_device);
310 #else
311  int idx = 0;
312  char *name;
313 
314  QString shortName = QLatin1String(m_device.mid(m_device.indexOf('=',0)+1).constData());
315 
316  while(snd_card_get_name(idx,&name) == 0) {
317  if(qstrncmp(shortName.toLocal8Bit().constData(),name,shortName.length()) == 0)
318  break;
319  idx++;
320  }
321  dev = QString(QLatin1String("hw:%1,0")).arg(idx);
322 #endif
323  }
324 
325  // Step 1: try and open the device
326  while((count < 5) && (err < 0)) {
327  err=snd_pcm_open(&handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0);
328  if(err < 0)
329  count++;
330  }
331  if (( err < 0)||(handle == 0)) {
334  return false;
335  }
336  snd_pcm_nonblock( handle, 0 );
337 
338  // Step 2: Set the desired HW parameters.
339  snd_pcm_hw_params_alloca( &hwparams );
340 
341  bool fatal = false;
342  QString errMessage;
343  unsigned int chunks = 8;
344 
345  err = snd_pcm_hw_params_any( handle, hwparams );
346  if ( err < 0 ) {
347  fatal = true;
348  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_any: err = %1").arg(err);
349  }
350  if ( !fatal ) {
351  err = snd_pcm_hw_params_set_rate_resample( handle, hwparams, 1 );
352  if ( err < 0 ) {
353  fatal = true;
354  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_rate_resample: err = %1").arg(err);
355  }
356  }
357  if ( !fatal ) {
358  err = snd_pcm_hw_params_set_access( handle, hwparams, access );
359  if ( err < 0 ) {
360  fatal = true;
361  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_access: err = %1").arg(err);
362  }
363  }
364  if ( !fatal ) {
365  err = setFormat();
366  if ( err < 0 ) {
367  fatal = true;
368  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_format: err = %1").arg(err);
369  }
370  }
371  if ( !fatal ) {
372  err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() );
373  if ( err < 0 ) {
374  fatal = true;
375  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_channels: err = %1").arg(err);
376  }
377  }
378  if ( !fatal ) {
379  err = snd_pcm_hw_params_set_rate_near( handle, hwparams, &freakuency, 0 );
380  if ( err < 0 ) {
381  fatal = true;
382  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_rate_near: err = %1").arg(err);
383  }
384  }
385  if ( !fatal ) {
386  unsigned int maxBufferTime = 0;
387  unsigned int minBufferTime = 0;
388  unsigned int maxPeriodTime = 0;
389  unsigned int minPeriodTime = 0;
390 
391  err = snd_pcm_hw_params_get_buffer_time_max(hwparams, &maxBufferTime, &dir);
392  if ( err >= 0)
393  err = snd_pcm_hw_params_get_buffer_time_min(hwparams, &minBufferTime, &dir);
394  if ( err >= 0)
395  err = snd_pcm_hw_params_get_period_time_max(hwparams, &maxPeriodTime, &dir);
396  if ( err >= 0)
397  err = snd_pcm_hw_params_get_period_time_min(hwparams, &minPeriodTime, &dir);
398 
399  if ( err < 0 ) {
400  fatal = true;
401  errMessage = QString::fromLatin1("QAudioOutput: buffer/period min and max: err = %1").arg(err);
402  } else {
403  if (maxBufferTime < buffer_time || buffer_time < minBufferTime || maxPeriodTime < period_time || minPeriodTime > period_time) {
404 #ifdef DEBUG_AUDIO
405  qDebug()<<"defaults out of range";
406  qDebug()<<"pmin="<<minPeriodTime<<", pmax="<<maxPeriodTime<<", bmin="<<minBufferTime<<", bmax="<<maxBufferTime;
407 #endif
408  period_time = minPeriodTime;
409  if (period_time*4 <= maxBufferTime) {
410  // Use 4 periods if possible
411  buffer_time = period_time*4;
412  chunks = 4;
413  } else if (period_time*2 <= maxBufferTime) {
414  // Use 2 periods if possible
415  buffer_time = period_time*2;
416  chunks = 2;
417  } else {
418  qWarning()<<"QAudioOutput: alsa only supports single period!";
419  fatal = true;
420  }
421 #ifdef DEBUG_AUDIO
422  qDebug()<<"used: buffer_time="<<buffer_time<<", period_time="<<period_time;
423 #endif
424  }
425  }
426  }
427  if ( !fatal ) {
428  err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, &buffer_time, &dir);
429  if ( err < 0 ) {
430  fatal = true;
431  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_buffer_time_near: err = %1").arg(err);
432  }
433  }
434  if ( !fatal ) {
435  err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, &period_time, &dir);
436  if ( err < 0 ) {
437  fatal = true;
438  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_period_time_near: err = %1").arg(err);
439  }
440  }
441  if ( !fatal ) {
442  err = snd_pcm_hw_params_set_periods_near(handle, hwparams, &chunks, &dir);
443  if ( err < 0 ) {
444  fatal = true;
445  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_periods_near: err = %1").arg(err);
446  }
447  }
448  if ( !fatal ) {
449  err = snd_pcm_hw_params(handle, hwparams);
450  if ( err < 0 ) {
451  fatal = true;
452  errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params: err = %1").arg(err);
453  }
454  }
455  if( err < 0) {
456  qWarning()<<errMessage;
459  return false;
460  }
461  snd_pcm_hw_params_get_buffer_size(hwparams,&buffer_frames);
462  buffer_size = snd_pcm_frames_to_bytes(handle,buffer_frames);
463  snd_pcm_hw_params_get_period_size(hwparams,&period_frames, &dir);
464  period_size = snd_pcm_frames_to_bytes(handle,period_frames);
465  snd_pcm_hw_params_get_buffer_time(hwparams,&buffer_time, &dir);
466  snd_pcm_hw_params_get_period_time(hwparams,&period_time, &dir);
467 
468  // Step 3: Set the desired SW parameters.
469  snd_pcm_sw_params_t *swparams;
470  snd_pcm_sw_params_alloca(&swparams);
471  snd_pcm_sw_params_current(handle, swparams);
472  snd_pcm_sw_params_set_start_threshold(handle,swparams,period_frames);
473  snd_pcm_sw_params_set_stop_threshold(handle,swparams,buffer_frames);
474  snd_pcm_sw_params_set_avail_min(handle, swparams,period_frames);
475  snd_pcm_sw_params(handle, swparams);
476 
477  // Step 4: Prepare audio
478  if(audioBuffer == 0)
479  audioBuffer = new char[snd_pcm_frames_to_bytes(handle,buffer_frames)];
480  snd_pcm_prepare( handle );
481  snd_pcm_start(handle);
482 
483  // Step 5: Setup callback and timer fallback
484  snd_async_add_pcm_handler(&ahandler, handle, async_callback, this);
486 
487  // Step 6: Start audio processing
488  timer->start(period_time/1000);
489 
491  timeStamp.restart();
492  elapsedTimeOffset = 0;
494  totalTimeValue = 0;
495  opened = true;
496 
497  return true;
498 }
snd_async_handler_t * ahandler
int frequency() const
Use sampleRate() instead.
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
static void async_callback(snd_async_handler_t *ahandler)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
snd_pcm_access_t access
Q_CORE_EXPORT void qDebug(const char *,...)
The QTime class provides clock time functions.
Definition: qdatetime.h:148
qint64 restart()
Restarts the timer and returns the time elapsed since the previous start.
snd_pcm_hw_params_t * hwparams
const char * name
Q_CORE_EXPORT void qWarning(const char *,...)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QByteArray mid(int index, int len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos...
bool isValid() const
Returns true if all of the parameters are valid.
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4049
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
int compare(const QString &s) const
Definition: qstring.cpp:5037
static QTime currentTime()
Returns the current time as reported by the system clock.
Definition: qdatetime.cpp:3125
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int bytesFree() const
Returns the free space available in bytes in the audio buffer.
snd_pcm_uframes_t period_frames
int qstrncmp(const char *str1, const char *str2, uint len)
Definition: qbytearray.h:101
static QList< QByteArray > availableDevices(QAudio::Mode)
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition: qtimer.cpp:249
snd_pcm_uframes_t buffer_frames
int channels() const
Use channelCount() instead.

◆ periodSize() [1/3]

int QAudioOutputPrivate::periodSize ( ) const
virtual

Returns the period size in bytes.

Implements QAbstractAudioOutput.

◆ periodSize() [2/3]

int QAudioOutputPrivate::periodSize ( ) const
virtual

Returns the period size in bytes.

Implements QAbstractAudioOutput.

Definition at line 573 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

574 {
575  return period_size;
576 }

◆ periodSize() [3/3]

int QAudioOutputPrivate::periodSize ( ) const
virtual

Returns the period size in bytes.

Implements QAbstractAudioOutput.

◆ processedUSecs() [1/3]

qint64 QAudioOutputPrivate::processedUSecs ( ) const
virtual

Returns the amount of audio data processed since start() was called in milliseconds.

Implements QAbstractAudioOutput.

◆ processedUSecs() [2/3]

qint64 QAudioOutputPrivate::processedUSecs ( ) const
virtual

Returns the amount of audio data processed since start() was called in milliseconds.

Implements QAbstractAudioOutput.

Definition at line 599 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

600 {
601  return qint64(1000000) * totalTimeValue / settings.frequency();
602 }
int frequency() const
Use sampleRate() instead.
__int64 qint64
Definition: qglobal.h:942

◆ processedUSecs() [3/3]

qint64 QAudioOutputPrivate::processedUSecs ( ) const
virtual

Returns the amount of audio data processed since start() was called in milliseconds.

Implements QAbstractAudioOutput.

◆ processMore

void QAudioOutputPrivate::processMore ( )
signal

◆ renderCallback()

OSStatus QAudioOutputPrivate::renderCallback ( void *  inRefCon,
AudioUnitRenderActionFlags *  ioActionFlags,
const AudioTimeStamp *  inTimeStamp,
UInt32  inBusNumber,
UInt32  inNumberFrames,
AudioBufferList *  ioData 
)
staticprivate

Definition at line 653 of file qaudiooutput_mac_p.cpp.

659 {
660  Q_UNUSED(ioActionFlags)
661  Q_UNUSED(inTimeStamp)
662  Q_UNUSED(inBusNumber)
663  Q_UNUSED(inNumberFrames)
664 
665  QAudioOutputPrivate* d = static_cast<QAudioOutputPrivate*>(inRefCon);
666 
667  const int threadState = d->audioThreadState.fetchAndAddAcquire(0);
668  if (threadState == Stopped) {
669  ioData->mBuffers[0].mDataByteSize = 0;
670  d->audioDeviceStop();
671  }
672  else {
673  const UInt32 bytesPerFrame = d->streamFormat.mBytesPerFrame;
674  qint64 framesRead;
675 
676  framesRead = d->audioBuffer->readFrames((char*)ioData->mBuffers[0].mData,
677  ioData->mBuffers[0].mDataByteSize / bytesPerFrame);
678 
679  if (framesRead > 0) {
680  ioData->mBuffers[0].mDataByteSize = framesRead * bytesPerFrame;
681  d->totalFrames += framesRead;
682  }
683  else {
684  ioData->mBuffers[0].mDataByteSize = 0;
685  if (framesRead == 0) {
686  if (threadState == Draining)
687  d->audioDeviceStop();
688  else
689  d->audioDeviceIdle();
690  }
691  else
692  d->audioDeviceError();
693  }
694  }
695 
696  return noErr;
697 }
double d
Definition: qnumeric_p.h:62
AudioStreamBasicDescription streamFormat
__int64 qint64
Definition: qglobal.h:942
int fetchAndAddAcquire(int valueToAdd)
Atomic fetch-and-add.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ reset() [1/3]

void QAudioOutputPrivate::reset ( )
virtual

Drops all audio data in the buffers, resets buffers to zero.

Implements QAbstractAudioOutput.

◆ reset() [2/3]

void QAudioOutputPrivate::reset ( )
virtual

Drops all audio data in the buffers, resets buffers to zero.

Implements QAbstractAudioOutput.

Definition at line 749 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks(), and xrun_recovery().

750 {
751  if(handle)
752  snd_pcm_reset(handle);
753 
754  stop();
755 }
void stop()
Stops the audio output.

◆ reset() [3/3]

void QAudioOutputPrivate::reset ( )
virtual

Drops all audio data in the buffers, resets buffers to zero.

Implements QAbstractAudioOutput.

◆ resume() [1/3]

void QAudioOutputPrivate::resume ( )
virtual

Resumes processing audio data after a suspend()

Implements QAbstractAudioOutput.

◆ resume() [2/3]

void QAudioOutputPrivate::resume ( )
virtual

Resumes processing audio data after a suspend()

Implements QAbstractAudioOutput.

Definition at line 604 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

605 {
607  int err = 0;
608 
609  if(handle) {
610  err = snd_pcm_prepare( handle );
611  if(err < 0)
612  xrun_recovery(err);
613 
614  err = snd_pcm_start(handle);
615  if(err < 0)
616  xrun_recovery(err);
617 
618  bytesAvailable = (int)snd_pcm_frames_to_bytes(handle, buffer_frames);
619  }
620  resuming = true;
621 
623 
625  timer->start(period_time/1000);
627  }
628 }
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
#define emit
Definition: qobjectdefs.h:76
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition: qtimer.cpp:249
snd_pcm_uframes_t buffer_frames

◆ resume() [3/3]

void QAudioOutputPrivate::resume ( )
virtual

Resumes processing audio data after a suspend()

Implements QAbstractAudioOutput.

◆ setBufferSize() [1/3]

void QAudioOutputPrivate::setBufferSize ( int  value)
virtual

Sets the audio buffer size to value in bytes.

Implements QAbstractAudioOutput.

◆ setBufferSize() [2/3]

void QAudioOutputPrivate::setBufferSize ( int  value)
virtual

Sets the audio buffer size to value in bytes.

Implements QAbstractAudioOutput.

Definition at line 578 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

◆ setBufferSize() [3/3]

void QAudioOutputPrivate::setBufferSize ( int  value)
virtual

Sets the audio buffer size to value in bytes.

Implements QAbstractAudioOutput.

◆ setFormat()

int QAudioOutputPrivate::setFormat ( )
private

Definition at line 156 of file qaudiooutput_alsa_p.cpp.

Referenced by open().

157 {
158  snd_pcm_format_t pcmformat = SND_PCM_FORMAT_UNKNOWN;
159 
160  if(settings.sampleSize() == 8) {
161  pcmformat = SND_PCM_FORMAT_U8;
162 
163  } else if(settings.sampleSize() == 16) {
166  pcmformat = SND_PCM_FORMAT_S16_LE;
167  else
168  pcmformat = SND_PCM_FORMAT_S16_BE;
171  pcmformat = SND_PCM_FORMAT_U16_LE;
172  else
173  pcmformat = SND_PCM_FORMAT_U16_BE;
174  }
175  } else if(settings.sampleSize() == 24) {
178  pcmformat = SND_PCM_FORMAT_S24_LE;
179  else
180  pcmformat = SND_PCM_FORMAT_S24_BE;
183  pcmformat = SND_PCM_FORMAT_U24_LE;
184  else
185  pcmformat = SND_PCM_FORMAT_U24_BE;
186  }
187  } else if(settings.sampleSize() == 32) {
190  pcmformat = SND_PCM_FORMAT_S32_LE;
191  else
192  pcmformat = SND_PCM_FORMAT_S32_BE;
195  pcmformat = SND_PCM_FORMAT_U32_LE;
196  else
197  pcmformat = SND_PCM_FORMAT_U32_BE;
198  } else if(settings.sampleType() == QAudioFormat::Float) {
200  pcmformat = SND_PCM_FORMAT_FLOAT_LE;
201  else
202  pcmformat = SND_PCM_FORMAT_FLOAT_BE;
203  }
204  } else if(settings.sampleSize() == 64) {
206  pcmformat = SND_PCM_FORMAT_FLOAT64_LE;
207  else
208  pcmformat = SND_PCM_FORMAT_FLOAT64_BE;
209  }
210 
211  return pcmformat != SND_PCM_FORMAT_UNKNOWN
212  ? snd_pcm_hw_params_set_format( handle, hwparams, pcmformat)
213  : -1;
214 }
int sampleSize() const
Returns the current sample size value.
QAudioFormat::Endian byteOrder() const
Returns the current byteOrder value.
QAudioFormat::SampleType sampleType() const
Returns the current SampleType value.
snd_pcm_hw_params_t * hwparams
snd_pcm_format_t pcmformat

◆ setNotifyInterval() [1/3]

void QAudioOutputPrivate::setNotifyInterval ( int  ms)
virtual

Sets the interval for notify() signal to be emitted.

This is based on the ms of audio data processed not on actual real-time. The resolution of the timer is platform specific.

Implements QAbstractAudioOutput.

◆ setNotifyInterval() [2/3]

void QAudioOutputPrivate::setNotifyInterval ( int  ms)
virtual

Sets the interval for notify() signal to be emitted.

This is based on the ms of audio data processed not on actual real-time. The resolution of the timer is platform specific.

Implements QAbstractAudioOutput.

Definition at line 589 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

590 {
591  intervalTime = qMax(0, ms);
592 }
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217

◆ setNotifyInterval() [3/3]

void QAudioOutputPrivate::setNotifyInterval ( int  ms)
virtual

Sets the interval for notify() signal to be emitted.

This is based on the ms of audio data processed not on actual real-time. The resolution of the timer is platform specific.

Implements QAbstractAudioOutput.

◆ start() [1/3]

QIODevice* QAudioOutputPrivate::start ( QIODevice device = 0)
virtual

Uses the device as the QIODevice to transfer data.

If device is null then the class creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle the data transfer. This QIODevice can be used to write() audio data directly. Passing a QIODevice allows the data to be transferred without any extra code.

Implements QAbstractAudioOutput.

◆ start() [2/3]

QIODevice * QAudioOutputPrivate::start ( QIODevice device = 0)
virtual

Uses the device as the QIODevice to transfer data.

If device is null then the class creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle the data transfer. This QIODevice can be used to write() audio data directly. Passing a QIODevice allows the data to be transferred without any extra code.

Implements QAbstractAudioOutput.

Definition at line 216 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

217 {
220 
222 
223  // Handle change of mode
224  if(audioSource && pullMode && !device) {
225  // pull -> push
226  close();
227  audioSource = 0;
228  } else if(audioSource && !pullMode && device) {
229  // push -> pull
230  close();
231  delete audioSource;
232  audioSource = 0;
233  }
234 
235  if(device) {
236  //set to pull mode
237  pullMode = true;
238  audioSource = device;
240  } else {
241  //set to push mode
242  if(!audioSource) {
243  audioSource = new OutputPrivate(this);
245  }
246  pullMode = false;
248  }
249 
250  open();
251 
253 
254  return audioSource;
255 }
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
#define emit
Definition: qobjectdefs.h:76
virtual bool open(OpenMode mode)
Opens the device and sets its OpenMode to mode.
Definition: qiodevice.cpp:570

◆ start() [3/3]

QIODevice* QAudioOutputPrivate::start ( QIODevice device)
virtual

Uses the device as the QIODevice to transfer data.

If device is null then the class creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle the data transfer. This QIODevice can be used to write() audio data directly. Passing a QIODevice allows the data to be transferred without any extra code.

Implements QAbstractAudioOutput.

◆ startTimers()

void QAudioOutputPrivate::startTimers ( )

Definition at line 619 of file qaudiooutput_mac_p.cpp.

620 {
621  audioBuffer->startFillTimer();
622  if (intervalTimer->interval() > 0)
623  intervalTimer->start();
624 }
int interval
the timeout interval in milliseconds
Definition: qtimer.h:60
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition: qtimer.cpp:249

◆ state() [1/3]

QAudio::State QAudioOutputPrivate::state ( ) const
virtual

Returns the state of audio processing.

Implements QAbstractAudioOutput.

◆ state() [2/3]

QAudio::State QAudioOutputPrivate::state ( ) const
virtual

Returns the state of audio processing.

Implements QAbstractAudioOutput.

Definition at line 104 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

105 {
106  return deviceState;
107 }

◆ state() [3/3]

QAudio::State QAudioOutputPrivate::state ( ) const
virtual

Returns the state of audio processing.

Implements QAbstractAudioOutput.

◆ stop() [1/3]

void QAudioOutputPrivate::stop ( )
virtual

Stops the audio output.

Implements QAbstractAudioOutput.

◆ stop() [2/3]

void QAudioOutputPrivate::stop ( )
virtual

Stops the audio output.

Implements QAbstractAudioOutput.

Definition at line 257 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks(), and reset().

258 {
260  return;
263  close();
265 }
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
#define emit
Definition: qobjectdefs.h:76

◆ stop() [3/3]

void QAudioOutputPrivate::stop ( )
virtual

Stops the audio output.

Implements QAbstractAudioOutput.

◆ stopTimers()

void QAudioOutputPrivate::stopTimers ( )

Definition at line 626 of file qaudiooutput_mac_p.cpp.

627 {
628  audioBuffer->stopFillTimer();
629  intervalTimer->stop();
630 }
void stop()
Stops the timer.
Definition: qtimer.cpp:284

◆ suspend() [1/3]

void QAudioOutputPrivate::suspend ( )
virtual

Stops processing audio data, preserving buffered audio data.

Implements QAbstractAudioOutput.

◆ suspend() [2/3]

void QAudioOutputPrivate::suspend ( )
virtual

Stops processing audio data, preserving buffered audio data.

Implements QAbstractAudioOutput.

Definition at line 635 of file qaudiooutput_alsa_p.cpp.

Referenced by freeBlocks().

636 {
638  timer->stop();
642  }
643 }
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
#define emit
Definition: qobjectdefs.h:76
void stop()
Stops the timer.
Definition: qtimer.cpp:284

◆ suspend() [3/3]

void QAudioOutputPrivate::suspend ( )
virtual

Stops processing audio data, preserving buffered audio data.

Implements QAbstractAudioOutput.

◆ updateAvailable

void QAudioOutputPrivate::updateAvailable ( )
privateslot

Definition at line 665 of file qaudiooutput_alsa_p.cpp.

Referenced by feedback().

666 {
667 #ifdef DEBUG_AUDIO
668  QTime now(QTime::currentTime());
669  qDebug()<<now.second()<<"s "<<now.msec()<<"ms :updateAvailable()";
670 #endif
672 }
Q_CORE_EXPORT void qDebug(const char *,...)
The QTime class provides clock time functions.
Definition: qdatetime.h:148
static QTime currentTime()
Returns the current time as reported by the system clock.
Definition: qdatetime.cpp:3125
int bytesFree() const
Returns the free space available in bytes in the audio buffer.

◆ userFeed

void QAudioOutputPrivate::userFeed ( )
privateslot

Definition at line 645 of file qaudiooutput_alsa_p.cpp.

Referenced by QAudioOutputPrivate().

646 {
648  return;
649 #ifdef DEBUG_AUDIO
650  QTime now(QTime::currentTime());
651  qDebug()<<now.second()<<"s "<<now.msec()<<"ms :userFeed() OUT";
652 #endif
655 
656  deviceReady();
657 }
Q_CORE_EXPORT void qDebug(const char *,...)
The QTime class provides clock time functions.
Definition: qdatetime.h:148
static QTime currentTime()
Returns the current time as reported by the system clock.
Definition: qdatetime.cpp:3125
int bytesFree() const
Returns the free space available in bytes in the audio buffer.

◆ waveOutProc()

void CALLBACK QAudioOutputPrivate::waveOutProc ( HWAVEOUT  hWaveOut,
UINT  uMsg,
DWORD_PTR  dwInstance,
DWORD_PTR  dwParam1,
DWORD_PTR  dwParam2 
)
staticprivate

Definition at line 133 of file qaudiooutput_win32_p.cpp.

Referenced by freeBlocks().

135 {
136  Q_UNUSED(dwParam1)
137  Q_UNUSED(dwParam2)
139 
140  QAudioOutputPrivate* qAudio;
141  qAudio = (QAudioOutputPrivate*)(dwInstance);
142  if(!qAudio)
143  return;
144 
145  QMutexLocker(&qAudio->mutex);
146 
147  switch(uMsg) {
148  case WOM_OPEN:
149  qAudio->feedback();
150  break;
151  case WOM_CLOSE:
152  return;
153  case WOM_DONE:
154  if(qAudio->finished || qAudio->buffer_size == 0 || qAudio->period_size == 0) {
155  return;
156  }
157  qAudio->waveFreeBlockCount++;
158  if(qAudio->waveFreeBlockCount >= qAudio->buffer_size/qAudio->period_size)
159  qAudio->waveFreeBlockCount = qAudio->buffer_size/qAudio->period_size;
160  qAudio->feedback();
161  break;
162  default:
163  return;
164  }
165 }
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ write() [1/2]

qint64 QAudioOutputPrivate::write ( const char *  data,
qint64  len 
)

◆ write() [2/2]

qint64 QAudioOutputPrivate::write ( const char *  data,
qint64  len 
)

Definition at line 532 of file qaudiooutput_alsa_p.cpp.

Referenced by deviceReady(), and freeBlocks().

533 {
534  // Write out some audio data
535  if ( !handle )
536  return 0;
537 #ifdef DEBUG_AUDIO
538  qDebug()<<"frames to write out = "<<
539  snd_pcm_bytes_to_frames( handle, (int)len )<<" ("<<len<<") bytes";
540 #endif
541  int frames, err;
542  int space = bytesFree();
543  if(len < space) {
544  // Just write it
545  frames = snd_pcm_bytes_to_frames( handle, (int)len );
546  err = snd_pcm_writei( handle, data, frames );
547  } else {
548  // Only write space worth
549  frames = snd_pcm_bytes_to_frames( handle, (int)space );
550  err = snd_pcm_writei( handle, data, frames );
551  }
552  if(err > 0) {
553  totalTimeValue += err;
554  resuming = false;
559  }
560  return snd_pcm_frames_to_bytes( handle, err );
561  } else
562  err = xrun_recovery(err);
563 
564  if(err < 0) {
565  close();
569  }
570  return 0;
571 }
void stateChanged(QAudio::State)
This signal is emitted when the device state has changed.
Q_CORE_EXPORT void qDebug(const char *,...)
#define emit
Definition: qobjectdefs.h:76
static const char * data(const QByteArray &arr)
int bytesFree() const
Returns the free space available in bytes in the audio buffer.

◆ xrun_recovery()

int QAudioOutputPrivate::xrun_recovery ( int  err)
private

Definition at line 120 of file qaudiooutput_alsa_p.cpp.

Referenced by resume(), and write().

121 {
122  int count = 0;
123  bool reset = false;
124 
125  if(err == -EPIPE) {
127  err = snd_pcm_prepare(handle);
128  if(err < 0)
129  reset = true;
130 
131  } else if((err == -ESTRPIPE)||(err == -EIO)) {
133  while((err = snd_pcm_resume(handle)) == -EAGAIN){
134  usleep(100);
135  count++;
136  if(count > 5) {
137  reset = true;
138  break;
139  }
140  }
141  if(err < 0) {
142  err = snd_pcm_prepare(handle);
143  if(err < 0)
144  reset = true;
145  }
146  }
147  if(reset) {
148  close();
149  open();
150  snd_pcm_prepare(handle);
151  return 0;
152  }
153  return err;
154 }
void reset()
Drops all audio data in the buffers, resets buffers to zero.

Friends and Related Functions

◆ OutputPrivate

friend class OutputPrivate
friend

Definition at line 76 of file qaudiooutput_alsa_p.h.

Referenced by freeBlocks(), and start().

Properties

◆ access

snd_pcm_access_t QAudioOutputPrivate::access
private

Definition at line 143 of file qaudiooutput_alsa_p.h.

Referenced by open(), and QAudioOutputPrivate().

◆ ahandler

snd_async_handler_t* QAudioOutputPrivate::ahandler
private

Definition at line 142 of file qaudiooutput_alsa_p.h.

Referenced by open(), and QAudioOutputPrivate().

◆ audioBuffer [1/2]

QtMultimediaInternal::QAudioOutputBuffer* QAudioOutputPrivate::audioBuffer

Definition at line 100 of file qaudiooutput_mac_p.h.

◆ audioBuffer [2/2]

char * QAudioOutputPrivate::audioBuffer
private

◆ audioDeviceId

AudioDeviceID QAudioOutputPrivate::audioDeviceId

Definition at line 94 of file qaudiooutput_mac_p.h.

◆ audioDeviceInfo

QAbstractAudioDeviceInfo* QAudioOutputPrivate::audioDeviceInfo

Definition at line 105 of file qaudiooutput_mac_p.h.

◆ audioFormat

QAudioFormat QAudioOutputPrivate::audioFormat

Definition at line 92 of file qaudiooutput_mac_p.h.

◆ audioIO

QIODevice* QAudioOutputPrivate::audioIO

Definition at line 93 of file qaudiooutput_mac_p.h.

◆ audioSource

QIODevice * QAudioOutputPrivate::audioSource

Definition at line 101 of file qaudiooutput_alsa_p.h.

Referenced by close(), deviceReady(), freeBlocks(), QAudioOutputPrivate(), and start().

◆ audioThreadState

QAtomicInt QAudioOutputPrivate::audioThreadState

Definition at line 101 of file qaudiooutput_mac_p.h.

Referenced by renderCallback().

◆ audioUnit

AudioUnit QAudioOutputPrivate::audioUnit

Definition at line 95 of file qaudiooutput_mac_p.h.

◆ buffer_frames

snd_pcm_uframes_t QAudioOutputPrivate::buffer_frames
private

Definition at line 125 of file qaudiooutput_alsa_p.h.

Referenced by bytesFree(), deviceReady(), open(), QAudioOutputPrivate(), and resume().

◆ buffer_size [1/2]

qint32 QAudioOutputPrivate::buffer_size
private

Definition at line 115 of file qaudiooutput_win32_p.h.

◆ buffer_size [2/2]

int QAudioOutputPrivate::buffer_size
private

◆ buffer_time

unsigned int QAudioOutputPrivate::buffer_time
private

Definition at line 123 of file qaudiooutput_alsa_p.h.

Referenced by open(), and QAudioOutputPrivate().

◆ bytesAvailable

int QAudioOutputPrivate::bytesAvailable
private

◆ clockFrequency

Float64 QAudioOutputPrivate::clockFrequency

Definition at line 96 of file qaudiooutput_mac_p.h.

◆ clockStamp

QElapsedTimer QAudioOutputPrivate::clockStamp
private

Definition at line 138 of file qaudiooutput_alsa_p.h.

Referenced by elapsedUSecs(), and open().

◆ deviceFormat

AudioStreamBasicDescription QAudioOutputPrivate::deviceFormat

Definition at line 98 of file qaudiooutput_mac_p.h.

◆ deviceState

QAudio::State QAudioOutputPrivate::deviceState

◆ elapsedTimeOffset

qint64 QAudioOutputPrivate::elapsedTimeOffset
private

Definition at line 139 of file qaudiooutput_alsa_p.h.

Referenced by deviceReady(), freeBlocks(), and open().

◆ errorCode

QAudio::Error QAudioOutputPrivate::errorCode

Definition at line 107 of file qaudiooutput_mac_p.h.

◆ errorState

QAudio::Error QAudioOutputPrivate::errorState

◆ finished

volatile bool QAudioOutputPrivate::finished
private

Definition at line 135 of file qaudiooutput_win32_p.h.

Referenced by waveOutProc().

◆ handle

snd_pcm_t* QAudioOutputPrivate::handle
private

◆ header

WAVEHDR QAudioOutputPrivate::header
private

Definition at line 133 of file qaudiooutput_win32_p.h.

◆ hWaveOut

HWAVEOUT QAudioOutputPrivate::hWaveOut
private

Definition at line 131 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks().

◆ hwparams

snd_pcm_hw_params_t* QAudioOutputPrivate::hwparams
private

Definition at line 146 of file qaudiooutput_alsa_p.h.

Referenced by open(), and setFormat().

◆ internalBufferSize

int QAudioOutputPrivate::internalBufferSize

Definition at line 89 of file qaudiooutput_mac_p.h.

◆ intervalTime

int QAudioOutputPrivate::intervalTime
private

◆ intervalTimer

QTimer* QAudioOutputPrivate::intervalTimer

Definition at line 104 of file qaudiooutput_mac_p.h.

◆ isOpen

bool QAudioOutputPrivate::isOpen

Definition at line 88 of file qaudiooutput_mac_p.h.

◆ m_device

QByteArray QAudioOutputPrivate::m_device
private

Definition at line 135 of file qaudiooutput_alsa_p.h.

Referenced by freeBlocks(), open(), and QAudioOutputPrivate().

◆ mutex

QMutex QAudioOutputPrivate::mutex

Definition at line 103 of file qaudiooutput_mac_p.h.

Referenced by freeBlocks(), and waveOutProc().

◆ opened

bool QAudioOutputPrivate::opened
private

Definition at line 116 of file qaudiooutput_alsa_p.h.

Referenced by close(), open(), and QAudioOutputPrivate().

◆ pcmformat

snd_pcm_format_t QAudioOutputPrivate::pcmformat
private

Definition at line 144 of file qaudiooutput_alsa_p.h.

Referenced by QAudioOutputPrivate(), and setFormat().

◆ period_frames

snd_pcm_uframes_t QAudioOutputPrivate::period_frames
private

Definition at line 126 of file qaudiooutput_alsa_p.h.

Referenced by deviceReady(), open(), and QAudioOutputPrivate().

◆ period_size [1/2]

qint32 QAudioOutputPrivate::period_size
private

Definition at line 116 of file qaudiooutput_win32_p.h.

◆ period_size [2/2]

int QAudioOutputPrivate::period_size
private

◆ period_time

unsigned int QAudioOutputPrivate::period_time
private

Definition at line 124 of file qaudiooutput_alsa_p.h.

Referenced by open(), QAudioOutputPrivate(), and resume().

◆ periodSizeBytes

int QAudioOutputPrivate::periodSizeBytes

Definition at line 90 of file qaudiooutput_mac_p.h.

◆ pullMode

bool QAudioOutputPrivate::pullMode
private

Definition at line 117 of file qaudiooutput_alsa_p.h.

Referenced by close(), deviceReady(), freeBlocks(), QAudioOutputPrivate(), and start().

◆ result

MMRESULT QAudioOutputPrivate::result
private

Definition at line 132 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks().

◆ resuming

bool QAudioOutputPrivate::resuming
private

◆ settings

QAudioFormat QAudioOutputPrivate::settings

Definition at line 102 of file qaudiooutput_alsa_p.h.

Referenced by format(), freeBlocks(), open(), processedUSecs(), and setFormat().

◆ startTime

UInt64 QAudioOutputPrivate::startTime

Definition at line 97 of file qaudiooutput_mac_p.h.

◆ stateCode

QAudio::State QAudioOutputPrivate::stateCode

Definition at line 108 of file qaudiooutput_mac_p.h.

◆ streamFormat

AudioStreamBasicDescription QAudioOutputPrivate::streamFormat

Definition at line 99 of file qaudiooutput_mac_p.h.

Referenced by renderCallback().

◆ threadFinished

QWaitCondition QAudioOutputPrivate::threadFinished

Definition at line 102 of file qaudiooutput_mac_p.h.

◆ timer

QTimer* QAudioOutputPrivate::timer
private

◆ timeStamp [1/2]

QTime QAudioOutputPrivate::timeStamp
private

Definition at line 112 of file qaudiooutput_win32_p.h.

◆ timeStamp [2/2]

QElapsedTimer QAudioOutputPrivate::timeStamp
private

Definition at line 137 of file qaudiooutput_alsa_p.h.

Referenced by deviceReady(), freeBlocks(), and open().

◆ timestamp

snd_timestamp_t* QAudioOutputPrivate::timestamp
private

Definition at line 145 of file qaudiooutput_alsa_p.h.

◆ timeStampOpened

QTime QAudioOutputPrivate::timeStampOpened
private

Definition at line 114 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks().

◆ totalFrames

qint64 QAudioOutputPrivate::totalFrames

Definition at line 91 of file qaudiooutput_mac_p.h.

Referenced by renderCallback().

◆ totalTimeValue

qint64 QAudioOutputPrivate::totalTimeValue
private

Definition at line 122 of file qaudiooutput_alsa_p.h.

Referenced by freeBlocks(), open(), processedUSecs(), QAudioOutputPrivate(), and write().

◆ waveBlocks

WAVEHDR* QAudioOutputPrivate::waveBlocks
private

Definition at line 134 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks().

◆ waveCurrentBlock

int QAudioOutputPrivate::waveCurrentBlock
private

Definition at line 137 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks().

◆ waveFreeBlockCount

volatile int QAudioOutputPrivate::waveFreeBlockCount
private

Definition at line 136 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks(), and waveOutProc().

◆ wfx

WAVEFORMATEX QAudioOutputPrivate::wfx
private

Definition at line 130 of file qaudiooutput_win32_p.h.

Referenced by freeBlocks().


The documentation for this class was generated from the following files: