QtCraft API C++ classes QML types Handbook

QcAudioRoute Class

Which output device the game should play through when the system's devices change (a headset switched on, a speaker unplugged): the system's default output, as long as there is one. More...

Header: #include <audio/QcAudioRoute.h>

Public Types

struct Decision

Static Public Members

QcAudioRoute::Decision decide(const QByteArray &current, const QList<QByteArray> &outputs, const QByteArray &defaultOutput)

Detailed Description

Pure, on device ids only, so that it can be checked without real devices.

Member Function Documentation

[static] QcAudioRoute::Decision QcAudioRoute::decide(const QByteArray &current, const QList<QByteArray> &outputs, const QByteArray &defaultOutput)

Returns what to do. current: the device playing now, empty when none is open; outputs: the devices there are; defaultOutput: the system's default output, empty when it has none. Switches to the default when it changed, when the current device went away, and when a device appeared while none was open; closes when the current device went away and none is left.