Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAudioStateMachine Class Reference

#include <qaudiostatemachine_p.h>

+ Collaboration diagram for QAudioStateMachine:

Classes

class  Notifier
 

Public Types

using RawState = AudioStateMachineUtils::RawState
 

Public Member Functions

 QAudioStateMachine (QAudioStateChangeNotifier &notifier)
 
 ~QAudioStateMachine ()
 
QAudio::State state () const
 
QAudio::Error error () const
 
bool isActiveOrIdle () const
 
bool isDraining () const
 
std::pair< bool, bool > getDrainedAndStopped () const
 
bool onDrained ()
 
Notifier stop (QAudio::Error error=QAudio::NoError, bool shouldDrain=false, bool forceUpdateError=false)
 
Notifier stopOrUpdateError (QAudio::Error error=QAudio::NoError)
 
Notifier start (bool isActive=true)
 
Notifier suspend ()
 
Notifier resume ()
 
Notifier activateFromIdle ()
 
Notifier updateActiveOrIdle (bool isActive, QAudio::Error error=QAudio::NoError)
 
Notifier forceSetState (QAudio::State state, QAudio::Error error=QAudio::NoError)
 
Notifier setError (QAudio::Error error)
 

Detailed Description

Definition at line 37 of file qaudiostatemachine_p.h.

Member Typedef Documentation

◆ RawState

Constructor & Destructor Documentation

◆ QAudioStateMachine()

QAudioStateMachine::QAudioStateMachine ( QAudioStateChangeNotifier & notifier)

Definition at line 14 of file qaudiostatemachine.cpp.

◆ ~QAudioStateMachine()

QAudioStateMachine::~QAudioStateMachine ( )
default

Member Function Documentation

◆ activateFromIdle()

Notifier QAudioStateMachine::activateFromIdle ( )

Definition at line 112 of file qaudiostatemachine.cpp.

References QAudio::ActiveState, QAudio::IdleState, AudioStateMachineUtils::makeStatesChecker(), and AudioStateMachineUtils::toRawState().

+ Here is the call graph for this function:

◆ error()

QAudio::Error QAudioStateMachine::error ( ) const

Definition at line 25 of file qaudiostatemachine.cpp.

References AudioStateMachineUtils::toAudioError().

Referenced by QDarwinAudioSink::error(), QPulseAudioSink::error(), QPulseAudioSource::error(), forceSetState(), resume(), setError(), stop(), suspend(), and updateActiveOrIdle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forceSetState()

Notifier QAudioStateMachine::forceSetState ( QAudio::State state,
QAudio::Error error = QAudio::NoError )

Definition at line 130 of file qaudiostatemachine.cpp.

References error(), state(), and AudioStateMachineUtils::toRawState().

+ Here is the call graph for this function:

◆ getDrainedAndStopped()

std::pair< bool, bool > QAudioStateMachine::getDrainedAndStopped ( ) const

Definition at line 83 of file qaudiostatemachine.cpp.

References AudioStateMachineUtils::isDrainingState(), state(), QAudio::StoppedState, and AudioStateMachineUtils::toAudioState().

+ Here is the call graph for this function:

◆ isActiveOrIdle()

bool QAudioStateMachine::isActiveOrIdle ( ) const

Definition at line 67 of file qaudiostatemachine.cpp.

References QAudio::ActiveState, QAudio::IdleState, and state().

Referenced by QPulseAudioSink::bytesFree(), QPulseAudioSource::bytesReady(), and QPulseAudioSource::setFormat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDraining()

bool QAudioStateMachine::isDraining ( ) const

Definition at line 78 of file qaudiostatemachine.cpp.

References AudioStateMachineUtils::isDrainingState().

+ Here is the call graph for this function:

◆ onDrained()

bool QAudioStateMachine::onDrained ( )

Definition at line 73 of file qaudiostatemachine.cpp.

References AudioStateMachineUtils::isDrainingState(), and AudioStateMachineUtils::removeDrainingFlag().

Referenced by QDarwinAudioSink::stop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resume()

Notifier QAudioStateMachine::resume ( )

Definition at line 103 of file qaudiostatemachine.cpp.

References error(), AudioStateMachineUtils::makeStatesChecker(), QAudio::NoError, QAudio::SuspendedState, and AudioStateMachineUtils::toRawState().

Referenced by QDarwinAudioSink::resume(), QPulseAudioSink::resume(), and QPulseAudioSource::resume().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setError()

Notifier QAudioStateMachine::setError ( QAudio::Error error)

Definition at line 124 of file qaudiostatemachine.cpp.

References error(), and AudioStateMachineUtils::setStateError().

Referenced by QDarwinAudioSink::start(), and QDarwinAudioSink::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

Notifier QAudioStateMachine::start ( bool isActive = true)

Definition at line 61 of file qaudiostatemachine.cpp.

References QAudio::ActiveState, QAudio::IdleState, AudioStateMachineUtils::makeStatesChecker(), QAudio::StoppedState, and AudioStateMachineUtils::toRawState().

Referenced by QDarwinAudioSink::start(), QPulseAudioSink::start(), QPulseAudioSource::start(), QDarwinAudioSink::start(), QPulseAudioSink::start(), and QPulseAudioSource::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ state()

QAudio::State QAudioStateMachine::state ( ) const

Definition at line 20 of file qaudiostatemachine.cpp.

References AudioStateMachineUtils::toAudioState().

Referenced by forceSetState(), getDrainedAndStopped(), isActiveOrIdle(), QDarwinAudioSink::state(), QPulseAudioSink::state(), QPulseAudioSource::state(), stop(), QPulseAudioSink::streamUnderflowCallback(), and updateActiveOrIdle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

Notifier QAudioStateMachine::stop ( QAudio::Error error = QAudio::NoError,
bool shouldDrain = false,
bool forceUpdateError = false )

Definition at line 46 of file qaudiostatemachine.cpp.

References QAudio::ActiveState, AudioStateMachineUtils::addDrainingFlag(), error(), QAudio::IdleState, AudioStateMachineUtils::makeStatesChecker(), state(), QAudio::StoppedState, QAudio::SuspendedState, AudioStateMachineUtils::toAudioState(), and AudioStateMachineUtils::toRawState().

Referenced by QPulseAudioSink::~QPulseAudioSink(), QPulseAudioSource::~QPulseAudioSource(), QDarwinAudioSink::stop(), QPulseAudioSink::stop(), and QPulseAudioSource::stop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stopOrUpdateError()

Notifier QAudioStateMachine::stopOrUpdateError ( QAudio::Error error = QAudio::NoError)
inline

Definition at line 109 of file qaudiostatemachine_p.h.

References error.

Referenced by QDarwinAudioSink::reset(), QPulseAudioSink::reset(), and QPulseAudioSource::reset().

+ Here is the caller graph for this function:

◆ suspend()

Notifier QAudioStateMachine::suspend ( )

Definition at line 89 of file qaudiostatemachine.cpp.

References QAudio::ActiveState, error(), QAudio::IdleState, AudioStateMachineUtils::makeStatesChecker(), QAudio::NoError, QAudio::SuspendedState, and AudioStateMachineUtils::toRawState().

Referenced by QDarwinAudioSink::suspend(), QPulseAudioSink::suspend(), and QPulseAudioSource::suspend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateActiveOrIdle()

Notifier QAudioStateMachine::updateActiveOrIdle ( bool isActive,
QAudio::Error error = QAudio::NoError )

Definition at line 117 of file qaudiostatemachine.cpp.

References QAudio::ActiveState, error(), QAudio::IdleState, isActive, AudioStateMachineUtils::makeStatesChecker(), state(), and AudioStateMachineUtils::toRawState().

Referenced by QPulseAudioSource::read(), and QPulseAudioSink::streamUnderflowCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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